From e9fd76632c2957861e7363d148f8526be31b30fa Mon Sep 17 00:00:00 2001 From: Koki Shinjo Date: Tue, 9 Jan 2024 16:01:58 +0900 Subject: [PATCH] [smart_device_protocol] add smart_devicE_protocol packages --- smart_device_protocol/.gitignore | 54 ++ smart_device_protocol/CMakeLists.txt | 47 ++ smart_device_protocol/LICENSE | 28 + smart_device_protocol/README.md | 196 +++++ .../arduino_lib/ArduinoAtomS3Hardware.h | 58 ++ smart_device_protocol/arduino_lib/README.md | 9 + .../arduino_lib/devices/stickv2_util.h | 37 + .../arduino_lib/devices/uwb_module_util.h | 132 +++ .../arduino_lib/iot_com_util/Time.h | 109 +++ .../iot_com_util/iot_client_util.h | 77 ++ .../arduino_lib/iot_com_util/iot_host_util.h | 35 + .../arduino_lib/sdp/esp_now.h | 25 + .../arduino_lib/sdp/packet_creator.h | 132 +++ .../arduino_lib/sdp/packet_parser.h | 119 +++ .../arduino_lib/sdp/packet_util.h | 89 ++ smart_device_protocol/arduino_lib/sdp/sdp.h | 355 ++++++++ .../arduino_lib/sdp/sdp_util.h | 6 + .../arduino_lib/utils/config_loader.h | 28 + .../arduino_lib/utils/ros_util.h | 0 .../arduino_lib/web_services/sesami_util.h | 182 ++++ .../arduino_lib/web_services/switchbot_util.h | 147 ++++ .../smart_device_protocol_interface.yaml | 8 + smart_device_protocol/docs/README_old.md | 78 ++ smart_device_protocol/docs/python.md | 9 + smart_device_protocol/docs/sdp.md | 3 + smart_device_protocol/docs/sdp_logo_v1.png | Bin 0 -> 93033 bytes smart_device_protocol/docs/sdp_logo_v1.svg | 83 ++ smart_device_protocol/launch/demo.launch | 17 + smart_device_protocol/msg/Packet.msg | 18 + smart_device_protocol/msg/UWBDistance.msg | 3 + .../node_scripts/broadcast_v1_test_packet.py | 20 + .../node_scripts/esp_now_v1_packet_printer.py | 17 + .../sdp_v2_device_interface_printer.py | 15 + .../node_scripts/sdp_v2_packet_printer.py | 16 + smart_device_protocol/package.xml | 25 + .../python/smart_device_protocol/__init__.py | 0 .../esp_now_ros_interface.py | 43 + .../smart_device_protocol/packet_generator.py | 70 ++ .../smart_device_protocol/packet_parser.py | 127 +++ .../smart_device_protocol/sdp_frames.py | 218 +++++ .../smart_device_protocol_interface.py | 146 ++++ .../python/smart_device_protocol/utils.py | 24 + smart_device_protocol/requirements.txt | 0 smart_device_protocol/ros_lib/.gitignore | 1 + .../ros_lib/ros_lib/ArduinoHardware.h | 118 +++ .../ros_lib/ros_lib/ArduinoTcpHardware.h | 116 +++ .../ros_lib/ros_lib/actionlib/TestAction.h | 56 ++ .../ros_lib/actionlib/TestActionFeedback.h | 56 ++ .../ros_lib/actionlib/TestActionGoal.h | 56 ++ .../ros_lib/actionlib/TestActionResult.h | 56 ++ .../ros_lib/ros_lib/actionlib/TestFeedback.h | 62 ++ .../ros_lib/ros_lib/actionlib/TestGoal.h | 62 ++ .../ros_lib/actionlib/TestRequestAction.h | 56 ++ .../actionlib/TestRequestActionFeedback.h | 56 ++ .../ros_lib/actionlib/TestRequestActionGoal.h | 56 ++ .../actionlib/TestRequestActionResult.h | 56 ++ .../ros_lib/actionlib/TestRequestFeedback.h | 38 + .../ros_lib/actionlib/TestRequestGoal.h | 215 +++++ .../ros_lib/actionlib/TestRequestResult.h | 80 ++ .../ros_lib/ros_lib/actionlib/TestResult.h | 62 ++ .../ros_lib/ros_lib/actionlib/TwoIntsAction.h | 56 ++ .../ros_lib/actionlib/TwoIntsActionFeedback.h | 56 ++ .../ros_lib/actionlib/TwoIntsActionGoal.h | 56 ++ .../ros_lib/actionlib/TwoIntsActionResult.h | 56 ++ .../ros_lib/actionlib/TwoIntsFeedback.h | 38 + .../ros_lib/ros_lib/actionlib/TwoIntsGoal.h | 102 +++ .../ros_lib/ros_lib/actionlib/TwoIntsResult.h | 70 ++ .../ros_lib/ros_lib/actionlib_msgs/GoalID.h | 79 ++ .../ros_lib/actionlib_msgs/GoalStatus.h | 78 ++ .../ros_lib/actionlib_msgs/GoalStatusArray.h | 70 ++ .../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/ros_lib/app_manager/App.h | 104 +++ .../app_manager/AppInstallationState.h | 89 ++ .../ros_lib/ros_lib/app_manager/AppList.h | 89 ++ .../ros_lib/ros_lib/app_manager/AppStatus.h | 82 ++ .../ros_lib/ros_lib/app_manager/ClientApp.h | 106 +++ .../ros_lib/ros_lib/app_manager/ExchangeApp.h | 147 ++++ .../ros_lib/app_manager/GetAppDetails.h | 93 +++ .../app_manager/GetInstallationState.h | 139 ++++ .../ros_lib/ros_lib/app_manager/Icon.h | 82 ++ .../ros_lib/ros_lib/app_manager/InstallApp.h | 122 +++ .../ros_lib/ros_lib/app_manager/KeyValue.h | 72 ++ .../ros_lib/ros_lib/app_manager/ListApps.h | 121 +++ .../ros_lib/ros_lib/app_manager/StartApp.h | 189 +++++ .../ros_lib/ros_lib/app_manager/StatusCodes.h | 45 + .../ros_lib/ros_lib/app_manager/StopApp.h | 146 ++++ .../ros_lib/app_manager/UninstallApp.h | 122 +++ .../ros_lib/apriltag_ros/AnalyzeSingleImage.h | 116 +++ .../ros_lib/apriltag_ros/AprilTagDetection.h | 113 +++ .../apriltag_ros/AprilTagDetectionArray.h | 70 ++ .../ros_lib/audio_common_msgs/AudioData.h | 65 ++ .../audio_common_msgs/AudioDataStamped.h | 50 ++ .../ros_lib/audio_common_msgs/AudioInfo.h | 105 +++ .../ros_lib/ros_lib/axis_camera/Axis.h | 200 +++++ .../base_local_planner/Position2DInt.h | 102 +++ .../ros_lib/ros_lib/bond/Constants.h | 44 + .../ros_lib/ros_lib/bond/Status.h | 144 ++++ .../FollowJointTrajectoryAction.h | 56 ++ .../FollowJointTrajectoryActionFeedback.h | 56 ++ .../FollowJointTrajectoryActionGoal.h | 56 ++ .../FollowJointTrajectoryActionResult.h | 56 ++ .../FollowJointTrajectoryFeedback.h | 97 +++ .../control_msgs/FollowJointTrajectoryGoal.h | 119 +++ .../FollowJointTrajectoryResult.h | 85 ++ .../ros_lib/control_msgs/GripperCommand.h | 48 ++ .../control_msgs/GripperCommandAction.h | 56 ++ .../GripperCommandActionFeedback.h | 56 ++ .../control_msgs/GripperCommandActionGoal.h | 56 ++ .../control_msgs/GripperCommandActionResult.h | 56 ++ .../control_msgs/GripperCommandFeedback.h | 84 ++ .../ros_lib/control_msgs/GripperCommandGoal.h | 44 + .../control_msgs/GripperCommandResult.h | 84 ++ .../control_msgs/JointControllerState.h | 112 +++ .../ros_lib/ros_lib/control_msgs/JointJog.h | 136 +++ .../ros_lib/control_msgs/JointTolerance.h | 70 ++ .../control_msgs/JointTrajectoryAction.h | 56 ++ .../JointTrajectoryActionFeedback.h | 56 ++ .../control_msgs/JointTrajectoryActionGoal.h | 56 ++ .../JointTrajectoryActionResult.h | 56 ++ .../JointTrajectoryControllerState.h | 97 +++ .../control_msgs/JointTrajectoryFeedback.h | 38 + .../control_msgs/JointTrajectoryGoal.h | 44 + .../control_msgs/JointTrajectoryResult.h | 38 + .../ros_lib/ros_lib/control_msgs/PidState.h | 123 +++ .../ros_lib/control_msgs/PointHeadAction.h | 56 ++ .../control_msgs/PointHeadActionFeedback.h | 56 ++ .../control_msgs/PointHeadActionGoal.h | 56 ++ .../control_msgs/PointHeadActionResult.h | 56 ++ .../ros_lib/control_msgs/PointHeadFeedback.h | 43 + .../ros_lib/control_msgs/PointHeadGoal.h | 96 +++ .../ros_lib/control_msgs/PointHeadResult.h | 38 + .../control_msgs/QueryCalibrationState.h | 88 ++ .../control_msgs/QueryTrajectoryState.h | 206 +++++ .../control_msgs/SingleJointPositionAction.h | 56 ++ .../SingleJointPositionActionFeedback.h | 56 ++ .../SingleJointPositionActionGoal.h | 56 ++ .../SingleJointPositionActionResult.h | 56 ++ .../SingleJointPositionFeedback.h | 59 ++ .../control_msgs/SingleJointPositionGoal.h | 72 ++ .../control_msgs/SingleJointPositionResult.h | 38 + .../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 +++ .../ros_lib/ros_lib/costmap_2d/VoxelGrid.h | 128 +++ .../costmap_converter/ObstacleArrayMsg.h | 70 ++ .../ros_lib/costmap_converter/ObstacleMsg.h | 99 +++ .../ros_lib/diagnostic_msgs/AddDiagnostics.h | 122 +++ .../ros_lib/diagnostic_msgs/DiagnosticArray.h | 70 ++ .../diagnostic_msgs/DiagnosticStatus.h | 137 ++++ .../ros_lib/diagnostic_msgs/KeyValue.h | 72 ++ .../ros_lib/diagnostic_msgs/SelfTest.h | 131 +++ .../DialogResponse.h | 178 ++++ .../DialogTextAction.h | 56 ++ .../DialogTextActionFeedback.h | 56 ++ .../DialogTextActionGoal.h | 56 ++ .../DialogTextActionResult.h | 56 ++ .../DialogTextFeedback.h | 72 ++ .../DialogTextGoal.h | 55 ++ .../DialogTextResult.h | 79 ++ .../ros_lib/driver_base/ConfigString.h | 72 ++ .../ros_lib/ros_lib/driver_base/ConfigValue.h | 60 ++ .../ros_lib/driver_base/SensorLevels.h | 41 + .../ros_lib/ros_lib/duration.cpp | 83 ++ .../dynamic_reconfigure/BoolParameter.h | 73 ++ .../ros_lib/dynamic_reconfigure/Config.h | 168 ++++ .../dynamic_reconfigure/ConfigDescription.h | 80 ++ .../dynamic_reconfigure/DoubleParameter.h | 60 ++ .../ros_lib/dynamic_reconfigure/Group.h | 146 ++++ .../ros_lib/dynamic_reconfigure/GroupState.h | 121 +++ .../dynamic_reconfigure/IntParameter.h | 79 ++ .../dynamic_reconfigure/ParamDescription.h | 119 +++ .../ros_lib/dynamic_reconfigure/Reconfigure.h | 81 ++ .../dynamic_reconfigure/SensorLevels.h | 41 + .../dynamic_reconfigure/StrParameter.h | 72 ++ .../ros_lib/dynamic_tf_publisher/AssocTF.h | 110 +++ .../ros_lib/dynamic_tf_publisher/DeleteTF.h | 76 ++ .../ros_lib/dynamic_tf_publisher/DissocTF.h | 93 +++ .../dynamic_tf_publisher/SetDynamicTF.h | 100 +++ .../ros_lib/ethercat_hardware/ActuatorInfo.h | 149 ++++ .../ros_lib/ethercat_hardware/BoardInfo.h | 166 ++++ .../ethercat_hardware/MotorTemperature.h | 82 ++ .../ros_lib/ethercat_hardware/MotorTrace.h | 99 +++ .../ethercat_hardware/MotorTraceSample.h | 144 ++++ .../ros_lib/ethercat_hardware/RawFTData.h | 128 +++ .../ethercat_hardware/RawFTDataSample.h | 108 +++ .../SoftProcessorFirmwareRead.h | 172 ++++ .../SoftProcessorFirmwareWrite.h | 172 ++++ .../ethercat_hardware/SoftProcessorReset.h | 139 ++++ .../MultiWaveform.h | 74 ++ .../MultiWaveformTransition.h | 73 ++ .../SetMultiWaveform.h | 111 +++ .../SetWaveform.h | 157 ++++ .../ros_lib/ros_lib/examples/ADC/ADC.pde | 52 ++ .../ros_lib/ros_lib/examples/Blink/Blink.pde | 29 + .../ros_lib/examples/BlinkM/BlinkM.pde | 162 ++++ .../ros_lib/examples/BlinkM/BlinkM_funcs.h | 440 ++++++++++ .../BlinkerWithClass/BlinkerWithClass.ino | 70 ++ .../ros_lib/examples/Clapper/Clapper.pde | 94 +++ .../Esp8266HelloWorld/Esp8266HelloWorld.ino | 75 ++ .../examples/HelloWorld/HelloWorld.pde | 28 + .../ros_lib/examples/IrRanger/IrRanger.pde | 64 ++ .../ros_lib/examples/Logging/Logging.pde | 45 + .../ros_lib/ros_lib/examples/Odom/Odom.pde | 53 ++ .../examples/ServiceClient/ServiceClient.pde | 38 + .../ros_lib/examples/ServiceClient/client.py | 20 + .../examples/ServiceServer/ServiceServer.pde | 40 + .../examples/ServoControl/ServoControl.pde | 49 ++ .../ros_lib/examples/TcpBlink/TcpBlink.ino | 47 ++ .../examples/TcpHelloWorld/TcpHelloWorld.ino | 84 ++ .../examples/Temperature/Temperature.pde | 72 ++ .../ros_lib/examples/TimeTF/TimeTF.pde | 37 + .../examples/Ultrasound/Ultrasound.pde | 61 ++ .../button_example/button_example.pde | 61 ++ .../ros_lib/examples/pubsub/pubsub.pde | 40 + .../face_detector/FaceDetectorAction.h | 56 ++ .../FaceDetectorActionFeedback.h | 56 ++ .../face_detector/FaceDetectorActionGoal.h | 56 ++ .../face_detector/FaceDetectorActionResult.h | 56 ++ .../face_detector/FaceDetectorFeedback.h | 38 + .../ros_lib/face_detector/FaceDetectorGoal.h | 38 + .../face_detector/FaceDetectorResult.h | 64 ++ .../ros_lib/fetch_auto_dock_msgs/DockAction.h | 56 ++ .../fetch_auto_dock_msgs/DockActionFeedback.h | 56 ++ .../fetch_auto_dock_msgs/DockActionGoal.h | 56 ++ .../fetch_auto_dock_msgs/DockActionResult.h | 56 ++ .../fetch_auto_dock_msgs/DockFeedback.h | 50 ++ .../ros_lib/fetch_auto_dock_msgs/DockGoal.h | 79 ++ .../ros_lib/fetch_auto_dock_msgs/DockResult.h | 73 ++ .../fetch_auto_dock_msgs/UndockAction.h | 56 ++ .../UndockActionFeedback.h | 56 ++ .../fetch_auto_dock_msgs/UndockActionGoal.h | 56 ++ .../fetch_auto_dock_msgs/UndockActionResult.h | 56 ++ .../fetch_auto_dock_msgs/UndockFeedback.h | 50 ++ .../ros_lib/fetch_auto_dock_msgs/UndockGoal.h | 56 ++ .../fetch_auto_dock_msgs/UndockResult.h | 56 ++ .../ros_lib/fetch_driver_msgs/BoardState.h | 267 ++++++ .../ros_lib/fetch_driver_msgs/ChargerState.h | 379 +++++++++ .../fetch_driver_msgs/DisableChargingAction.h | 56 ++ .../DisableChargingActionFeedback.h | 56 ++ .../DisableChargingActionGoal.h | 56 ++ .../DisableChargingActionResult.h | 56 ++ .../DisableChargingFeedback.h | 38 + .../fetch_driver_msgs/DisableChargingGoal.h | 62 ++ .../fetch_driver_msgs/DisableChargingResult.h | 56 ++ .../ros_lib/fetch_driver_msgs/GripperState.h | 158 ++++ .../ros_lib/ros_lib/fetch_driver_msgs/Gyro.h | 87 ++ .../ros_lib/fetch_driver_msgs/JointState.h | 206 +++++ .../ros_lib/fetch_driver_msgs/MotorState.h | 261 ++++++ .../ros_lib/fetch_driver_msgs/RobotState.h | 208 +++++ .../fetch_driver_msgs/SafetyLaserState.h | 117 +++ .../ros_lib/fingertip_pressure/PressureInfo.h | 64 ++ .../fingertip_pressure/PressureInfoElement.h | 156 ++++ .../JointTorqueComparison.h | 67 ++ .../ros_lib/franka_gripper/GraspAction.h | 56 ++ .../franka_gripper/GraspActionFeedback.h | 56 ++ .../ros_lib/franka_gripper/GraspActionGoal.h | 56 ++ .../franka_gripper/GraspActionResult.h | 56 ++ .../ros_lib/franka_gripper/GraspEpsilon.h | 48 ++ .../ros_lib/franka_gripper/GraspFeedback.h | 38 + .../ros_lib/franka_gripper/GraspGoal.h | 59 ++ .../ros_lib/franka_gripper/GraspResult.h | 73 ++ .../ros_lib/franka_gripper/HomingAction.h | 56 ++ .../franka_gripper/HomingActionFeedback.h | 56 ++ .../ros_lib/franka_gripper/HomingActionGoal.h | 56 ++ .../franka_gripper/HomingActionResult.h | 56 ++ .../ros_lib/franka_gripper/HomingFeedback.h | 38 + .../ros_lib/franka_gripper/HomingGoal.h | 38 + .../ros_lib/franka_gripper/HomingResult.h | 73 ++ .../ros_lib/franka_gripper/MoveAction.h | 56 ++ .../franka_gripper/MoveActionFeedback.h | 56 ++ .../ros_lib/franka_gripper/MoveActionGoal.h | 56 ++ .../ros_lib/franka_gripper/MoveActionResult.h | 56 ++ .../ros_lib/franka_gripper/MoveFeedback.h | 38 + .../ros_lib/ros_lib/franka_gripper/MoveGoal.h | 48 ++ .../ros_lib/franka_gripper/MoveResult.h | 73 ++ .../ros_lib/franka_gripper/StopAction.h | 56 ++ .../franka_gripper/StopActionFeedback.h | 56 ++ .../ros_lib/franka_gripper/StopActionGoal.h | 56 ++ .../ros_lib/franka_gripper/StopActionResult.h | 56 ++ .../ros_lib/franka_gripper/StopFeedback.h | 38 + .../ros_lib/ros_lib/franka_gripper/StopGoal.h | 38 + .../ros_lib/franka_gripper/StopResult.h | 73 ++ .../ros_lib/franka_msgs/ErrorRecoveryAction.h | 56 ++ .../franka_msgs/ErrorRecoveryActionFeedback.h | 56 ++ .../franka_msgs/ErrorRecoveryActionGoal.h | 56 ++ .../franka_msgs/ErrorRecoveryActionResult.h | 56 ++ .../franka_msgs/ErrorRecoveryFeedback.h | 38 + .../ros_lib/franka_msgs/ErrorRecoveryGoal.h | 38 + .../ros_lib/franka_msgs/ErrorRecoveryResult.h | 38 + .../ros_lib/ros_lib/franka_msgs/Errors.h | 776 ++++++++++++++++++ .../ros_lib/ros_lib/franka_msgs/FrankaState.h | 406 +++++++++ .../franka_msgs/SetCartesianImpedance.h | 113 +++ .../ros_lib/ros_lib/franka_msgs/SetEEFrame.h | 113 +++ .../SetForceTorqueCollisionBehavior.h | 137 ++++ .../franka_msgs/SetFullCollisionBehavior.h | 169 ++++ .../ros_lib/franka_msgs/SetJointImpedance.h | 113 +++ .../ros_lib/ros_lib/franka_msgs/SetKFrame.h | 113 +++ .../ros_lib/ros_lib/franka_msgs/SetLoad.h | 126 +++ .../ros_lib/gazebo_msgs/ApplyBodyWrench.h | 199 +++++ .../ros_lib/gazebo_msgs/ApplyJointEffort.h | 175 ++++ .../ros_lib/ros_lib/gazebo_msgs/BodyRequest.h | 87 ++ .../ros_lib/gazebo_msgs/ContactState.h | 196 +++++ .../ros_lib/gazebo_msgs/ContactsState.h | 70 ++ .../ros_lib/ros_lib/gazebo_msgs/DeleteLight.h | 122 +++ .../ros_lib/ros_lib/gazebo_msgs/DeleteModel.h | 122 +++ .../ros_lib/gazebo_msgs/GetJointProperties.h | 210 +++++ .../ros_lib/gazebo_msgs/GetLightProperties.h | 143 ++++ .../ros_lib/gazebo_msgs/GetLinkProperties.h | 181 ++++ .../ros_lib/gazebo_msgs/GetLinkState.h | 145 ++++ .../ros_lib/gazebo_msgs/GetModelProperties.h | 322 ++++++++ .../ros_lib/gazebo_msgs/GetModelState.h | 157 ++++ .../gazebo_msgs/GetPhysicsProperties.h | 145 ++++ .../ros_lib/gazebo_msgs/GetWorldProperties.h | 165 ++++ .../ros_lib/gazebo_msgs/JointRequest.h | 87 ++ .../ros_lib/ros_lib/gazebo_msgs/LinkState.h | 84 ++ .../ros_lib/ros_lib/gazebo_msgs/LinkStates.h | 127 +++ .../ros_lib/ros_lib/gazebo_msgs/ModelState.h | 84 ++ .../ros_lib/ros_lib/gazebo_msgs/ModelStates.h | 127 +++ .../ros_lib/gazebo_msgs/ODEJointProperties.h | 288 +++++++ .../ros_lib/ros_lib/gazebo_msgs/ODEPhysics.h | 125 +++ .../ros_lib/gazebo_msgs/PerformanceMetrics.h | 75 ++ .../gazebo_msgs/SensorPerformanceMetric.h | 70 ++ .../ros_lib/gazebo_msgs/SetJointProperties.h | 128 +++ .../ros_lib/gazebo_msgs/SetJointTrajectory.h | 170 ++++ .../ros_lib/gazebo_msgs/SetLightProperties.h | 178 ++++ .../ros_lib/gazebo_msgs/SetLinkProperties.h | 181 ++++ .../ros_lib/gazebo_msgs/SetLinkState.h | 111 +++ .../gazebo_msgs/SetModelConfiguration.h | 201 +++++ .../ros_lib/gazebo_msgs/SetModelState.h | 111 +++ .../gazebo_msgs/SetPhysicsProperties.h | 127 +++ .../ros_lib/ros_lib/gazebo_msgs/SpawnModel.h | 179 ++++ .../ros_lib/ros_lib/gazebo_msgs/WorldState.h | 159 ++++ .../ros_lib/gdrive_ros/MultipleUpload.h | 360 ++++++++ .../ros_lib/ros_lib/gdrive_ros/Upload.h | 260 ++++++ .../ros_lib/geographic_msgs/BoundingBox.h | 49 ++ .../ros_lib/ros_lib/geographic_msgs/GeoPath.h | 70 ++ .../ros_lib/geographic_msgs/GeoPoint.h | 53 ++ .../ros_lib/geographic_msgs/GeoPointStamped.h | 50 ++ .../ros_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 ++ .../ros_lib/geographic_msgs/GetGeoPath.h | 143 ++++ .../geographic_msgs/GetGeographicMap.h | 134 +++ .../ros_lib/geographic_msgs/GetRoutePlan.h | 127 +++ .../ros_lib/geographic_msgs/KeyValue.h | 72 ++ .../ros_lib/geographic_msgs/MapFeature.h | 95 +++ .../ros_lib/geographic_msgs/RouteNetwork.h | 134 +++ .../ros_lib/geographic_msgs/RoutePath.h | 101 +++ .../ros_lib/geographic_msgs/RouteSegment.h | 80 ++ .../geographic_msgs/UpdateGeographicMap.h | 111 +++ .../ros_lib/geographic_msgs/WayPoint.h | 76 ++ .../ros_lib/ros_lib/geometry_msgs/Accel.h | 49 ++ .../ros_lib/geometry_msgs/AccelStamped.h | 50 ++ .../geometry_msgs/AccelWithCovariance.h | 52 ++ .../AccelWithCovarianceStamped.h | 50 ++ .../ros_lib/ros_lib/geometry_msgs/Inertia.h | 79 ++ .../ros_lib/geometry_msgs/InertiaStamped.h | 50 ++ .../ros_lib/ros_lib/geometry_msgs/Point.h | 53 ++ .../ros_lib/ros_lib/geometry_msgs/Point32.h | 110 +++ .../ros_lib/geometry_msgs/PointStamped.h | 50 ++ .../ros_lib/ros_lib/geometry_msgs/Polygon.h | 64 ++ .../ros_lib/geometry_msgs/PolygonStamped.h | 50 ++ .../ros_lib/ros_lib/geometry_msgs/Pose.h | 50 ++ .../ros_lib/ros_lib/geometry_msgs/Pose2D.h | 53 ++ .../ros_lib/ros_lib/geometry_msgs/PoseArray.h | 70 ++ .../ros_lib/geometry_msgs/PoseStamped.h | 50 ++ .../geometry_msgs/PoseWithCovariance.h | 52 ++ .../geometry_msgs/PoseWithCovarianceStamped.h | 50 ++ .../ros_lib/geometry_msgs/Quaternion.h | 58 ++ .../ros_lib/geometry_msgs/QuaternionStamped.h | 50 ++ .../ros_lib/ros_lib/geometry_msgs/Transform.h | 50 ++ .../ros_lib/geometry_msgs/TransformStamped.h | 67 ++ .../ros_lib/ros_lib/geometry_msgs/Twist.h | 49 ++ .../ros_lib/geometry_msgs/TwistStamped.h | 50 ++ .../geometry_msgs/TwistWithCovariance.h | 52 ++ .../TwistWithCovarianceStamped.h | 50 ++ .../ros_lib/ros_lib/geometry_msgs/Vector3.h | 53 ++ .../ros_lib/geometry_msgs/Vector3Stamped.h | 50 ++ .../ros_lib/ros_lib/geometry_msgs/Wrench.h | 49 ++ .../ros_lib/geometry_msgs/WrenchStamped.h | 50 ++ .../ros_lib/google_chat_ros/ActionParameter.h | 72 ++ .../ros_lib/google_chat_ros/Annotation.h | 134 +++ .../ros_lib/google_chat_ros/Attachment.h | 210 +++++ .../ros_lib/ros_lib/google_chat_ros/Button.h | 134 +++ .../ros_lib/ros_lib/google_chat_ros/Card.h | 113 +++ .../ros_lib/google_chat_ros/CardAction.h | 61 ++ .../ros_lib/google_chat_ros/CardEvent.h | 79 ++ .../ros_lib/google_chat_ros/CardHeader.h | 124 +++ .../ros_lib/google_chat_ros/FormAction.h | 81 ++ .../ros_lib/ros_lib/google_chat_ros/Image.h | 83 ++ .../ros_lib/google_chat_ros/KeyValue.h | 170 ++++ .../ros_lib/ros_lib/google_chat_ros/Message.h | 181 ++++ .../ros_lib/google_chat_ros/MessageEvent.h | 73 ++ .../ros_lib/ros_lib/google_chat_ros/OnClick.h | 61 ++ .../ros_lib/ros_lib/google_chat_ros/Section.h | 81 ++ .../google_chat_ros/SendMessageAction.h | 56 ++ .../SendMessageActionFeedback.h | 56 ++ .../google_chat_ros/SendMessageActionGoal.h | 56 ++ .../google_chat_ros/SendMessageActionResult.h | 56 ++ .../google_chat_ros/SendMessageFeedback.h | 55 ++ .../ros_lib/google_chat_ros/SendMessageGoal.h | 133 +++ .../google_chat_ros/SendMessageResult.h | 88 ++ .../ros_lib/google_chat_ros/SlashCommand.h | 132 +++ .../ros_lib/ros_lib/google_chat_ros/Space.h | 108 +++ .../ros_lib/google_chat_ros/SpaceEvent.h | 103 +++ .../ros_lib/ros_lib/google_chat_ros/User.h | 169 ++++ .../ros_lib/google_chat_ros/WidgetMarkup.h | 93 +++ .../ros_lib/ros_lib/graft/GraftControl.h | 67 ++ .../ros_lib/graft/GraftSensorResidual.h | 103 +++ .../ros_lib/ros_lib/graft/GraftState.h | 80 ++ .../FindGraspableObjectsAction.h | 56 ++ .../FindGraspableObjectsActionFeedback.h | 56 ++ .../FindGraspableObjectsActionGoal.h | 56 ++ .../FindGraspableObjectsActionResult.h | 56 ++ .../FindGraspableObjectsFeedback.h | 44 + .../grasping_msgs/FindGraspableObjectsGoal.h | 56 ++ .../FindGraspableObjectsResult.h | 90 ++ .../grasping_msgs/GraspPlanningAction.h | 56 ++ .../GraspPlanningActionFeedback.h | 56 ++ .../grasping_msgs/GraspPlanningActionGoal.h | 56 ++ .../grasping_msgs/GraspPlanningActionResult.h | 56 ++ .../grasping_msgs/GraspPlanningFeedback.h | 64 ++ .../ros_lib/grasping_msgs/GraspPlanningGoal.h | 61 ++ .../grasping_msgs/GraspPlanningResult.h | 64 ++ .../ros_lib/grasping_msgs/GraspableObject.h | 70 ++ .../ros_lib/ros_lib/grasping_msgs/Object.h | 219 +++++ .../ros_lib/grasping_msgs/ObjectProperty.h | 72 ++ .../ros_lib/ros_lib/image_view2/ChangeMode.h | 87 ++ .../ros_lib/image_view2/ImageMarker2.h | 455 ++++++++++ .../ros_lib/ros_lib/image_view2/MouseEvent.h | 193 +++++ .../ros_lib/image_view2/PointArrayStamped.h | 70 ++ .../FootCoordsLowLevelInfo.h | 69 ++ .../jsk_footstep_controller/GoPosAction.h | 56 ++ .../GoPosActionFeedback.h | 56 ++ .../jsk_footstep_controller/GoPosActionGoal.h | 56 ++ .../GoPosActionResult.h | 56 ++ .../jsk_footstep_controller/GoPosFeedback.h | 74 ++ .../jsk_footstep_controller/GoPosGoal.h | 121 +++ .../jsk_footstep_controller/GoPosResult.h | 38 + .../GroundContactState.h | 76 ++ .../LookAroundGroundAction.h | 56 ++ .../LookAroundGroundActionFeedback.h | 56 ++ .../LookAroundGroundActionGoal.h | 56 ++ .../LookAroundGroundActionResult.h | 56 ++ .../LookAroundGroundFeedback.h | 38 + .../LookAroundGroundGoal.h | 38 + .../LookAroundGroundResult.h | 38 + .../jsk_footstep_controller/RequireLog.h | 87 ++ .../RequireMonitorStatus.h | 118 +++ .../SynchronizedForces.h | 67 ++ .../jsk_footstep_msgs/ExecFootstepsAction.h | 56 ++ .../ExecFootstepsActionFeedback.h | 56 ++ .../ExecFootstepsActionGoal.h | 56 ++ .../ExecFootstepsActionResult.h | 56 ++ .../jsk_footstep_msgs/ExecFootstepsFeedback.h | 38 + .../jsk_footstep_msgs/ExecFootstepsGoal.h | 53 ++ .../jsk_footstep_msgs/ExecFootstepsResult.h | 38 + .../ros_lib/jsk_footstep_msgs/Footstep.h | 155 ++++ .../ros_lib/jsk_footstep_msgs/FootstepArray.h | 70 ++ .../jsk_footstep_msgs/PlanFootstepsAction.h | 56 ++ .../PlanFootstepsActionFeedback.h | 56 ++ .../PlanFootstepsActionGoal.h | 56 ++ .../PlanFootstepsActionResult.h | 56 ++ .../jsk_footstep_msgs/PlanFootstepsFeedback.h | 44 + .../jsk_footstep_msgs/PlanFootstepsGoal.h | 73 ++ .../jsk_footstep_msgs/PlanFootstepsResult.h | 44 + .../jsk_footstep_planner/ChangeSuccessor.h | 87 ++ .../CollisionBoundingBoxInfo.h | 82 ++ .../jsk_footstep_planner/ProjectFootstep.h | 126 +++ .../jsk_footstep_planner/SetHeuristicPath.h | 96 +++ .../ros_lib/ros_lib/jsk_gui_msgs/Action.h | 197 +++++ .../ros_lib/jsk_gui_msgs/AndroidSensor.h | 68 ++ .../ros_lib/jsk_gui_msgs/DeviceSensor.h | 63 ++ .../ros_lib/ros_lib/jsk_gui_msgs/Gravity.h | 44 + .../ros_lib/jsk_gui_msgs/MagneticField.h | 44 + .../ros_lib/ros_lib/jsk_gui_msgs/MultiTouch.h | 64 ++ .../ros_lib/ros_lib/jsk_gui_msgs/Query.h | 111 +++ .../ros_lib/jsk_gui_msgs/SlackMessage.h | 78 ++ .../ros_lib/ros_lib/jsk_gui_msgs/Tablet.h | 116 +++ .../ros_lib/ros_lib/jsk_gui_msgs/Touch.h | 144 ++++ .../ros_lib/ros_lib/jsk_gui_msgs/TouchEvent.h | 155 ++++ .../ros_lib/jsk_gui_msgs/VoiceMessage.h | 75 ++ .../ros_lib/ros_lib/jsk_gui_msgs/YesNo.h | 105 +++ .../ros_lib/ros_lib/jsk_hark_msgs/HarkPower.h | 160 ++++ .../jsk_interactive_marker/GetJointState.h | 76 ++ .../GetMarkerDimensions.h | 93 +++ .../GetTransformableMarkerColor.h | 93 +++ .../GetTransformableMarkerExistence.h | 105 +++ .../GetTransformableMarkerFocus.h | 87 ++ .../GetTransformableMarkerPose.h | 93 +++ .../ros_lib/jsk_interactive_marker/GetType.h | 111 +++ .../jsk_interactive_marker/IndexRequest.h | 76 ++ .../JointTrajectoryPointWithType.h | 220 +++++ .../JointTrajectoryWithType.h | 107 +++ .../jsk_interactive_marker/MarkerDimensions.h | 182 ++++ .../jsk_interactive_marker/MarkerMenu.h | 136 +++ .../jsk_interactive_marker/MarkerPose.h | 89 ++ .../jsk_interactive_marker/MarkerSetPose.h | 124 +++ .../jsk_interactive_marker/MoveModel.h | 100 +++ .../jsk_interactive_marker/MoveObject.h | 55 ++ .../PoseStampedWithName.h | 61 ++ .../RemoveParentMarker.h | 87 ++ .../jsk_interactive_marker/SetHeuristic.h | 87 ++ .../SetMarkerDimensions.h | 93 +++ .../jsk_interactive_marker/SetParentMarker.h | 121 +++ .../ros_lib/jsk_interactive_marker/SetPose.h | 107 +++ .../SetTransformableMarkerColor.h | 93 +++ .../SetTransformableMarkerFocus.h | 87 ++ .../SetTransformableMarkerPose.h | 93 +++ .../jsk_interactive_marker/SnapFootPrint.h | 110 +++ .../SnapFootPrintInput.h | 55 ++ .../ros_lib/jsk_network_tools/AllTypeTest.h | 410 +++++++++ .../CompressedAngleVectorPR2.h | 48 ++ .../ros_lib/jsk_network_tools/FC2OCS.h | 106 +++ .../jsk_network_tools/FC2OCSLargeData.h | 55 ++ .../ros_lib/jsk_network_tools/Heartbeat.h | 68 ++ .../jsk_network_tools/HeartbeatResponse.h | 50 ++ .../ros_lib/jsk_network_tools/OCS2FC.h | 84 ++ .../ros_lib/jsk_network_tools/OpenNISample.h | 50 ++ .../ros_lib/jsk_network_tools/SetSendRate.h | 112 +++ .../SilverhammerInternalBuffer.h | 84 ++ .../ros_lib/jsk_network_tools/WifiStatus.h | 243 ++++++ .../ros_lib/jsk_perception/EuclideanSegment.h | 125 +++ .../jsk_perception/NonMaximumSuppression.h | 177 ++++ .../ros_lib/jsk_perception/SetTemplate.h | 164 ++++ .../ros_lib/jsk_perception/WhiteBalance.h | 108 +++ .../jsk_perception/WhiteBalancePoints.h | 108 +++ .../ros_lib/jsk_recognition_msgs/Accuracy.h | 68 ++ .../jsk_recognition_msgs/BoolStamped.h | 62 ++ .../jsk_recognition_msgs/BoundingBox.h | 93 +++ .../jsk_recognition_msgs/BoundingBoxArray.h | 70 ++ .../BoundingBoxArrayWithCameraInfo.h | 56 ++ .../BoundingBoxMovement.h | 62 ++ .../jsk_recognition_msgs/CallPolygon.h | 93 +++ .../ros_lib/jsk_recognition_msgs/CallSnapIt.h | 82 ++ .../jsk_recognition_msgs/CheckCircle.h | 135 +++ .../jsk_recognition_msgs/CheckCollision.h | 100 +++ .../ros_lib/jsk_recognition_msgs/Circle2D.h | 59 ++ .../jsk_recognition_msgs/Circle2DArray.h | 70 ++ .../ClassificationResult.h | 218 +++++ .../ClusterPointIndices.h | 70 ++ .../jsk_recognition_msgs/ColorHistogram.h | 88 ++ .../ColorHistogramArray.h | 70 ++ .../jsk_recognition_msgs/ContactSensor.h | 79 ++ .../jsk_recognition_msgs/ContactSensorArray.h | 70 ++ .../DepthCalibrationParameter.h | 131 +++ .../jsk_recognition_msgs/DepthErrorResult.h | 166 ++++ .../jsk_recognition_msgs/EnvironmentLock.h | 83 ++ .../jsk_recognition_msgs/EuclideanSegment.h | 125 +++ .../jsk_recognition_msgs/HeightmapConfig.h | 134 +++ .../ros_lib/jsk_recognition_msgs/Histogram.h | 69 ++ .../jsk_recognition_msgs/HistogramWithRange.h | 70 ++ .../HistogramWithRangeArray.h | 70 ++ .../HistogramWithRangeBin.h | 61 ++ .../jsk_recognition_msgs/HumanSkeleton.h | 107 +++ .../jsk_recognition_msgs/HumanSkeletonArray.h | 96 +++ .../ros_lib/jsk_recognition_msgs/ICPAlign.h | 87 ++ .../jsk_recognition_msgs/ICPAlignWithBox.h | 88 ++ .../ros_lib/jsk_recognition_msgs/ICPResult.h | 72 ++ .../ImageDifferenceValue.h | 68 ++ .../jsk_recognition_msgs/Int32Stamped.h | 68 ++ .../ros_lib/jsk_recognition_msgs/Label.h | 79 ++ .../ros_lib/jsk_recognition_msgs/LabelArray.h | 70 ++ .../ros_lib/jsk_recognition_msgs/Line.h | 58 ++ .../ros_lib/jsk_recognition_msgs/LineArray.h | 70 ++ .../ModelCoefficientsArray.h | 70 ++ .../NonMaximumSuppression.h | 177 ++++ .../ros_lib/jsk_recognition_msgs/Object.h | 204 +++++ .../jsk_recognition_msgs/ObjectArray.h | 70 ++ .../jsk_recognition_msgs/ParallelEdge.h | 96 +++ .../jsk_recognition_msgs/ParallelEdgeArray.h | 70 ++ .../ros_lib/jsk_recognition_msgs/PeoplePose.h | 145 ++++ .../jsk_recognition_msgs/PeoplePoseArray.h | 70 ++ .../ros_lib/jsk_recognition_msgs/PlotData.h | 200 +++++ .../jsk_recognition_msgs/PlotDataArray.h | 208 +++++ .../jsk_recognition_msgs/PointsArray.h | 70 ++ .../jsk_recognition_msgs/PolygonArray.h | 147 ++++ .../PolygonOnEnvironment.h | 137 ++++ .../jsk_recognition_msgs/PosedCameraInfo.h | 56 ++ .../ros_lib/jsk_recognition_msgs/Rect.h | 134 +++ .../ros_lib/jsk_recognition_msgs/RectArray.h | 70 ++ .../RobotPickupReleasePoint.h | 118 +++ .../jsk_recognition_msgs/RotatedRect.h | 63 ++ .../jsk_recognition_msgs/RotatedRectStamped.h | 50 ++ .../ros_lib/jsk_recognition_msgs/SaveMesh.h | 111 +++ .../ros_lib/jsk_recognition_msgs/Segment.h | 49 ++ .../jsk_recognition_msgs/SegmentArray.h | 70 ++ .../jsk_recognition_msgs/SegmentStamped.h | 50 ++ .../SetDepthCalibrationParameter.h | 76 ++ .../ros_lib/jsk_recognition_msgs/SetLabels.h | 140 ++++ .../jsk_recognition_msgs/SetPointCloud2.h | 110 +++ .../jsk_recognition_msgs/SetTemplate.h | 164 ++++ .../jsk_recognition_msgs/SimpleHandle.h | 55 ++ .../SimpleOccupancyGrid.h | 121 +++ .../SimpleOccupancyGridArray.h | 70 ++ .../jsk_recognition_msgs/SlicedPointCloud.h | 58 ++ .../jsk_recognition_msgs/SnapFootstep.h | 81 ++ .../jsk_recognition_msgs/SnapItRequest.h | 91 ++ .../jsk_recognition_msgs/SparseImage.h | 132 +++ .../SparseOccupancyGrid.h | 100 +++ .../SparseOccupancyGridArray.h | 70 ++ .../SparseOccupancyGridCell.h | 86 ++ .../SparseOccupancyGridColumn.h | 88 ++ .../ros_lib/jsk_recognition_msgs/Spectrum.h | 132 +++ .../jsk_recognition_msgs/SwitchTopic.h | 104 +++ .../ros_lib/jsk_recognition_msgs/TimeRange.h | 91 ++ .../ros_lib/jsk_recognition_msgs/Torus.h | 78 ++ .../ros_lib/jsk_recognition_msgs/TorusArray.h | 70 ++ .../jsk_recognition_msgs/TowerPickUp.h | 94 +++ .../TowerRobotMoveCommand.h | 202 +++++ .../jsk_recognition_msgs/TrackerStatus.h | 62 ++ .../jsk_recognition_msgs/TrackingStatus.h | 62 ++ .../TransformScreenpoint.h | 154 ++++ .../jsk_recognition_msgs/UpdateOffset.h | 76 ++ .../jsk_recognition_msgs/VectorArray.h | 93 +++ .../jsk_recognition_msgs/WeightedPoseArray.h | 94 +++ .../jsk_recognition_msgs/WhiteBalance.h | 108 +++ .../jsk_recognition_msgs/WhiteBalancePoints.h | 108 +++ .../ros_lib/jsk_rviz_plugins/EusCommand.h | 87 ++ .../jsk_rviz_plugins/ObjectFitCommand.h | 62 ++ .../ros_lib/jsk_rviz_plugins/OverlayMenu.h | 142 ++++ .../ros_lib/jsk_rviz_plugins/OverlayText.h | 236 ++++++ .../ros_lib/jsk_rviz_plugins/Pictogram.h | 111 +++ .../ros_lib/jsk_rviz_plugins/PictogramArray.h | 70 ++ .../ros_lib/jsk_rviz_plugins/RecordCommand.h | 76 ++ .../jsk_rviz_plugins/RequestMarkerOperate.h | 76 ++ .../ros_lib/jsk_rviz_plugins/Screenshot.h | 87 ++ .../ros_lib/jsk_rviz_plugins/StringStamped.h | 61 ++ .../TransformableMarkerOperate.h | 181 ++++ .../ros_lib/jsk_topic_tools/ChangeTopic.h | 87 ++ .../ros_lib/ros_lib/jsk_topic_tools/List.h | 107 +++ .../jsk_topic_tools/PassthroughDuration.h | 94 +++ .../ros_lib/jsk_topic_tools/TopicInfo.h | 60 ++ .../ros_lib/ros_lib/jsk_topic_tools/Update.h | 134 +++ .../ros_lib/laser_assembler/AssembleScans.h | 123 +++ .../ros_lib/laser_assembler/AssembleScans2.h | 123 +++ .../ros_lib/ros_lib/map_msgs/GetMapROI.h | 96 +++ .../ros_lib/ros_lib/map_msgs/GetPointMap.h | 76 ++ .../ros_lib/ros_lib/map_msgs/GetPointMapROI.h | 111 +++ .../ros_lib/map_msgs/OccupancyGridUpdate.h | 156 ++++ .../ros_lib/map_msgs/PointCloud2Update.h | 65 ++ .../ros_lib/ros_lib/map_msgs/ProjectedMap.h | 54 ++ .../ros_lib/map_msgs/ProjectedMapInfo.h | 85 ++ .../ros_lib/map_msgs/ProjectedMapsInfo.h | 96 +++ .../ros_lib/ros_lib/map_msgs/SaveMap.h | 76 ++ .../ros_lib/map_msgs/SetMapProjections.h | 96 +++ .../ros_lib/ros_lib/mbf_msgs/CheckPath.h | 251 ++++++ .../ros_lib/ros_lib/mbf_msgs/CheckPoint.h | 110 +++ .../ros_lib/ros_lib/mbf_msgs/CheckPose.h | 224 +++++ .../ros_lib/ros_lib/mbf_msgs/ExePathAction.h | 56 ++ .../ros_lib/mbf_msgs/ExePathActionFeedback.h | 56 ++ .../ros_lib/mbf_msgs/ExePathActionGoal.h | 56 ++ .../ros_lib/mbf_msgs/ExePathActionResult.h | 56 ++ .../ros_lib/mbf_msgs/ExePathFeedback.h | 128 +++ .../ros_lib/ros_lib/mbf_msgs/ExePathGoal.h | 134 +++ .../ros_lib/ros_lib/mbf_msgs/ExePathResult.h | 141 ++++ .../ros_lib/ros_lib/mbf_msgs/GetPathAction.h | 56 ++ .../ros_lib/mbf_msgs/GetPathActionFeedback.h | 56 ++ .../ros_lib/mbf_msgs/GetPathActionGoal.h | 56 ++ .../ros_lib/mbf_msgs/GetPathActionResult.h | 56 ++ .../ros_lib/mbf_msgs/GetPathFeedback.h | 38 + .../ros_lib/ros_lib/mbf_msgs/GetPathGoal.h | 96 +++ .../ros_lib/ros_lib/mbf_msgs/GetPathResult.h | 94 +++ .../ros_lib/ros_lib/mbf_msgs/MoveBaseAction.h | 56 ++ .../ros_lib/mbf_msgs/MoveBaseActionFeedback.h | 56 ++ .../ros_lib/mbf_msgs/MoveBaseActionGoal.h | 56 ++ .../ros_lib/mbf_msgs/MoveBaseActionResult.h | 56 ++ .../ros_lib/mbf_msgs/MoveBaseFeedback.h | 128 +++ .../ros_lib/ros_lib/mbf_msgs/MoveBaseGoal.h | 115 +++ .../ros_lib/ros_lib/mbf_msgs/MoveBaseResult.h | 133 +++ .../ros_lib/ros_lib/mbf_msgs/RecoveryAction.h | 56 ++ .../ros_lib/mbf_msgs/RecoveryActionFeedback.h | 56 ++ .../ros_lib/mbf_msgs/RecoveryActionGoal.h | 56 ++ .../ros_lib/mbf_msgs/RecoveryActionResult.h | 56 ++ .../ros_lib/mbf_msgs/RecoveryFeedback.h | 38 + .../ros_lib/ros_lib/mbf_msgs/RecoveryGoal.h | 62 ++ .../ros_lib/ros_lib/mbf_msgs/RecoveryResult.h | 95 +++ .../microstrain_3dmgx2_imu/AddOffset.h | 80 ++ .../ros_lib/ros_lib/mongodb_store/GetParam.h | 122 +++ .../ros_lib/ros_lib/mongodb_store/MongoFind.h | 138 ++++ .../ros_lib/mongodb_store/MongoInsert.h | 138 ++++ .../ros_lib/mongodb_store/MongoUpdate.h | 155 ++++ .../ros_lib/ros_lib/mongodb_store/SetParam.h | 105 +++ .../ros_lib/mongodb_store_msgs/Insert.h | 84 ++ .../mongodb_store_msgs/MongoDeleteMsg.h | 139 ++++ .../mongodb_store_msgs/MongoInsertMsg.h | 133 +++ .../mongodb_store_msgs/MongoQueryMsg.h | 221 +++++ .../MongoQuerywithProjectionMsg.h | 221 +++++ .../mongodb_store_msgs/MongoUpdateMsg.h | 179 ++++ .../mongodb_store_msgs/MoveEntriesAction.h | 56 ++ .../MoveEntriesActionFeedback.h | 56 ++ .../MoveEntriesActionGoal.h | 56 ++ .../MoveEntriesActionResult.h | 56 ++ .../mongodb_store_msgs/MoveEntriesFeedback.h | 75 ++ .../mongodb_store_msgs/MoveEntriesGoal.h | 109 +++ .../mongodb_store_msgs/MoveEntriesResult.h | 38 + .../mongodb_store_msgs/SerialisedMessage.h | 82 ++ .../ros_lib/mongodb_store_msgs/StringList.h | 75 ++ .../ros_lib/mongodb_store_msgs/StringPair.h | 72 ++ .../mongodb_store_msgs/StringPairList.h | 64 ++ .../ros_lib/move_base_msgs/MoveBaseAction.h | 56 ++ .../move_base_msgs/MoveBaseActionFeedback.h | 56 ++ .../move_base_msgs/MoveBaseActionGoal.h | 56 ++ .../move_base_msgs/MoveBaseActionResult.h | 56 ++ .../ros_lib/move_base_msgs/MoveBaseFeedback.h | 44 + .../ros_lib/move_base_msgs/MoveBaseGoal.h | 44 + .../ros_lib/move_base_msgs/MoveBaseResult.h | 38 + .../ros_lib/move_base_msgs/RecoveryStatus.h | 79 ++ .../moveit_msgs/AllowedCollisionEntry.h | 76 ++ .../moveit_msgs/AllowedCollisionMatrix.h | 176 ++++ .../ros_lib/moveit_msgs/ApplyPlanningScene.h | 94 +++ .../moveit_msgs/AttachedCollisionObject.h | 109 +++ .../ros_lib/moveit_msgs/BoundingVolume.h | 141 ++++ .../ros_lib/moveit_msgs/CartesianPoint.h | 56 ++ .../ros_lib/moveit_msgs/CartesianTrajectory.h | 87 ++ .../moveit_msgs/CartesianTrajectoryPoint.h | 68 ++ .../moveit_msgs/ChangeControlDimensions.h | 196 +++++ .../moveit_msgs/ChangeDriftDimensions.h | 202 +++++ .../CheckIfRobotStateExistsInWarehouse.h | 122 +++ .../ros_lib/moveit_msgs/CollisionObject.h | 310 +++++++ .../moveit_msgs/ConstraintEvalResult.h | 61 ++ .../ros_lib/ros_lib/moveit_msgs/Constraints.h | 159 ++++ .../ros_lib/moveit_msgs/ContactInformation.h | 124 +++ .../ros_lib/ros_lib/moveit_msgs/CostSource.h | 54 ++ .../DeleteRobotStateFromWarehouse.h | 104 +++ .../ros_lib/moveit_msgs/DisplayRobotState.h | 88 ++ .../ros_lib/moveit_msgs/DisplayTrajectory.h | 87 ++ .../moveit_msgs/ExecuteKnownTrajectory.h | 100 +++ .../moveit_msgs/ExecuteTrajectoryAction.h | 56 ++ .../ExecuteTrajectoryActionFeedback.h | 56 ++ .../moveit_msgs/ExecuteTrajectoryActionGoal.h | 56 ++ .../ExecuteTrajectoryActionResult.h | 56 ++ .../moveit_msgs/ExecuteTrajectoryFeedback.h | 55 ++ .../moveit_msgs/ExecuteTrajectoryGoal.h | 44 + .../moveit_msgs/ExecuteTrajectoryResult.h | 44 + .../ros_lib/moveit_msgs/GenericTrajectory.h | 96 +++ .../ros_lib/moveit_msgs/GetCartesianPath.h | 230 ++++++ .../ros_lib/moveit_msgs/GetMotionPlan.h | 82 ++ .../ros_lib/moveit_msgs/GetMotionSequence.h | 82 ++ .../ros_lib/moveit_msgs/GetPlannerParams.h | 127 +++ .../ros_lib/moveit_msgs/GetPlanningScene.h | 82 ++ .../ros_lib/moveit_msgs/GetPositionFK.h | 188 +++++ .../ros_lib/moveit_msgs/GetPositionIK.h | 88 ++ .../moveit_msgs/GetRobotStateFromWarehouse.h | 110 +++ .../ros_lib/moveit_msgs/GetStateValidity.h | 195 +++++ .../ros_lib/ros_lib/moveit_msgs/Grasp.h | 154 ++++ .../ros_lib/moveit_msgs/GraspPlanning.h | 212 +++++ .../ros_lib/moveit_msgs/GripperTranslation.h | 92 +++ .../ros_lib/moveit_msgs/JointConstraint.h | 75 ++ .../ros_lib/ros_lib/moveit_msgs/JointLimits.h | 129 +++ .../ros_lib/moveit_msgs/KinematicSolverInfo.h | 138 ++++ .../ros_lib/ros_lib/moveit_msgs/LinkPadding.h | 60 ++ .../ros_lib/ros_lib/moveit_msgs/LinkScale.h | 60 ++ .../moveit_msgs/ListRobotStatesInWarehouse.h | 141 ++++ .../ros_lib/ros_lib/moveit_msgs/LoadMap.h | 105 +++ .../moveit_msgs/MotionPlanDetailedResponse.h | 155 ++++ .../ros_lib/moveit_msgs/MotionPlanRequest.h | 225 +++++ .../ros_lib/moveit_msgs/MotionPlanResponse.h | 78 ++ .../ros_lib/moveit_msgs/MotionSequenceItem.h | 49 ++ .../moveit_msgs/MotionSequenceRequest.h | 64 ++ .../moveit_msgs/MotionSequenceResponse.h | 81 ++ .../ros_lib/moveit_msgs/MoveGroupAction.h | 56 ++ .../moveit_msgs/MoveGroupActionFeedback.h | 56 ++ .../ros_lib/moveit_msgs/MoveGroupActionGoal.h | 56 ++ .../moveit_msgs/MoveGroupActionResult.h | 56 ++ .../ros_lib/moveit_msgs/MoveGroupFeedback.h | 55 ++ .../ros_lib/moveit_msgs/MoveGroupGoal.h | 50 ++ .../ros_lib/moveit_msgs/MoveGroupResult.h | 66 ++ .../moveit_msgs/MoveGroupSequenceAction.h | 56 ++ .../MoveGroupSequenceActionFeedback.h | 56 ++ .../moveit_msgs/MoveGroupSequenceActionGoal.h | 56 ++ .../MoveGroupSequenceActionResult.h | 56 ++ .../moveit_msgs/MoveGroupSequenceFeedback.h | 55 ++ .../moveit_msgs/MoveGroupSequenceGoal.h | 50 ++ .../moveit_msgs/MoveGroupSequenceResult.h | 44 + .../ros_lib/moveit_msgs/MoveItErrorCodes.h | 92 +++ .../ros_lib/ros_lib/moveit_msgs/ObjectColor.h | 61 ++ .../moveit_msgs/OrientationConstraint.h | 96 +++ .../ros_lib/moveit_msgs/OrientedBoundingBox.h | 50 ++ .../ros_lib/moveit_msgs/PickupAction.h | 56 ++ .../moveit_msgs/PickupActionFeedback.h | 56 ++ .../ros_lib/moveit_msgs/PickupActionGoal.h | 56 ++ .../ros_lib/moveit_msgs/PickupActionResult.h | 56 ++ .../ros_lib/moveit_msgs/PickupFeedback.h | 55 ++ .../ros_lib/ros_lib/moveit_msgs/PickupGoal.h | 276 +++++++ .../ros_lib/moveit_msgs/PickupResult.h | 124 +++ .../ros_lib/ros_lib/moveit_msgs/PlaceAction.h | 56 ++ .../ros_lib/moveit_msgs/PlaceActionFeedback.h | 56 ++ .../ros_lib/moveit_msgs/PlaceActionGoal.h | 56 ++ .../ros_lib/moveit_msgs/PlaceActionResult.h | 56 ++ .../ros_lib/moveit_msgs/PlaceFeedback.h | 55 ++ .../ros_lib/ros_lib/moveit_msgs/PlaceGoal.h | 222 +++++ .../ros_lib/moveit_msgs/PlaceLocation.h | 120 +++ .../ros_lib/ros_lib/moveit_msgs/PlaceResult.h | 124 +++ .../moveit_msgs/PlannerInterfaceDescription.h | 109 +++ .../ros_lib/moveit_msgs/PlannerParams.h | 149 ++++ .../ros_lib/moveit_msgs/PlanningOptions.h | 156 ++++ .../ros_lib/moveit_msgs/PlanningScene.h | 212 +++++ .../moveit_msgs/PlanningSceneComponents.h | 61 ++ .../ros_lib/moveit_msgs/PlanningSceneWorld.h | 70 ++ .../ros_lib/moveit_msgs/PositionConstraint.h | 78 ++ .../ros_lib/moveit_msgs/PositionIKRequest.h | 194 +++++ .../moveit_msgs/QueryPlannerInterfaces.h | 96 +++ .../moveit_msgs/RenameRobotStateInWarehouse.h | 121 +++ .../ros_lib/ros_lib/moveit_msgs/RobotState.h | 94 +++ .../ros_lib/moveit_msgs/RobotTrajectory.h | 50 ++ .../ros_lib/ros_lib/moveit_msgs/SaveMap.h | 105 +++ .../moveit_msgs/SaveRobotStateToWarehouse.h | 128 +++ .../ros_lib/moveit_msgs/SetPlannerParams.h | 145 ++++ .../moveit_msgs/TrajectoryConstraints.h | 64 ++ .../moveit_msgs/UpdatePointcloudOctomap.h | 94 +++ .../moveit_msgs/VisibilityConstraint.h | 103 +++ .../ros_lib/moveit_msgs/WorkspaceParameters.h | 55 ++ .../ros_lib/naoqi_bridge_msgs/AudioBuffer.h | 130 +++ .../ros_lib/naoqi_bridge_msgs/BlinkAction.h | 56 ++ .../naoqi_bridge_msgs/BlinkActionFeedback.h | 56 ++ .../naoqi_bridge_msgs/BlinkActionGoal.h | 56 ++ .../naoqi_bridge_msgs/BlinkActionResult.h | 56 ++ .../ros_lib/naoqi_bridge_msgs/BlinkFeedback.h | 44 + .../ros_lib/naoqi_bridge_msgs/BlinkGoal.h | 141 ++++ .../ros_lib/naoqi_bridge_msgs/BlinkResult.h | 56 ++ .../naoqi_bridge_msgs/BodyPoseAction.h | 56 ++ .../BodyPoseActionFeedback.h | 56 ++ .../naoqi_bridge_msgs/BodyPoseActionGoal.h | 56 ++ .../naoqi_bridge_msgs/BodyPoseActionResult.h | 56 ++ .../naoqi_bridge_msgs/BodyPoseFeedback.h | 38 + .../ros_lib/naoqi_bridge_msgs/BodyPoseGoal.h | 55 ++ .../naoqi_bridge_msgs/BodyPoseResult.h | 38 + .../BodyPoseWithSpeedAction.h | 56 ++ .../BodyPoseWithSpeedActionFeedback.h | 56 ++ .../BodyPoseWithSpeedActionGoal.h | 56 ++ .../BodyPoseWithSpeedActionResult.h | 56 ++ .../BodyPoseWithSpeedFeedback.h | 38 + .../naoqi_bridge_msgs/BodyPoseWithSpeedGoal.h | 79 ++ .../BodyPoseWithSpeedResult.h | 38 + .../ros_lib/naoqi_bridge_msgs/BodyROI.h | 182 ++++ .../ros_lib/naoqi_bridge_msgs/BoolStamped.h | 62 ++ .../ros_lib/naoqi_bridge_msgs/Bumper.h | 57 ++ .../naoqi_bridge_msgs/CmdPoseService.h | 76 ++ .../ros_lib/naoqi_bridge_msgs/CmdVelService.h | 76 ++ .../ros_lib/naoqi_bridge_msgs/EventStamped.h | 55 ++ .../ros_lib/naoqi_bridge_msgs/FaceROI.h | 182 ++++ .../ros_lib/naoqi_bridge_msgs/FadeRGB.h | 85 ++ .../naoqi_bridge_msgs/FloatArrayStamped.h | 88 ++ .../ros_lib/naoqi_bridge_msgs/FloatStamped.h | 68 ++ .../naoqi_bridge_msgs/FollowPathAction.h | 56 ++ .../FollowPathActionFeedback.h | 56 ++ .../naoqi_bridge_msgs/FollowPathActionGoal.h | 56 ++ .../FollowPathActionResult.h | 56 ++ .../naoqi_bridge_msgs/FollowPathFeedback.h | 51 ++ .../naoqi_bridge_msgs/FollowPathGoal.h | 44 + .../naoqi_bridge_msgs/FollowPathResult.h | 38 + .../ros_lib/naoqi_bridge_msgs/GetBodyROI.h | 96 +++ .../ros_lib/naoqi_bridge_msgs/GetFacesROI.h | 96 +++ .../ros_lib/naoqi_bridge_msgs/GetFloat.h | 111 +++ .../naoqi_bridge_msgs/GetInstalledBehaviors.h | 107 +++ .../ros_lib/naoqi_bridge_msgs/GetRobotInfo.h | 76 ++ .../ros_lib/naoqi_bridge_msgs/GetString.h | 87 ++ .../ros_lib/naoqi_bridge_msgs/GetTruepose.h | 76 ++ .../ros_lib/naoqi_bridge_msgs/HandTouch.h | 60 ++ .../ros_lib/naoqi_bridge_msgs/HeadTouch.h | 57 ++ .../naoqi_bridge_msgs/IntArrayStamped.h | 88 ++ .../ros_lib/naoqi_bridge_msgs/IntStamped.h | 68 ++ .../naoqi_bridge_msgs/JointAngleTrajectory.h | 176 ++++ .../naoqi_bridge_msgs/JointAnglesWithSpeed.h | 156 ++++ .../JointAnglesWithSpeedAction.h | 56 ++ .../JointAnglesWithSpeedActionFeedback.h | 56 ++ .../JointAnglesWithSpeedActionGoal.h | 56 ++ .../JointAnglesWithSpeedActionResult.h | 56 ++ .../JointAnglesWithSpeedFeedback.h | 38 + .../JointAnglesWithSpeedGoal.h | 44 + .../JointAnglesWithSpeedResult.h | 44 + .../naoqi_bridge_msgs/JointTrajectoryAction.h | 56 ++ .../JointTrajectoryActionFeedback.h | 56 ++ .../JointTrajectoryActionGoal.h | 56 ++ .../JointTrajectoryActionResult.h | 56 ++ .../JointTrajectoryFeedback.h | 38 + .../naoqi_bridge_msgs/JointTrajectoryGoal.h | 51 ++ .../naoqi_bridge_msgs/JointTrajectoryResult.h | 44 + .../ros_lib/naoqi_bridge_msgs/MemoryList.h | 122 +++ .../naoqi_bridge_msgs/MemoryPairFloat.h | 79 ++ .../ros_lib/naoqi_bridge_msgs/MemoryPairInt.h | 79 ++ .../naoqi_bridge_msgs/MemoryPairString.h | 72 ++ .../OrthogonalSecurityDistance.h | 76 ++ .../PoseWithConfidenceStamped.h | 74 ++ .../ros_lib/naoqi_bridge_msgs/RobotInfo.h | 224 +++++ .../naoqi_bridge_msgs/RunBehaviorAction.h | 56 ++ .../RunBehaviorActionFeedback.h | 56 ++ .../naoqi_bridge_msgs/RunBehaviorActionGoal.h | 56 ++ .../RunBehaviorActionResult.h | 56 ++ .../naoqi_bridge_msgs/RunBehaviorFeedback.h | 38 + .../naoqi_bridge_msgs/RunBehaviorGoal.h | 55 ++ .../naoqi_bridge_msgs/RunBehaviorResult.h | 38 + .../naoqi_bridge_msgs/SetArmsEnabled.h | 106 +++ .../ros_lib/naoqi_bridge_msgs/SetFloat.h | 129 +++ .../SetSpeechVocabularyAction.h | 56 ++ .../SetSpeechVocabularyActionFeedback.h | 56 ++ .../SetSpeechVocabularyActionGoal.h | 56 ++ .../SetSpeechVocabularyActionResult.h | 56 ++ .../SetSpeechVocabularyFeedback.h | 38 + .../SetSpeechVocabularyGoal.h | 75 ++ .../SetSpeechVocabularyResult.h | 56 ++ .../ros_lib/naoqi_bridge_msgs/SetString.h | 105 +++ .../ros_lib/naoqi_bridge_msgs/SetTransform.h | 76 ++ .../ros_lib/naoqi_bridge_msgs/SoundLocated.h | 75 ++ .../SpeechWithFeedbackAction.h | 56 ++ .../SpeechWithFeedbackActionFeedback.h | 56 ++ .../SpeechWithFeedbackActionGoal.h | 56 ++ .../SpeechWithFeedbackActionResult.h | 56 ++ .../SpeechWithFeedbackFeedback.h | 38 + .../SpeechWithFeedbackGoal.h | 55 ++ .../SpeechWithFeedbackResult.h | 38 + .../naoqi_bridge_msgs/StatusChangeStamped.h | 75 ++ .../naoqi_bridge_msgs/StringArrayStamped.h | 81 ++ .../ros_lib/naoqi_bridge_msgs/StringStamped.h | 61 ++ .../TangentialSecurityDistance.h | 76 ++ .../naoqi_bridge_msgs/WordRecognized.h | 119 +++ .../ros_lib/ros_lib/nav_msgs/GetMap.h | 76 ++ .../ros_lib/ros_lib/nav_msgs/GetMapAction.h | 56 ++ .../ros_lib/nav_msgs/GetMapActionFeedback.h | 56 ++ .../ros_lib/nav_msgs/GetMapActionGoal.h | 56 ++ .../ros_lib/nav_msgs/GetMapActionResult.h | 56 ++ .../ros_lib/ros_lib/nav_msgs/GetMapFeedback.h | 38 + .../ros_lib/ros_lib/nav_msgs/GetMapGoal.h | 38 + .../ros_lib/ros_lib/nav_msgs/GetMapResult.h | 44 + .../ros_lib/ros_lib/nav_msgs/GetPlan.h | 111 +++ .../ros_lib/ros_lib/nav_msgs/GridCells.h | 118 +++ .../ros_lib/ros_lib/nav_msgs/LoadMap.h | 105 +++ .../ros_lib/ros_lib/nav_msgs/MapMetaData.h | 118 +++ .../ros_lib/ros_lib/nav_msgs/OccupancyGrid.h | 88 ++ .../ros_lib/ros_lib/nav_msgs/Odometry.h | 73 ++ .../ros_lib/ros_lib/nav_msgs/Path.h | 70 ++ .../ros_lib/ros_lib/nav_msgs/SetMap.h | 100 +++ .../ros_lib/ros_lib/navfn/MakeNavPlan.h | 130 +++ .../ros_lib/ros_lib/navfn/SetCostmap.h | 115 +++ .../ros_lib/ros_lib/nmea_msgs/Gpgga.h | 272 ++++++ .../ros_lib/ros_lib/nmea_msgs/Gpgsa.h | 184 +++++ .../ros_lib/ros_lib/nmea_msgs/Gpgsv.h | 108 +++ .../ros_lib/nmea_msgs/GpgsvSatellite.h | 79 ++ .../ros_lib/ros_lib/nmea_msgs/Gprmc.h | 250 ++++++ .../ros_lib/ros_lib/nmea_msgs/Sentence.h | 61 ++ .../ros_lib/ros_lib/nodelet/NodeletList.h | 107 +++ .../ros_lib/ros_lib/nodelet/NodeletLoad.h | 250 ++++++ .../ros_lib/ros_lib/nodelet/NodeletUnload.h | 105 +++ .../GetObjectInformation.h | 82 ++ .../ObjectInformation.h | 67 ++ .../ObjectRecognitionAction.h | 56 ++ .../ObjectRecognitionActionFeedback.h | 56 ++ .../ObjectRecognitionActionGoal.h | 56 ++ .../ObjectRecognitionActionResult.h | 56 ++ .../ObjectRecognitionFeedback.h | 38 + .../ObjectRecognitionGoal.h | 100 +++ .../ObjectRecognitionResult.h | 44 + .../object_recognition_msgs/ObjectType.h | 72 ++ .../RecognizedObject.h | 138 ++++ .../RecognizedObjectArray.h | 114 +++ .../ros_lib/object_recognition_msgs/Table.h | 76 ++ .../object_recognition_msgs/TableArray.h | 70 ++ .../ros_lib/octomap_msgs/BoundingBoxQuery.h | 81 ++ .../ros_lib/ros_lib/octomap_msgs/GetOctomap.h | 76 ++ .../ros_lib/ros_lib/octomap_msgs/Octomap.h | 122 +++ .../ros_lib/octomap_msgs/OctomapWithPose.h | 56 ++ .../ros_lib/ros_lib/opencv_apps/Circle.h | 49 ++ .../ros_lib/ros_lib/opencv_apps/CircleArray.h | 64 ++ .../ros_lib/opencv_apps/CircleArrayStamped.h | 70 ++ .../ros_lib/ros_lib/opencv_apps/Contour.h | 64 ++ .../ros_lib/opencv_apps/ContourArray.h | 64 ++ .../ros_lib/opencv_apps/ContourArrayStamped.h | 70 ++ .../ros_lib/ros_lib/opencv_apps/Face.h | 91 ++ .../ros_lib/ros_lib/opencv_apps/FaceArray.h | 64 ++ .../ros_lib/opencv_apps/FaceArrayStamped.h | 70 ++ .../opencv_apps/FaceRecognitionTrain.h | 194 +++++ .../ros_lib/ros_lib/opencv_apps/Flow.h | 49 ++ .../ros_lib/ros_lib/opencv_apps/FlowArray.h | 64 ++ .../ros_lib/opencv_apps/FlowArrayStamped.h | 70 ++ .../ros_lib/ros_lib/opencv_apps/FlowStamped.h | 50 ++ .../ros_lib/ros_lib/opencv_apps/Line.h | 49 ++ .../ros_lib/ros_lib/opencv_apps/LineArray.h | 64 ++ .../ros_lib/opencv_apps/LineArrayStamped.h | 70 ++ .../ros_lib/ros_lib/opencv_apps/Moment.h | 174 ++++ .../ros_lib/ros_lib/opencv_apps/MomentArray.h | 64 ++ .../ros_lib/opencv_apps/MomentArrayStamped.h | 70 ++ .../ros_lib/ros_lib/opencv_apps/Point2D.h | 48 ++ .../ros_lib/opencv_apps/Point2DArray.h | 64 ++ .../ros_lib/opencv_apps/Point2DArrayStamped.h | 70 ++ .../ros_lib/opencv_apps/Point2DStamped.h | 50 ++ .../ros_lib/ros_lib/opencv_apps/Rect.h | 58 ++ .../ros_lib/ros_lib/opencv_apps/RectArray.h | 64 ++ .../ros_lib/opencv_apps/RectArrayStamped.h | 70 ++ .../ros_lib/ros_lib/opencv_apps/RotatedRect.h | 55 ++ .../ros_lib/opencv_apps/RotatedRectArray.h | 64 ++ .../opencv_apps/RotatedRectArrayStamped.h | 70 ++ .../ros_lib/opencv_apps/RotatedRectStamped.h | 50 ++ .../ros_lib/ros_lib/opencv_apps/Size.h | 48 ++ .../ros_lib/openni2_camera/GetSerial.h | 87 ++ .../ros_lib/pcl_msgs/ModelCoefficients.h | 88 ++ .../ros_lib/ros_lib/pcl_msgs/PointIndices.h | 88 ++ .../ros_lib/ros_lib/pcl_msgs/PolygonMesh.h | 76 ++ .../ros_lib/ros_lib/pcl_msgs/UpdateFilename.h | 105 +++ .../ros_lib/ros_lib/pcl_msgs/Vertices.h | 71 ++ .../ros_lib/ros_lib/people_msgs/People.h | 70 ++ .../ros_lib/ros_lib/people_msgs/Person.h | 145 ++++ .../ros_lib/people_msgs/PersonStamped.h | 50 ++ .../ros_lib/people_msgs/PositionMeasurement.h | 115 +++ .../people_msgs/PositionMeasurementArray.h | 114 +++ .../ros_lib/plotjuggler_msgs/DataPoint.h | 57 ++ .../ros_lib/plotjuggler_msgs/DataPoints.h | 77 ++ .../ros_lib/plotjuggler_msgs/Dictionary.h | 88 ++ .../plotjuggler_msgs/StatisticsNames.h | 94 +++ .../plotjuggler_msgs/StatisticsValues.h | 82 ++ .../ros_lib/polled_camera/GetPolledImage.h | 202 +++++ .../ros_lib/posedetection_msgs/Curve1D.h | 82 ++ .../ros_lib/posedetection_msgs/Detect.h | 88 ++ .../ros_lib/posedetection_msgs/Feature0D.h | 305 +++++++ .../posedetection_msgs/Feature0DDetect.h | 82 ++ .../ros_lib/posedetection_msgs/Feature1D.h | 182 ++++ .../posedetection_msgs/Feature1DDetect.h | 82 ++ .../posedetection_msgs/ImageFeature0D.h | 56 ++ .../posedetection_msgs/ImageFeature1D.h | 56 ++ .../ros_lib/posedetection_msgs/Object6DPose.h | 85 ++ .../posedetection_msgs/ObjectDetection.h | 70 ++ .../ros_lib/posedetection_msgs/TargetObj.h | 93 +++ .../ros_lib/ros_lib/power_msgs/BatteryState.h | 259 ++++++ .../ros_lib/power_msgs/BreakerCommand.h | 94 +++ .../ros_lib/ros_lib/power_msgs/BreakerState.h | 185 +++++ .../pr2_common_action_msgs/ArmMoveIKAction.h | 56 ++ .../ArmMoveIKActionFeedback.h | 56 ++ .../ArmMoveIKActionGoal.h | 56 ++ .../ArmMoveIKActionResult.h | 56 ++ .../ArmMoveIKFeedback.h | 38 + .../pr2_common_action_msgs/ArmMoveIKGoal.h | 102 +++ .../pr2_common_action_msgs/ArmMoveIKResult.h | 38 + .../pr2_common_action_msgs/TuckArmsAction.h | 56 ++ .../TuckArmsActionFeedback.h | 56 ++ .../TuckArmsActionGoal.h | 56 ++ .../TuckArmsActionResult.h | 56 ++ .../pr2_common_action_msgs/TuckArmsFeedback.h | 38 + .../pr2_common_action_msgs/TuckArmsGoal.h | 74 ++ .../pr2_common_action_msgs/TuckArmsResult.h | 74 ++ .../JointControllerState.h | 94 +++ .../JointTrajectoryAction.h | 56 ++ .../JointTrajectoryActionFeedback.h | 56 ++ .../JointTrajectoryActionGoal.h | 56 ++ .../JointTrajectoryActionResult.h | 56 ++ .../JointTrajectoryControllerState.h | 97 +++ .../JointTrajectoryFeedback.h | 38 + .../JointTrajectoryGoal.h | 44 + .../JointTrajectoryResult.h | 38 + .../pr2_controllers_msgs/PointHeadAction.h | 56 ++ .../PointHeadActionFeedback.h | 56 ++ .../PointHeadActionGoal.h | 56 ++ .../PointHeadActionResult.h | 56 ++ .../pr2_controllers_msgs/PointHeadFeedback.h | 43 + .../pr2_controllers_msgs/PointHeadGoal.h | 96 +++ .../pr2_controllers_msgs/PointHeadResult.h | 38 + .../pr2_controllers_msgs/Pr2GripperCommand.h | 48 ++ .../Pr2GripperCommandAction.h | 56 ++ .../Pr2GripperCommandActionFeedback.h | 56 ++ .../Pr2GripperCommandActionGoal.h | 56 ++ .../Pr2GripperCommandActionResult.h | 56 ++ .../Pr2GripperCommandFeedback.h | 84 ++ .../Pr2GripperCommandGoal.h | 44 + .../Pr2GripperCommandResult.h | 84 ++ .../QueryCalibrationState.h | 88 ++ .../QueryTrajectoryState.h | 206 +++++ .../SingleJointPositionAction.h | 56 ++ .../SingleJointPositionActionFeedback.h | 56 ++ .../SingleJointPositionActionGoal.h | 56 ++ .../SingleJointPositionActionResult.h | 56 ++ .../SingleJointPositionFeedback.h | 59 ++ .../SingleJointPositionGoal.h | 72 ++ .../SingleJointPositionResult.h | 38 + .../pr2_gazebo_plugins/ModelJointsState.h | 126 +++ .../ros_lib/pr2_gazebo_plugins/PlugCommand.h | 71 ++ .../SetModelsJointsStates.h | 168 ++++ .../PR2GripperEventDetectorAction.h | 56 ++ .../PR2GripperEventDetectorActionFeedback.h | 56 ++ .../PR2GripperEventDetectorActionGoal.h | 56 ++ .../PR2GripperEventDetectorActionResult.h | 56 ++ .../PR2GripperEventDetectorCommand.h | 71 ++ .../PR2GripperEventDetectorData.h | 124 +++ .../PR2GripperEventDetectorFeedback.h | 44 + .../PR2GripperEventDetectorGoal.h | 44 + .../PR2GripperEventDetectorResult.h | 44 + .../PR2GripperFindContactAction.h | 56 ++ .../PR2GripperFindContactActionFeedback.h | 56 ++ .../PR2GripperFindContactActionGoal.h | 56 ++ .../PR2GripperFindContactActionResult.h | 56 ++ .../PR2GripperFindContactCommand.h | 78 ++ .../PR2GripperFindContactData.h | 142 ++++ .../PR2GripperFindContactFeedback.h | 44 + .../PR2GripperFindContactGoal.h | 44 + .../PR2GripperFindContactResult.h | 44 + .../PR2GripperForceServoAction.h | 56 ++ .../PR2GripperForceServoActionFeedback.h | 56 ++ .../PR2GripperForceServoActionGoal.h | 56 ++ .../PR2GripperForceServoActionResult.h | 56 ++ .../PR2GripperForceServoCommand.h | 43 + .../PR2GripperForceServoData.h | 101 +++ .../PR2GripperForceServoFeedback.h | 44 + .../PR2GripperForceServoGoal.h | 44 + .../PR2GripperForceServoResult.h | 44 + .../PR2GripperGrabAction.h | 56 ++ .../PR2GripperGrabActionFeedback.h | 56 ++ .../PR2GripperGrabActionGoal.h | 56 ++ .../PR2GripperGrabActionResult.h | 56 ++ .../PR2GripperGrabCommand.h | 43 + .../PR2GripperGrabData.h | 44 + .../PR2GripperGrabFeedback.h | 44 + .../PR2GripperGrabGoal.h | 44 + .../PR2GripperGrabResult.h | 44 + .../PR2GripperPressureData.h | 59 ++ .../PR2GripperReleaseAction.h | 56 ++ .../PR2GripperReleaseActionFeedback.h | 56 ++ .../PR2GripperReleaseActionGoal.h | 56 ++ .../PR2GripperReleaseActionResult.h | 56 ++ .../PR2GripperReleaseCommand.h | 44 + .../PR2GripperReleaseData.h | 44 + .../PR2GripperReleaseFeedback.h | 44 + .../PR2GripperReleaseGoal.h | 44 + .../PR2GripperReleaseResult.h | 44 + .../PR2GripperSensorRTState.h | 61 ++ .../PR2GripperSensorRawData.h | 180 ++++ .../PR2GripperSlipServoAction.h | 56 ++ .../PR2GripperSlipServoActionFeedback.h | 56 ++ .../PR2GripperSlipServoActionGoal.h | 56 ++ .../PR2GripperSlipServoActionResult.h | 56 ++ .../PR2GripperSlipServoCommand.h | 38 + .../PR2GripperSlipServoData.h | 160 ++++ .../PR2GripperSlipServoFeedback.h | 44 + .../PR2GripperSlipServoGoal.h | 44 + .../PR2GripperSlipServoResult.h | 44 + .../BaseControllerState.h | 231 ++++++ .../BaseControllerState2.h | 256 ++++++ .../BaseOdometryState.h | 131 +++ .../pr2_mechanism_controllers/DebugInfo.h | 110 +++ .../pr2_mechanism_controllers/Odometer.h | 48 ++ .../OdometryMatrix.h | 63 ++ .../pr2_mechanism_controllers/SetProfile.h | 115 +++ .../pr2_mechanism_controllers/TrackLinkCmd.h | 79 ++ .../pr2_mechanism_msgs/ActuatorStatistics.h | 306 +++++++ .../pr2_mechanism_msgs/ControllerStatistics.h | 214 +++++ .../pr2_mechanism_msgs/JointStatistics.h | 160 ++++ .../pr2_mechanism_msgs/ListControllerTypes.h | 107 +++ .../pr2_mechanism_msgs/ListControllers.h | 144 ++++ .../pr2_mechanism_msgs/LoadController.h | 105 +++ .../pr2_mechanism_msgs/MechanismStatistics.h | 122 +++ .../ReloadControllerLibraries.h | 106 +++ .../pr2_mechanism_msgs/SwitchController.h | 188 +++++ .../SwitchControllerAction.h | 56 ++ .../SwitchControllerActionFeedback.h | 56 ++ .../SwitchControllerActionGoal.h | 56 ++ .../SwitchControllerActionResult.h | 56 ++ .../SwitchControllerFeedback.h | 38 + .../pr2_mechanism_msgs/SwitchControllerGoal.h | 112 +++ .../SwitchControllerResult.h | 38 + .../pr2_mechanism_msgs/UnloadController.h | 105 +++ .../ros_lib/pr2_msgs/AccelerometerState.h | 70 ++ .../ros_lib/ros_lib/pr2_msgs/AccessPoint.h | 232 ++++++ .../ros_lib/ros_lib/pr2_msgs/BatteryServer.h | 242 ++++++ .../ros_lib/ros_lib/pr2_msgs/BatteryServer2.h | 208 +++++ .../ros_lib/ros_lib/pr2_msgs/BatteryState.h | 113 +++ .../ros_lib/ros_lib/pr2_msgs/BatteryState2.h | 240 ++++++ .../ros_lib/ros_lib/pr2_msgs/DashboardState.h | 134 +++ .../ros_lib/ros_lib/pr2_msgs/GPUStatus.h | 225 +++++ .../ros_lib/pr2_msgs/LaserScannerSignal.h | 68 ++ .../ros_lib/ros_lib/pr2_msgs/LaserTrajCmd.h | 140 ++++ .../ros_lib/ros_lib/pr2_msgs/PeriodicCmd.h | 76 ++ .../ros_lib/pr2_msgs/PowerBoardState.h | 173 ++++ .../ros_lib/ros_lib/pr2_msgs/PowerState.h | 126 +++ .../ros_lib/ros_lib/pr2_msgs/PressureState.h | 124 +++ .../ros_lib/pr2_msgs/SetLaserTrajCmd.h | 100 +++ .../ros_lib/ros_lib/pr2_msgs/SetPeriodicCmd.h | 100 +++ .../pr2_power_board/PowerBoardCommand.h | 161 ++++ .../pr2_power_board/PowerBoardCommand2.h | 169 ++++ .../ros_lib/realsense2_camera/DeviceInfo.h | 172 ++++ .../ros_lib/realsense2_camera/Extrinsics.h | 60 ++ .../ros_lib/realsense2_camera/IMUInfo.h | 79 ++ .../ros_lib/realsense2_camera/Metadata.h | 61 ++ .../robot_calibration_msgs/CalibrationData.h | 70 ++ .../robot_calibration_msgs/CameraParameter.h | 60 ++ .../robot_calibration_msgs/CaptureConfig.h | 81 ++ .../ExtendedCameraInfo.h | 70 ++ .../GripperLedCommandAction.h | 56 ++ .../GripperLedCommandActionFeedback.h | 56 ++ .../GripperLedCommandActionGoal.h | 56 ++ .../GripperLedCommandActionResult.h | 56 ++ .../GripperLedCommandFeedback.h | 38 + .../GripperLedCommandGoal.h | 45 + .../GripperLedCommandResult.h | 38 + .../robot_calibration_msgs/Observation.h | 99 +++ .../robot_controllers_msgs/ControllerState.h | 82 ++ .../DiffDriveLimiterParams.h | 104 +++ .../QueryControllerStatesAction.h | 56 ++ .../QueryControllerStatesActionFeedback.h | 56 ++ .../QueryControllerStatesActionGoal.h | 56 ++ .../QueryControllerStatesActionResult.h | 56 ++ .../QueryControllerStatesFeedback.h | 64 ++ .../QueryControllerStatesGoal.h | 64 ++ .../QueryControllerStatesResult.h | 64 ++ .../ros_lib/robot_localization/FromLL.h | 82 ++ .../ros_lib/robot_localization/GetState.h | 127 +++ .../ros_lib/robot_localization/SetDatum.h | 76 ++ .../ros_lib/robot_localization/SetPose.h | 76 ++ .../ros_lib/robot_localization/SetUTMZone.h | 87 ++ .../ros_lib/ros_lib/robot_localization/ToLL.h | 82 ++ .../ToggleFilterProcessing.h | 106 +++ .../JTCartesianControllerState.h | 168 ++++ .../ros_lib/robot_pose_ekf/GetStatus.h | 87 ++ smart_device_protocol/ros_lib/ros_lib/ros.h | 67 ++ .../ros_lib/ros_lib/ros/duration.h | 75 ++ .../ros_lib/ros_lib/ros/msg.h | 207 +++++ .../ros_lib/ros_lib/ros/node_handle.h | 644 +++++++++++++++ .../ros_lib/ros_lib/ros/publisher.h | 74 ++ .../ros_lib/ros_lib/ros/service_client.h | 95 +++ .../ros_lib/ros_lib/ros/service_server.h | 130 +++ .../ros_lib/ros_lib/ros/subscriber.h | 140 ++++ .../ros_lib/ros_lib/ros/time.h | 83 ++ .../ros_lib/ros_lib/rosapi/DeleteParam.h | 87 ++ .../ros_lib/ros_lib/rosapi/GetActionServers.h | 107 +++ .../ros_lib/ros_lib/rosapi/GetParam.h | 121 +++ .../ros_lib/ros_lib/rosapi/GetParamNames.h | 107 +++ .../ros_lib/ros_lib/rosapi/GetTime.h | 94 +++ .../ros_lib/ros_lib/rosapi/HasParam.h | 105 +++ .../ros_lib/ros_lib/rosapi/MessageDetails.h | 113 +++ .../ros_lib/ros_lib/rosapi/NodeDetails.h | 198 +++++ .../ros_lib/ros_lib/rosapi/Nodes.h | 107 +++ .../ros_lib/ros_lib/rosapi/Publishers.h | 124 +++ .../ros_lib/ros_lib/rosapi/SearchParam.h | 104 +++ .../ros_lib/ros_lib/rosapi/ServiceHost.h | 104 +++ .../ros_lib/ros_lib/rosapi/ServiceNode.h | 104 +++ .../ros_lib/ros_lib/rosapi/ServiceProviders.h | 124 +++ .../ros_lib/rosapi/ServiceRequestDetails.h | 113 +++ .../ros_lib/rosapi/ServiceResponseDetails.h | 113 +++ .../ros_lib/ros_lib/rosapi/ServiceType.h | 104 +++ .../ros_lib/ros_lib/rosapi/Services.h | 107 +++ .../ros_lib/ros_lib/rosapi/ServicesForType.h | 124 +++ .../ros_lib/ros_lib/rosapi/SetParam.h | 104 +++ .../ros_lib/ros_lib/rosapi/Subscribers.h | 124 +++ .../ros_lib/ros_lib/rosapi/TopicType.h | 104 +++ .../ros_lib/ros_lib/rosapi/Topics.h | 144 ++++ .../ros_lib/rosapi/TopicsAndRawTypes.h | 181 ++++ .../ros_lib/ros_lib/rosapi/TopicsForType.h | 124 +++ .../ros_lib/ros_lib/rosapi/TypeDef.h | 284 +++++++ .../ros_lib/ros_lib/rosauth/Authentication.h | 220 +++++ .../ros_lib/rosbridge_msgs/ConnectedClient.h | 79 ++ .../ros_lib/rosbridge_msgs/ConnectedClients.h | 64 ++ .../ros_lib/ros_lib/roscpp/Empty.h | 70 ++ .../ros_lib/ros_lib/roscpp/GetLoggers.h | 96 +++ .../ros_lib/ros_lib/roscpp/Logger.h | 72 ++ .../ros_lib/ros_lib/roscpp/SetLoggerLevel.h | 104 +++ .../ros_lib/roscpp_tutorials/TwoInts.h | 166 ++++ .../ros_lib/ros_lib/roseus/AddTwoInts.h | 166 ++++ .../ros_lib/ros_lib/roseus/FixedArray.h | 325 ++++++++ .../ros_lib/ros_lib/roseus/String.h | 55 ++ .../ros_lib/ros_lib/roseus/StringStamped.h | 61 ++ .../ros_lib/ros_lib/roseus/StringString.h | 104 +++ .../ros_lib/ros_lib/roseus/TestName.h | 44 + .../ros_lib/ros_lib/roseus/VariableArray.h | 563 +++++++++++++ .../ros_lib/roseus_smach/Multiply10Action.h | 56 ++ .../roseus_smach/Multiply10ActionFeedback.h | 56 ++ .../roseus_smach/Multiply10ActionGoal.h | 56 ++ .../roseus_smach/Multiply10ActionResult.h | 56 ++ .../ros_lib/roseus_smach/Multiply10Feedback.h | 62 ++ .../ros_lib/roseus_smach/Multiply10Goal.h | 62 ++ .../ros_lib/roseus_smach/Multiply10Result.h | 62 ++ .../ros_lib/ros_lib/roseus_smach/Sub5Action.h | 56 ++ .../ros_lib/roseus_smach/Sub5ActionFeedback.h | 56 ++ .../ros_lib/roseus_smach/Sub5ActionGoal.h | 56 ++ .../ros_lib/roseus_smach/Sub5ActionResult.h | 56 ++ .../ros_lib/roseus_smach/Sub5Feedback.h | 62 ++ .../ros_lib/ros_lib/roseus_smach/Sub5Goal.h | 62 ++ .../ros_lib/ros_lib/roseus_smach/Sub5Result.h | 62 ++ .../ros_lib/ros_lib/rosgraph_msgs/Clock.h | 62 ++ .../ros_lib/ros_lib/rosgraph_msgs/Log.h | 185 +++++ .../ros_lib/rosgraph_msgs/TopicStatistics.h | 347 ++++++++ .../ros_lib/rospy_tutorials/AddTwoInts.h | 166 ++++ .../ros_lib/rospy_tutorials/BadTwoInts.h | 150 ++++ .../ros_lib/ros_lib/rospy_tutorials/Floats.h | 82 ++ .../ros_lib/rospy_tutorials/HeaderString.h | 61 ++ .../ros_lib/ros_lib/rosserial_arduino/Adc.h | 92 +++ .../ros_lib/ros_lib/rosserial_arduino/Test.h | 104 +++ .../ros_lib/ros_lib/rosserial_msgs/Log.h | 67 ++ .../ros_lib/rosserial_msgs/RequestParam.h | 212 +++++ .../ros_lib/rosserial_msgs/TopicInfo.h | 130 +++ .../ros_lib/ros_lib/rostwitter/TweetAction.h | 56 ++ .../ros_lib/rostwitter/TweetActionFeedback.h | 56 ++ .../ros_lib/rostwitter/TweetActionGoal.h | 56 ++ .../ros_lib/rostwitter/TweetActionResult.h | 56 ++ .../ros_lib/rostwitter/TweetFeedback.h | 62 ++ .../ros_lib/ros_lib/rostwitter/TweetGoal.h | 133 +++ .../ros_lib/ros_lib/rostwitter/TweetResult.h | 56 ++ .../ros_lib/ros_lib/rtcm_msgs/Message.h | 71 ++ .../ros_lib/ros_lib/rviz/SendFilePath.h | 94 +++ .../rwt_image_view/RosbagRecordRequest.h | 107 +++ .../ros_lib/sensor_msgs/BatteryState.h | 394 +++++++++ .../ros_lib/ros_lib/sensor_msgs/CameraInfo.h | 168 ++++ .../ros_lib/sensor_msgs/ChannelFloat32.h | 99 +++ .../ros_lib/sensor_msgs/CompressedImage.h | 88 ++ .../ros_lib/sensor_msgs/FluidPressure.h | 54 ++ .../ros_lib/ros_lib/sensor_msgs/Illuminance.h | 54 ++ .../ros_lib/ros_lib/sensor_msgs/Image.h | 134 +++ .../ros_lib/ros_lib/sensor_msgs/Imu.h | 85 ++ .../ros_lib/ros_lib/sensor_msgs/JointState.h | 156 ++++ .../ros_lib/ros_lib/sensor_msgs/Joy.h | 132 +++ .../ros_lib/ros_lib/sensor_msgs/JoyFeedback.h | 79 ++ .../ros_lib/sensor_msgs/JoyFeedbackArray.h | 64 ++ .../ros_lib/ros_lib/sensor_msgs/LaserEcho.h | 82 ++ .../ros_lib/ros_lib/sensor_msgs/LaserScan.h | 300 +++++++ .../ros_lib/sensor_msgs/MagneticField.h | 58 ++ .../ros_lib/sensor_msgs/MultiDOFJointState.h | 159 ++++ .../ros_lib/sensor_msgs/MultiEchoLaserScan.h | 263 ++++++ .../ros_lib/ros_lib/sensor_msgs/NavSatFix.h | 84 ++ .../ros_lib/sensor_msgs/NavSatStatus.h | 73 ++ .../ros_lib/ros_lib/sensor_msgs/PointCloud.h | 96 +++ .../ros_lib/ros_lib/sensor_msgs/PointCloud2.h | 185 +++++ .../ros_lib/ros_lib/sensor_msgs/PointField.h | 96 +++ .../ros_lib/ros_lib/sensor_msgs/Range.h | 149 ++++ .../ros_lib/sensor_msgs/RegionOfInterest.h | 108 +++ .../ros_lib/sensor_msgs/RelativeHumidity.h | 54 ++ .../ros_lib/sensor_msgs/SetCameraInfo.h | 111 +++ .../ros_lib/ros_lib/sensor_msgs/Temperature.h | 54 ++ .../ros_lib/sensor_msgs/TimeReference.h | 85 ++ .../ros_lib/ros_lib/shape_msgs/Mesh.h | 90 ++ .../ros_lib/ros_lib/shape_msgs/MeshTriangle.h | 54 ++ .../ros_lib/ros_lib/shape_msgs/Plane.h | 46 ++ .../ros_lib/shape_msgs/SolidPrimitive.h | 82 ++ .../SmachContainerInitialStatusCmd.h | 109 +++ .../ros_lib/smach_msgs/SmachContainerStatus.h | 169 ++++ .../smach_msgs/SmachContainerStructure.h | 246 ++++++ .../ros_lib/smart_device_protocol/Packet.h | 107 +++ .../smart_device_protocol/UWBDistance.h | 86 ++ .../ros_lib/ros_lib/sound_play/SoundRequest.h | 143 ++++ .../ros_lib/sound_play/SoundRequestAction.h | 56 ++ .../sound_play/SoundRequestActionFeedback.h | 56 ++ .../sound_play/SoundRequestActionGoal.h | 56 ++ .../sound_play/SoundRequestActionResult.h | 56 ++ .../ros_lib/sound_play/SoundRequestFeedback.h | 80 ++ .../ros_lib/sound_play/SoundRequestGoal.h | 44 + .../ros_lib/sound_play/SoundRequestResult.h | 80 ++ .../ros_lib/speech_recognition_msgs/Grammar.h | 144 ++++ .../speech_recognition_msgs/PhraseRule.h | 92 +++ .../SpeechRecognition.h | 171 ++++ .../SpeechRecognitionCandidates.h | 119 +++ .../speech_recognition_msgs/Vocabulary.h | 129 +++ .../ros_lib/ros_lib/std_msgs/Bool.h | 56 ++ .../ros_lib/ros_lib/std_msgs/Byte.h | 56 ++ .../ros_lib/ros_lib/std_msgs/ByteMultiArray.h | 82 ++ .../ros_lib/ros_lib/std_msgs/Char.h | 45 + .../ros_lib/ros_lib/std_msgs/ColorRGBA.h | 134 +++ .../ros_lib/ros_lib/std_msgs/Duration.h | 62 ++ .../ros_lib/ros_lib/std_msgs/Empty.h | 38 + .../ros_lib/ros_lib/std_msgs/Float32.h | 62 ++ .../ros_lib/std_msgs/Float32MultiArray.h | 88 ++ .../ros_lib/ros_lib/std_msgs/Float64.h | 43 + .../ros_lib/std_msgs/Float64MultiArray.h | 69 ++ .../ros_lib/ros_lib/std_msgs/Header.h | 92 +++ .../ros_lib/ros_lib/std_msgs/Int16.h | 58 ++ .../ros_lib/std_msgs/Int16MultiArray.h | 84 ++ .../ros_lib/ros_lib/std_msgs/Int32.h | 62 ++ .../ros_lib/std_msgs/Int32MultiArray.h | 88 ++ .../ros_lib/ros_lib/std_msgs/Int64.h | 70 ++ .../ros_lib/std_msgs/Int64MultiArray.h | 96 +++ .../ros_lib/ros_lib/std_msgs/Int8.h | 56 ++ .../ros_lib/ros_lib/std_msgs/Int8MultiArray.h | 82 ++ .../ros_lib/std_msgs/MultiArrayDimension.h | 81 ++ .../ros_lib/std_msgs/MultiArrayLayout.h | 77 ++ .../ros_lib/ros_lib/std_msgs/String.h | 55 ++ .../ros_lib/ros_lib/std_msgs/Time.h | 62 ++ .../ros_lib/ros_lib/std_msgs/UInt16.h | 47 ++ .../ros_lib/std_msgs/UInt16MultiArray.h | 73 ++ .../ros_lib/ros_lib/std_msgs/UInt32.h | 51 ++ .../ros_lib/std_msgs/UInt32MultiArray.h | 77 ++ .../ros_lib/ros_lib/std_msgs/UInt64.h | 59 ++ .../ros_lib/std_msgs/UInt64MultiArray.h | 85 ++ .../ros_lib/ros_lib/std_msgs/UInt8.h | 45 + .../ros_lib/std_msgs/UInt8MultiArray.h | 71 ++ .../ros_lib/ros_lib/std_srvs/Empty.h | 70 ++ .../ros_lib/ros_lib/std_srvs/SetBool.h | 123 +++ .../ros_lib/ros_lib/std_srvs/Trigger.h | 105 +++ .../ros_lib/stereo_msgs/DisparityImage.h | 176 ++++ .../ros_lib/ros_lib/switchbot_ros/Device.h | 72 ++ .../ros_lib/switchbot_ros/DeviceArray.h | 64 ++ .../switchbot_ros/SwitchBotCommandAction.h | 56 ++ .../SwitchBotCommandActionFeedback.h | 56 ++ .../SwitchBotCommandActionGoal.h | 56 ++ .../SwitchBotCommandActionResult.h | 56 ++ .../switchbot_ros/SwitchBotCommandFeedback.h | 55 ++ .../switchbot_ros/SwitchBotCommandGoal.h | 106 +++ .../switchbot_ros/SwitchBotCommandResult.h | 56 ++ .../ros_lib/teb_local_planner/FeedbackMsg.h | 85 ++ .../ros_lib/teb_local_planner/TrajectoryMsg.h | 70 ++ .../teb_local_planner/TrajectoryPointMsg.h | 79 ++ .../ros_lib/tests/array_test/array_test.pde | 49 ++ .../tests/float64_test/float64_test.pde | 38 + .../ros_lib/tests/time_test/time_test.pde | 30 + .../ros_lib/ros_lib/tf/FrameGraph.h | 87 ++ smart_device_protocol/ros_lib/ros_lib/tf/tf.h | 56 ++ .../ros_lib/ros_lib/tf/tfMessage.h | 64 ++ .../ros_lib/tf/transform_broadcaster.h | 69 ++ .../ros_lib/ros_lib/tf2_msgs/FrameGraph.h | 87 ++ .../ros_lib/tf2_msgs/LookupTransformAction.h | 56 ++ .../tf2_msgs/LookupTransformActionFeedback.h | 56 ++ .../tf2_msgs/LookupTransformActionGoal.h | 56 ++ .../tf2_msgs/LookupTransformActionResult.h | 56 ++ .../tf2_msgs/LookupTransformFeedback.h | 38 + .../ros_lib/tf2_msgs/LookupTransformGoal.h | 178 ++++ .../ros_lib/tf2_msgs/LookupTransformResult.h | 50 ++ .../ros_lib/ros_lib/tf2_msgs/TF2Error.h | 69 ++ .../ros_lib/ros_lib/tf2_msgs/TFMessage.h | 64 ++ .../ros_lib/tf2_web_republisher/TFArray.h | 64 ++ .../TFSubscriptionAction.h | 56 ++ .../TFSubscriptionActionFeedback.h | 56 ++ .../TFSubscriptionActionGoal.h | 56 ++ .../TFSubscriptionActionResult.h | 56 ++ .../TFSubscriptionFeedback.h | 64 ++ .../tf2_web_republisher/TFSubscriptionGoal.h | 164 ++++ .../TFSubscriptionResult.h | 38 + .../ros_lib/theora_image_transport/Packet.h | 183 +++++ .../ros_lib/ros_lib/time.cpp | 79 ++ .../ros_lib/ros_lib/topic_tools/DemuxAdd.h | 87 ++ .../ros_lib/ros_lib/topic_tools/DemuxDelete.h | 87 ++ .../ros_lib/ros_lib/topic_tools/DemuxList.h | 107 +++ .../ros_lib/ros_lib/topic_tools/DemuxSelect.h | 104 +++ .../ros_lib/ros_lib/topic_tools/MuxAdd.h | 87 ++ .../ros_lib/ros_lib/topic_tools/MuxDelete.h | 87 ++ .../ros_lib/ros_lib/topic_tools/MuxList.h | 107 +++ .../ros_lib/ros_lib/topic_tools/MuxSelect.h | 104 +++ .../ros_lib/trajectory_msgs/JointTrajectory.h | 107 +++ .../trajectory_msgs/JointTrajectoryPoint.h | 162 ++++ .../trajectory_msgs/MultiDOFJointTrajectory.h | 107 +++ .../MultiDOFJointTrajectoryPoint.h | 139 ++++ .../ros_lib/turtle_actionlib/ShapeAction.h | 56 ++ .../turtle_actionlib/ShapeActionFeedback.h | 56 ++ .../turtle_actionlib/ShapeActionGoal.h | 56 ++ .../turtle_actionlib/ShapeActionResult.h | 56 ++ .../ros_lib/turtle_actionlib/ShapeFeedback.h | 38 + .../ros_lib/turtle_actionlib/ShapeGoal.h | 86 ++ .../ros_lib/turtle_actionlib/ShapeResult.h | 86 ++ .../ros_lib/turtle_actionlib/Velocity.h | 86 ++ .../ros_lib/ros_lib/turtlesim/Color.h | 59 ++ .../ros_lib/ros_lib/turtlesim/Kill.h | 87 ++ .../ros_lib/ros_lib/turtlesim/Pose.h | 158 ++++ .../ros_lib/ros_lib/turtlesim/SetPen.h | 105 +++ .../ros_lib/ros_lib/turtlesim/Spawn.h | 176 ++++ .../ros_lib/turtlesim/TeleportAbsolute.h | 142 ++++ .../ros_lib/turtlesim/TeleportRelative.h | 118 +++ .../twist_mux_msgs/JoyPriorityAction.h | 56 ++ .../JoyPriorityActionFeedback.h | 56 ++ .../twist_mux_msgs/JoyPriorityActionGoal.h | 56 ++ .../twist_mux_msgs/JoyPriorityActionResult.h | 56 ++ .../twist_mux_msgs/JoyPriorityFeedback.h | 38 + .../ros_lib/twist_mux_msgs/JoyPriorityGoal.h | 38 + .../twist_mux_msgs/JoyPriorityResult.h | 38 + .../ros_lib/twist_mux_msgs/JoyTurboAction.h | 56 ++ .../twist_mux_msgs/JoyTurboActionFeedback.h | 56 ++ .../twist_mux_msgs/JoyTurboActionGoal.h | 56 ++ .../twist_mux_msgs/JoyTurboActionResult.h | 56 ++ .../ros_lib/twist_mux_msgs/JoyTurboFeedback.h | 38 + .../ros_lib/twist_mux_msgs/JoyTurboGoal.h | 38 + .../ros_lib/twist_mux_msgs/JoyTurboResult.h | 38 + .../ros_lib/ros_lib/urg_node/Status.h | 136 +++ .../ros_lib/ros_lib/uuid_msgs/UniqueID.h | 48 ++ .../ros_lib/velodyne_msgs/VelodynePacket.h | 72 ++ .../ros_lib/velodyne_msgs/VelodyneScan.h | 70 ++ .../view_controller_msgs/CameraMovement.h | 90 ++ .../view_controller_msgs/CameraPlacement.h | 151 ++++ .../view_controller_msgs/CameraTrajectory.h | 163 ++++ .../ros_lib/visualization_msgs/ImageMarker.h | 262 ++++++ .../visualization_msgs/InteractiveMarker.h | 160 ++++ .../InteractiveMarkerControl.h | 167 ++++ .../InteractiveMarkerFeedback.h | 151 ++++ .../InteractiveMarkerInit.h | 102 +++ .../InteractiveMarkerPose.h | 67 ++ .../InteractiveMarkerUpdate.h | 174 ++++ .../ros_lib/visualization_msgs/Marker.h | 312 +++++++ .../ros_lib/visualization_msgs/MarkerArray.h | 64 ++ .../ros_lib/visualization_msgs/MenuEntry.h | 108 +++ .../ros_lib/ros_lib/voice_text/TextToSpeech.h | 122 +++ .../ros_lib/wge100_camera/BoardConfig.h | 117 +++ .../ros_lib/ros_lib/wifi_ddwrt/Network.h | 168 ++++ .../ros_lib/ros_lib/wifi_ddwrt/SiteSurvey.h | 70 ++ smart_device_protocol/setup.py | 6 + smart_device_protocol/sketchbooks/README.md | 3 + .../enr_dps310_interface/.gitignore | 1 + .../enr_dps310_interface/include/README | 39 + .../enr_dps310_interface/platformio.ini | 21 + .../enr_dps310_interface/src/main.cpp | 141 ++++ .../enr_dps310_interface/test/README | 11 + .../sketchbooks/enr_message_board/.gitignore | 1 + .../sketchbooks/enr_message_board/README.md | 7 + .../enr_message_board/include/README | 39 + .../enr_message_board/include/message.h | 84 ++ .../enr_message_board/platformio.ini | 20 + .../enr_message_board/src/main.cpp | 176 ++++ .../sketchbooks/enr_message_board/test/README | 11 + .../enr_stickv2_interface/.gitignore | 1 + .../enr_stickv2_interface/include/README | 39 + .../enr_stickv2_interface/platformio.ini | 21 + .../enr_stickv2_interface/src/main.cpp | 140 ++++ .../enr_stickv2_interface/test/README | 11 + .../m5atoms3_sesami_client/.gitignore | 1 + .../m5atoms3_sesami_client/README.md | 54 ++ .../m5atoms3_sesami_client/include/README | 39 + .../m5atoms3_sesami_client/platformio.ini | 30 + .../m5atoms3_sesami_client/src/main.cpp | 249 ++++++ .../m5atoms3_sesami_client/test/README | 11 + .../m5atoms3_switchbot_client/.gitignore | 1 + .../m5atoms3_switchbot_client/README.md | 38 + .../m5atoms3_switchbot_client/include/README | 39 + .../m5atoms3_switchbot_client/platformio.ini | 28 + .../m5atoms3_switchbot_client/src/main.cpp | 253 ++++++ .../m5atoms3_switchbot_client/test/README | 11 + .../sketchbooks/sample_aes_cmac/.gitignore | 1 + .../sample_aes_cmac/include/README | 39 + .../sample_aes_cmac/platformio.ini | 22 + .../sketchbooks/sample_aes_cmac/src/main.cpp | 116 +++ .../sketchbooks/sample_aes_cmac/test/README | 11 + .../sample_esp_now_broadcaster/.gitignore | 1 + .../sample_esp_now_broadcaster/include/README | 39 + .../sample_esp_now_broadcaster/platformio.ini | 17 + .../sample_esp_now_broadcaster/src/main.cpp | 105 +++ .../sample_esp_now_broadcaster/test/README | 11 + .../sample_esp_now_receiver/.gitignore | 1 + .../sample_esp_now_receiver/include/README | 39 + .../sample_esp_now_receiver/platformio.ini | 17 + .../sample_esp_now_receiver/src/main.cpp | 84 ++ .../sample_esp_now_receiver/test/README | 11 + .../sketchbooks/sample_sesami/.gitignore | 1 + .../sketchbooks/sample_sesami/include/README | 39 + .../sketchbooks/sample_sesami/platformio.ini | 28 + .../sketchbooks/sample_sesami/src/main.cpp | 61 ++ .../sketchbooks/sample_sesami/test/README | 11 + .../sketchbooks/sample_uwb/.gitignore | 1 + .../sketchbooks/sample_uwb/README.md | 6 + .../sketchbooks/sample_uwb/include/README | 39 + .../sketchbooks/sample_uwb/platformio.ini | 26 + .../sketchbooks/sample_uwb/src/main.cpp | 75 ++ .../sketchbooks/sample_uwb/test/README | 11 + .../sketchbooks/sdp_debug_board/.gitignore | 1 + .../sketchbooks/sdp_debug_board/README.md | 7 + .../sdp_debug_board/include/README | 39 + .../sketchbooks/sdp_debug_board/include/epd.h | 33 + .../sdp_debug_board/platformio.ini | 20 + .../sketchbooks/sdp_debug_board/src/main.cpp | 177 ++++ .../sketchbooks/sdp_debug_board/test/README | 11 + .../.gitignore | 1 + .../include/README | 39 + .../platformio.ini | 22 + .../src/main.cpp | 145 ++++ .../test/README | 11 + .../sketchbooks/sdp_example/.gitignore | 1 + .../sketchbooks/sdp_example/include/README | 39 + .../sketchbooks/sdp_example/include/lcd.h | 70 ++ .../sketchbooks/sdp_example/platformio.ini | 24 + .../sketchbooks/sdp_example/src/main.cpp | 107 +++ .../sketchbooks/sdp_example/test/README | 11 + .../sdp_landmark_information/.gitignore | 1 + .../sdp_landmark_information/README.md | 11 + .../sdp_landmark_information/data/config.json | 5 + .../sdp_landmark_information/include/README | 39 + .../sdp_landmark_information/platformio.ini | 46 ++ .../sdp_landmark_information/src/main.cpp | 137 ++++ .../sdp_landmark_information/test/README | 11 + .../sketchbooks/sdp_sesami_host/.gitignore | 1 + .../sketchbooks/sdp_sesami_host/README.md | 10 + .../sdp_sesami_host/data/config.json | 10 + .../sdp_sesami_host/include/README | 39 + .../sdp_sesami_host/platformio.ini | 27 + .../sketchbooks/sdp_sesami_host/src/main.cpp | 266 ++++++ .../sketchbooks/sdp_sesami_host/test/README | 11 + .../sdp_stickv2_interface/.gitignore | 1 + .../sdp_stickv2_interface/data/config.json | 6 + .../sdp_stickv2_interface/include/README | 39 + .../sdp_stickv2_interface/include/lcd.h | 39 + .../sdp_stickv2_interface/platformio.ini | 23 + .../sdp_stickv2_interface/src/main.cpp | 194 +++++ .../sdp_stickv2_interface/test/README | 11 + .../sdp_switchbot_light/.gitignore | 1 + .../sketchbooks/sdp_switchbot_light/README.md | 11 + .../sdp_switchbot_light/data/config.json | 10 + .../sdp_switchbot_light/include/README | 39 + .../sdp_switchbot_light/platformio.ini | 27 + .../sdp_switchbot_light/src/main.cpp | 285 +++++++ .../sdp_switchbot_light/test/README | 11 + .../sketchbooks/sdp_switchbot_lock/.gitignore | 1 + .../sketchbooks/sdp_switchbot_lock/README.md | 11 + .../sdp_switchbot_lock/data/config.json | 10 + .../sdp_switchbot_lock/include/README | 39 + .../sdp_switchbot_lock/platformio.ini | 27 + .../sdp_switchbot_lock/src/main.cpp | 279 +++++++ .../sdp_switchbot_lock/test/README | 11 + .../.gitignore | 1 + .../smart_device_protocol_interface/README.md | 6 + .../include/README | 39 + .../include/lcd.h | 138 ++++ .../platformio.ini | 65 ++ .../src/main.cpp | 186 +++++ .../test/README | 11 + .../tests/sdp_v2_interface_rostest.test | 5 + .../tests/test_sdp_interface.py | 31 + smart_device_protocol/tests/test_topics.bag | Bin 0 -> 95355 bytes 1624 files changed, 141627 insertions(+) create mode 100644 smart_device_protocol/.gitignore create mode 100644 smart_device_protocol/CMakeLists.txt create mode 100644 smart_device_protocol/LICENSE create mode 100644 smart_device_protocol/README.md create mode 100644 smart_device_protocol/arduino_lib/ArduinoAtomS3Hardware.h create mode 100644 smart_device_protocol/arduino_lib/README.md create mode 100644 smart_device_protocol/arduino_lib/devices/stickv2_util.h create mode 100644 smart_device_protocol/arduino_lib/devices/uwb_module_util.h create mode 100644 smart_device_protocol/arduino_lib/iot_com_util/Time.h create mode 100644 smart_device_protocol/arduino_lib/iot_com_util/iot_client_util.h create mode 100644 smart_device_protocol/arduino_lib/iot_com_util/iot_host_util.h create mode 100644 smart_device_protocol/arduino_lib/sdp/esp_now.h create mode 100644 smart_device_protocol/arduino_lib/sdp/packet_creator.h create mode 100644 smart_device_protocol/arduino_lib/sdp/packet_parser.h create mode 100644 smart_device_protocol/arduino_lib/sdp/packet_util.h create mode 100644 smart_device_protocol/arduino_lib/sdp/sdp.h create mode 100644 smart_device_protocol/arduino_lib/sdp/sdp_util.h create mode 100644 smart_device_protocol/arduino_lib/utils/config_loader.h create mode 100644 smart_device_protocol/arduino_lib/utils/ros_util.h create mode 100644 smart_device_protocol/arduino_lib/web_services/sesami_util.h create mode 100644 smart_device_protocol/arduino_lib/web_services/switchbot_util.h create mode 100644 smart_device_protocol/config/smart_device_protocol_interface.yaml create mode 100644 smart_device_protocol/docs/README_old.md create mode 100644 smart_device_protocol/docs/python.md create mode 100644 smart_device_protocol/docs/sdp.md create mode 100644 smart_device_protocol/docs/sdp_logo_v1.png create mode 100644 smart_device_protocol/docs/sdp_logo_v1.svg create mode 100644 smart_device_protocol/launch/demo.launch create mode 100644 smart_device_protocol/msg/Packet.msg create mode 100644 smart_device_protocol/msg/UWBDistance.msg create mode 100644 smart_device_protocol/node_scripts/broadcast_v1_test_packet.py create mode 100644 smart_device_protocol/node_scripts/esp_now_v1_packet_printer.py create mode 100644 smart_device_protocol/node_scripts/sdp_v2_device_interface_printer.py create mode 100644 smart_device_protocol/node_scripts/sdp_v2_packet_printer.py create mode 100644 smart_device_protocol/package.xml create mode 100644 smart_device_protocol/python/smart_device_protocol/__init__.py create mode 100644 smart_device_protocol/python/smart_device_protocol/esp_now_ros_interface.py create mode 100644 smart_device_protocol/python/smart_device_protocol/packet_generator.py create mode 100644 smart_device_protocol/python/smart_device_protocol/packet_parser.py create mode 100644 smart_device_protocol/python/smart_device_protocol/sdp_frames.py create mode 100644 smart_device_protocol/python/smart_device_protocol/smart_device_protocol_interface.py create mode 100644 smart_device_protocol/python/smart_device_protocol/utils.py create mode 100644 smart_device_protocol/requirements.txt create mode 100644 smart_device_protocol/ros_lib/.gitignore create mode 100644 smart_device_protocol/ros_lib/ros_lib/ArduinoHardware.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ArduinoTcpHardware.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TestResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalID.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalStatusArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/App.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/AppInstallationState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/AppList.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/AppStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/ClientApp.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/ExchangeApp.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/GetAppDetails.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/GetInstallationState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/Icon.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/InstallApp.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/KeyValue.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/ListApps.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/StartApp.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/StatusCodes.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/StopApp.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/app_manager/UninstallApp.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/apriltag_ros/AnalyzeSingleImage.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/apriltag_ros/AprilTagDetection.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/apriltag_ros/AprilTagDetectionArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioDataStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/axis_camera/Axis.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/base_local_planner/Position2DInt.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/bond/Constants.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/bond/Status.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointControllerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointJog.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTolerance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryControllerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/PidState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/QueryCalibrationState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/QueryTrajectoryState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/control_toolbox/SetPidGains.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllerStatistics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllersStatistics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/HardwareInterfaceResources.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ListControllerTypes.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ListControllers.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/LoadController.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ReloadControllerLibraries.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/SwitchController.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/UnloadController.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/costmap_2d/VoxelGrid.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/costmap_converter/ObstacleArrayMsg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/costmap_converter/ObstacleMsg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/AddDiagnostics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/DiagnosticArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/KeyValue.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/SelfTest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogResponse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/driver_base/ConfigString.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/driver_base/ConfigValue.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/driver_base/SensorLevels.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/duration.cpp create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/BoolParameter.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Config.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/ConfigDescription.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/DoubleParameter.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Group.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/GroupState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/IntParameter.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/ParamDescription.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Reconfigure.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/SensorLevels.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/StrParameter.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/AssocTF.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/DeleteTF.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/DissocTF.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/SetDynamicTF.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/ActuatorInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/BoardInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTemperature.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTrace.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTraceSample.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/RawFTData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/RawFTDataSample.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorFirmwareRead.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorFirmwareWrite.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorReset.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/MultiWaveform.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/MultiWaveformTransition.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/SetMultiWaveform.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/SetWaveform.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/ADC/ADC.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/Blink/Blink.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/BlinkM/BlinkM.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/BlinkM/BlinkM_funcs.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/BlinkerWithClass/BlinkerWithClass.ino create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/Clapper/Clapper.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/Esp8266HelloWorld/Esp8266HelloWorld.ino create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/HelloWorld/HelloWorld.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/IrRanger/IrRanger.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/Logging/Logging.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/Odom/Odom.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/ServiceClient/ServiceClient.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/ServiceClient/client.py create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/ServiceServer/ServiceServer.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/ServoControl/ServoControl.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/TcpBlink/TcpBlink.ino create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/TcpHelloWorld/TcpHelloWorld.ino create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/Temperature/Temperature.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/TimeTF/TimeTF.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/Ultrasound/Ultrasound.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/button_example/button_example.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/examples/pubsub/pubsub.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/BoardState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/ChargerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/GripperState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/Gyro.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/JointState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/MotorState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/RobotState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/SafetyLaserState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fingertip_pressure/PressureInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/fingertip_pressure/PressureInfoElement.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_example_controllers/JointTorqueComparison.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspEpsilon.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/Errors.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/FrankaState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetCartesianImpedance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetEEFrame.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetForceTorqueCollisionBehavior.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetFullCollisionBehavior.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetJointImpedance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetKFrame.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetLoad.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ApplyJointEffort.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/BodyRequest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ContactState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ContactsState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/DeleteLight.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/DeleteModel.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetJointProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLightProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLinkProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLinkState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetModelProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetModelState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetWorldProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/JointRequest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/LinkState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/LinkStates.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ModelState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ModelStates.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ODEJointProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ODEPhysics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/PerformanceMetrics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SensorPerformanceMetric.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetJointProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetJointTrajectory.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLightProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLinkProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLinkState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetModelConfiguration.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetModelState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SpawnModel.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/WorldState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gdrive_ros/MultipleUpload.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/gdrive_ros/Upload.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/BoundingBox.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPath.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPointStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPoseStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeographicMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeographicMapChanges.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GetGeoPath.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GetGeographicMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GetRoutePlan.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/KeyValue.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/MapFeature.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/RouteNetwork.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/RoutePath.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/RouteSegment.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/UpdateGeographicMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geographic_msgs/WayPoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Accel.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelWithCovariance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Inertia.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/InertiaStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Point.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Point32.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PointStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Polygon.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PolygonStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Pose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Pose2D.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseWithCovariance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Quaternion.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/QuaternionStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Transform.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TransformStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Twist.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistWithCovariance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Vector3.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Vector3Stamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Wrench.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/geometry_msgs/WrenchStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/ActionParameter.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Annotation.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Attachment.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Button.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Card.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardEvent.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardHeader.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/FormAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Image.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/KeyValue.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Message.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/MessageEvent.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/OnClick.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Section.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SlashCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Space.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SpaceEvent.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/User.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/google_chat_ros/WidgetMarkup.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/graft/GraftControl.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/graft/GraftSensorResidual.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/graft/GraftState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspableObject.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/Object.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/grasping_msgs/ObjectProperty.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/image_view2/ChangeMode.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/image_view2/ImageMarker2.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/image_view2/MouseEvent.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/image_view2/PointArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/FootCoordsLowLevelInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GroundContactState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/RequireLog.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/RequireMonitorStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/SynchronizedForces.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/Footstep.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/FootstepArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/ChangeSuccessor.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/CollisionBoundingBoxInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/ProjectFootstep.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/SetHeuristicPath.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Action.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/AndroidSensor.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/DeviceSensor.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Gravity.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/MagneticField.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/MultiTouch.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Query.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/SlackMessage.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Tablet.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Touch.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/TouchEvent.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/VoiceMessage.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/YesNo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_hark_msgs/HarkPower.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetJointState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetMarkerDimensions.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerColor.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerExistence.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerFocus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetType.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/IndexRequest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/JointTrajectoryPointWithType.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/JointTrajectoryWithType.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerDimensions.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerMenu.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerSetPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MoveModel.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MoveObject.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/PoseStampedWithName.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/RemoveParentMarker.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetHeuristic.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetMarkerDimensions.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetParentMarker.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerColor.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerFocus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SnapFootPrint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SnapFootPrintInput.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/AllTypeTest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/CompressedAngleVectorPR2.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/FC2OCS.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/FC2OCSLargeData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/Heartbeat.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/HeartbeatResponse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/OCS2FC.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/OpenNISample.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/SetSendRate.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/SilverhammerInternalBuffer.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/WifiStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_perception/EuclideanSegment.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_perception/NonMaximumSuppression.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_perception/SetTemplate.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_perception/WhiteBalance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_perception/WhiteBalancePoints.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Accuracy.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoolStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBox.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxArrayWithCameraInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxMovement.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CallPolygon.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CallSnapIt.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CheckCircle.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CheckCollision.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Circle2D.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Circle2DArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ClassificationResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ClusterPointIndices.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ColorHistogram.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ColorHistogramArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ContactSensor.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ContactSensorArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/DepthCalibrationParameter.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/DepthErrorResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/EnvironmentLock.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/EuclideanSegment.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HeightmapConfig.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Histogram.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRange.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRangeArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRangeBin.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HumanSkeleton.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HumanSkeletonArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPAlign.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPAlignWithBox.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ImageDifferenceValue.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Int32Stamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Label.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/LabelArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Line.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/LineArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ModelCoefficientsArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/NonMaximumSuppression.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Object.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ObjectArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ParallelEdge.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ParallelEdgeArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PeoplePose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PeoplePoseArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PlotData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PlotDataArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PointsArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PolygonArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PolygonOnEnvironment.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PosedCameraInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Rect.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RectArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RobotPickupReleasePoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RotatedRect.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RotatedRectStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SaveMesh.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Segment.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SegmentArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SegmentStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetDepthCalibrationParameter.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetLabels.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetPointCloud2.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetTemplate.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleHandle.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleOccupancyGrid.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleOccupancyGridArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SlicedPointCloud.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SnapFootstep.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SnapItRequest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseImage.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGrid.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridCell.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridColumn.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Spectrum.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SwitchTopic.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TimeRange.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Torus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TorusArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TowerPickUp.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TowerRobotMoveCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TrackerStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TrackingStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TransformScreenpoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/UpdateOffset.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/VectorArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WeightedPoseArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WhiteBalance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WhiteBalancePoints.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/EusCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/ObjectFitCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/OverlayMenu.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/OverlayText.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/Pictogram.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/PictogramArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/RecordCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/RequestMarkerOperate.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/Screenshot.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/StringStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/TransformableMarkerOperate.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/ChangeTopic.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/List.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/PassthroughDuration.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/TopicInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/Update.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/laser_assembler/AssembleScans.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/laser_assembler/AssembleScans2.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/map_msgs/GetMapROI.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/map_msgs/GetPointMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/map_msgs/GetPointMapROI.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/map_msgs/OccupancyGridUpdate.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/map_msgs/PointCloud2Update.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMapInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMapsInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/map_msgs/SaveMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/map_msgs/SetMapProjections.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPath.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/microstrain_3dmgx2_imu/AddOffset.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store/GetParam.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoFind.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoInsert.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoUpdate.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store/SetParam.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/Insert.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoDeleteMsg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoInsertMsg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoQueryMsg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoQuerywithProjectionMsg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoUpdateMsg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/SerialisedMessage.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringList.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringPair.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringPairList.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/move_base_msgs/RecoveryStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AllowedCollisionEntry.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AllowedCollisionMatrix.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ApplyPlanningScene.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AttachedCollisionObject.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/BoundingVolume.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianPoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianTrajectory.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianTrajectoryPoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ChangeControlDimensions.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ChangeDriftDimensions.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CheckIfRobotStateExistsInWarehouse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CollisionObject.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ConstraintEvalResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/Constraints.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ContactInformation.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CostSource.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DeleteRobotStateFromWarehouse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DisplayRobotState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DisplayTrajectory.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteKnownTrajectory.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GenericTrajectory.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetCartesianPath.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetMotionPlan.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetMotionSequence.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPlannerParams.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPlanningScene.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPositionFK.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPositionIK.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetRobotStateFromWarehouse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetStateValidity.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/Grasp.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GraspPlanning.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GripperTranslation.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/JointConstraint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/JointLimits.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/KinematicSolverInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LinkPadding.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LinkScale.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ListRobotStatesInWarehouse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LoadMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanDetailedResponse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanRequest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanResponse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceItem.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceRequest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceResponse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveItErrorCodes.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ObjectColor.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/OrientationConstraint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/OrientedBoundingBox.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceLocation.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlannerInterfaceDescription.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlannerParams.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningOptions.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningScene.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningSceneComponents.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningSceneWorld.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PositionConstraint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PositionIKRequest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/QueryPlannerInterfaces.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RenameRobotStateInWarehouse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RobotState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RobotTrajectory.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SaveMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SaveRobotStateToWarehouse.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SetPlannerParams.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/TrajectoryConstraints.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/UpdatePointcloudOctomap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/VisibilityConstraint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/moveit_msgs/WorkspaceParameters.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/AudioBuffer.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyROI.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BoolStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/Bumper.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/CmdPoseService.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/CmdVelService.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/EventStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FaceROI.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FadeRGB.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FloatArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FloatStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetBodyROI.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetFacesROI.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetFloat.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetInstalledBehaviors.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetRobotInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetString.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetTruepose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/HandTouch.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/HeadTouch.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/IntArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/IntStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAngleTrajectory.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeed.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryList.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairFloat.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairInt.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairString.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/OrthogonalSecurityDistance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/PoseWithConfidenceStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RobotInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetArmsEnabled.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetFloat.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetString.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetTransform.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SoundLocated.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StatusChangeStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StringArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StringStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/TangentialSecurityDistance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/WordRecognized.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetPlan.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/GridCells.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/LoadMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/MapMetaData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/OccupancyGrid.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/Odometry.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/Path.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nav_msgs/SetMap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/navfn/MakeNavPlan.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/navfn/SetCostmap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgga.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgsa.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgsv.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nmea_msgs/GpgsvSatellite.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gprmc.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Sentence.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletList.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletLoad.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletUnload.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/GetObjectInformation.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectInformation.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectType.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/RecognizedObject.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/RecognizedObjectArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/Table.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/TableArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/octomap_msgs/BoundingBoxQuery.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/octomap_msgs/GetOctomap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/octomap_msgs/Octomap.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/octomap_msgs/OctomapWithPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Circle.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/CircleArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/CircleArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Contour.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/ContourArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/ContourArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Face.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceRecognitionTrain.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Flow.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Line.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/LineArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/LineArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Moment.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/MomentArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/MomentArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2D.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Rect.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/RectArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/RectArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRect.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectArrayStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/opencv_apps/Size.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/openni2_camera/GetSerial.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pcl_msgs/ModelCoefficients.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pcl_msgs/PointIndices.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pcl_msgs/PolygonMesh.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pcl_msgs/UpdateFilename.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pcl_msgs/Vertices.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/people_msgs/People.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/people_msgs/Person.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/people_msgs/PersonStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/people_msgs/PositionMeasurement.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/people_msgs/PositionMeasurementArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/DataPoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/DataPoints.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/Dictionary.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/StatisticsNames.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/StatisticsValues.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/polled_camera/GetPolledImage.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Curve1D.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Detect.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature0D.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature0DDetect.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature1D.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature1DDetect.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ImageFeature0D.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ImageFeature1D.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Object6DPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ObjectDetection.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/TargetObj.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/power_msgs/BatteryState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/power_msgs/BreakerCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/power_msgs/BreakerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointControllerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryControllerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/QueryCalibrationState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/QueryTrajectoryState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/ModelJointsState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/PlugCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/SetModelsJointsStates.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperPressureData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSensorRTState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSensorRawData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseControllerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseControllerState2.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseOdometryState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/DebugInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/Odometer.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/OdometryMatrix.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/SetProfile.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/TrackLinkCmd.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ActuatorStatistics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ControllerStatistics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/JointStatistics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ListControllerTypes.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ListControllers.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/LoadController.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/MechanismStatistics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ReloadControllerLibraries.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchController.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/UnloadController.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/AccelerometerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/AccessPoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryServer.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryServer2.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryState2.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/DashboardState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/GPUStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/LaserScannerSignal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/LaserTrajCmd.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PeriodicCmd.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PowerBoardState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PowerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PressureState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/SetLaserTrajCmd.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_msgs/SetPeriodicCmd.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_power_board/PowerBoardCommand.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/pr2_power_board/PowerBoardCommand2.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/realsense2_camera/DeviceInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/realsense2_camera/Extrinsics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/realsense2_camera/IMUInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/realsense2_camera/Metadata.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CalibrationData.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CameraParameter.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CaptureConfig.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/ExtendedCameraInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/Observation.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/ControllerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/DiffDriveLimiterParams.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_localization/FromLL.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_localization/GetState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_localization/SetDatum.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_localization/SetPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_localization/SetUTMZone.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_localization/ToLL.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_localization/ToggleFilterProcessing.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_mechanism_controllers/JTCartesianControllerState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/robot_pose_ekf/GetStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ros.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ros/duration.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ros/msg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ros/node_handle.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ros/publisher.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ros/service_client.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ros/service_server.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ros/subscriber.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/ros/time.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/DeleteParam.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/GetActionServers.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/GetParam.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/GetParamNames.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/GetTime.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/HasParam.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/MessageDetails.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/NodeDetails.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/Nodes.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/Publishers.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/SearchParam.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceHost.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceNode.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceProviders.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceRequestDetails.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceResponseDetails.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceType.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/Services.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/ServicesForType.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/SetParam.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/Subscribers.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/TopicType.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/Topics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/TopicsAndRawTypes.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/TopicsForType.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosapi/TypeDef.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosauth/Authentication.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosbridge_msgs/ConnectedClient.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosbridge_msgs/ConnectedClients.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roscpp/Empty.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roscpp/GetLoggers.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roscpp/Logger.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roscpp/SetLoggerLevel.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roscpp_tutorials/TwoInts.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus/AddTwoInts.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus/FixedArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus/String.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus/StringStamped.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus/StringString.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus/TestName.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus/VariableArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Action.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Feedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Goal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Result.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Action.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Feedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Goal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Result.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/Clock.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/Log.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/TopicStatistics.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/AddTwoInts.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/BadTwoInts.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/Floats.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/HeaderString.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosserial_arduino/Adc.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosserial_arduino/Test.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/Log.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/RequestParam.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/TopicInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rtcm_msgs/Message.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rviz/SendFilePath.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/rwt_image_view/RosbagRecordRequest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/BatteryState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/CameraInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/ChannelFloat32.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/CompressedImage.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/FluidPressure.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Illuminance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Image.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Imu.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JointState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Joy.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JoyFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JoyFeedbackArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/LaserEcho.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/LaserScan.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MagneticField.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MultiDOFJointState.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/NavSatFix.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/NavSatStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointCloud.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointCloud2.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointField.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Range.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/RegionOfInterest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/RelativeHumidity.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/SetCameraInfo.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Temperature.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sensor_msgs/TimeReference.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/shape_msgs/Mesh.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/shape_msgs/MeshTriangle.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/shape_msgs/Plane.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/shape_msgs/SolidPrimitive.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerStatus.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerStructure.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/smart_device_protocol/Packet.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/smart_device_protocol/UWBDistance.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequest.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/Grammar.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/PhraseRule.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/SpeechRecognition.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/SpeechRecognitionCandidates.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/Vocabulary.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Bool.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Byte.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/ByteMultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Char.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/ColorRGBA.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Duration.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Empty.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Float32.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Float32MultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Float64.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Float64MultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Header.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Int16.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Int16MultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Int32.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Int32MultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Int64.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Int64MultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Int8.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Int8MultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/MultiArrayDimension.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/MultiArrayLayout.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/String.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/Time.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt16.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt16MultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt32.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt32MultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt64.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt64MultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt8.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt8MultiArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_srvs/Empty.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_srvs/SetBool.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/std_srvs/Trigger.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/stereo_msgs/DisparityImage.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/switchbot_ros/Device.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/switchbot_ros/DeviceArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/teb_local_planner/FeedbackMsg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/teb_local_planner/TrajectoryMsg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/teb_local_planner/TrajectoryPointMsg.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tests/array_test/array_test.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/tests/float64_test/float64_test.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/tests/time_test/time_test.pde create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf/FrameGraph.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf/tf.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf/tfMessage.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf/transform_broadcaster.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_msgs/FrameGraph.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_msgs/TF2Error.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_msgs/TFMessage.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/theora_image_transport/Packet.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/time.cpp create mode 100644 smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxAdd.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxDelete.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxList.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxSelect.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxAdd.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxDelete.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxList.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxSelect.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/JointTrajectory.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/Velocity.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtlesim/Color.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtlesim/Kill.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtlesim/Pose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtlesim/SetPen.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtlesim/Spawn.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtlesim/TeleportAbsolute.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/turtlesim/TeleportRelative.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboAction.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboGoal.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboResult.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/urg_node/Status.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/uuid_msgs/UniqueID.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/velodyne_msgs/VelodynePacket.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/velodyne_msgs/VelodyneScan.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraMovement.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraPlacement.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraTrajectory.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/visualization_msgs/ImageMarker.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarker.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/visualization_msgs/Marker.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/visualization_msgs/MarkerArray.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/visualization_msgs/MenuEntry.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/voice_text/TextToSpeech.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/wge100_camera/BoardConfig.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/wifi_ddwrt/Network.h create mode 100644 smart_device_protocol/ros_lib/ros_lib/wifi_ddwrt/SiteSurvey.h create mode 100644 smart_device_protocol/setup.py create mode 100644 smart_device_protocol/sketchbooks/README.md create mode 100644 smart_device_protocol/sketchbooks/enr_dps310_interface/.gitignore create mode 100644 smart_device_protocol/sketchbooks/enr_dps310_interface/include/README create mode 100644 smart_device_protocol/sketchbooks/enr_dps310_interface/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/enr_dps310_interface/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/enr_dps310_interface/test/README create mode 100644 smart_device_protocol/sketchbooks/enr_message_board/.gitignore create mode 100644 smart_device_protocol/sketchbooks/enr_message_board/README.md create mode 100644 smart_device_protocol/sketchbooks/enr_message_board/include/README create mode 100644 smart_device_protocol/sketchbooks/enr_message_board/include/message.h create mode 100644 smart_device_protocol/sketchbooks/enr_message_board/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/enr_message_board/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/enr_message_board/test/README create mode 100644 smart_device_protocol/sketchbooks/enr_stickv2_interface/.gitignore create mode 100644 smart_device_protocol/sketchbooks/enr_stickv2_interface/include/README create mode 100644 smart_device_protocol/sketchbooks/enr_stickv2_interface/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/enr_stickv2_interface/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/enr_stickv2_interface/test/README create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_sesami_client/.gitignore create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_sesami_client/README.md create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_sesami_client/include/README create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_sesami_client/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_sesami_client/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_sesami_client/test/README create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/.gitignore create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/README.md create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/include/README create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/test/README create mode 100644 smart_device_protocol/sketchbooks/sample_aes_cmac/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sample_aes_cmac/include/README create mode 100644 smart_device_protocol/sketchbooks/sample_aes_cmac/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sample_aes_cmac/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sample_aes_cmac/test/README create mode 100644 smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/include/README create mode 100644 smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/test/README create mode 100644 smart_device_protocol/sketchbooks/sample_esp_now_receiver/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sample_esp_now_receiver/include/README create mode 100644 smart_device_protocol/sketchbooks/sample_esp_now_receiver/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sample_esp_now_receiver/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sample_esp_now_receiver/test/README create mode 100644 smart_device_protocol/sketchbooks/sample_sesami/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sample_sesami/include/README create mode 100644 smart_device_protocol/sketchbooks/sample_sesami/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sample_sesami/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sample_sesami/test/README create mode 100644 smart_device_protocol/sketchbooks/sample_uwb/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sample_uwb/README.md create mode 100644 smart_device_protocol/sketchbooks/sample_uwb/include/README create mode 100644 smart_device_protocol/sketchbooks/sample_uwb/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sample_uwb/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sample_uwb/test/README create mode 100644 smart_device_protocol/sketchbooks/sdp_debug_board/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sdp_debug_board/README.md create mode 100644 smart_device_protocol/sketchbooks/sdp_debug_board/include/README create mode 100644 smart_device_protocol/sketchbooks/sdp_debug_board/include/epd.h create mode 100644 smart_device_protocol/sketchbooks/sdp_debug_board/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sdp_debug_board/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sdp_debug_board/test/README create mode 100644 smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/include/README create mode 100644 smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/test/README create mode 100644 smart_device_protocol/sketchbooks/sdp_example/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sdp_example/include/README create mode 100644 smart_device_protocol/sketchbooks/sdp_example/include/lcd.h create mode 100644 smart_device_protocol/sketchbooks/sdp_example/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sdp_example/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sdp_example/test/README create mode 100644 smart_device_protocol/sketchbooks/sdp_landmark_information/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sdp_landmark_information/README.md create mode 100644 smart_device_protocol/sketchbooks/sdp_landmark_information/data/config.json create mode 100644 smart_device_protocol/sketchbooks/sdp_landmark_information/include/README create mode 100644 smart_device_protocol/sketchbooks/sdp_landmark_information/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sdp_landmark_information/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sdp_landmark_information/test/README create mode 100644 smart_device_protocol/sketchbooks/sdp_sesami_host/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sdp_sesami_host/README.md create mode 100644 smart_device_protocol/sketchbooks/sdp_sesami_host/data/config.json create mode 100644 smart_device_protocol/sketchbooks/sdp_sesami_host/include/README create mode 100644 smart_device_protocol/sketchbooks/sdp_sesami_host/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sdp_sesami_host/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sdp_sesami_host/test/README create mode 100644 smart_device_protocol/sketchbooks/sdp_stickv2_interface/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sdp_stickv2_interface/data/config.json create mode 100644 smart_device_protocol/sketchbooks/sdp_stickv2_interface/include/README create mode 100644 smart_device_protocol/sketchbooks/sdp_stickv2_interface/include/lcd.h create mode 100644 smart_device_protocol/sketchbooks/sdp_stickv2_interface/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sdp_stickv2_interface/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sdp_stickv2_interface/test/README create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_light/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_light/README.md create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_light/data/config.json create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_light/include/README create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_light/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_light/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_light/test/README create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_lock/.gitignore create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_lock/README.md create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_lock/data/config.json create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_lock/include/README create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_lock/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_lock/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/sdp_switchbot_lock/test/README create mode 100644 smart_device_protocol/sketchbooks/smart_device_protocol_interface/.gitignore create mode 100644 smart_device_protocol/sketchbooks/smart_device_protocol_interface/README.md create mode 100644 smart_device_protocol/sketchbooks/smart_device_protocol_interface/include/README create mode 100644 smart_device_protocol/sketchbooks/smart_device_protocol_interface/include/lcd.h create mode 100644 smart_device_protocol/sketchbooks/smart_device_protocol_interface/platformio.ini create mode 100644 smart_device_protocol/sketchbooks/smart_device_protocol_interface/src/main.cpp create mode 100644 smart_device_protocol/sketchbooks/smart_device_protocol_interface/test/README create mode 100644 smart_device_protocol/tests/sdp_v2_interface_rostest.test create mode 100644 smart_device_protocol/tests/test_sdp_interface.py create mode 100644 smart_device_protocol/tests/test_topics.bag diff --git a/smart_device_protocol/.gitignore b/smart_device_protocol/.gitignore new file mode 100644 index 000000000..f4a99a34b --- /dev/null +++ b/smart_device_protocol/.gitignore @@ -0,0 +1,54 @@ +devel/ +logs/ +build/ +bin/ +lib/ +msg_gen/ +srv_gen/ +msg/*Action.msg +msg/*ActionFeedback.msg +msg/*ActionGoal.msg +msg/*ActionResult.msg +msg/*Feedback.msg +msg/*Goal.msg +msg/*Result.msg +msg/_*.py +build_isolated/ +devel_isolated/ + +# Generated by dynamic reconfigure +*.cfgc +/cfg/cpp/ +/cfg/*.py + +# Ignore generated docs +*.dox +*.wikidoc + +# eclipse stuff +.project +.cproject + +# qcreator stuff +CMakeLists.txt.user + +srv/_*.py +*.pcd +*.pyc +qtcreator-* +*.user + +/planning/cfg +/planning/docs +/planning/src + +*~ + +# Emacs +.#* + +# Catkin custom files +CATKIN_IGNORE + +# +*.vscode diff --git a/smart_device_protocol/CMakeLists.txt b/smart_device_protocol/CMakeLists.txt new file mode 100644 index 000000000..52a87ed35 --- /dev/null +++ b/smart_device_protocol/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 2.8.3) +project(smart_device_protocol) + +find_package(catkin REQUIRED COMPONENTS message_generation catkin_virtualenv std_msgs) + +catkin_generate_virtualenv( + PYTHON_INTERPRETER python3 + CHECK_VENV FALSE + USE_SYSTEM_PACKAGES FALSE + ISOLATE_REQUIREMENTS TRUE +) + +catkin_python_setup() + +add_message_files( + FILES + Packet.msg + UWBDistance.msg +) + +generate_messages( + DEPENDENCIES + std_msgs +) + +catkin_package( + CATKIN_DEPENDS message_runtime +) + +file(GLOB ${PROJECT_NAME}_node_scripts ${PROJECT_SOURCE_DIR}/node_scripts/*) + +catkin_install_python( + PROGRAMS ${${PROJECT_NAME}_node_scripts} + DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) + +if (CATKIN_ENABLE_TESTING) + find_package(rostest REQUIRED) + + file(GLOB ${PROJECT_NAME}_test_node_scripts ${PROJECT_SOURCE_DIR}/tests/*.py) + catkin_install_python( + PROGRAMS ${${PROJECT_NAME}_test_node_scripts} + DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} + ) + + add_rostest(tests/sdp_v2_interface_rostest.test) +endif() diff --git a/smart_device_protocol/LICENSE b/smart_device_protocol/LICENSE new file mode 100644 index 000000000..29d7e1c6a --- /dev/null +++ b/smart_device_protocol/LICENSE @@ -0,0 +1,28 @@ +BSD 3-Clause License + +Copyright (c) 2023, Koki Shinjo + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/smart_device_protocol/README.md b/smart_device_protocol/README.md new file mode 100644 index 000000000..c80bf3a84 --- /dev/null +++ b/smart_device_protocol/README.md @@ -0,0 +1,196 @@ +

+ +

+ +
+ +[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +[![Black formatting](https://github.com/sktometometo/smart_device_protocol/actions/workflows/python_black.yml/badge.svg)](https://github.com/sktometometo/smart_device_protocol/actions/workflows/python_black.yml) +[![ROS build workflow](https://github.com/sktometometo/smart_device_protocol/actions/workflows/catkin_build.yml/badge.svg)](https://github.com/sktometometo/smart_device_protocol/actions/workflows/catkin_build.yml) +[![PlatformIO Build Workflow](https://github.com/sktometometo/smart_device_protocol/actions/workflows/platformio.yml/badge.svg)](https://github.com/sktometometo/smart_device_protocol/actions/workflows/platformio.yml) + +
+ +# smart_device_protocol + +The Smart Device Protocol (SDP) Repository. + +## What is this? + +Smart Device Protocol (SDP) is a protocol to communicate between smart devices, wearable devices, and robots. +SDP is based on [ESP-NOW](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/network/esp_now.html) protocol, which is a protocol to communicate between ESP32 devices. + +This package provides firmwares and ROS nodes to communicate with ESP32 devices via Smart Device Protocol. + +For more details of Smart Device Protocol, please see [Smart Device Protocol Document](./docs/sdp.md) + +## How to use + +### 0. Prerequisites + +This code is developed under environment below. Other environment is not tested. + +- Ubuntu 20.04 +- ROS Noetic +- Python 3.8 + +And you have to install `platformio` pip package to your environment. + + ```bash + pip3 install platformio + ``` + +### 1. Build ROS package + +First, clone this repository to your catkin workspace and build it. + + ```bash + cd ~/catkin_ws/src + git clone https://github.com/sktometometo/smart_device_protocol.git + cd .. + catkin build + ``` + +### 2. Make Smart Device Protocol interface device + +Second, you have to make an ESP32 device which is connected to your PC via USB. +This device will be the interface to Smart Device Protocol communication of your PC. +Basically, you can use any ESP32 device, but this package is tested with M5Stack-Fire, M5Stack-Core2, and M5Atom-S3. + +We will use [smart_device_protocol_interface](./sketchbooks/smart_device_protocol_interface) project. +This code is developed with [PlatformIO](https://platformio.org/). So you can build and burn firmware with it. + +You can execute `pio` command. + + ```bash + ~ $ pio + Usage: pio [OPTIONS] COMMAND [ARGS]... + + Options: + --version Show the version and exit. + -c, --caller TEXT Caller ID (service) + --no-ansi Do not print ANSI control characters + -h, --help Show this message and exit. + + Commands: + access Manage resource access + account Manage PlatformIO account + boards Board Explorer + check Static Code Analysis + ci Continuous Integration + debug Unified Debugger + device Device manager & Serial/Socket monitor + home GUI to manage PlatformIO + org Manage organizations + pkg Unified Package Manager + project Project Manager + remote Remote Development + run Run project targets (build, upload, clean, etc.) + settings Manage system settings + system Miscellaneous system commands + team Manage organization teams + test Unit Testing + upgrade Upgrade PlatformIO Core to the latest version + ``` + +Then, connect M5Stack-Core2 to your PC. You can check which port is connected to it by + + ```bash + ~ $ pio device list + /dev/ttyACM0 + ------------ + Hardware ID: USB VID:PID=1A86:55D4 SER=54BB013663 LOCATION=7-1:1.0 + Description: USB Single Serial + ``` + +So let's build firmware and burn it to M5Stack-Core2 + + ```bash + roscd smart_device_protocol/sketchbooks/smart_device_protocol_interface/ + pio run -e m5stack-core2 --target upload --upload-port /dev/ttyACM0 + ``` + +### 3. Make an example of Smart Device Protocol device + +In this tutorial, you will see your PC can communicate with ESP32 device via Smart Device Protocol. So you have to make another ESP32 Smart Device Protocol device. +We will use [sdp_example](./sketchbooks/sdp_example/). + +Connect M5Stack-Fire to your PC and burn firmware to it. + + ```bash + roscd smart_device_protocol/sketchbooks/sdp_example/ + pio run -e m5stack-fire --target upload --upload-port /dev/ttyACM0 + ``` + +### 4. Run Smart Device Protocol Interface Device + +After step 2, you can run Smart Device Protocol interface node. + + ```bash + roslaunch smart_device_protocol demo.launch port:=/dev/ttyACM0 + ``` + +with this, you can see topics below. + + ```bash + $ rostopic list + /diagnostics + /smart_device_protocol/recv + /smart_device_protocol/send + /rosout + /rosout_agg + ``` + +You can send a ESP-NOW (which is the bottom of Smart Device Protocol) packet directly by sending ROS a message to `/smart_device_protocol/send` topic. + + ```bash + rostopic pub -1 /smart_device_protocol/send smart_device_protocol/Packet "mac_address: [255, 255, 255, 255, 255, 255] + data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]" + ``` + +### 5. Run a ROS Node with Smart Device Protocol Interface + +Now you can communicate with smart devices, wearable devices, and robots via Smart Device Protocol. +You can run an example of Smart Device Protocol Interface node. + + ```bash + rosrun smart_device_protocol sdp_v2_packet_printer.py + ``` + +With this command, you can see Smart Device Protocol packets from other devices. + + ```bash + TODO + ``` + +You can also send Smart Device Protocol packets to other devices. + + ```bash + TODO + ``` + +## API for Smart Device Protocol + +### Python API (for ROS Node) + +You can use Smart Device Protocol API in Python for ROS Node. Please see [this document](./docs/python.md) for more details. + +### C++ API (for Arduino) + +You can use Smart Device Protocol API in C++ for Arduino. Please see (this document)[./arduino_lib/README.md] for more details. + +## Examples of Smart Device Protocol Interface Device + +There are some examples of Smart Device Protocol Interface Device. For more details, please see [this directory](./sketchbooks/). + +## Notices + +### Update of ros_lib for Arduino + +If you update ros_lib for Arduino, you have to update `ros_lib` directory in [this directory](./ros_lib/). + + ```bash + cd ~/catkin_ws/src/smart_device_protocol/ros_lib + rm -rf ros_lib + rosrun rosserial_arduino make_libraries.py . + ``` \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/ArduinoAtomS3Hardware.h b/smart_device_protocol/arduino_lib/ArduinoAtomS3Hardware.h new file mode 100644 index 000000000..de6c7136e --- /dev/null +++ b/smart_device_protocol/arduino_lib/ArduinoAtomS3Hardware.h @@ -0,0 +1,58 @@ +#include // Arduino 1.0 + +#define SERIAL_CLASS HWCDC + +class ArduinoHardware +{ +public: + ArduinoHardware(SERIAL_CLASS* io, long baud = 57600) + { + iostream = io; + baud_ = baud; + } + ArduinoHardware() + { + iostream = &Serial; + baud_ = 57600; + } + ArduinoHardware(ArduinoHardware& h) + { + this->iostream = h.iostream; + this->baud_ = h.baud_; + } + + void setBaud(long baud) + { + this->baud_ = baud; + } + + int getBaud() + { + return baud_; + } + + void init() + { + iostream->begin(baud_); + } + + int read() + { + return iostream->read(); + }; + void write(uint8_t* data, int length) + { + for (int i = 0; i < length; i++) + iostream->write(data[i]); + } + + unsigned long time() + { + return millis(); + } + +protected: + SERIAL_CLASS* iostream; + long baud_; +}; + diff --git a/smart_device_protocol/arduino_lib/README.md b/smart_device_protocol/arduino_lib/README.md new file mode 100644 index 000000000..984da88c1 --- /dev/null +++ b/smart_device_protocol/arduino_lib/README.md @@ -0,0 +1,9 @@ +# C++ API for Smart Device Protocol + +## Overview + +This is a C++ API for Smart Device Protocol. + +## How to use + +TBD \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/devices/stickv2_util.h b/smart_device_protocol/arduino_lib/devices/stickv2_util.h new file mode 100644 index 000000000..c18d78cd2 --- /dev/null +++ b/smart_device_protocol/arduino_lib/devices/stickv2_util.h @@ -0,0 +1,37 @@ +#ifndef STICKV2_UTIL_H +#define STICKV2_UTIL_H + +#include + +#include + +#define BUFSIZE 2048 + +bool send_data_to_serial(HardwareSerial &serial, StaticJsonDocument &doc) +{ + String request; + serializeJson(doc, request); + serial.println(request); + return true; +} + +bool read_data_from_serial(HardwareSerial &serial, StaticJsonDocument &doc) +{ + String response = serial.readStringUntil('\n'); + DeserializationError error = deserializeJson(doc, response); + if (error) + { + return false; + } + return true; +} + +bool set_object_recognition_model(HardwareSerial &serial, const String &model_path) +{ + StaticJsonDocument doc; + doc["function"] = "object_recognition"; + doc["args"][0] = model_path; + return send_data_to_serial(serial, doc); +} + +#endif \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/devices/uwb_module_util.h b/smart_device_protocol/arduino_lib/devices/uwb_module_util.h new file mode 100644 index 000000000..0b6d3a114 --- /dev/null +++ b/smart_device_protocol/arduino_lib/devices/uwb_module_util.h @@ -0,0 +1,132 @@ +#ifndef UWB_MODULE_UTIL_H +#define UWB_MODULE_UTIL_H + +#include +#include + +/** + * @brief Drivers for UWB module + * http://docs.m5stack.com/en/unit/uwb + */ + +std::optional readUWB(HardwareSerial& serial, int timeout); +String testUWB(HardwareSerial& serial); +bool resetUWB(HardwareSerial& serial); +bool initUWB(bool tag, int id, HardwareSerial& serial); + +std::optional readUWB(HardwareSerial& serial, int timeout = 1000) +{ + String DATA; + auto start = millis(); + while (timeout > millis() - start) + { + if (serial.available()) + { + DATA = serial.readStringUntil('\n'); + return DATA; + } + } + return std::nullopt; +} + +std::optional> getDistanceUWB(HardwareSerial& serial) +{ + std::optional ret = readUWB(serial); + if (ret) + { + auto data = *ret; + auto index = data.indexOf(':'); + if (index != -1) + { + auto id_str = data.substring(0, index); + id_str.replace(String("an"), String("")); + auto id = id_str.toInt(); + auto distance_str = data.substring(index + 1); + distance_str.replace(String("m"), String("")); + auto distance = distance_str.toFloat(); + return std::make_tuple(id, distance); + } + } + return std::nullopt; +} + +void clearReadUWB(HardwareSerial& serial, int timeout = 1000) +{ + auto start = millis(); + while (timeout > millis() - start) + { + if (serial.available()) + { + serial.readStringUntil('\n'); + } + } +} + +String testUWB(HardwareSerial& serial) +{ + serial.write("AT\r\n"); + delay(100); + auto ret = readUWB(serial); + if (ret) + { + return *ret; + } + else + { + return "No response"; + } +} + +bool resetUWB(HardwareSerial& serial) +{ + serial.write("AT+RST\r\n"); + delay(500); + auto ret = readUWB(serial); + clearReadUWB(serial); + if (ret) + { + return true; + } + else + { + return false; + } +} + +bool initUWB(bool tag, int id, HardwareSerial& serial) +{ + String DATA; + auto ret = resetUWB(serial); + if (!ret) + { + return false; + } + if (tag) + { + serial.printf("AT+anchor_tag=0\r\n", id); + delay(100); + readUWB(serial); + + resetUWB(serial); + + serial.write("AT+interval=1\r\n"); + delay(100); + readUWB(serial); + + serial.write("AT+switchdis=1\r\n"); + delay(100); + readUWB(serial); + } + else + { + serial.printf("AT+anchor_tag=1,%d\r\n", id); + delay(100); + readUWB(serial); + + resetUWB(serial); + } + + return true; +} + +#endif // UWB_MODULE_UTIL_H diff --git a/smart_device_protocol/arduino_lib/iot_com_util/Time.h b/smart_device_protocol/arduino_lib/iot_com_util/Time.h new file mode 100644 index 000000000..8fa632093 --- /dev/null +++ b/smart_device_protocol/arduino_lib/iot_com_util/Time.h @@ -0,0 +1,109 @@ +/** + The MIT License (MIT) + Copyright (c) 2017 kerikun11 + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + https://www.kerislab.jp/posts/2017-04-26-esp32-time/ +*/ + +#ifndef TIME_H +#define TIME_H + +#pragma once + +#include +#include +#include +#include +#include "esp32-hal-log.h" + +class Time; + +class Time +{ +public: + Time(char *time_zone = "JST-9") : time_zone(time_zone) {} + bool set_time(); + +private: + WiFiUDP udp; + const char *time_zone; + bool getNtpTime(struct timeval *tvp); +}; + +#define NTP_SERVER_IPADDRESS IPAddress(133, 243, 238, 164) +#define NTP_LOCAL_PORT 2390 +#define NTP_PACKET_SIZE 48 + +class Time Time; + +bool Time::set_time() +{ + udp.begin(NTP_LOCAL_PORT); + struct timeval tv; + if (!getNtpTime(&tv)) + { + return false; + } + struct timezone tz; + setenv("TZ", time_zone, 1); + tzset(); + tz.tz_minuteswest = 0; + tz.tz_dsttime = 0; + settimeofday(&tv, &tz); + time_t t = time(NULL); + log_d("Time: %s", ctime(&t)); + return true; +} + +bool Time::getNtpTime(struct timeval *tvp) +{ + while (udp.parsePacket() > 0) + { + delay(1); + } + log_i("Transmiting NTP Request..."); + byte packetBuffer[NTP_PACKET_SIZE]; + memset(packetBuffer, 0, NTP_PACKET_SIZE); + packetBuffer[0] = 0b11100011; // LI, Version, Mode + packetBuffer[1] = 0; // Stratum, or type of clock + packetBuffer[2] = 6; // Polling Interval + packetBuffer[3] = 0xEC; // Peer Clock Precision + // 8 bytes of zero for Root Delay & Root Dispersion + packetBuffer[12] = 49; + packetBuffer[13] = 0x4E; + packetBuffer[14] = 49; + packetBuffer[15] = 52; + udp.beginPacket(NTP_SERVER_IPADDRESS, 123); // NTP requests are to port 123 + udp.write(packetBuffer, NTP_PACKET_SIZE); + udp.endPacket(); + uint32_t time_stamp = millis(); + while (millis() - time_stamp < 1500) + { + int size = udp.parsePacket(); + if (size >= NTP_PACKET_SIZE) + { + log_i("Received NTP Response"); + udp.read(packetBuffer, NTP_PACKET_SIZE); + unsigned long secsSince1900, afterTheDecimalPoint; + secsSince1900 = (unsigned long)packetBuffer[40] << 24; + secsSince1900 |= (unsigned long)packetBuffer[41] << 16; + secsSince1900 |= (unsigned long)packetBuffer[42] << 8; + secsSince1900 |= (unsigned long)packetBuffer[43] << 0; + afterTheDecimalPoint = (unsigned long)packetBuffer[44] << 24; + afterTheDecimalPoint |= (unsigned long)packetBuffer[45] << 16; + afterTheDecimalPoint |= (unsigned long)packetBuffer[46] << 8; + afterTheDecimalPoint |= (unsigned long)packetBuffer[47] << 0; + tvp->tv_sec = secsSince1900 - 2208988800UL; + tvp->tv_usec = (float)afterTheDecimalPoint * 1000000 / (uint64_t)0x100000000; + log_d("%d,%d", tvp->tv_sec, tvp->tv_usec); + return true; + } + } + log_e("No NTP Response :-("); + return false; +} + +#endif \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/iot_com_util/iot_client_util.h b/smart_device_protocol/arduino_lib/iot_com_util/iot_client_util.h new file mode 100644 index 000000000..1f351d6ee --- /dev/null +++ b/smart_device_protocol/arduino_lib/iot_com_util/iot_client_util.h @@ -0,0 +1,77 @@ +#ifndef IOT_WIFI_UTIL_H +#define IOT_WIFI_UTIL_H + +#include +#include + +#include +#include + +#include "iot_com_util/Time.h" + +bool initWiFi(const char *ssid, const char *password, LGFX_Sprite &sprite, LGFX &lcd, WiFiMulti &WiFiMulti) +{ + WiFiMulti.addAP(ssid, password); + sprite.fillScreen(0xFFFFFF); + sprite.setCursor(0, 0); + sprite.printf("Waiting connect to WiFi: %s ...", ssid); + sprite.pushSprite(0, lcd.height() / 3); + int sum = 0; + while (WiFiMulti.run() != WL_CONNECTED) + { + sprite.print("."); + sprite.pushSprite(0, lcd.height() / 3); + delay(1000); + sum += 1; + if (sum == 5) + { + sprite.print("Conncet failed!"); + sprite.pushSprite(0, lcd.height() / 3); + return false; + } + } + + if (not Ping.ping("www.google.com")) + { + sprite.fillScreen(0xFFFFFF); + sprite.setCursor(0, 0); + sprite.print("Ping failed!"); + sprite.pushSprite(0, lcd.height() / 3); + return false; + } + sprite.fillScreen(0xFFFFFF); + sprite.println("WiFi connected"); + sprite.print("IP address: "); + sprite.println(WiFi.localIP()); + sprite.pushSprite(0, lcd.height() / 3); + Time.set_time(); + delay(500); + return true; +} + +void init_screen(LGFX &lcd, LGFX_Sprite &sprite_device_info, LGFX_Sprite &sprite_event_info) +{ + lcd.init(); + lcd.setRotation(1); + lcd.setBrightness(128); + lcd.setColorDepth(24); + lcd.fillScreen(0xFFFFFF); + sprite_device_info.createSprite(lcd.width(), lcd.height() / 3); + sprite_event_info.createSprite(lcd.width(), lcd.height() / 3 * 2); + sprite_device_info.fillScreen(0xFFFFFF); + sprite_event_info.fillScreen(0xFFFFFF); + sprite_device_info.setTextColor(0x000000); + sprite_event_info.setTextColor(0x000000); + sprite_device_info.setTextSize(1); + sprite_event_info.setTextSize(1); +} + +void show_device_info(const char *message, LGFX_Sprite &sprite, LGFX &lcd) +{ + sprite.fillScreen(0xFFFFFF); + sprite.setCursor(0, 0); + sprite.println(message); + sprite.pushSprite(0, lcd.height() / 3); +} + +#endif // IOT_WIFI_UTIL_H \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/iot_com_util/iot_host_util.h b/smart_device_protocol/arduino_lib/iot_com_util/iot_host_util.h new file mode 100644 index 000000000..5e5859aa7 --- /dev/null +++ b/smart_device_protocol/arduino_lib/iot_com_util/iot_host_util.h @@ -0,0 +1,35 @@ +#ifndef IOT_HOST_UTIL_H +#define IOT_HOST_UTIL_H + +#include + +String send_serial_command(String command, int timeout_duration = 5000) +{ + Serial2.print(command.c_str()); + auto timeout = millis() + timeout_duration; + while (millis() < timeout) + { + delay(100); + if (Serial2.available()) + { + return Serial2.readStringUntil('\n'); + } + } + return ""; +} + +void clear_recv_buf(int duration = 5000) +{ + auto timeout = millis() + duration; + while (millis() < timeout) + { + delay(100); + if (Serial2.available()) + { + Serial2.readStringUntil('\n'); + } + } + return; +} + +#endif // IOT_HOST_UTIL_H diff --git a/smart_device_protocol/arduino_lib/sdp/esp_now.h b/smart_device_protocol/arduino_lib/sdp/esp_now.h new file mode 100644 index 000000000..1b5b1093f --- /dev/null +++ b/smart_device_protocol/arduino_lib/sdp/esp_now.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include +#include + +#include + +bool init_esp_now(uint8_t *mac_address, esp_now_recv_cb_t callback_receive) +{ + // Read device mac address + esp_read_mac(mac_address, ESP_MAC_WIFI_STA); + + WiFi.mode(WIFI_STA); + WiFi.disconnect(); + if (esp_now_init() != ESP_OK) + { + return false; + } + if (callback_receive != NULL) + { + esp_now_register_recv_cb(callback_receive); + } + return true; +} \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/sdp/packet_creator.h b/smart_device_protocol/arduino_lib/sdp/packet_creator.h new file mode 100644 index 000000000..a3b9c81d0 --- /dev/null +++ b/smart_device_protocol/arduino_lib/sdp/packet_creator.h @@ -0,0 +1,132 @@ +#ifndef SMART_DEVICE_PROTOCOL_PACKET_CREATOR_H__ +#define SMART_DEVICE_PROTOCOL_PACKET_CREATOR_H__ + +#include +#include +#include + +#include + +#include "sdp/packet_util.h" + +void generate_meta_frame(uint8_t *packet, const char *device_name, const char *packet_description_01, + const char *serialization_format_01, const char *packet_description_02, + const char *serialization_format_02, const char *packet_description_03, + const char *serialization_format_03) +{ + *(uint16_t *)(packet + 0) = smart_device_protocol::Packet::PACKET_TYPE_META; + strncpy((char *)(packet + 2), device_name, 20); + strncpy((char *)(packet + 2 + 20), packet_description_01, 64); + strncpy((char *)(packet + 2 + 20 + 64), serialization_format_01, 10); + strncpy((char *)(packet + 2 + 20 + 64 + 10), packet_description_02, 64); + strncpy((char *)(packet + 2 + 20 + 64 + 10 + 64), serialization_format_02, 10); + strncpy((char *)(packet + 2 + 20 + 64 + 10 + 64 + 10), packet_description_03, 64); + strncpy((char *)(packet + 2 + 20 + 64 + 10 + 64 + 10 + 64), serialization_format_03, 10); +} + +bool generate_data_frame(uint8_t *packet, const char *packet_description, const char *serialization_format, + std::vector &data) +{ + if (not is_consistent_serialization_format(serialization_format, data)) + { + return false; + } + if (strlen(serialization_format) != std::vector(data).size()) + { + return false; + } + *(uint16_t *)(packet + 0) = smart_device_protocol::Packet::PACKET_TYPE_DATA; + strncpy((char *)(packet + 2), packet_description, 64); + strncpy((char *)(packet + 2 + 64), serialization_format, 10); + auto packet_data_p = packet + 2 + 64 + 10; + auto it = data.begin(); + int index_sf = 0; + while (it != data.end()) + { + std::string str; + switch (serialization_format[index_sf]) + { + case 'i': // std::holds_alternative(*it) + *(int32_t *)packet_data_p = std::get(*it); + packet_data_p += sizeof(int32_t); + break; + case 'f': // std::holds_alternative(*it) + *(float *)packet_data_p = std::get(*it); + packet_data_p += sizeof(float); + break; + case 'S': // std::holds_alternative(*it) + str = std::get(*it); + if (str.size() > 64) + { + str.resize(64); + } + for (int i = str.size(); i < 64; ++i) + { + *(char *)(packet_data_p + i) = '\0'; + } + strncpy((char *)packet_data_p, str.c_str(), 64); + packet_data_p += 64; + break; + case 's': // std::holds_alternative(*it) + str = std::get(*it); + if (str.size() > 16) + { + str.resize(64); + } + for (int i = str.size(); i < 16; ++i) + { + *(char *)(packet_data_p + i) = '\0'; + } + strncpy((char *)packet_data_p, str.c_str(), str.size()); + packet_data_p += 16; + break; + case '?': // std::holds_alternative(*it) + case 'b': + *(bool *)packet_data_p = std::get(*it); + packet_data_p += sizeof(bool); + break; + } + ++it; + ++index_sf; + } + return true; +} + +bool generate_data_frame(uint8_t *packet, const char *packet_description, + std::vector &data) +{ + std::string serialization_format = get_serialization_format(data); + return generate_data_frame(packet, packet_description, serialization_format.c_str(), data); +} + +/* Version 1 functions */ +void create_sensor_enviii_packet(uint8_t *packet, const char *module_name, int32_t pressure) +{ + *(uint16_t *)(packet + 0) = smart_device_protocol::Packet::PACKET_TYPE_SENSOR_ENV_III; + strncpy((char *)(packet + 2), module_name, 64); + *(int32_t *)(packet + 2 + 64) = pressure; +} + +void create_sensor_stickv2_packet(uint8_t *packet, uint32_t number_of_person, const char *place_name) +{ + *(uint16_t *)(packet + 0) = smart_device_protocol::Packet::PACKET_TYPE_SENSOR_UNITV2_PERSON_COUNTER; + *(uint32_t *)(packet + 2) = number_of_person; + strncpy((char *)(packet + 2 + 4), place_name, 64); +} + +void create_device_message_board_meta_packet(uint8_t *packet, const char *module_name) +{ + *(uint16_t *)(packet + 0) = smart_device_protocol::Packet::PACKET_TYPE_DEVICE_MESSAGE_BOARD_META; + strncpy((char *)(packet + 2), module_name, 64); +} + +void create_device_message_board_data_packet(uint8_t *packet, const char *source_name, uint64_t timeout_duration, + const char *message) +{ + *(uint16_t *)(packet + 0) = smart_device_protocol::Packet::PACKET_TYPE_DEVICE_MESSAGE_BOARD_DATA; + strncpy((char *)(packet + 2), source_name, 64); + *(uint64_t *)(packet + 2 + 64) = timeout_duration; + strncpy((char *)(packet + 2 + 64 + 8), message, 64); +} + +#endif // SMART_DEVICE_PROTOCOL_PACKET_CREATOR_H__ \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/sdp/packet_parser.h b/smart_device_protocol/arduino_lib/sdp/packet_parser.h new file mode 100644 index 000000000..4943e9969 --- /dev/null +++ b/smart_device_protocol/arduino_lib/sdp/packet_parser.h @@ -0,0 +1,119 @@ +#ifndef SMART_DEVICE_PROTOCOL_PACKET_PARSER_H__ +#define SMART_DEVICE_PROTOCOL_PACKET_PARSER_H__ + +#include +#include +#include +#include + +#include + +#include "sdp/packet_util.h" + +uint16_t get_packet_type(const uint8_t *packet) +{ + return *(uint16_t *)packet; +} + +SDPInterfaceDescription get_interface_definition(const uint8_t *packet) +{ + std::string packet_description = std::string((char *)(packet + 2), 64); + std::string serialization_format = std::string((char *)(packet + 2 + 64), 10); + packet_description.erase(std::find(packet_description.begin(), packet_description.end(), '\0'), packet_description.end()); + serialization_format.erase(std::find(serialization_format.begin(), serialization_format.end(), '\0'), serialization_format.end()); + return std::make_tuple(packet_description, serialization_format); +} + +std::tuple> parse_packet_as_meta_packet(const uint8_t *packet) +{ + std::string device_name; + std::vector packet_description_and_serialization_format; + device_name = std::string((char *)(packet + 2), 20); + for (int i = 0; i < 3; ++i) + { + std::string packet_description = std::string((char *)(packet + 2 + 20 + 74 * i), 64); + std::string serialization_format = std::string((char *)(packet + 2 + 20 + 74 * i + 64), 10); + // Remove '\0' characters from strings + packet_description.erase(std::find(packet_description.begin(), packet_description.end(), '\0'), packet_description.end()); + serialization_format.erase(std::find(serialization_format.begin(), serialization_format.end(), '\0'), serialization_format.end()); + packet_description_and_serialization_format.push_back(std::make_tuple(packet_description, serialization_format)); + } + return std::make_tuple(device_name, packet_description_and_serialization_format); +} + +std::tuple> parse_packet_as_data_packet(const uint8_t *packet) +{ + SDPInterfaceDescription packet_description_and_serialization_format = get_interface_definition(packet); + std::string serialization_format = std::get<1>(packet_description_and_serialization_format); + std::vector data; + auto packet_data_p = packet + 2 + 64 + 10; + for (int i = 0; i < serialization_format.size(); ++i) + { + if (serialization_format[i] == 'i') + { + data.push_back(SDPData(*(int32_t *)packet_data_p)); + packet_data_p += sizeof(int32_t); + } + else if (serialization_format[i] == 'f') + { + data.push_back(SDPData(*(float *)packet_data_p)); + packet_data_p += sizeof(float); + } + else if (serialization_format[i] == 'S') + { + std::string str = std::string((char *)packet_data_p, 64); + str.erase(std::find(str.begin(), str.end(), '\0'), str.end()); + SDPData str_sdp = str; + data.push_back(str_sdp); + packet_data_p += 64; + } + else if (serialization_format[i] == 's') + { + std::string str = std::string((char *)packet_data_p, 16); + str.erase(std::find(str.begin(), str.end(), '\0'), str.end()); + SDPData str_sdp = str; + data.push_back(str_sdp); + packet_data_p += 16; + } + else if (serialization_format[i] == '?' or serialization_format[i] == 'b') + { + data.push_back(SDPData(*(bool *)packet_data_p)); + packet_data_p += sizeof(bool); + } + } + return std::make_tuple(packet_description_and_serialization_format, data); +} + +/* Version 1 functions */ +void parse_packet_as_test_packet(const uint8_t *packet, uint16_t &packet_type, int32_t &num_int, float num_float, + char *str) +{ + packet_type = *(uint16_t *)packet; + num_int = *(int32_t *)(packet + 2); + num_float = *(float *)(packet + 2 + 4); + strncpy(str, (char *)(packet + 2 + 4 + 4), 64); +} + +void parse_packet_as_named_string_packet(const uint8_t *packet, uint16_t &packet_type, char *name, char *value) +{ + packet_type = *(uint16_t *)packet; + strncpy(name, (char *)(packet + 2), 64); + strncpy(value, (char *)(packet + 2 + 64), 64); +} + +void parse_packet_as_message_board_meta_packet(const uint8_t *packet, uint16_t &packet_type, char *module_name) +{ + packet_type = *(uint16_t *)packet; + strncpy(module_name, (char *)(packet + 2), 64); +} + +void parse_packet_as_message_board_data_packet(const uint8_t *packet, uint16_t &packet_type, char *source_name, + uint64_t &timeout_duration, char *message) +{ + packet_type = *(uint16_t *)packet; + strncpy(source_name, (char *)(packet + 2), 64); + timeout_duration = *(uint64_t *)(packet + 2 + 64); + strncpy(message, (char *)(packet + 2 + 64 + 8), 64); +} + +#endif // SMART_DEVICE_PROTOCOL_PACKET_PARSER_H__z \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/sdp/packet_util.h b/smart_device_protocol/arduino_lib/sdp/packet_util.h new file mode 100644 index 000000000..58c9f2147 --- /dev/null +++ b/smart_device_protocol/arduino_lib/sdp/packet_util.h @@ -0,0 +1,89 @@ +#ifndef SMART_DEVICE_PROTOCOL_PACKET_UTIL_H__ +#define SMART_DEVICE_PROTOCOL_PACKET_UTIL_H__ + +#include +#include + +typedef std::variant SDPData; +typedef std::tuple SDPInterfaceDescription; + +std::string get_serialization_format(const std::vector &data) +{ + std::string serialization_format; + for (auto itr = data.begin(); itr != data.end(); ++itr) + { + if (std::holds_alternative(*itr)) + { + serialization_format += "i"; + } + else if (std::holds_alternative(*itr)) + { + serialization_format += "f"; + } + else if (std::holds_alternative(*itr)) + { + if (std::get(*itr).size() > 16) + { + serialization_format += "S"; + } + else + { + serialization_format += "s"; + } + } + else if (std::holds_alternative(*itr)) + { + serialization_format += "?"; + } + } + return serialization_format; +} + +bool is_consistent_serialization_format(const std::string &serialization_format, const std::vector &data) +{ + if (serialization_format.size() != std::vector(data).size()) + { + return false; + } + auto itr = data.begin(); + int index_sf = 0; + while (itr != data.end()) + { + switch (serialization_format[index_sf]) + { + case 'i': + if (not std::holds_alternative(*itr)) + { + return false; + } + break; + case 'f': + if (not std::holds_alternative(*itr)) + { + return false; + } + break; + case 'S': + case 's': + if (not std::holds_alternative(*itr)) + { + return false; + } + break; + case '?': + case 'b': + if (not std::holds_alternative(*itr)) + { + return false; + } + break; + default: + return false; + } + itr++; + index_sf; + } + return true; +} + +#endif // SMART_DEVICE_PROTOCOL_PACKET_UTIL_H__ \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/sdp/sdp.h b/smart_device_protocol/arduino_lib/sdp/sdp.h new file mode 100644 index 000000000..6c542018c --- /dev/null +++ b/smart_device_protocol/arduino_lib/sdp/sdp.h @@ -0,0 +1,355 @@ +#pragma once + +/* + * SDP (Smart Device Protocol) Library + * + * To use these functions, you need to include the following libraries: + * - smart_device_protocol/Packet.h + */ + +#include +#include +#include + +#include + +#include "sdp/esp_now.h" +#include "sdp/packet_creator.h" +#include "sdp/packet_parser.h" + +typedef void (*sdp_data_if_recv_cb_t)(const uint8_t *mac_addr, const std::vector &body); +typedef void (*sdp_data_recv_cb_t)(const uint8_t *mac_addr, const SDPInterfaceDescription &interface_description, + const std::vector &body); +typedef void (*sdp_meta_recv_cb_t)(const uint8_t *mac_addr, const std::string &device_name, + const std::vector &interfaces); +typedef std::tuple SDPInterfaceCallbackEntry; + +// Internal variables +inline String _sdp_device_name; +inline std::vector _sdp_interface_data_callbacks; +inline std::vector _sdp_data_callbacks; +inline std::vector _sdp_meta_callbacks; +inline std::vector _esp_now_recv_callbacks; + +// Internal variables for get_sdp_interfaces() +// Each element stands for mac_addr, device_name, interfaces +inline std::vector>> _vector_device_interfaces; + +// Function declarations +bool _broadcast_sdp_meta_packet(const SDPInterfaceDescription &packet_description_and_serialization_format); +void _meta_frame_broadcast_task(void *parameter); +void _OnDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len); +void _get_device_interfaces_callback(const uint8_t *mac_addr, const std::string &device_name, + const std::vector &interfaces); +esp_err_t send_sdp_esp_now_packet(const uint8_t *peer_addr, uint8_t *data, int data_len); +esp_err_t broadcast_sdp_esp_now_packet(uint8_t *data, int data_len); + +std::string _convert_mac_address(const uint8_t *mac_addr) +{ + if (mac_addr == NULL) + { + return ""; + } + else + { + String addr = String(mac_addr[0], 16) + ":" + + String(mac_addr[1], 16) + ":" + + String(mac_addr[2], 16) + ":" + + String(mac_addr[3], 16) + ":" + + String(mac_addr[4], 16) + ":" + + String(mac_addr[5], 16); + return addr.c_str(); + } +} + +void _OnDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len) +{ + uint8_t packet_type = get_packet_type(data); + for (auto &entry : _esp_now_recv_callbacks) + { + entry(mac_addr, data, data_len); + } + if (packet_type == smart_device_protocol::Packet::PACKET_TYPE_DATA) + { + auto packet = parse_packet_as_data_packet(data); + SDPInterfaceDescription packet_description_and_serialization_format = std::get<0>(packet); + std::string packet_description = std::get<0>(packet_description_and_serialization_format); + std::string serialization_format = std::get<1>(packet_description_and_serialization_format); + std::vector body = std::get<1>(packet); + + for (auto &entry : _sdp_data_callbacks) + { + entry(mac_addr, packet_description_and_serialization_format, body); + } + + for (auto &entry : _sdp_interface_data_callbacks) + { + if (packet_description == std::get<0>(std::get<0>(entry)) and + serialization_format == std::get<1>(std::get<0>(entry))) + { + std::get<1>(entry)(mac_addr, body); + } + } + } + else if (packet_type == smart_device_protocol::Packet::PACKET_TYPE_META) + { + auto packet = parse_packet_as_meta_packet(data); + std::string device_name = std::get<0>(packet); + std::vector interfaces = std::get<1>(packet); + + for (auto &entry : _sdp_meta_callbacks) + { + entry(mac_addr, device_name, interfaces); + } + } +} + +bool _broadcast_sdp_meta_packet(const SDPInterfaceDescription &packet_description_and_serialization_format) +{ + uint8_t buf[245]; + const std::string &packet_description = std::get<0>(packet_description_and_serialization_format); + const std::string &serialization_format = std::get<1>(packet_description_and_serialization_format); + generate_meta_frame(buf, _sdp_device_name.c_str(), packet_description.c_str(), serialization_format.c_str(), "", "", + "", ""); + bool success = broadcast_sdp_esp_now_packet(buf, sizeof(buf)) == ESP_OK; + return success; +} + +void _meta_frame_broadcast_task(void *parameter) +{ + for (;;) + { + vTaskDelay(pdMS_TO_TICKS(1000)); + for (auto &entry : _sdp_interface_data_callbacks) + { + const SDPInterfaceDescription &packet_description_and_serialization_format = std::get<0>(entry); + _broadcast_sdp_meta_packet(packet_description_and_serialization_format); + } + if (_sdp_interface_data_callbacks.size() == 0) + { + _broadcast_sdp_meta_packet(std::make_tuple("", "")); + } + } +} + +bool init_sdp(uint8_t *mac_address, const String &device_name) +{ + if (mac_address != NULL) + { + esp_read_mac(mac_address, ESP_MAC_WIFI_STA); + } + _sdp_device_name = device_name; + WiFi.mode(WIFI_STA); + WiFi.disconnect(); + if (not esp_now_init() == ESP_OK) + { + return false; + } + xTaskCreate(_meta_frame_broadcast_task, "meta_frame_broadcast_task", 16384, NULL, 1, NULL); + esp_now_register_recv_cb(_OnDataRecv); + return true; +} + +bool register_sdp_interface_callback(SDPInterfaceDescription packet_description_and_serialization_format, + sdp_data_if_recv_cb_t callback) +{ + // Check if the callback is already registered + for (auto &entry : _sdp_interface_data_callbacks) + { + if (std::get<0>(std::get<0>(entry)) == std::get<0>(packet_description_and_serialization_format) and + std::get<1>(std::get<0>(entry)) == std::get<1>(packet_description_and_serialization_format)) + { + return false; + } + } + _sdp_interface_data_callbacks.push_back(std::make_tuple(packet_description_and_serialization_format, callback)); + return true; +} + +bool unregister_sdp_interface_callback(SDPInterfaceDescription packet_description_and_serialization_format) +{ + for (auto it = _sdp_interface_data_callbacks.begin(); it != _sdp_interface_data_callbacks.end(); ++it) + { + if (std::get<0>(std::get<0>(*it)) == std::get<0>(packet_description_and_serialization_format) and + std::get<1>(std::get<0>(*it)) == std::get<1>(packet_description_and_serialization_format)) + { + _sdp_interface_data_callbacks.erase(it); + return true; + } + } + return false; +} + +bool register_sdp_data_callback(sdp_data_recv_cb_t callback) +{ + _sdp_data_callbacks.push_back(callback); + return true; +} + +bool unregister_sdp_data_callback(sdp_data_recv_cb_t callback) +{ + for (auto it = _sdp_data_callbacks.begin(); it != _sdp_data_callbacks.end(); ++it) + { + if (*it == callback) + { + _sdp_data_callbacks.erase(it); + return true; + } + } + return false; +} + +bool register_sdp_meta_callback(sdp_meta_recv_cb_t callback) +{ + _sdp_meta_callbacks.push_back(callback); + return true; +} + +bool unregister_sdp_meta_callback(sdp_meta_recv_cb_t callback) +{ + for (auto it = _sdp_meta_callbacks.begin(); it != _sdp_meta_callbacks.end(); ++it) + { + if (*it == callback) + { + _sdp_meta_callbacks.erase(it); + return true; + } + } + return false; +} + +bool register_sdp_esp_now_recv_callback(esp_now_recv_cb_t callback) +{ + _esp_now_recv_callbacks.push_back(callback); + return true; +} + +bool unregister_sdp_esp_now_recv_callback(esp_now_recv_cb_t callback) +{ + for (auto it = _esp_now_recv_callbacks.begin(); it != _esp_now_recv_callbacks.end(); ++it) + { + if (*it == callback) + { + _esp_now_recv_callbacks.erase(it); + return true; + } + } + return false; +} + +bool send_sdp_data_packet(std::string &packet_description, std::vector &body) +{ + uint8_t buf[240]; + bool ret = generate_data_frame(buf, packet_description.c_str(), body); + if (not ret) + { + return false; + } + else + { + return broadcast_sdp_esp_now_packet(buf, sizeof(buf)) == ESP_OK; + } +} + +bool send_sdp_data_packet(const SDPInterfaceDescription &interface_description, std::vector &body) +{ + uint8_t buf[240]; + const std::string &packet_description = std::get<0>(interface_description); + const std::string &serialization_format = std::get<1>(interface_description); + bool ret = generate_data_frame(buf, packet_description.c_str(), serialization_format.c_str(), body); + if (not ret) + { + return false; + } + else + { + return broadcast_sdp_esp_now_packet(buf, sizeof(buf)) == ESP_OK; + } +} + +esp_err_t send_sdp_esp_now_packet(const uint8_t *peer_addr, uint8_t *data, int data_len) +{ + esp_now_peer_info_t peer_info; + memset(&peer_info, 0, sizeof(peer_info)); + for (int i = 0; i < 6; i++) + { + peer_info.peer_addr[i] = peer_addr[i]; + } + esp_err_t addStatus = esp_now_add_peer(&peer_info); + if (addStatus != ESP_OK) + { + return addStatus; + } + bool success = esp_now_send(peer_addr, data, data_len) == ESP_OK; + esp_now_del_peer(peer_addr); + return success; +} + +esp_err_t broadcast_sdp_esp_now_packet(uint8_t *data, int data_len) +{ + const uint8_t broadcast_address[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + return send_sdp_esp_now_packet(broadcast_address, data, data_len); +} + +// Retrive device interfaces from meta package for given duration +const std::vector>> &get_sdp_interfaces(unsigned long duration = 3000) +{ + _vector_device_interfaces.clear(); + unsigned long start_time = millis(); + register_sdp_meta_callback(_get_device_interfaces_callback); + while (millis() - start_time < duration) + { + vTaskDelay(pdMS_TO_TICKS(100)); + } + unregister_sdp_meta_callback(_get_device_interfaces_callback); + return _vector_device_interfaces; +} + +// Call back function for get_device_interfaces() to store MetaFrame +void _get_device_interfaces_callback(const uint8_t *mac_addr, const std::string &device_name, + const std::vector &interfaces) +{ + std::string address = _convert_mac_address(mac_addr); + + // if _vector_device_interfaces has not entry for address, add interfaces to it + for (auto &entry : _vector_device_interfaces) + { + if (std::get<0>(entry) == address) + { + for (auto &interface : interfaces) + { + // Add only if interface is not empty + if (std::get<0>(interface).size() > 0 and std::get<1>(interface).size() > 0) + { + // Add only there is no same interface + bool ok = true; + for (auto &original_interface : std::get<2>(entry)) + { + if (std::get<0>(original_interface) == std::get<0>(interface) and + std::get<1>(original_interface) == std::get<1>(interface)) + { + ok = false; + break; + } + } + if (ok) + { + std::get<2>(entry).push_back(interface); + } + } + } + return; + } + } + // add interface which is not empty + std::vector valid_interfaces; + for (auto &interface : interfaces) + { + if (std::get<0>(interface).size() > 0 and std::get<1>(interface).size() > 0) + { + valid_interfaces.push_back(std::make_tuple(std::get<0>(interface), std::get<1>(interface))); + } + } + _vector_device_interfaces.push_back(std::make_tuple(address, device_name, valid_interfaces)); + return; +} diff --git a/smart_device_protocol/arduino_lib/sdp/sdp_util.h b/smart_device_protocol/arduino_lib/sdp/sdp_util.h new file mode 100644 index 000000000..4789923eb --- /dev/null +++ b/smart_device_protocol/arduino_lib/sdp/sdp_util.h @@ -0,0 +1,6 @@ +#ifndef SMART_DEVICE_PROTOCOL_SDP_UTIL_H +#define SMART_DEVICE_PROTOCOL_SDP_UTIL_H + +#include "sdp/sdp.h" + +#endif // SMART_DEVICE_PROTOCOL_SDP_UTIL_H diff --git a/smart_device_protocol/arduino_lib/utils/config_loader.h b/smart_device_protocol/arduino_lib/utils/config_loader.h new file mode 100644 index 000000000..2f43aa783 --- /dev/null +++ b/smart_device_protocol/arduino_lib/utils/config_loader.h @@ -0,0 +1,28 @@ +#ifndef SMART_DEVICE_PROTOCOL_CONFIG_LOADER_H +#define SMART_DEVICE_PROTOCOL_CONFIG_LOADER_H + +#include +#include + +template +bool load_json_from_FS(fs::FS &fs, const String &filename, StaticJsonDocument &doc) +{ + auto file = fs.open(filename.c_str()); + if (!file) + { + Serial.printf("Failed to open config file from %s\n", filename.c_str()); + file.close(); + return false; + } + DeserializationError error = deserializeJson(doc, file.readString()); + if (error) + { + Serial.println("Failed to parse config file"); + file.close(); + return false; + } + file.close(); + return true; +} + +#endif // SMART_DEVICE_PROTOCOL_CONFIG_LOADER_H \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/utils/ros_util.h b/smart_device_protocol/arduino_lib/utils/ros_util.h new file mode 100644 index 000000000..e69de29bb diff --git a/smart_device_protocol/arduino_lib/web_services/sesami_util.h b/smart_device_protocol/arduino_lib/web_services/sesami_util.h new file mode 100644 index 000000000..b7852e442 --- /dev/null +++ b/smart_device_protocol/arduino_lib/web_services/sesami_util.h @@ -0,0 +1,182 @@ +#ifndef SESAMI_UTIL_H +#define SESAMI_UTIL_H + +#include +#include +#include +#include + +#include +#include + +#include + +#include + +String generateRandomTag(String secret_key, uint32_t date_sec); + +std::optional operation_sesami(String device_uuid, String api_key, int command, String secret_key); + +std::optional get_sesami_status(String device_uuid, String api_key); + +std::optional get_sesami_history(String device_uuid, String api_key); + +String generateRandomTag(String secret_key, uint32_t date_sec) +{ + AESTiny128 aes128; + AES_CMAC cmac(aes128); + + uint8_t dateBytes[3]; + dateBytes[0] = (date_sec >> 8) & 0xFF; + dateBytes[1] = (date_sec >> 16) & 0xFF; + dateBytes[2] = (date_sec >> 24) & 0xFF; + + uint8_t key[16]; + for (int i = 0; i < 16; i++) + { + key[i] = 0; + if (secret_key[2 * i] >= '0' and secret_key[2 * i] <= '9') + { + key[i] += (secret_key[2 * i] - '0') << 4; + } + else if (secret_key[2 * i] >= 'a' and secret_key[2 * i] <= 'f') + { + key[i] += (secret_key[2 * i] - 'a' + 10) << 4; + } + else if (secret_key[2 * i] >= 'A' and secret_key[2 * i] <= 'F') + { + key[i] += (secret_key[2 * i] - 'A' + 10) << 4; + } + else + { + USBSerial.printf("secret_key[%d]: %c\n", 2 * i, secret_key[2 * i]); + USBSerial.println("secret_key error!"); + } + + if (secret_key[2 * i + 1] >= '0' and secret_key[2 * i + 1] <= '9') + { + key[i] += (secret_key[2 * i + 1] - '0'); + } + else if (secret_key[2 * i + 1] >= 'a' and secret_key[2 * i + 1] <= 'f') + { + key[i] += (secret_key[2 * i + 1] - 'a' + 10); + } + else if (secret_key[2 * i + 1] >= 'A' and secret_key[2 * i + 1] <= 'F') + { + key[i] += (secret_key[2 * i + 1] - 'A' + 10); + } + else + { + USBSerial.printf("secret_key[%d]: %c\n", 2 * i + 1, secret_key[2 * i + 1]); + USBSerial.println("secret_key error!"); + } + } + + uint8_t output[16]; + + cmac.generateMAC(output, key, dateBytes, sizeof(dateBytes)); + + char outputHex[32]; + for (int i = 0; i < 16; i++) + { + sprintf(outputHex + (i * 2), "%02x", output[i]); + } + return String(outputHex); +} + +std::optional operation_sesami(String device_uuid, String api_key, int command, String secret_key) +{ + uint32_t date_sec = time(nullptr); + String sign = generateRandomTag(secret_key, date_sec); + String history = "test02"; + String base64History = base64::encode(history); + String body = String("{\"cmd\":") + command + String(",\"sign\":\"") + sign + String("\",\"history\":\"") + + base64History + String("\"}"); + String url = String("https://app.candyhouse.co/api/sesame2/") + device_uuid + String("/cmd"); + + HTTPClient http; + + if (!http.begin(url)) + { + return std::nullopt; + } + + USBSerial.println("=== HTTPClient begin! ==="); + USBSerial.printf("URL: %s\n", url.c_str()); + USBSerial.printf("date: %d\n", date_sec); + USBSerial.printf("sign: %s\n", sign.c_str()); + USBSerial.printf("request body: %s\n", body.c_str()); + http.addHeader("Content-Type", "application/json"); + http.addHeader("x-api-key", api_key); + int responseCode = http.POST(body); + String result_body = http.getString(); + http.end(); + USBSerial.printf("** POST result **\n"); + USBSerial.printf("responseCode: %d\n", responseCode); + USBSerial.println("result_body: " + result_body); + + if (responseCode != 200) + { + return std::nullopt; + } + else + { + body.replace("\\\"", "\""); + USBSerial.println("body: " + result_body); + return result_body; + } +} + +std::optional get_sesami_status(String device_uuid, String api_key) +{ + HTTPClient http; + + String url = String("https://app.candyhouse.co/api/sesame2/") + device_uuid; + + if (!http.begin(url)) + { + return std::nullopt; + } + + USBSerial.println("=== HTTPClient begin! ==="); + USBSerial.printf("URL: %s\n", url.c_str()); + http.addHeader("Content-Type", "application/json"); + http.addHeader("x-api-key", api_key); + int responseCode = http.GET(); + String body = http.getString(); + USBSerial.printf("** GET status result **\n"); + USBSerial.printf("responseCode: %d\n", responseCode); + body.replace("\\\"", "\""); + USBSerial.println("body: " + body); + http.end(); + + return body; +} + +std::optional get_sesami_history(String device_uuid, String api_key) +{ + HTTPClient http; + + String url = String("https://app.candyhouse.co/api/sesame2/") + device_uuid + String("/history?page=0&lg=5"); + + if (!http.begin(url)) + { + return std::nullopt; + } + + USBSerial.println("=== HTTPClient begin! ==="); + USBSerial.printf("URL: %s\n", url.c_str()); + http.addHeader("Content-Type", "application/json"); + http.addHeader("x-api-key", api_key); + int responseCode = http.GET(); + String body = http.getString(); + USBSerial.printf("** GET history result **\n"); + USBSerial.printf("responseCode: %d\n", responseCode); + body.replace("\\\"", "\""); + USBSerial.println("body: " + body); + http.end(); + + return body; +} + +#endif // SESAMI_UTIL_H \ No newline at end of file diff --git a/smart_device_protocol/arduino_lib/web_services/switchbot_util.h b/smart_device_protocol/arduino_lib/web_services/switchbot_util.h new file mode 100644 index 000000000..5cc41e5f8 --- /dev/null +++ b/smart_device_protocol/arduino_lib/web_services/switchbot_util.h @@ -0,0 +1,147 @@ +#ifndef SWITCHBOT_UTIL_H +#define SWITCHBOT_UTIL_H + +#include +#include + +#include + +#include + +#include + +// Copied from https://qiita.com/poruruba/items/2ba3f1ff3e3045ce26c1 +void hmac_sha256(const char *p_key, const char *p_payload, unsigned char *p_hmacResult) +{ + mbedtls_md_context_t ctx; + mbedtls_md_type_t md_type = MBEDTLS_MD_SHA256; + mbedtls_md_init(&ctx); + mbedtls_md_setup(&ctx, mbedtls_md_info_from_type(md_type), 1); + mbedtls_md_hmac_starts(&ctx, (const unsigned char *)p_key, strlen(p_key)); + mbedtls_md_hmac_update(&ctx, (const unsigned char *)p_payload, strlen(p_payload)); + mbedtls_md_hmac_finish(&ctx, p_hmacResult); // 32 bytes + mbedtls_md_free(&ctx); +} + +std::tuple make_switchbot_sign(String &token, String &secret) +{ + String nonce = ""; + uint32_t t = (uint32_t)std::time(nullptr); + String t_str = String(t) + "000"; + String sign_str = token + t_str + nonce; + unsigned char hmacResult[32]; + hmac_sha256(secret.c_str(), sign_str.c_str(), hmacResult); + String sign = base64::encode(hmacResult, 32); + return std::make_tuple(sign, t_str, nonce); +} + +std::optional get_device_list(String &token, String &secret) +{ + HTTPClient http; + String url = "https://api.switch-bot.com/v1.1/devices"; + String sign, t, nonce; + std::tie(sign, t, nonce) = make_switchbot_sign(token, secret); + if (!http.begin(url)) + { + USBSerial.println("http.begin() failed"); + return std::nullopt; + } + http.addHeader("Content-Type", "application/json"); + http.addHeader("Authorization", token); + http.addHeader("sign", sign); + http.addHeader("t", t); + http.addHeader("nonce", nonce); + int responseCode = http.GET(); + String result_body = http.getString(); + http.end(); + + USBSerial.printf("** GET result **\n"); + USBSerial.printf("responseCode: %d\n", responseCode); + USBSerial.println("body: " + result_body); + + if (responseCode != 200) + { + return std::nullopt; + } + else + { + return result_body; + } +} + +std::optional get_device_status(String &token, String &secret, String &device_id) +{ + HTTPClient http; + String url = "https://api.switch-bot.com/v1.1/devices/" + device_id + "/status"; + String sign, t, nonce; + std::tie(sign, t, nonce) = make_switchbot_sign(token, secret); + if (!http.begin(url)) + { + USBSerial.println("http.begin() failed"); + return std::nullopt; + } + http.addHeader("Content-Type", "application/json"); + http.addHeader("Authorization", token); + http.addHeader("sign", sign); + http.addHeader("t", t); + http.addHeader("nonce", nonce); + int responseCode = http.GET(); + String result_body = http.getString(); + http.end(); + + USBSerial.printf("** GET result **\n"); + USBSerial.printf("responseCode: %d\n", responseCode); + USBSerial.println("body: " + result_body); + if (responseCode != 200) + { + return std::nullopt; + } + else + { + return result_body; + } +} + +std::optional send_device_command( + String &token, + String &secret, + String &device_id, + String &command_type, + String &command) +{ + HTTPClient http; + String url = "https://api.switch-bot.com/v1.1/devices/" + device_id + "/commands"; + String sign, t, nonce; + std::tie(sign, t, nonce) = make_switchbot_sign(token, secret); + if (!http.begin(url)) + { + USBSerial.println("http.begin() failed"); + return std::nullopt; + } + http.addHeader("Authorization", token); + http.addHeader("sign", sign); + http.addHeader("t", t); + http.addHeader("nonce", nonce); + String body = "{"; + body = body + "\"command\":\"" + command + "\","; + body = body + "\"commandType\":\"" + command_type + "\","; + body = body + "\"parameter\":\"" + "default" + "\""; + body = body + "}"; + int responseCode = http.POST(body); + String result_body = http.getString(); + http.end(); + + USBSerial.printf("** POST result **\n"); + USBSerial.printf("responseCode: %d\n", responseCode); + USBSerial.println("body: " + result_body); + if (responseCode != 200) + { + return std::nullopt; + } + else + { + return result_body; + } +} + +#endif // SWITCHBOT_UTIL_H \ No newline at end of file diff --git a/smart_device_protocol/config/smart_device_protocol_interface.yaml b/smart_device_protocol/config/smart_device_protocol_interface.yaml new file mode 100644 index 000000000..772f2be66 --- /dev/null +++ b/smart_device_protocol/config/smart_device_protocol_interface.yaml @@ -0,0 +1,8 @@ +- smart_device_protocol: + description: sample + format_specifier: "S" + ros: + subtopic: "sample" + msg_type: "std_msgs/String" + input_conversion: "rostype(data=d[0])" + output_conversion: "[m.data]" \ No newline at end of file diff --git a/smart_device_protocol/docs/README_old.md b/smart_device_protocol/docs/README_old.md new file mode 100644 index 000000000..92347ed31 --- /dev/null +++ b/smart_device_protocol/docs/README_old.md @@ -0,0 +1,78 @@ +# old readme for SMART_DEVICE_PROTOCOL + +## Packet Specification + +### System packet + +#### Test Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | Integer number = -120 (4 byte signed int LSB) | Float number -1.0 (4 byte float LSB) | String (Hello, world!) (64 bytes String) | +|-|-|-|-| + +### Named value packet + +#### Named String Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | Name (64 byte string) | Value (64 bytes String) | +|-|-|-| + +#### Named Int Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | Name (64 byte string) | Value (4 bytes signed int LSB) | +|-|-|-| + +#### Named Float Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | Name (64 byte string) | Value (4 bytes float LSB) | +|-|-|-| + +### Sensor modules + +#### ENV III Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | MODULE_NAME (64 byte String) | PRESSURE (4 byte signed int LSB) | +|-|-|-| + +#### UNITV2 Person Counter Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | NUMBER OF PERSON (4 byte unsigned int LSB) | PLACE_NAME (64 byte String) | +|-|-|-| + +#### IMU Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | MODULE_NAME (64 byte String) | Accel_X, Y, Z (4 byte float LSB x 3) | +|-|-|-| + +### Task packet + +#### Emergency Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | MAP_FRAME (64 byte String) | POS_X, Y, Z (4 byte float LSB x 3) | ROT_X, Y, Z, W (4byte float LSB x 4) | +|-|-|-|-| + +#### Task Dispatcher Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | Caller name (16 byte String) | Target name (16 byte String) | Task name (16 byte String) | Task Args (String) | +|-|-|-|-|-| + +#### Task Received Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | Worker name (16 byte String) | Caller name (16 byte String) | Task name (16 byte String) | +|-|-|-|-| + +#### Task Result Packet + +| PACKET_TYPE (2 byte unsigned int LSB) | Worker name (16 byte String) | Caller name (16 byte String) | Task name (16 byte String) | Result (String) | +|-|-|-|-|-| + +### Device Packet + +#### Device message board meta packet + +| PACKET_TYPE (2 byte unsigned int LSB) | device name (64 byte String) | +|-|-| + +#### Device message board data packet + +| PACKET_TYPE (2 byte unsigned int LSB) | source name (64 byte String) | timeout duration (msec) (8 byte unsigned int LSB) | message name (64 byte String) | +|-|-|-|-| diff --git a/smart_device_protocol/docs/python.md b/smart_device_protocol/docs/python.md new file mode 100644 index 000000000..6b5cf5a9f --- /dev/null +++ b/smart_device_protocol/docs/python.md @@ -0,0 +1,9 @@ +# Python API for Smart Device Protocol + +## Overview + +This is a Python API for Smart Device Protocol. + +## How to use + +TBD \ No newline at end of file diff --git a/smart_device_protocol/docs/sdp.md b/smart_device_protocol/docs/sdp.md new file mode 100644 index 000000000..de8fc4069 --- /dev/null +++ b/smart_device_protocol/docs/sdp.md @@ -0,0 +1,3 @@ +# Smart Device Protocol + +TBD \ No newline at end of file diff --git a/smart_device_protocol/docs/sdp_logo_v1.png b/smart_device_protocol/docs/sdp_logo_v1.png new file mode 100644 index 0000000000000000000000000000000000000000..7521b0ee683d6bf2e4083e2e71f44b76aeed8e22 GIT binary patch literal 93033 zcmYhj2Ut^Q`#*kg;iy=vMJ%h%HC@&htF?{M?`WeonY?!qj;E+V9pP z2(te7-+n!XAZuL_WX0{(tKbvOKer{q|E=&j^1H=q_z7Np<~sa)jpuJxJ_w?|o%o;3 z#Z*H-_;9Q5QA=NQk8{5M4&G-Ge}8{K@)s>=C{15afI0_g@cNTud11 z^e@bu4qjXwxZmY;^VRxiUp?C7c75NYV;i=eG+KT5(PM?OvDv?mOdY%O>*^b;fB5x= z`m4(y=r>Ijj&0yfdWVK}%pP*u=~VYq&}ie&(N)aOX6xd*F@f#uP|gUmd}K1n2+@3* zgvnqF*bAykfu5Z8^o;xNMw@_+6UvsuPd`cMw6d^**wNPFHkaLtL5lfPKI$KM_?vap zZCf$1O>pojraSWwrXSOq*)QK+AZ{e3kplW=&FrQZV$e;nH%8Rkgo3Y+^hawxXvBaQSH3g`dyZm9>Rf z?mJhlL%!OuCo-XmYLAu)J{|mTf#2oIox-{HybM-R#$QF^!aqcJ>gd;YIG#*+ZPC&3 zX{x5CH+oh7vM-O{Q(VhN#{0angXkbn&#qW-EN}9k6KZ+A>_6G|=?3=7IiIG6Z$JER z^K-XgbJw;4ft~rb@isSgCl$SYn_VL|aT}Qn-wf=;f5WaCjA5KI1B>#?5zEHAn3H?@>!x5Mt1!8^4xVo)Cath`are!S8Li?V7VNzd!DR zz5IUyP-8%VHWE)@#T3O>4O$f6`f7zw&tqJKRiPUws_yX(Yre>;83*R3Ho9X>l&wu} zC^>5Gu*p)n8#Oo)!gpRfP{qx;_J0Dj90LJ#-A6gq_Y1i0^v=RIpYuOhs;6niYH5?- z&M}yk|Ni=)3AP*oz1rR49|W|=_V#0TMw?`8NZB)|M4KD@GnJ|~kXL+pk`E8QtsJIy zKF&x8uwb598?R~B;AWk;kc5|#k2aVeTlJs*cjG{*X=Uq9hrU8L=D#h6gg=wgoUhIV zas3Zuo-%Yg{{tdlk!(>MEhodjrbXRl`+PFtWMb&XZl6;kGR4N{59Y+mg@Oj2sZBtr zx5#DEhqj=Eu#S4hamaQEuPldaUN9EaIPyp~)b?YruPER`;^JIhL;3vhn^?8X;Kl0p zduv!LIs7$h#id*u3xC(2o$Y*Fl^Dv2mZilrld-*pPrQ(O=4sT~n;^gyQ;(njZ2H`` zP|^@KHkiwaJjedyL0aaV_AagY5d+7_fi!LUMcuP~)74up${~FDB)Wd6?`q^)i*J@7 zW3?dTfFR?%K>YF_@<2ZO&t&$WkJt_2W-UEqkF}B;lRA!e2d@!+zm_fBN6Ho0Fb8mI zkx=fqL3jVB{#mvuOXlsPA6=KJmBp~t?0aD*kZjueX{!3FUU%V0h78M! z$V}^YU!R_8H+8S1k{4coh;#<;+An&EriVCH>)P+i2<1+-thoC^!u})P9}NxllxIvN zw&jxMGch)IH0suJ;aBD@D;PGena_*zE)PVbs?_e<1Dg>`Ux<^s@J(FRyy*nVWyn9( zutM*ICz#`PhqFemy09)oz%~&b#oGi=g5&ZJ0Zsv@sWS-;G+ROFGoz|OB z#KhrGWq4b!k{MmYl+GstGiLLJ@+V%b9pm$ySaEiC7bS7OmK?Gij@Hy@a2-FI?cqKa zEE+4__z+>-_{nvd@aXK}0S!-;pi8}V@R{GW%AK0g6Fm2Bi`OMKOd*IxnNJUNlW1UJ z=RWNeK0N`}JDKpR3E)Y~?YpV!zbp`bA><=tz|}RrZn_UQ!3Jn5<@ea%T-ply)J1l- z*}g6@Zc1F9GhB?J>>9ReecNHyQ9{?JQzzLPmqX6>O`Vc-W39`5WP~N)JyxDiFt~LK zDeV4ui*3R3Rp7C6of1@*GMTA<@X$J8)YLHmRtgrjzG0aVC;Zu(XdaR|(;;8A7xK?X zwtty4RFJ{ZT+W(=Dp#-Id}j$sC;;Kly*i7|YJYn$o7m{W%n`|JJUO1@xlD7BP-3v* zJV|!OR#fkjoMk{sJhX2!Qup;$GICFOQ3M!k(KB~OWYOSr?AkJUfGf@26Pck!fea@5 zLNg>%)0-l!9TfE7H7F^{vJxNg*C6fgjuHu{r=PQIAT3_~ri}3ENl>uWFHp4pdh+?7 zJwu<0U;f(uKUN~R_oiPAu8q!G%x-8{rdc_L?MB0R1_oMd5nZShh+kJ2O|`XWDjOeq zcmrV!6TX|%$rP`89!*tsB}L>>HngZidaahFZaDw*1v`IFd6w0uX*k=E(ygkvlI8Xo z*_0MIyM2%3{0_1-bp>Dp+)2t}D_Eog5R^YoSZ{A)o5kDU(VDTb&4(`Sfsk_< zK1~)KP_?7GfG`1{Uw|;R+)b;TWZs5>*I0YY-dJ?aHFDN5y0^x!Lh_Rpl;@4%uP`Gt1d`2ig_DIxR#Lk!O$Et043eCC){Fu;dt{q_rznf4 z|4r?aer?6R}IVf{}?nKU_$VS!*dWdUBb8eP6s_;aLlDmSV*87h{;+QbgJ z#esB50-iz$qDTm$F`z~64mJ_J$kvDkr1}PIgs9h~5#`c1&kJz-AlOv5hl6cmHzm*N zFVnO!u+}dKbThxbiItZM-W?xC$y>_0PK7)mIk_q!cdvtFeEldFQdkICvVfNWFes;< zU+EgHtM%0t(p!nZfRR~!-bX|_SS>nv zZdeJ?HH955O;nvp{vi}eOobJT2u${no&MuMZ{`O$lNar;Medl3esvh>zX!*uW%tJK zj4RP&e}%M!LUsrP521lBpkX)aQ}t5DZ>ut*;9h`NU~%Xc4sQ+rxH}DssV6g{!V367 zfBi#j6WXZlrg_noSq+(rAaCa;(g7w+B)9Mk@l_$D7r(?WW2F1@wNED8-M7HgzZh$E zo}663sh}W&)TJm|G-i~Ed^Zktk+-~nPZ(4sYyH%W!s)yC2-&EN#e`I@6(?a%Xc#w( zbZ8xt1AHZjO-)tR0k}Yfwr!aL9|?}zVEeh-rDTXT-kvA!kgUhF(OpiCD|irZmg?HP zE?Q}ppdXA-m({M7`Fog?=#B!Mm*1VrO+mA@GLMH{%$t-lB+t;e%!S9KEOEb)5uI`C zC)Y~vL%D$tl2`a$5L(mF-6o_Y(1%&NWQ5lB@mA@dE^Vl!~A=G9)Z1+wb&+ZDICO*8M4;r%~(rr5;YL?=x@7* zPhd7|_k05Z={%4v1UXc`o7$Kem6>Es4?d${xfz^s(cNBIlxrZW$bx zZAT5^2{14zf<(R*;$GxU+TE7(Jy1vy#M5Aw8tvBh&twn&hhwiW_*Bc4=>lW+uEb6N zNaSwgdhR4OJ3DKi)QLx0QUx}W5f1zP$oysdf5MPINTg0g- z%AR9a?yQTWbB(n#4Hq%c{B5NYwKOBpk@`Ix#N*V`8nXx+E9>q13O;akh{jKnwG|gm zx@%p@B((PG!xOP_?mS>R%gw8Rqbp9b9$pIGBSjabHr~&T{7-IsNf_H*OOMpN=3Ve+ zEr*F=>-kVg5x#|3J)Gw+I{JK(>#i#m`%!DQxTm?9t$s~e6NnFj%)NQRcHgJR5lp^S z)7%fM^XWM=CnN*pt6PwJG@48N=6ReGvmc(MHXbGq_Lp_~?i~_J!{=>U)@$EeA44#v ztkb1;uvBZf%hz}=jjIS18bQTfWdB#4j=o=mc~<6ziJsSIXX=gUemQjyYDR5rWNo<% zm{OPILQ(Y)Y!8hFQ!)0~asopnHTYlBT#9E~LRI8Qkn|3%co?NI~!PN$_KnPS`nZKV1G2E#Hfox(snQGY8NNYNlr)^pEx zpxP9OhVS6lO`;uWSVosE-5uft8VIHYUyntgHc${@DciPq<`>CR-tSJo|L9tI(H}LS zb)JPY6h5evH`yO=hrY*B*O)qr+R>E(Wnsme+}jhEu)Rgpf4(`Z-H&D!|$OZ*#1 zARw@X&TaiBQrE&d3q@`a%|1QJT={_1Fc!@F9G9yenR1GXE1RM!ci!}x$78VV$7E$# zTR*>rZjZcb01mJ`1HqVCW~+aonKdjAV;7PILbww%Mmi_2Fvb%%2|SkM%eS0LwF z-jNsW4D#BTuA4!%tA5q^C>l-EmL>smq0M?$8w;ZvgQh50rK!;l>!xUAPHY9M^jElJ z=1}Y+2zMg<520n^xxuqoDufm6#AR!{@k1_h+@5|9t`D(IojEVzLy=&}DO-g+n#qIz zL=gFoYxpIy%j+;8MUp{LkMM*e}Z682n(RSsN zArAt*v$pIr24gTg^JY#kQwd|NaXn9xnVsZ_o8T#4Y0v?3d$4cTUigP*(+GLFU6&o* z+f%+}XV>vd*!UHQx`mW*MEG}+8>s$|)P#4R%K#EAre^`If@K{Xap1dpW7$iQK#6rd z8u1<2{&D}c$g!eeNf%z>=m^iK#oAD+EQ|+APr^T53T!1wc!rMg*=y79t|a>WCW*RZ zgfQe?1vh$%0uo_QzTHGd(yQFik+o6-@H_m_q}RFICQpaw2&qMXt=Ap-h(E*j7|Y5a z4KV7kiKl*s0N@+Aw;ymDe}`R@=BcH-f2IMI4(VR_{Z(?yUhNEnQ_6e6zI;l#MQOR9 z2P}vnChuAJRg8_+N;6C7t@~((!K`|9m|+5@o(HCofy$Lw*qP;gqKKL?VZY zNJdzxekVld%2GgiGFW+5uQ1RiZ}F`XBFxu$9B3>NF4?PY8xWrIENNmRtiC)K$xU39 zs}E5Na>)aTAV{~k z8A*7!cz2@=YdYs)ptYo=WEE69OONIZ11o($0&S4HZ5jtUEiT5sI&5jDPJPyx?;`nx zPZE1mU!5=Ft8nknjyg7E?LYjf;O7%eu%WX7Mce2juFg|HmM4VT2dyn7BWem zQW)Fe+lcSSZbMXn$#c~yrD+1uhws%?K^K8Omqwf1O03vakkv(_pZl`nyhx`NtOQ3g zoQG+pPXb$D#g?n&scx;?XstPcoOyQEVCTnUUZ-MPp>5FdGUv@)nq{=*JPZG4HHKGMy`BplAVEAYfkuU~=6sV{lq&PeR*oziC~nlU5e2n0Fzn)A9};})P8!hb%I-F4!> zsCb=iq2b*2b{%>Ic9wj`U!@o!$bPqM&bn}a1*vIn3|s4`&CFgPN*}0Vup!+pAxRm1 zzTunN4>z!wW3YRFr3&VPZeP;XdqZXyg&w>VbPd@w4X)Nrxym{7mNTs#1$PU!M8aswn%*WB%RhedGN(S#nt z*VDtC`ZE5r&01FS%{)8%VI8oQW`X+2(j39-rMMaCArHO^`)_j*+N}her^4oiu9AHG z0b#=;{~|EW*)PHbQL}kbQmAI7K7AN?m2gbWUhS5i zbaMV|mOq$=AL^HBN9_#s{klI|Taze&*;!e-L|l4iS(QF)bCK#8Xe$w1AiM{*{4VGq zU87{;!}oO%`|_>hs4k505H+5S#bV2WS3n9_Pex9b77LzBwNbmZoU2WZ`%d}F^h192 zqd;G%X4{}(PNL+&N!U(d^dH;^a|nma1B9=a^~R#DBM4*(uiP2=VGGv@MwE!!tz8!7 z`$-V-2u1moMO*IQM1DxTWAHw4&y)3YfAP=DWiI5k5uAvTF?UupqYsb1EIuwNKpk^h11CpMzFE@=P}8Y5xwwa(5fDFhh#=cSOLjxa!o>6oKT6%qggBv|NQNxc_zu zU-0h3*TRlNDWruTqI@D!m-oLa1FU@}Wekj`Vc-+@r3gM?cLECB>T}KRDa(aF2e?We zyxPW6&VNFBnDM`WBg~$fUQX}L*v3S9;?qxKVk`r*!hR?B)sT18#^g`sG+IxWVNdPz zX602!I}f~@d~l(WQ`r={yK#fw-76P_QbQS;Qj+cg_fxy>|f4`vu)L%!n# z*N&$D*m*y}t9Ys8frr}MGQ&gb_W$M(bJP>Xtsp-JeEyIm;$iW2ESQ-)NJ>Et&r7|} z_wM!o=cg@GQ&W@~pULxsM;pS?T1s4&96g{U*nG|Ad*o)+&bG54<1ete(6X4K;U;)D z5wKLzrqu0AIWsRf6&4@O*Rt!1jkvV;PFtI5i^!?9jyg?NCZsvlMHrt+3KS8 zi;HfN;qiYa#L;!syDj=ljxhW1k9SB8kL@!J%=M+57U8y~&J1!UEf##Gup{4Hj}B0y zA%0pPy??3K{;x0XbKf!9ODnzYB=xxB?&xmUpU=4mE(~|f@7=9M-ZekhIF(eZ^{w^> z51$)8BCmg}WmiCLX~o^7KKf`Lc52vOSziiJ>qc*5yV&{ThatIwXFGAz6eD2*DR1Ue z&De`QNnu4KM}|7J*`F3Q>CxvR3wvf;(NRG|&A3tX9%Z#Mdi>5y-H&H#q`bv-;tJ;y zVkSi&i0%?dPp4zD4qC1X%81{;x6lp5xP96Fkz9`0JvpQ7L`X))odDZBFNXTL=ELNb z4SP%ynzPik_HC{!(x4hscLD10ZkVGX1X3{~<^uj;3lBABsTdMzFxZ1)>$x$;vJQGz z$^EYmV`n^Hlo>`M47LE;66o6jx5!)xg)xy6}?tB8uS8B*2H_Bl03v6-PF&k=p86xf&$&Ih^=Zo`-ftVQ!=NTU62lUBWjzf7$yS;<~yf^AHElI_rc(Vv3Kq$yB4l+ zDz1=$YWN&uiZ~UvYCnOp)$gz{%50R}GMAwa{9c3ozjG7+{tEH$8ecLUN#2pS9o4_K z^YU03ot`~2M(jsS)hw03dVx|MP3<#7%Sg~>ygboz#%|~oj2AB`sy%W<{dr1@CzTBk ztmoYd;o6`7*`rG!I4QcowAAu&gG%Y;`!$0CBOFBSt`n_Xo3w(z8AeXX-R4L%;+9;6 z0)&5Lx0|4NtNe?fupk&d&%wlA^Z5%@m*Sr>Vo7v`Jk&5f=^(89nOG^`m=oX7jx-Uo zL!o!ElVs-AHp?*BCLEOm8S7^?ysNd^8gC0r=iVj1!XrhnNO zt?K2aBJWJ_fj=5m=OQmJ(nbeqRS=;=n_+gwdLe1Svmx~4?}B*9BDJ$9!@lzGmb1P{ z;cDYFUUjfec3_yK5a)A}yPaSh)jsG0Lm&1*py8)PcdRY{N8>FJw={4Y{KkiCuc{2d z#JVam!BUJP7$NtmFVu?NB~Lg9i!^H+&@S4%iR2nC3$uwM#Z+KGW#rWJmMhBbN?k#t zi2D$!{Fa7{5%bbe@WQ)$@b6zRG1+FiOb;|P0uA$QB)9QZpkd?3Zt_ZYoK|Mu%BIF^ z95H*+O>o}(#uG0_T7o6LnB)!{MEvNgom=*m!wM+Hh4iHQ7TcepR~o*Xb8eLnr z{c8OSKMT=;5XP{Zz%%dcLm$!AC*&=K6V?Ht|JIC$#Q*U)D08l0He0VdtgknORu;;z z(THB=8g0&QXg2`;`I?)xwzTi&%0dyY^SVXgghM^}Q(hh;O?u zsGbWrE@_7H(N1>od7>N(1GK-Fv(?YIk+edBLBMd-h^nGd=It6-Hoz(o4(XH$m=b${ z+I5HFc?iZF#-vu9_J#}N)1ysMM)6sh^rr#~&ZWxLY1HP7G9ZdBM2LFR1vCG>3-H+k zQ#OuZ;deNH_uJF#p>J(52%=8%R8DqYfS!(;MrqD2+XtG{3C&N!88IR4wr@+`%U7Mv zzZlvYTV-+}^DkL>(FVADv{zPMaW7~sJCf|M>7IX(c4D_3w|+nnm#$v=>Edt9B7AM@ z1sPPVkGVaK^>{d}MM7+a^QW55lsKXT6pbuX1;v#uhn=X|wmMl|x$5)V$msVB>afT+ zMYxCS16K+#W;Lbjl;y4OE;eDO{jJpIE8`+M%7YSWKV34u>7H2}x67_GH=|??4CX$3 z=J>pI)7fC~K%6kikFDAh{Vd+yujA~VBbCbpOwqCGEm3lnZF>oOcuHPyv~wJ;Oj5!q zrB6sOXk$p|yg&<4oAY9mW^IzKz8i!i`#ywbRLvDKV|b|BqC+oNysRl!-BW3w+E)G^ zgIAxe-@U2OVNIW{>_5F9ZkcmB+3t2F7nt=NhuzJVI>!gDEDk@$tue2ZaK6@Nt@}F` z|2;7ORg*}EylE2 z=JsrHkX@T#n4G!!;|!jZV#L=f$*AHT;?6|R z9e*0ykg-rSBf?SO6plmG&a}WI%+3m{x0elUJ4;9&zF)un;U`Gg6oBt@A_EMIuVK@Q zg-^PLw)~rR|K`40&Ip3vYh5L?lnY!$z7_WA?gDQmg996Hdd1sEkYR4QxO3CH+xgPe5HudfbJd-Me^V{bEJV`179GW99+VxzOOzLj(4%3r(9r z0n#rHSS-G=cr!N&cL1$$ALLwggVpMJO7z`dqcEPCI}V{aoDSDKFZgC6m)b$C%)7;} zYR2`CUAw&U=@UViqy`YEh(I7H8cj{9sIE5o`x1KIDAa&+NnHmnUSIi$UwuBp!ahS? zi?n*3i=zl1PkWrc#+6NvSARO^#cXN$@!vr-C`wM||94oPvAOg3HJ}}e6k6l|Oj}Mm zQT_jMk!7@hF{LDj#zb+u-BlF;%3KmEu#>z1#q^7B$_Zc3itZe=(p7c-E^>i&=intb ze>-T(FJO*b)u>y~{+{i_Rfu+s|5pRoz^?Sc%q8nHts=gHUhsY4w)CI}_E17#8N>1Oib53T_rs;5;STNFI3NQS*k}U)zUvD=J^cpto8b zL9U z9{8$mWzO4X_JTW9>zv*a&Uj0)wp;ToioXHb+x0U9l^?zy(%TZe^_~BxbypG#o&=sG z2Dy-~wF3#98~d8m?e>H0z1OhiQrVN=wP=}jm)J_!m`x5Tu}`wdm3D}TD;7qJcEhvv zGMv}$s(V_BrU7$mfF7%q&J(MWTDIC}yW8kLB6$Js6onKE%tSBZJicnE^uBm3Z;?=* zzdqD*K7<*EzlMw1$uoUQwP%}g3OObSEY|uthBK%^%Th_KPpZqGr5Q)T-X~#i{fvy< zHM%_|oZIi4GZtVF#oAMv;!K|Dz9m;#2|eO_Xh#u-ZldM9kt7oP7U--aFi45d2?;0G z7=GiIXr*6HdK73O$pjjKYFUI8eflTiRLdEC`a_ti4PEc$+8n&~KSL($oT*b3coAMQ z2@22Qx2VL4;X0-++e16^MwuzI6vpP}uydY&9-hqJ=?;u2XPAet#3)?jet~Mvz&}!G z?1jOAS(xoG5Jev`9lOQd05HK{4`Y~=z-buQ@btL@z%392eOn%{9!k#-{FUSWv?Vmd zx&8;3eyTQH5LAD>j^Dt3hs>SUD{X^1;dirg=U`tO;UC6Gf++Wg!3k^w6t5PQU2rot zLYqJ12@G(U3)xL<{QfIi>svxGUDKl26W zmcF4<{Az0VI(AJp{33YT4x&YZPQon$#VliDtMX-d9j-dC@Gvv&)wX-PN3+~5Ltt>n zqI~S+{9a+kYfwzM`T}m~9i;nyH|;LE8nN4=+%5zzGb|4VX_Ie*$Ph7%2qn>hVBDan z`mZPIHZVR~OGufZT;ChyDW%F!30EF=KZYdd{U{vL-MBN zo{W66P5jQ)VK6(Cf0>GQD-#U3siGA#L0u@5#0wU3L%BheXhq`lmY)ortz$wXaTt~J z6Xdus%eg$9!mqZTEiW>;7dg?1Q?YU)4CKn}I(aiy6*`tmVJGOP38z@@8lYrnyLaTK z_JxDTO#{w}f}lkd2G25>^SBOqAd{b@lIU{P=cq$Wp6@)K1$vJgw0>SyoUvNCPp35S zH_3I5B$U5@B0EWsXfD6{n1%Oaom@w_OHh6iBq9%~^JEa=oNj4gFeHffDkq1cA)EPy z4_~{&dkjr~i{owYG*b(BW&261h2Lv%-EHP!$lu@PL4n%?P;M3UoTd0-?1^KF(62aH zVpe3g9Jo*q+;5@fipp0~PuKJ-jjcjl`UF@fbO#)L6y7HyMyTN-58!o zsc^nuY7GjtW_f$x1bI1lnf1cc8|Z2?HwJ{$0pS2DUE!{|sYdmjV5bcr))A56W<{98 z-uu?x?Ps@81_;=etwsKJ8H`;0s1h3X4m0PPzkGSgZDR4@x7tvdUW{o#k8Kt$S9$89 z1;@1kUMXm*j3w%5#c@(v;Caaa5TUvUs@j>xVHnK9GNIi528x-V9FInmYXjuR9pX6H zhdAlP&5~k|x>NPTAQ+NAAhw72@5gVsl!60TV=Vn_EU ze0y(OcgBcKr(mYzt(xaa^^^0C`806FBb}5$U*;nIxx&iQHJU32*^*3lh{60kC4UiH z?xOmqcftHysMKOP?;zph9Tish3>D*>K0tO4Om^WjWNmgbBIvN>)^K%;yHlCV5tM9bRhYYK0Z zT)<4&?)Sp2KHqdTgAb2NZs5l-W0-$9%=;18ZF}e{nJP*mhlw3xk}V2Q1K2~D5XfYX zawuYc=JD1Q2rGG577It&G<)FO`7ryc)(w)5OnEm(DaI5H#f0z|zEALiV-asFe{y{q zuVP6Lgjw6mHJGw_(~1@=4_;^n(b)Ibl&fpCHPzQH3)Y@V8$kf$M@l6lHT*0p^$CJr1 zk!DJ;n^!W9O93lk%9Sa?f4ZMvJ=AhyK19og@M_TSKutaa%la|w1T-Qm76}*hZA@9N zxyiKQ44IYp`5~T9?z>p{WATB+>!3?}{}3LHDpHdb5>{#z{VItj!@Da8!>jb6^P#3O z;PjeVZw|b@x)qS*LSZly!cAdh2)DZrZ;v!Vb1*vM48gW#gt*`!f^B~laf{|neZ5z4 zgqXAwh+hxywqC4_hDnoyUZ^j!pbh#xd$#Y0e=EG4oD(!0) zI;|PekdZ_Mq-uMsb^@-6z9W=ITt>{XJ={^qs3V0A%<)&-4jEo0`!%_fuafV!zrsu) zoGkZ^y2dA69D#f)F{aK+>zohX3yDaBY5eQy4|2q{ulNEviZ1yUFRO<^?n^PWPOcu ztje9b7vgYW%9_txu~O6n(n>g;K-1^X)PbdW+fg=j2MDt6eI7YGr`lGqGIrDTA| zp493*baCRXQeAd;4WsP-1AcXs;4Je67`o>PHVXz~pr)B4T?f`|&F{aR0thI)JRQvJ zh1M&a?>mvPu&p@&WV~NeG*f?}7miCswI!trbvN{M@xu_?&rQ%RaFVd`b0!|grhcwi z*_kGIFJ*fS)ASK*{U^?|GQ2o8EqW_aO)O~|Zt;a1bbH>VEGI;1O%pVK_?lN7O^sGi zUdD3!^sc1k+~5Q+6vqAV^e>92lUAum;On<)YH?{4<0YNYG>dGoXpwI={!NMz@j9O0 zbA2wsj_8RNof@Jxq`$hBy9iUh{o;)}8zBAjK3&6iVl)6W=OJ^zaUwV9Zafw1c}Rh} zM13^krreVu+w`->dY-;WQ>O=wn0c{=CmzGx*+|nzF56u?xmDw9P_#3xYF9 z2nttv_c47m8(RO4fQzJXqiMtBVR&6ZJIqogn`dVL@T~j31PW*Ykz#XA;9rFQHuUvp z1AI4p;;dIpI=>{(e4(?+NHyd%4UXGSdcF^+bx~5hj)IxR1@FhD1DjilG1zxjHzqj?DJf2AOQ97h8+R`L&~hvc<;gV}56Dlbh06 z*N+@cXMO*({I7=(^DjSQ7A#w)p6dQv-p}%fx$_z6lyyH|{^8N7Ehm1_y3PM-wygG> z@2~vtitG4nZ`~b*bCvItW(`Jj^i-N9rQY?PUSlPHJM0@sXr2zXjWqa&5wm;HKqRA9 z|6)(ptLYD*nep&SEQPb(@~0|lx4tsOsSP76ve~gaPUH2H$+Gg9r((hz;v}p2Xz}W% z8f_{qF{*{Sify|!ncf*dx||9VtVi&SU%dvk@qQE|HQ31xd@6i8=f`ZcHLvO-ac1iA zLNP%X#i9F>S9-rU<&J18KgkUKr8ai#R*_tY4McA%u?3d8C(G#KqVMY6y)zii%ow(j zpB{vFtAo;vTFw`6RY-(@YMndwxStGZ_Fe7LtIJuQA6v1L_A(@Gx#gep*aqsB;}Hmd zu*+Wm!HacT=`#~zuy@P8?5vT0d)A5gw9tG(wJ%YUeVr)X)^t7PO6x*LNs(w{JJ@DB zGY?l6ZB%j( zS*A3yuaelI5x*i{J<%bHswPGuj7EKKV5jej-S6Jxp`wj&?A3+57hB%jYjsrg3uuyC z#Am|m$=M4Iq|139h4RnHccpS9i;=rM4wx}#JJRBl%q!bXOUZf5hFd(%-e(wneA{VO#j$i)ztY#a6np$)?2XpL0QWk~?76yZxzHFSvM(zx&u} zcy-IN%!iwuxp0AW<(BU;$w#S!p9gVA!Fzjx$9;wQdt2WB)=@+{OS-I|S3dKE*kUBj z=O8K4MNZ|AG)9KzuPM`7!8FIMx#OjU!%qVTU!T{k7{&(tGWqC6>;;*%8hEdt$gdH411v7Et)zl^? zSC?$;x-Oh-5L0X>%TH6WNrVIw{xMaHFPa)_;x};%|Tl9 zk|9eD=x&r7wZqE9*WDQW>TiqaOx$-xP=7Pm2Trj3$%DHv;JYHFEP!}lVM<#)z3j=% zEQs(jnyQ^7b;aBnNfM~>T7rf_wyyt5tLO*+BsoT7g3UbagzOd%aKjR#7 z7%iraCdoMrE1S<(5(%z}zuPmh-P39@OHkqaoU^~>y{Ef*B1yR-X)48*xlZ_PyS@I9 z(7x3`TmK_SfDY*IImTAK4?BdoF~NTTS9QAHEnAY^?M+)dd?2Z!2LIJ=_Ar%&Z^=o2Ce7r&zFe5Zt7Y*KjuITsS;J_r5+%>BfqHXD=i(R@cR1CTs##L zmUk;TOC9X?yqPQui)kNHvE|&zG$Tuwg3J*q0N>Opn7IL#Z=iEy(za{euh<#keO%Hf z+Bmc(&1ISA*%Ho7ig@)gNKiK-;0uq0+074J0Mv9D9zY>*3EP=*A?FyW36`DCq|-55 zUA=#_KM~U8yP|lc7gIGgM)-azv72o2U#-EKr9qqgYSbbcR%CXT%rq=1pNd5vH|Bc> zn-)fZ26x&`W%;|3I!@=VL1-`8=q`xh9!O1quZ`2AmdI09y4!>FeKaC38b zz5W?~^}~*HB$obIF+9u5OwKgWQLcF1nbM|B;E2-g2n&sSQ4BYF_KWOour_GkA}f&X;!`RlpP+#1M2MZ=1ti#ag^7RXm*m;*4e!0+!=i1xOk)cgTN=3~Ji z9qpOT;_KwI{OUes`_4epW%^_lAw;Qt-B0ZHfAXNz^9>rfBUXv~p$Z7BC48ykZ?>Z* zY1=KgW*zO`4rQ)u54tIBdkfQyEeBuFD9sN11jkQOq?*TmYQq<>9dLMR1U2~}q0!Ch zxFM6NJK4@&uXh&LF=A?qhkcRa5i+(Lg1TjObaerqUq6h-NZqu%Z;`qPD4XYt$)^y_ zMbP{asrsIYI7hUR4W*!V_O%%COY|^A_%>ZFJ>iD=RTS%+aKp)xd@97(fSFSx2JXPx zmUD}z<}pyaw?QN$U0Ez4PB!B#M_PU?*Hae0E|Q0EZ4w!A2h5E5epzij&2nIZ(okm- zE7pNuBnv6d3&H9^TgqtmLI7zQ>(-|^TosJL%}#(v5x@73a5g%5Jc92RdMFL9LWNqh z5%>!b;)*U=*7b*QvijgL%o!q;>qMI+6h2hGPg!`XQ$6e$w4hA5C@sUTg1KTFxuKp? zw3ZlhmRqjT=DHtJe&S3BU~^oSKbW*%84(@}43y-HSKsX~#G|B@E~+$l<`op%h7AL? zFqGuiFFXnqfyNbiAEc(<*V3UjyC1$e2uaZ9c-#O$dz3JCiTov zM~E^8zo-_@RDjIp;~hC!k9IBs$Ik^xs)V zKgX{=yVceGu9F!+!Yc!+J`;{CVlp8>;H_|r2DB_=W{Myw@z@54T>=jq+}6LTM@10X zP#$H6YZ*SG5(Wuj-I{DCNZA+`Cw0 z)bZ-Xk4dG<3b2usLg?I5h0KD|pJ1c!L%MuY`}~;IwqhY8CfprjHjCs#9QjFVp5Zj2 zUehJHcr~oMs*ydSDK$;NYhR={;c1Zx;M9kgfEL_1!X*^D6Q$1J63;zQ<6M(uDIVa- zJ#!y?;WW*D9c&i-DA@tY0=zA};hr3$Ie{L+AZ#*j3^utcwMmi>*CRtcLC&Es#8I+R zD)@C1t|4I7n=NLtu4}`|+^FmtNYFn#(jnn4>-)zNi4UNfbkSGR0Y#vzfYvOn$Hz(@ z5!A@BA>EW6)v{t0`;O?K_N`4?GWUAmWyE()Qb0;7%nf8nZi~OBw%x#tmP$b*XjWH- z-vvAYt8xbk=YIvuKD~jOu_9=My0kLDLt+G0EgALL+X2qcZ%j6o)vSTcf<@jT)ttSM zS2gY2H~{(qSdK7q<_}9ggM@7dQ4fNQ0T+H8*bNeXrR9IAVkf0Jo`{$b!hQYLpX;6A zy#jcelbT_ZmUeZ74L~BJW|kWUHLMY^9yV|BG0R*y1I9o1 z23{9#7f)m0zMF-Cl2*~i!3I$3$m^ZcLhzYIn2xeA$wwL`5sL|vN;)O8{p0YaUCXfn zng(oGH((~q(+wxrtYNd?^C08kMH5&t`-ngn#!n4gl>^EZHKd0#UD5*by!*JUX8$>n z3~>tA1?r}Y!6C>@cvE&XDT-kxB5~P8*5fps2f)^VnkfPuc7!H$dR`Q z0GeMQvr{ULvw^LCFqlE|c1c|N=GOn-1rSfrfZJ89mMvD=5l%Ku28Yo#K~mW{I&%SH zqb71MSV7&aI&S<>t}ex1ibQIik(}iUV*%I`up?AB5odV|B^l}iYq`NmeIPyheFDhS z76ZdKJrWh$u1P7+F`2w9MvlSz_6g$aOh8Ub8mw9cUncuzSGKFxE~1u903i54a6F!+ zrAbMNiDU+cn7mo|%2!C*-|`&HPap~9Qy45ZH-#5-Si_%dv2wsZZ&P^Bo&W}RB(Q+*s{x^UrK10&=Knim zyhMyl)RDQpP{k0|Mvcr+7qH=YA5k9RgH)(BrrJqzmQHYpCLHo9(+{E6kAqXf)V2=HCG|Ri!Y#!5{LaRCQ9FGTY)-X0LFR$-` z*TSf`EBgDrcff*=ZFn;$px6BdbPQleZ4KReaJDeQFhJe}nb{YTAByGrtF&SXK zCnV`O54L}~7xQ0o;y9PU851Xdkval z6Qn0i9pqa9PFYf%AOUxoW@POp48*%)!j0(vPS2q4k`(q{gF33=^~(F2dV7FpfyodQ zKMN(~zM|ATyL(q+<^&t;wn&7w1>);!MgIi!G26n)UukJaN}un;QX%zjxJWT=cV88E zoM^VwD3em)hC=BxJ9X0&STw9tBVwNGgKC=^^LJ$(Bnmd~&ZI>-fgnqTN)~XScYmew zzLw_@8&magE$7$oiv(3B8$#gK2H8q3fuSnt=u+DqG-8huF~CL1Qm3dBg*wDf%0iT` zL72@9NiE!$K%4J@_$B=szr>|;4uI3OC-vr=a0#}1)_m}w+^)-6Pzb#BoPW? zC!~AR?TVdS2y*96Y!?A-oZ$bK9V(}l0(*-6D3r?DsN>)>TPPm_jC6VmNNfX<^%Fqm zzMOJs3ndzoU`MbEvx6wB{4`J?B+EdV9|aV^pTwe1PJ??rR}y*=#fr82)14Ce$M6M> z`v3Pl{Brp!_8|wK@eXeY^eol}u~y^n1oA@ttr0v9d`~E{uv8wQvLPn^7{D`dngF6B zVN-WOfD0W;LZQ9!YLg<#>xJCFR^Ju9We-VS1gN*{S0y6S^uC;>@zPOB-9!h4ei+84 zA!Y<3h-risn_oWT0idN@II(1>|WLQMyYRU1Gao!aU; z!m8LgV6g=%(cr>7=wN%P*$jMSD&=HNl_InNdTcxwcag%Le(#m~Vei)f$NO5&gfXQJ zr5{lU5KjfumJYqFUjb91p6|c_HWdb}VZRnz_*^{=0Ao88P=?Q@MC*`O-~%Ew`@N)T z{5VuY^{rcRP`{BrJZ}MXnr{J%WZ-$WBO9L}JgMN3sSc@5(}DL_kwd2jXypdV73t>O zVksdA>ggqv*XSJvZGd+|&$mX%1rIg?M~12m{)`<%u>df!x3tXf%$DTWjzNX~P$)*I zmjPWwbf95iu2K>-2HU+4OWxJ$IVoS1TbSC8?XJSXNzBi;@kvy6y}#zbpmoCYo@cfo zts0?SeuVB@kMGX%i!$6#bUqENhpDPkB{7+NQ)P2g&G1dRvV)3}oyvv3#LxBvglf$F zAz2Pa+jjF%>WlN^&Z2D~A5^Ihbvw~0C_o`%rm;hxsQ#jM2!W0TgAmVv)^~jmSKU|5 zQct)J+~m-e0;*Xf*3v#?AT1xj&pOmsv2}q*VZ}rh^3M*14i1rfr!11${k~F8KTB^= z(=hB~tKmlC+f$J$F%|t<#X-y?WwxtXbkqrEvckR+N7CEX37zGo)^poKX4c$`Gh8`-`8NFhBbG#R5d{2#f6f z3R3NCP~q|g&dJEVl{%PMv~B3dEa6i;z&_He_lC(#ckzQ~$({k}n=}pYY`FvJQ2Q|# z_rkC=BZaYBm=Sk=$*6^A0OGu*;&}gCj1pwdtOF$#k-|vuEquqYNb@p}z#WT0$sf9t z`~q4xX>O1Nr_Z#E{Ew(6vOs6xTS%awLE4Nzwwq%FqSD{}vU%z&K$(9SK0b-3LP8=v z;I9k(9N@+bP7ckS`j)OcvJUKtum{!H)xR)|n!Z_Ms3l4s%cy z9N`u3^HQYwmWV`Y08}6LfH|F6qGiY+0d~ZrdMPt+iFuW@-VFT-Y{HVeZV6mup+{or zPd*@k7tVZE$e$?{uYMW)ObTebqkt4jj$cIo^0=>qB#Ib?Z;)0};^B6#lNmfbg}X~p?&N+Dc?)oBfCly2ybtWrGVCCM zGw>tV>kll`XOa->Z925sTXspYDh|?Y+LQ;38$u8YjzX9fOjRqc7gK=pfcz;?nCR;9 zQoOZo8U#iEjIc=iPu$9t7&PAsUWqt$NrL~&n(DKq7a&#&k4f~2-@s4AScFLCW>Gs~ z2Tu!A$jJ=b8)Z;2Y@5n0;((fMHvBv6cK~@99*P67Am}C?h#qIKehs_*#Tp_NtIsCd zmlAg*g`pB5LB>HqBWTfTd{=BAu}st=bQrq#>{))~5^e`%gX5f4tP-U|b~tu*7;ww$ zn~2#jto0lEOeAUS2V(0!ut~Hcb%T^+5O_eNWy1jfiVIv?GD7HXpbQDf6O?N2fNbEm z8KF-FFTcdYwz+q{$o4WnBJf(Cpg@o;mLjLG)Em~#@bL2gvzRJ%7Wj`qk)|yjuK58e zDNfigt+YiYleAIjgfmn+de&=7wWEA$z^@XNeO4MiFhKjy6c6WmA+4FGB`*Kj_oFP> zw@_+d{&tw2{a216KK)HlQh2LU3hq#o8boL$A%rfiO8OBkev?)~Z52ma9V2?6CVe(U zfu<26AnLt5+sLw8rWx+KgnezDX+Tpm3`k4l;0}$F3?hr&Pv~DD@&=;I8+uUT^`!|{ zRxVUz%XkyiCv7`XdLz6YfFQ3vrk6YO`ilc=r*fc^Q6M<`Oi>f)z z2fg7rdr3QXkN__Dv9`Uj010^)*c6Nbt0Vv_KNHlq<^7*?Q2JA{X!<{u!}}%hgI2(V zbO8RWi?r%*CoJ6a$7khz&wKtS*g`M_?(8J?yVT51zP&`IKoSC5bLy$r zkP}cORhZY8&70t_EdXb|i(kR>rO$sWphi9uwy2CQnJ;*!M@ARH$O~;G>?KnRo8Yx1 zpmrwy5mHE6+vy7j`ao#`W&gJTX%qXY6N~;5u{MJq;5ZUgaKzFLa-eTc-ah>d&{>^t zh>>z5ty_AN32j~~L3e!p(Nk>&8#AIRVr&@Anc-~VQNXZN`&-zusZ7w#sOo{x=02cX&T%{mJ2QeXg| z^e#x>29V{H8G!qa#1r}{g4r*2q`>4=_*%*+E|BtPU;;&0k?26T!?%e`K$zESuw)DW zc;bx)m=ayHd6*wv0nDGrQKZoTe=?wLTiSdePrFmN|WS{$eBG=Tdy3113c3n4r*w^7a$kuLJ6r-1-E*BVzcUDRawFbwXxo zftElgP+U?x^WOJ43>)6p1meDki-SFURYx1`jj$oqWz_=*q`(C+=Jw^HWpUsb1~rXu z;gKk3=?}iO3Zo<*Bxa}!@E)fNIf7V*D2i7CKgFuCEmBxrj2`^ApwR~43z{Zc(^brz zv)yvHz1{yu)SCxHRet~DV=h=KRK5ijfp=L_Z&Yw&75J1Tl>sU+GYSKvsE8noFzm~q z78weaDax9XEHf}O%037TqL8wscm-t@1Z3D$9FRfa_j>Ns_t#&kbMJkg^PK1G=XJ_I z@x4luwQTHb{61CVG(bskSkb zJcLptvV6*Ee}oaT&GpKAM4XS1@EeJUr7Hc9>|Ffli9glk*d(-yHl{ztcE>%bCBBK# z*hW0w0o`qkIHFCj2?9)uL7gI$<@NXxI03ZPcJ7WuYVn%1f#@0UQg@PTCCov>l^HKn zG<{E3-8ZiY`zr2fzvYjr!&BU-410+i+(*2jONu+h)*w+g#2)Y7Z%ubFe$4T3Y!b|t zNN4}~iWL+I$7dhsFp*$It#A=mKIK-@zgJpQrOh9Br%V^I`{s^z2F@qTvdY&Yx>Ucw z^gjHcOD`{weO%k%)7bYJq(lKy1c*nU3p}Q{q&f7~w{DC@9+EvRzbfToFSKh?Z(1Zp zPGi?(k-V2gY#BdyyclYp=Ut#(ymDdXO{GTu=k!BAD-S8`X->?Ng0Q(qWbu+z&>|qipax_LAx@5c~S~^rs&wfxUz<)^Gz=O9TVr zaJXa}0>n_G5hY=h$lDsV9x|~k3`4HkdGM0Fb3?@!bHnn9d^7T#jK3>j`NN_qL~g*U zo4ZV*#37D?!l7vE0P!BVUoN3){g%^~A1xv9ynV zC`Q}KZ4(UJN#+>h{hwfkKLjAkeP9LTwd9V|V6<~&ByadAZL3P0Hy(f4sn=FbyY`b6 z8!YmV_XRd^`scnGzJTUmn3F87n_?T~<~SzM<#hNJ&|0%~8Ii9(4k*(tpF9p@Y^oOA zgMtTF^dBOyvgXQ=Q$ltp)3QwJX4gSvI8u18REiaZDXz$sPQj~iHPw+Ib@zDJoI#fN z4cGWQl$GU$ImCT1P`ERWY>sbG2a~ujZhw0=UNU^n7aUTrKYr~m4np0oK;yhNxVZJo zmi;d0XGi5Z6l-Aed-51tO)Rzo2_8f+i_Ep% zpQY@M3_zjm2-W12ZoQvYH!i=%fnJYwO-Lw%zYK*ra-6omj#3vqCFbm&L3n5QH*Kah z)gyhqMHtI$S-FAMnCg8z+!7KB#9EQ4FhbZuW2N_vrS_hid`{V(NS43cAo_mpl-&B+ zq$9o16-34NlR%Lq#>Xl04u~?rGQ1q$`c=)>>#JwwwV7+V2`P@2e<+iIkYwoSW~5po zf{$=(U`URJBP*3Ld(GU-{NVCc-Z$1a36bM?XQEXh)bo9L~(gUjer1vj# zE^srdvIp$cy#IH~_Tu08Ve@D2}nj{{fr67M2yIxZs&MHRArM(NA+>1kKw+yuVzbov@~e9! z)h_9YA9Uz#2zD~`@qhhh)%iW-G0D2l{Txu^L3{2UwR&u~5!ir2c+i%`#FSXKrS;GQ zdxUi2`P;6GrI8T*zFX%46ysE7(-?jA{XR={^hIF8(=Nx#gUHNB4>wUw@Gn0^g%-DY z)s)d-1~qAGBTG_VmFo+ly*EWf9YigA!QIcu_t~4sB~G_MOqJn<^!f$}(s!d_;SFNl z69Xj4Bugqg0-P_;4K>Npu95b<)PJ6w=S!qJGM~5~+XBB={6*r*$@|-t_jDntR%|zA zWmNl^RcXVa|By`%f5a+1uDU80#+Ose$R0h4TYr_*A_u{*dvir@ARMxbm1&xaq`fg& z@{tYkMYBR!VB@h;@;uiB=!wPVJoD4nj7W@WZE&wV7B5-VB-oe~-@3@I_0WZg5~V$L zty)KN&S&ooH?G;o`eHL$6~OOnKw;gMMpG@sHXjDV5*@A4*>kLaX{aGhD)w%zNqIt9dU!Wy_?T_b-+4 zsi6HlG5R`89Oodhl@;=^QylWB-!J6LBnQy_!pDV_QyKL2XsYq9lO5mCXWAp?Ao_jC zaZ;GJySyxH9~#d)1P+VJ$g{1kBo3uwM}uQ-ic0w9JJ_E`vtX_rMDpl{Jn9cbNEb-f z);hZFpGibHdA@Lq(1sP9XP2^zSW(=#oB2}YZLiVM;WbYtS#B_>?}a|03lk4fsjNr` zUSr^5zlZTc9|y~;VL^&t=SR<+k=Loe9Ux1Pv~3i0;*kgKf8M$K1sE->U2?AK{m*dPaMH3af|7@{dXU{Q(`@jRT4fd9? z6g)4orl0Q_r&-{)M)7Q*`9W-y0w>u3u8fMQvl?5E( zz5ISPd5giQ<-f}8;TfuVe|yloiIX10b|nR`ya1+xN5u(*>cxzFJKvYnRV_MiUQTTg z?TtPV*Bs);<`|t{gty3k4jqFGM+g?ZMd!EqBI0%rg;260qzH$e7gEKArvA&j|2QwS zU?yavxB1U7ALIc=RF3;$vWV|Vpbv>JhIg57P6es&Qp9MMy|>8pz z_q?ENO~|oLucF-J&YQS7T2_V)d_|Be;of}rdgLHJj(Ve;bkS2mmZKJq0nva*fK5*B z*PbW))vQQ*CuU$;{cXFm^HNidc+;-kBYHVBOBtp*1He%pxOkWUDPklwxT0BE?cg$vt7dac!*D z2z|uste}dpyVn_1FnHrtl!rOD4ch z-8v86p1LJJd3h^?(ZzLd{kIkX2{2hWahZo$b9AP2m){VKF{CMSZ)Wu~@B1%G_WrG< z@J)@Z%PDJVF{7>b3Du$(BG@Q$?Z~ow8WE+aBCkaJts3@8JF1$1FV-!k(pgz{v8b3t zsvU1gOJsKKwOm_S5woh+so3nr+rMMd!`&6XX|8S5Vu_nnd#fWsWYpB)4dKJjG~I38 zm_6Uz6x}%zb70YN@2i!lja7CW>+)Oje^i6|_PIe>g7t%gvZ)@;=>LZ8kyT)7U=yEo%mQ`%=V*9YH2`w?V zG6qZ4=cyW8`67VJQ5q0WrlsP&;iq2K$RIZJk(`oxHm5hn)iLa!Jw3y zQQr;<*I7^GEH`!An`%L`jO5}(@tfa<&&67>vuj+Y081l*rs}ovDKxj{-Tn`KrC$dM!G;3w)K-xSH+XT z#a4H?=a0WUPkl>OXYF7F-Mvn2P~YCw(sTN!7G{&!)vr6Wi%pJ0cI?#;EhGN-Vg^v{ z3SqxcBQMGa^^317Gv~i4#zNLv?}dMI)O-O~V_4`D+HLk`x*fX4gxp4B)iO5InMaPr z*qM3g8;_DGFCZB3piN+%9N*mqyCWG!+Fs73^TshFFG6t>x4-C}EMDnTk$uNWF3#PU z`YpN9E1!}?WF86J0BkK=7Xs-?SOh7sn7dfDuI)&)qMA~BWw@0)?UE(!f<=%bPZtan ztn{CCh}&a9c9KaFZY^oV_L)mBpN=n@S^xa)T*c?7-~aO6a+AT&?l9gxt-Ij&p1(A9 zE~vWvLC+uav;S-K`qxjt`sIr0vCaQI`SE*aKdbuA@XBXbCO`ah`ETzp{^TRY?ChJg zOJCkAFC7^67@LVKf20%z`2OToKBGU7Qf@sR8dQ}p^f-r#h1A{UCju8(BN|d_9@s0q zzs|@bQK;S-BCr#5cA4q>fx+)zBDaaZ;pum;Lunpdaoo#%)l2`39c<57C+jsjRS8gK zjp}((yJrqGn^^Em+p@;hP3^^2o#X{&%30M55DhRhWa*I8v+$ghub?t^#v;rno;@14 zKnp>}(&-FTq9+JD78NtrCtC{BJ422s$NFLglUvW3bWvL)z;F!q3ei{TwEZRdZbCFG z4MX!3v(rl`J{RA8a+UX&I-P+FUKj{>E%TYjJ`(Pz=Dposo-%L1LV#)&p`9+1yu{%r|7oVuIqFM*^?Z8~MaU{bEI zNIXn9m!rOfW_1u)IF@M`kat{)5SvE^E?AP^^&EdHS!wO8bNTwZg#|{&EJ+7vVxB(GefefHZX<`rOUg|Wn~)tWwpD!ILxd0Xw)=)Hr$=@ z1kCT`4<$YHY8cbZXy(kVZuLhA&D&VW6S_#oj8os6lxFs3&1;QdiAF15I!5LLG;-pc z*iH8#@pf{H-EGt)Mu|BS0z0}38r_BEnaVTwKgvx-=m2bTCt$_rE+yv$YRp*lpduV*{?*8@RtvJ*ch$;U3xmQFG+@<|Euoa z$UmiZ&) zy`3d4%}=@Fy4asu_al(M&HSVest+v&;%qY-iqZAhyd7&A6T|oC4X-(6+Zw75qh39)NW*7dckOXulmOThhE#B}mDB5I znGR;f=V;6IqU=n@eD-IwdGMJ@?ra5OIwMsZ>Z?DXrgz#%0ww@fW+1PZe@;ycSx$+1 z$@67jx0acQ^yUmIUk9^%k1OX*IG-X83xCs6;{oIlVKEh23Tpvwz0soNhbdr|*F0Yw zl(yXXKnqIrYURxtI~c78SVJj8&6Tc^*sY%?we@Zg~wGCljl9lwsFqSKFjoKPViEWO^KaaR<#n=^48J!Zj3WPKC$&Z zU^`q5^Weo@|GfV11mFh7cmKAj^>l;(LB$ek&Re=shffvwD*k{R5i|8XrPA*BsZ!XA zj7L8#|92yq22O^#R&JIzpBNj*URGvgPUi3X;zu<}Xc4PPILe6(K!`56*O+Ps2ymAG zg*1N665k=TTxf{?PSgza)fAm^yzma>FFv>S@L1IePI`4{L$6^r;ij^!E zz@kKaxH!zW*-37qy^3sRcYrtr6j9QciP=%v3(BNhkQ`G)Y`;HVYhZl=S6y`LN7{6FU1?E|ITx5BMYL$LeTP zG#R){-gWi}2Vk%rrKMKPkQDkn4t&y&_9{oQP=l?(pc8_7|wN+P^ zpfcOX)L5;t_l&LHmxq4989kcbT^QXQqQ+MgyD5H=J5krEHer{*XZvR0!81$~(Co`S zFhNAS?7Nch6vOf%+p+PEz@y9FmJ~bru0~BVc6H}XlpVZriOnfv4N<>vv21!m8#0XtihYf+*wZ{FqWW`4iU`YK-D z|G--v@3|>&5`XZB@j_eioIq?wF{ovp0R!%y*XIyzT-2hsz?gUbdwJ<(s zHb*I5<%?~}jwtUxXK2y|MB@R4^57)V_GlY;yVqhhs~V@dimZ&atuBj_jXFK4=A<8! z^|Z086F|kcSNxo5{}yd92Gj~Qm?#XHxhcTimJt8RNFy;%msx&Yxu18G*L&q_zq_gX zX2N)np1*ILSha3_LWW=_IezoRpbw)FILT2M7~(FRWG0A3s#9nF-ohO~6)bZ6BOJ>= z!gz{2xuG!KH_Ue#^YH;&=Z_zq#aj}$Bw0Q6FOx??V6$DzSivG!m&o!khvseS(`V@u zTS4UgbUe9K4tP-sP=87?C+|g>={-CU86g}ja(#rYIXd zi%qsI`)!}YqGZY2*>YuRX79~PW8;PV6~HMm!PpYF+^Ayd;NKr(No-vrF?P`sBX+oD z>t7L0%@_WjW6p@>{9}_b9LZ<;%u49pJe-HH*B3ZuhPifnIJ;w|2LN}QPyI?|2bSL<-YA%|o6=+On|AutUvHKQS_~&jZTZ$-Kha=cM~r61KNF>)Y9E zXZOu|h{Rr{In^VaeW!-QG6L=*@V~ zfOVK8$!cFm9sqHsZLJ?7oLKU`;-_;12DW;OLY#Q7|N4w<@E3=jYLeZg0(xcdBHQZv zGVh4;sn#{@{aKE4+hT|7Pa51mz&q}1zG5Vk+I7O#oRQeB5MVAtZs*>aXew<73CnZ6 zP-W>#Ea;-nWx`mb;t+op4gT>9iEp`Mb8PKdp-g)&9#U z`J~86&3Ak4)<~o77b#MRd709T_wUJ-iuTRCE={xOKeD^z&rVi(VBmr{h{U1ZanwUi zI|0GO*jSCf0x&&ysq=zpk-D(cCDn|UXvSv@?ho`mAeW!{_oyu^sVkzlbRRG7oH!BU zcL=~atXI0jxiCnSQ?WYRVLG0vosgcv^_pptFUeTTUJtgk&te%uxp@|Ze#6VT@--v(lozX#WtlM; zUcXCduTC?;u6`S$*mulla2q#rICCydipI%FVZu-EgoP_^-2Y>GhJT;$C6xwsR)w z&S=JK10O!B>I56P<#j%K9oerZ$XD^Woe|C-aZ@gbb49w7cR`*+QO2`T9gV9Fxw`Mx z_IqlVt$SgT<#Ct0y#MJgs#>7MjAc%)#wL?mnL0OLMqELZyh-4o5-ahh$3b`AAmL97 zu5&YE{AcZ^6~<{oC)RQEcgI(2M_2UMu&f6#6sb@?l(BYYHD247ow=u>Y3ni*-z_+a zZ6|sWw(?*a3e<&BrgUOxWBcWQ?HK2$uWZYb>saB;#N(@Xk8(yFILCUU+sZvdLUYKH zpGHJi^wd-?$*n{<15(vgwDZTQCwYSp8@lp*j7k>r6#)^78|MbfAc%?{d<&sqBRM?k zTJ8lsA^B9~sAB^2cj_q6v_J5(G89AwAkWudMkU(VFf6>gqTb5#EsbZVrZ`2ODewAy z8&NvwSGe3J)+inpP(`D_wYlKQoFOcRA)FI8)g=e9z}uN5b`vM}rEcFpJBcgm zs+rI5E7~G(Yh(vZ1ZnFqmIjCMLUQFBn`~?irOIR)NI!6}BJ#ur8v0fo>$W>4 zE+7nHcYUE-_AC!cOt1dElzWosySXlks_Dlfjg~KhsY|lp+|vV2zN>VqPQVZedbp3$ zMgUKZHRp0%Z~p?B`Qx&%FL{BAY3f2Pc}&vpa>h#aJ8_!Hu6X~Z!mu35?Y~hO~|C1P0?6$0sGMjUb zx@m*ISC@LD{%4CVD|2iU$tCl*9g>*o(G|s-eXldG_g{zWYquy_b_5p9Zveol7HWVF z+;c8M^IYXo-W>D_{Gr4x5RFDORW$ov0)u`n+Z9J(+&oCRF^k0$Vs){dE_Np^ISjjF zR=yFO35lu!m7y^f3$n(&NRlVO!E49fyf0)3b_j+X?Q<(&n(?>!{~s(L9%T>11H>y# zHG>UDXPP8byg=8|{A3?^#Jg~e8NIvXPie41>9TEsO!Sy(`KK}vYd+x~K)$u-|9y+( zw5^@8&Z-}nnp(Jm{rd>zj6|dfCTm3UklGdcG@+=~LttaP%#3`{W{Nu%LDz1y{x8c( zLsVgGewu<~b@qiq{@Av%%Q8swQh%hGJbu-d=6F|P<~CBcmIQ2UBjJ>y65w$ zjAXlxh@*;r`B@@rlj@udv!U(0=lLUOcYLzMq9N`Bncxi*RL>GR zJH;})$e{~NC$|kI++A@LKmGou&1OA#xcJ{kw-S*aKxIpr=m6PQ)sU5%x zwow|fn)4*@O$gP!%>Bn}XkJ;_gmpeO$2z&JR4VYBdcd?up4?nHFZae4L8TbcfV?oa zB2)el_R;$Ca3?*$9*%6I55k{(lV<54%0XyyHlC{>8`RQgMLSt$BOWQF+D=f*7+S** zFpem}F?dZoRGDmL=i18}B-zGg-7HYffSzig=g{-h2dYN)=5#b<2~Vdmf6mZX|wwZk{xl_iwzQN+XP*-TTTb$^?&Zhuv>5T9&R zIwG-|fB+NhikMRK$&hg+<;&9hD`Yu$G)M?*K3m!gTN}kR@z)_IJCIQWE+J63QjN?{ zDa=d{eA^&TEnTO^ZS?63d~bZ54lQB-6M)Fw?MlScK4xv8F#>v`@CVfL+b?A6c^%RyFZ(4*}ja?8YZV2LNjh3N; z#fHfe>axqP4r*^@jQb1aGc=$JIMH)r%|B5IMu}-HOO2JTt8*(1VfWTeS&lZ2mHRp6 zPbx7W<1#tzdMkKE+Cl@w!LZmCVqn=p(;!e(xE#iho}SJvC3!T|V;d)7dRVS$t1m|8 zt@zk<$$Exn_kb|LX>v8m3CK30i2i1Z6^Wv=_jid$+X|-m8z5XHLsm}kSYk7U&3aDd zrRF@ilg|D7DQ7|Av#-b)Ag98Xe|;9&LbEIIMP~1RR3BTlPS$T;1b2ZC_t=mbO}##| z6h)v#kT2oFp#)p3xBEjse3KS0rj_o3GABJ;2ogf@PF*gn6zM+N+IiDn5iKxG0C62U zD$E5+077Ab!~Zc^S5M~)`2o{Ao7v;bGj?3kJ7vqiW16Q-gnrd#nh4ZArRFm>h)uNe zrk!lIa(*2>O_mGsr3wnl9#`z`C|9<3s~gcVUBDp|*$v2xQTY=DW8l_n=!ufGeCtt$@HSvCE1O(dO^6ZHH3%CVdj$^q|hrLPUO&f@ivM*9OWt#=B8pz*FPRtAFeYzjVIPP29LL8RmzPS0Z^s>UNr4 ze~QkDx^8|TaIwouI6C#!!I-5G>)0an*=KnrEI@H8hQkPWeF>-3N29#eUm{lj@3irA zF?^3Af0fq__>}Yd2b-x~0yW2JK)k0p=v-dj#n5~jMU@G?XyCF-pOa&$S_hdg)~b_Bo~;1}4RRgc+4 zLKDM3HzPn$>D(cd9s~mNWvXrb%go}LEoWB2& zWED=R^*awoo8#MKnc+^sN2OoR_>_LB(|zmh-sb2n(K+VF>1WLm62gUB_g_%k7Nv-p z<^Znu*2F1k4z}z2U7V*c`#RK5QLOD&ejTABNoo5#TMX&eUh35hDsNfw>M;#R(E9Vu zq7;VKNEBu5sF525&jRu_b>+Vt5WiM1=NjpbHzP5}xOjI;EhQZBKx9-#Q|9R#SqF?_UZrwtmpw|iZHrAPT8a5q_e-HjHcv1Q1WgF*D6XH z=FFpLN$16##GIB7*8lEofbW-<7fC&9lIr;o4(v|{tYZS2Fqx2JoMypdtvtU-(&y8$ zm04-S8zw4`?^NVlcpRyRfFo9KmZAJmE~I?7a!#q|cawhG$Ai>#l3n-B=;n7*AS`oc zZw|&<@OdZd;OAbT?@6vv%ax`&4Z%ppTD)!Cv^>m{Cp^3D@+$23QNw-P+CQytNL`!x z<9oE{hMOU1jqB{Uoim=KF;FE}!2*4^=}Q)RGec^tc$2BYuF5U>P>0V8eqA#zKUe8i zjxhA8B+>55<5n^Z8*6incI(jh-44|-42X=-m*HEW$YOn&_9H2iqX#a611=@|vcz2> z$E3_Rf5=6)I~v>ir`JkWs~=r`ytCNcljeZ`Jq{)ua9bBX(a`VmJJcAmSMBdqulkc= z6kN-SE`I4a(!BM_%>dqunwIj~Kj*pRo)SdgI|?zz^>6_!qAIAr(mfnurMpz3TCwbb z-@^5bl$LLyx^@V|SuAh!(D7*I+$F7$n7)AB&4y*+G~yon16&$a)lg5lP`X3$_t|Yv zw`1AeS5u!L{o$&}r=qA4VV5XA+iqpzq8ECj&NH4kq{U$R_eyRNJxZjh=0E_|#0nN$ zZ8cta@jL?J+<}zGuTLRIrnN2d&C@JF*|wR#LlfoSW%Tg(g@2_Ok$+3y`it$zhOj>~ zf%7DLG<{6b4#&N@HdA&2GMUdo>BaqX1E1Q?Z*(?3XEMg@D3spIHsuDTu_J|^yK!x0 z3&#(%(YZe$QsiZ}{ZGSJTK-|lN(dZDDbT;Kzr5+)o8BQYFEP*d{3|r|qr)qfRa3v_#*xGe4$o>AY#f z>-d5rJJwbl=D?fIY=*vNTq?n5abAq>-=+`pj>4%esM;XW#NTkI)|9`zc>?P{w%R9c z#>IWNmLv?3Ck`aw@3i+)cMJI(`nwim?kG=hVR@+g#1xXhsT&{SvLJis{TG{tAVLjkQF=U~skt0(FsII>Gb`n2w zV4aQGR+5+7#XxJXm8XFL=L^bzq~^s1U6%VM|JdHOiq<%{oJfqZi_RSH>M4;oC8^I$ z-D>^MB@+moONq?_XpW|wiBaU9G(l=-s1T%f&F{!Y;&OM!<|6OEcE;UZ-%`?B;y z9e~3sk2L=uhC65Btpg+=lhSsba`WBpWHOx6Y%;cw8qCLR3gEv(D$Dv$GaH*b?q=1u4%E*ietA!q@3?rfwt z(krrCE+n)@BK9(=g+Mu;IT;ZT({q@C<#TOPsn_%8_P{>bWwOkq$tq?%$acOFm*;Xl z>^QHOa4Gg5*NxP@SrE}Q-ZA!pjd^F>Aoqqp!3(;7Q|?g|og2uZqTs&ixy*deJLT^w zvorkzhT zPj%4iY#0GUS*#i?u(6GONt(yryp)aJ;T-q5$??~rn1!#dyJiL?3!QBh{Zu-pDweO ztgfiu^m%c?V{(%uyBg?pwh4Xisryq+Nh$0`*`%PDiNR+Nw+DHvOTHn;chrNa*BX-6 zjHFr>cz4>dWp(1B{J^8laSPIE5L3xrB-QypDD8ZH!R0aY7Gt1*L-RM|k+vrPd1nip zMbtTrF~w~mMNXJKXFM|x2A@yw1Fj}28?Ks5{xMvRyt?vts6Xa9GS(uK7!D3h7x*GD zc#+@&N$QI*w>>1ynNupYX$~2Wq55jCRqZe1G@mK9r_=C~Gnj|L|H1qSIsW_;Cz|hG z_RWjWwPL4Q6)a|dM>g_5Gf~(~O+b#^hng`-(^elo$$R~${HIJUc*TrIF$g5CArhBg zh{5uojgL@m0*z<=o4IO)2ZU(J-=N*pD@+b<3>mkZGE)npMll|{jhUrRe9zXUq+o+( zhxG4dyJM>lR}_ae)uh|6-oGIClO2l?eU3QN8~O$B4u%1-vgW)+cCot<2ihXYqG6m{ z7ZAk>K4k>mxo*o!t_<%TiWP48QFESG6|@K2M&D7~5i%hdb(;AS{@K0xW!x1g`&P=` zX}uRzRfJLxlP;vY0iab;%?H6*mZ8UGxwcuZ<|`=8Zky4~z_o;kv+ z&3xK#=xDOCbz$A;BlLHXItL^(Pm4%+4%HY8h6mFP69pp=^-lTm-v0F&x0Bq2QgdP0 zT+R4xz&=+usIg3tW2loqhWp;6F^WZ$e4;wRe4HVK`VvKk+`;x#eZE?f9tP8|TId&r zLu8!Kw|1I5o7ub|x-^V!*Uiu8NX>Jl9)*##?b8U$IniCPWv2~H+fVI$&0S!->zh zaCs3zXCGQqJD2FSD%mjpq-zJeWkiSp?HgbI}aR zT|yGg-oMTb$SJW?LY`=I!D8du^TN5d*MmT(;2#cD9bCYP{}^?mffcyT3$( zq^nD;`ubC1N3kCIm1VCULq{@X->2>`mn!d~mL^#^vLmkhw{UO8a$>nKHr`ec6M!5s zWBmp~)9Xbn-#p#jBW~qa0z`lFovwQ*+V7JlCaoSNu~>-EVO&HFAKs2mf?t3O{ghhe z9>C4oUV!1U#JZXqcIFUAiU<-+{3M_eY%4bem{$ADe%q`VlnfU+VTK$|ygS0D{q^*F z<8)vCKfiQ!6U~P6GUOUt+7C^2luHMmF9xLoO7H%2oDetU#gexbdu9?c9lmf)db+M| zB$}X^GfWecQ4w{eh~=h3w`*$=@KIcJt+HjE-WO zLWm~%RM18xW8=?+KynPBXpzU5eS5O+Wj*cM4Ri7^PiC>^y`his;`KBaEBwFW)xnb< zTjmoJ&Qv=WkAFGRzwc&;IhO=3d_FTP6$Wx8=eJrJH+Ia*Asi znWd!Ue7T!iv60)Pr@4Y$?**qCrbrnJW`mNp;oRbAp?dDDGjV$RJ)9NJWb^#T(mNop z{F3}Oy%WDZgmE8r?W59-Ip?E73M28+@fU#aCqLdNrHH&5Od?w#C@B0X(<|nGO2ZYU zC_nnkm2yXR5K1-Qp4S08<)IcG6_MQ`tGJXN%qq@Hb4WEV`62X;BGY6SG=XNHW~jy? zpNg%}1mMYdEjaJ}gTF)8$52@{nMU)cohr8zez|nP8Rz?yjxWm|5W-w4)?iJu3^C@Q z{Z?4`m&AcbFh(2p)%ayXBZi+p*~*(e=!E?vWoOl+Qcs?k>`~_3ehgxdcf_?Bzv3<= zhwoQ3$to7QB4l02`-@m-Tw_uaIp>KX`CaUH4as0~{6-%O`Dy02{LAfIw zk#qtli;}PTx$JDdbdHR$vd_B4X6&` z9Ot-R@~zdOfl(S*deNgih#tRm+Q4U6+|s^=8i(JT1ziGN$H-{ZGd^8JRnZ4h7*qyM zP9c?G4EDQ(L5F`@E3oMQd6RMNM`SrLQQGi}_5syN#1mP}FoCe$ zqX(mKBz-FOMWSpAe;!^;u6t0;WU|O6+K1>&p;v-ji#}ej!F7}sQcj;0$KaQe&4kRY z``{mBM_n^N?){#@Ffi)Lr=OX>{)Yh%(=_?ETneYI9p8O0OEnP9%kZk@21HqHQW1o< zYs-56lFLv7u!H?=CCwIW3v#9}=`)o80S6yLNeNnZFeK4n;3-u^AL{VOCRevN0@BFl0{wtM?jLe5o2&I6KuZoY^?KH!nWSE^H;kEJe`oE4;lE%S$!`;)C}c2~OkPnPRz5i__Me7M8povTbQ;H0 zOlUAzM5Td!vYQ3=w8-P9(!Si)$UnkfKVN+DK@+j47|h>>{vH@uJ~KDm5nPbx!5JHA zvb)jz+%oX@jkdX4znHgh#Rrb+S3mw^@p~2j%l_l}p8q($zsE8D1Xa zUkKj+rPJ}=7fFl0{PNZ8CX-DE7k@k9GBjClCiXgOHu2<_dFh*eE4(q0Uol=W^o+Dm zGE7k@KaX+g#clahG;lXI2;6DpnsWibte8lp>C;L)9me;iZia4gs z_`YT@`s(r5=T0=^YaLkxQ4Bwmh09_`kiLg1IE2wIqkkD2|N~*J?S|*5Sm`W3|nx@WP%j~dm^!8TV{0Fj=1}h%36T8yb zf{a*H*T8%*FI84Ct$#T%xhA&)O}zMEZnC|aWUSLM@(?ZO)sc-umE^=#`AgD~ya9{y zV~Y0DM4Ci@HU2Y2Ss^Y+hdom-8Qt?F`^3*bQHQ?xn}PKGP)D&K-Z5Dv{|N6WnWZWH z4KPu;x6z(X=;KEd@m<|L<$%?V48A7+m>`+RuCCb=ITE;FdbCSuLZg+)p3*0>JVGD^ zPUH0G|B)(i#%!5k-bP@oRbXxo-NnvWvyqU=_>O}x5xt0GgtYuEWjNxsuG`5GGKNrz zfJXMIQo>k?q)~+t_o@MH<%Dk-Tm#f?l?ER|xu+k@$)La8oCx-41&zu1VxN`>uz*z+ z(_bl)=(A(TW@OIieiWa#aX;rzX&~=%{?wZf^Q?k>T*?DK)?@^=&)@u{{Zp2>(QT%d z#A}U4wO<9Cbl;NJoSRr%%}<8;FidUFL`&HrrtyhJe})}Bk|XFQT3In zln%Z>apwan(Gj=+V7(f2XfoE`^hD5?I7WBZnPp1Z9?|dhdqhW1P0ZeVW%#6bE|Sqb z9*$;#vS+IaiDe>-t5O9Jom^>{M8*&xmJ52#hpPJao!ex8ly{Hn)z;3 zlqktz8I2kUcA@KQ%xd3EFRcx8kz7*E>wse1Xw$jk)$?2VzB35MGrni5z2$c!iIRaanS1rY49 zsj7Y-U|`@uMlO&Xe9Q%NRuylDyI<{%bxogsxoOMgxZqMbmxqQW#xUUZy7Hn9o1X?M zF|(^W&73$#(m{GjBz`08hYl_%5Kpo(Ssh*l`m)Iw^bZ#a;jmK zzO9-B0dIz6X@b|b_Cw(`gN%ZUfXu!&E!}zmUy%HORl}DGcd4M|$ny?r7X-Egi=bcN z>f{NQ0CTZtAuS6fTKF+~rW4i*ghWzb@VZ~zu~4{#h6|b|;D~1l01W;cUWo6f=K>v? zdz?Tl)x8*?fFpUNfTIEj8Sw0V0Hw?^ zAnn3%O^9D!>yQ!Rvr3=&z07on*~2!SM}vm-&Z!4Td3kN^K)(ew&Pg&^x*3S@+l z6Xc&{6{hTtD4ariHtF2Q2g2`g1LA?ET5^mxj0>u4{g49(|dbv(jO-rG(!m;nZhnWkh;}f%q;Zf>C+xS+n6??vr!L^Kn&y8 zGFOCiFwub{0z5t5yqp3W#sB+pJdT2n7c!gygoTaK7zFF!Q`^2@=ruwthp?%+Yc z9}`(wAeH_*ItEi<+ls^T6_D2lXoyi)m>XTD!1-VZhSDXlq0HJ>y~@fNh4)Ecxe! z;kX6kEtEd3mbunQ%1%WCN~q(Su+9!-^9TXBSU8OqU(}>Pn?3+MR;if94GWF9sYL6l z7nxzej*kYgmpyWlAWc(h7V!V}D-u<54nOq(i1Bm;u_^q1j26$5xd{OTK-4=igP{Kq zSdeMjQsGu&4V(YlYGpz=e^xt-VEjUNwQlU%oeHRiOCENF!DUf6PT*lhR!Av}Tl4sb zP5lYD5{VajCzgSt@_&|@j&GyyH+`JdLV(U2U&IeG9+CVxU^O;!I*yp1+@#O+r7_U? zGbmaFtiJ_qYM7n^dz;ZPd+g*grW&EUhidCxs&{5-lcjh7gT~5+)|g)Ye<*Q3cg{?y zE;WS8KA@6u?MYqE#a<4Xu8>P(lX%A_(}-L3&cYUzB9B6CInYl>0`JIgfNKBeq|cfI zQrP~|jZhUu)qqbkx<}s;9$Kwgg6o_dAJhwClf)4~niv1V4z`F?3>#%FZLz>$z zq3K`@eapjVgiM4|7>xe`qd=Sfw0E&UgfC@h(NvIOc1Wl%w%ufkVS^W+&IdnHRpcGr zlD97amD0%pQX%n~GjY`DE_XE{ye?3-(o}Qelqzco5%-~IpK$N@DBPIDD5wcEM=;h` z*P_oElXi%-A0O_VD!nZV#|Q!PyI0&poz6sHu#PI?{TbYg*hyUuEx$rfV8|a{T3#3i zZBKp-_L*#yZ^7ld>`ayo2 z9o5VXs=mFY)#b-x=nszyk@*p9E~x!3wta!FJQ{DmDFr-GhO2YAr)uA;yf+f=G6$>= z4nWeo^ledGWja_gGzwsJ{-PaN5FeVgX9V>AyyfbA+4}jFBRymK;O>iFtYV1$hl2#$ z8Y|?!iyu}2qlbi}kF0ugJkf!c0s(#cg8A5oa$3$&UBd;7lIvddgOCrm2@RlwWa^}~ zKb_WGjo0g#!FX*uP$uwF8O)xI)olWM$jGdU!`OGwrSmRD1hx??3mCQ$W`Hwz-_awg zU?jhHs^RdP?-iK@VU$dI;Ku3z{~*uGifDtBwOZLx0Lk)i5}|#VXb&`0m#zUawJc5Q z$$JTD-nxgN@GPg#%Irjf{1z4-{+1@~dcdupxOo8Df_Dfoc>K@tOI1Bggbm9Yu0Tlw z83I7R7WkoSaF9{tcW`9e=z6M)W77fyDCJRmGLnZ-47s#KG`dfB+%SjL%ozTIV5$O+ z02?VfMa=+PoJiCmTyTh(~#B>{A-(9 zT`ro~sYwPf-U8h7{1)K?@GWC~%deC@#QtLYY&(@!pnux}=VHLefrHT%jG+33gtw!~ zZD3f5Eto85k@i7?$4pjz2CME{28Jl@75ZX68DFOt$O^Aw=$o}(XOAUF{B_8lpO>#m z`L`B8L5~Asus_D}gu?Nh?y(?;Q|kg~-NGqH1(^=U=w9DZAq5(A+zVi);zI;awCz5L`AzFbi2&z2-buq*q+CP64tlmfj>rvDc^AN2>c5fl;8?-kAPaV6Eg|Xq z(2R8Cw(fNYrGT||TAvB*6}+Axg>Gyz04|&sIi{Ha*kfMfD)|s?%C__~KY7QGr0y6g z%T6`)g+gac_Z*?LASPw;CByh}FR6ZKrD-{T~!9gF5nJq$JsAa6O7TsLGSg* zOBHb{%|v8Ioo4SOVP8x$10@GGP=F+A)e3GH_%CC)FwRMf*iytX;_e&eaG)2yesf6i zCv9o4&E2o}nOU}69sAjUX@b+k?6M0`Bl2>ZVOPPA0UlM{%L4gY)lCDIUEQ<&uRHvU zaX76fSRh^=P)*35Pz47MpMAEAK4rcwS5o>tmaWspRxMr1(Mx`(3+UAha0S`C$ge_SVv4_jzCnRCPUDyVwvS&-{xro11|9$ z<>I4752QU#324|w92_fT#Ku2B!di?20T^FCW zyvkoVTX$Z7=~7saEc3O}m0s?K!7B$Fp^Jrtva46O$=ayCM+T-}~&t`gYB=fL3bNz$gB5Lv)ZUBs~d zPZpY8SB>!sddOl1r^a*l*a>x2q6kBr0v>l>IDa~*K_PGkwPc!@gu(FQ^$>ClXRqDA zZ2ax|m@U(BaJFb?@XYo@`>e9?jdYm1{0)AR5iPz+KY`!Zpd(#N{F)ulp%3E*OGSI2cJCJ!*Yvz;N;m~(r|!|_FksurhUNGJc< z@-Xtx&`X;!x8wzY$R|3g|7r};^Ko`Yxxh!yT+_;(w=atTYnN$bB z0QE1Hzef(@0AQ!!HS8~^XTSv2H?deCs=r;{EU@6oHvst9@Zx7V;4_BHGKA>>R^~4Y z7$;1hiy2*@4mZ}NSUQHg`1*IbrHZb&>?YM7f=Y<++mkF7z)ShdUgbe7(?bu26V?i? z1?oUK`9?!^BQfl*)C|~>$?*tP66)TLksFf_e5(pxac$bOh!?FnxR4U6=&KDQEPjAc z&!}gV>LZ(89Bk&1Pxwo#s*OJXnw zEw>j(gX?8au%wHy$Bg>_B0(mGgli(Iz%?igCpI`hH@%#!5tld!)DxAAYbBEk`V>?f z48wqAdXNzchyd*T1pViAg#6yuGmz!21*zDToJgVyVVFWW_xs=L_X%eU4czAO=T1nZ z)$j-=e^Z6=S`Sw4=3uPM9ZU?&R*4vR*ysZeD2{YejF5#Hbvbh2;1`C|p$+fr0QJLV zylQ!aY5+GgWQf!Fq_G?!)VU9n3I1; zmc^L-E61n}1O7fIY$W*s(^MfGG)JB>i%C%>BOK?kWrm}uf>o)*qNge@wGc?#FnOm3 zvWPq)+CPI8#7)-z>w*?R0DhmIlLmaN5(`IKk$h1s-e>_MorKx=3iBdmzWg18gP-J> zeTI)PCVt0G2$*f$3uo#+R$}z50)p<0y^|Qi9AW~AHz`DZ=Xrvaiw9)J&J)=;iX#}pu>RI2YK*Ctxr4z?cPW)3I2lf>ibuWgpdw`n zm?b2OsX-&4^MSou`q7EzfpV#VR&C!9`l1BUaYbu=Sxh*vz-iis;R{#W=Jmx0QLR@cUu_y|otQZr2^$E*h z0(;oyxYDrh+N0kALD@z&fMU0J8;Ynt%#v0B7Z7-B$xc?@DB`whVKmN+2E_JS6Hm@CyV^5Ug@5Ql!RP#8;$fYmc65SGR0rs;hMgN#MxDPe~j-|+5ubIHmRBXL}h`KT8CR45KwEd}MQbS{g zuMl~HsIb>Cif>uq+r)(az>gcB=m@8Ynk{|pK#?OHK*$p-((eC~$`=}d5B)p$ z&ye9I(7sSrBje8p8Ja^^s0JKa_Znpn8Sy(Dmt_x`BU@xv6vpJ0W1{MVIgyvtsUO~eG^Epq$~eZY)K zPo8vL3aioyc?cr!*_gTD>YJMe)zO2VH%tp+I1YI6l;bfZ7N3J@zJv@JTCYTbjMdhUbKc*x^ggIA#(h!9DXX8hYPfV%O-{XA-e2HZ~Aj@ z06Ek)A{Ln79*5X46NEkhMn|VwzZ_;*D~tHa{HC!op>_RuxO$VebH^bfn%DoNX4N+G zTK)krgipJpEY$>v=iC98o61uutMhkRb;_rqWV@r4qw)mj^1G|mYZLyRGBKA5w>L!H!3rwU1;(+Bqksq`^dbTR zp^2eadkg5Gg3=UFBnc$+9zX>|gn)P;2n3W82_*uC5(v5Lg!$d)e!ido`7qDSaCTdJ z?X~w_Ywh=?KoHB>$*_3kI4JwwG1oNH7^PsIdxSD3K%2FKi_~&HJnw>wzQW))q~8+O z?J8%rrE}o({&hBWFT7oY7VoehmPf|C4L*;r5gMHVNYj|S*`I?>bVJ!iZkL{?bWAnZ z4WYnQk>hAlE!@y#N92gN+{jH~M^Id4RE7OJ;ne;17EuiZW3G;{KPYCJh|IpZVe3E- z8o%=E;-tAyv9_Hm(T`nbK?FhGuPJ#42*Q8dC_=VRljQpajZ6wq!j*K&L*W|C}M9L>{aWUMMB}AG0|#WCB+| z2R*yN@O}V-%H$IrD>FD^?r_Koi^7iqWSMp+VwXA_`58!E95L0Xmqp|zQ1+a_6Gne4 zX{8JKp`kGCz_pe>cbF%yd8b?uOC#o#HGV`;~CeG9i;vyf+)G) zgBY&NgYd2h0|4?WN9$0q?;VgNWQ}?Mh|vq+oyvy;o>m_O-@i=1|YUpsfSy?yDSX1R#P$C`SVP2(^`k9|%XV zV16X`>gcZ}Z(4|n80=FJ(m{AV22Qs@Q;M?iM!EPs1F%i|UrS1sQu_eaXJkcClQ26a z;$Zsp74t|~4R1UmEmAo#i@452ssfUYiEuTW(OyA5btOy<^OkKYnj|5D+h+WCzYpbg z8aN9(%R)d9e26M-2^?cL>7Bm$_?FQ48tE1wGgLXtL=|5bo!&|S=|jc)=P$`{G6DJ= zyTR9x>d&!i1Qp1>G6zJzEuu=8CnVk0r(rfg-J@5l%LJCCh zE4WmJB7KLkF;sgk`t1!#`o8+t>qG2T9AJzcYDGNFHV%dboi1Ja8)bR>f6G%44y@A0 za1AX*-o6uk3kWLx!NvME9o7k&;r~(7lDlI8aq|x1<8Hw?N++hRxXBcafG}e$kp#DG z>SMT$6ar~R`&U_!PF5P=A76uW;s*nw8al|@XORKiD)vF-#7#Sfp^6vR!ynprmH@&J z8H5CSbvGiF>&IY@D?aC z_Vw0yO81WGfm_v(YkVSC`AX&QO3pKiHhfc(c^YLfB5%$z9(8-gXf3eWj{zZM5E^%g zJ_l5=!o33g_O0W_q;xpBk164}&ld%lL`4AMN->Bgscho6!DSF~1Upb|@lR53_xfY* z6Z_09JBE)RWl~dkN+Ls`Jbmn7E>ll3d_uv_K@ATy=OVP{XRy(Bku(0{&0N1+T0Gbu z6MzG#2Kmjgy7dZ8Ni+%%UArKG>LXVm10T~@svoI;J=OmX+Y?c-l0$nzcBlyp1!itI zYy%t`dP0qv`RaLI72jA}{?@Vjl{Ll#{C|w&c|HIX8Vvg)W44Bh;?85=;ODCBEE-!dizivVVD2P$#S6SUcctcJ$g>?x7nT3p?bb2_+353Z~H0K}Z zeqpPEDpj&CAb}*6bV-*TOBN&-4OnDXXRyW=)wvZ|yuY^ia&iZ$60lXF3K7P6h&QJK zs0lx+D7}soMqzPD*Zre_~QgEPYJH zwt73*BXEd;M7EpdECc#vYS1W5Ny79wC1(x$D&+g*Mx-6;cp~&l$Iu7Avz38*H9nVi z3DC7V1*FMyaPvg1H6t9YBpYjNpQ^9)rWJD1JG7$@I8};t4ttZjEc*}l){QLOV{_1L zXdqA#%m14@%WmK5RS=O~tS>fO4GRI5&GLb;Zz&;>T!oH}=NyW7eHiSTNW@>FR@I;+ zECdkdE<<0^=$6Jpb@aF#3z$v@r2dcTfeb~dT%cP)r)C`0^Bi#u2VlaF(K0}(%Ip&) z{e2xuk*>DIk?^Cf$^DdNp(BYXZEIK>fhB$Id8z6;U>_EMa;6IVF?}qoH7CK=fgpJ% z;CV$LAP^`og#Gg4hN2a~aK|HDSXuTeEmAU&dlX#F&POWk_lJa@}F%l)gUzcfb zh&o7OQUhOL=zsKM_$Rnr=n+HtGkYrIo2VX-w14rq5i+JCS9yR!y#00XITu zfGs{gh5ByVp)Aar1neTjO!q*Dhty%Z*3fbgsTgMm(;T7gsl_Z#WBfJ=5&>U9Be^BE zc+rwOfr!I)1*;UoZz)*6*UG>H#A+M1HT-FuUtvL;UDdG8>=E#D&w^e`grX;qYGQTL}P1e4?u;MRWvBV!g2pY-QSuiV1&-o{2`H@J>o?kMrcRo~U6tl;zjFFGrHyb(Va% zgDc8-Ib>JE*DzOZVaG;)gZrb^3BCjOEXU!9q zGky+ptmT%a+_M%J@f6EG)UgHWZD;Xg0CgvYiH2p1pK98*WjY<1u#HrQ%0yD?cHO}P zHbELYvtzq|Ql1k(6t1!1By=YAGmy2leq=xg9>+-<49Ss#(an(>!XnXLh5`2~TMwDT z%B9}F>XKc`I}(DDJ;I-l0Q__FB5~0a!1nD)0DN}=Pq*(98?V`6SH1O{Nv^2~jSba} zY(P)t@VzxQFRF}3V($Q`Jp-1i$UHfn1P5c`o~H_E)T0Lx&Fme{ggjeAVi=Yro}2e$ z_3RgOB)C}qqajeeKwaN|f|^>uVM4_E{!FR)}>Z84iJ*kWr&^mImAv}Ij9X^ z?$a0xif7-1u)#5Bg1Qa=FT4QrcBua~)5vxW4gvv{R>tO$Q?PYUNRblJJLduRYk<_J zw{as5pwx#FP#z0^>*W zgfvoW3E^&3g!|GVlWKSsVq$AJf5RuJ4|A>M7RKy#RCd_lrH#~!I^?J#-fV*>&sDrj8*zyifP_Rz74Dnb*ItN(4?kiXz@8wt)i;*^quZOn zv8paZ{AaczO$p|;zbld_+q_;cSiRlvk6}JcfW*|2x`POws6on${@yia*=TaI?n!0v ze_1Eafq*}q$aLt-4GTl%H``$%Rc+MECjM+3a+sywQ}1Wr9j(MBLR)lJ5vHHQ7pAze zKDgPXri7-lzvMPN?ZR8)?Z~3?VvWm2`+x^K!Pz8qWY2E)g5s;w86HqV~B-q^$r1N=7F4c zO8`8^uCy$D@A(Y(#KMkWxCjZWs3)6>C{)tE&s3@FCH|6f#_u()_&dcAX5%=tfGbcGW=isb#59Y}OF=juGiJ{t1(3>=l6`+z##mfr(!&1#=2Svfq{FVUZD zYdlpfZ=04Zm|VIQ75#!9x=Jz5f+Vo2#;u4(@|WbZ^M8{Ler&ciJS*P%bg!lHo+pI*6Q{MWUC|C3OWacth4oWO@KX zAW{r|@`w@XqE=FrG-2u-b$e7PZxmq54dM%b?g7~Hwb$23&z|U{{10|ai4^CX% zsMy`x)_!pLilSnQx#H(o8^wTAjf4Q_lQLq*e>r+iHde&^V&Z-mi8H@$|KsA0@K5~3 z!QK*sw$z`ONv+jZoVhW)V=3`d@NU$c$QFD8+4g)vK`<)H07KYLnD@ay}Xh2y)kuMtM8(+t@NwZVTb+ zNVUSw7C%U4(v%^W4-)5E(dAD4#Sz}T1gQx-cjpZ-zhH^3#PlSkHH_>rjFjDd2X!BE z)xuZy4#HooTcm_Sd9}AKq;RW7Ot51_MB^h(m#1k?)geK!RYBh>*q%>gV9X-8-){hy zizcxL=+L1mzphI%Q*nGECEX^~GL>O{W5)Gfys?c#!P8aUGF>?GgV0+ix6YV`M?`#n zXHQj9gw$!_M0VDClQ?)h!YjzUE19*S=UsQU zCdfG%0E2SJrpwRstRmk!HYgE$F4mt-`kH{$eE4tx`h^`vkc9J{XmzSEua8sh3}5jY z*|G_RKvWWfU#y>RtzMebD6Xtp7-efByAe6SBz7XJ_g_!xX>mbJNOtNC2ceriClAhy zWxo`i9U(V(ztVIU2T@uFP~K~Qhnj1TuS+IZSP(g{nYMk-mt~y;`$7&*7RC#rLNkjN z7Ea!odBiR{**^30WWeZ0Ltl-afhy9ZK4K#8)(m8}0%E*h@2Nd}1_k zvbv8#y_nuJ#B7!#dZ#+@@Qv!&z%c?c$7C>W$~|YZ375aN%+1i#kzIjlHmQBq^>Zop zjja7f#=%olc@!twd`Kg<&-Y2D!f?|LSrsRezE?naUwv1cZA8RG{lo_17$=}|403NS z_&U!lS#zHV<&WvTM~qJBvxOF8nn3z;9CF$@z6pM4XkTsE7b{2mn}+w2JthX}<9k9T zTZ$LI^w)J=3f>)QqZgYyQDY?t7V5?3xm$=?31{XoR3nmn5~x+CU%|b&dAd;IBfdB& zanIwuv0IljcrX8JlL8*bi4@_SKR@|(O=r_yl1eM?l8EzS7?!)Ed;oOK-z^Qx$1x2+ z>>_)QLybSP5lxR<@KA05C`&MMA0=TKQ!~^lailaY11KO;i?v`}bTF(5n;eIAl>9vq zUgG{YZ{~@X{n%<}bbUcOt2yIhs$sTy?-~&X8(f8sk?z8Uw;3M=Z)0B;UW1QB#+$zu ziq>xD&E4zqI1316)PPo4>_FA^!Dip$5RPkym5|7n@6$o3!3BEZu6$xD# zfa0$=OiD5Y=lIj8G{jvzxPGMngmyIuL-#p*xiaE1U;~N7hz8A%i%^fI_34Jrjick6 z?Pz6Z6Z_MJm5QZ0MLKbb!f}g8K7l@VYgi^)2}04Kkf`2nCT@@s5JQ1vx-vHZzqZ%e zWfVg4C9lb=aYzx;xeE$;!MgzuL}a{WktCi)7J5@xtxLv<*EsS2#E+uGbaLy`{w@ey znTnsE*s%ypxadTze}R$QOSFX71*pWGUAjIztI=7Jad{Q5ob9QXEdc|;ZHEfgD7nhE zse15N>V$)%QsQH95Q@;gl!K?r$>*$)DwA;tB4f&*C9@*3gbcnOq0Y!I}Er#3lRVz zSV~LSj>5^~`!t7NAjPuVW@KkW{Q#Luz)R^*g)!bO_ad5Z+k3sI%9 zHZUNuFvhkH`g$-gwR_6Sc%y8C0x>k|M{U`Sd&5jMH!R>4qQWl@Fy}sE>#dCGZam7+ zQ**Fx1AOUhXTi80SxMzBv&+a2#6;}NH5C#J9gS8b#jvS#KPDT~9_m~f3@@_3=E9PXi zqhnun*jrQ`;U)CnF4D98EC5B-KuuMWuLnSlx{?ZoO(soz1cssnITca(k}3zyJF63; zvhq{uJJHDtjCdKaak?9cYl4`zh_{5Q*Je;r6|OVV3@hRVtWG9V&JQZ1+*IMCh-(I^KJ)}&Qv6)^B= zTZ%cL{7QBIt|U@IOhsmhjg}t5KOg7-avh=ynRW!75Xi1EXIwv4TF4`?R}p;911`&8 z3P8^l5}VafX(kQ7VV4t>ZZQvmCc)Rd^Nj1mp=Ka3I=UdAeCs3hPiU-IhYTI7IY5kc zII{9-7);qPkZLZoN09|o4&ojjTmwXuWVX_e<{ZLIij*Jj2I@zx-3}EKrqqyXk`yX_ z#Rq{zH7xzL`crhGoNr2ySXRNf6c%b^olnbXy9}mS_to%n!KUmJskJhA0dds-#5UxH zq!K-}f}~MdINyP9T^+0q3&Sqqr_pbj6R#nwpoCo*mcv7o_f01$oAYt_QTPv7TL8PbXpQS@s)ihdq1j{OK`Hzq6;76L~& zeT<7NluyE%AK=PDCs0H?=?&0BbYX)%$tAEo&vjka3ohGl?+V1_u8#CEoCD|0u!7M#U!bGBnS)3x|IXZaBfp4XP@+ zreirrQN~vL3AY3hm>8?+n-J0oB%J|ukI5al%C>=b;R!}MuzTaI6;oGO09 z#CpFRhMqIoXT4#)h_0?*?xdq3WyOrdwET!;Pk|29tSrEo>T`_i$j`clJ4iOxDGlbj zv#A>ifcQ(i89E`2NRGxF&ZQ z95!upG}4h2IU5)O%VR5|Clm+{Ub3?=rM^`HJvU$2{zOD1Z@f_@XKUz~wlOQstyjfN ze3L-ttokvL{=PEMgAFrM0Lg1-MbBwXd-e<3rQ6TlU`_KYiuz&4sKo@@ zx^9Mhp;?}3(n=#6GJ!6nQ4ERB^~Lgo@Ke3IBL449^U}^67V&-vb-%f&Fw7$JdFU7z zgm0)%T*MC5XhRQ60gczd7DI+X6>C=+R6@Q9j$0s{uqUJA4SJQ8u;JihqnbV+M@!-4 zp=%XJSja)o9AD;=Md!oquKnOf~E=w81#P|$#{ z9o3!LVFKawFZ9=~DMACW)u=z|{;UZC_-HxmX~ zd!vmDh}Ak;&MMm6kXT^_eDcy3LK{nk!+^_TsFkZ&p&Evhnj#i6F_s0Ez0}e#8Es|Y z+&GyD@hbcboM*>KN}9*eg-s2EQsG~0_%&=t!sZsH9_T>Ndk@kevC>k*XUP=Q*!q-8 zZdwmxdg&;l0%q6*H6FG97(@h#I9KSXHvmWsdD0k)*?ry(kg<-|4u^!wR;T|me|RC? ziu2!M(SkV|pRTA6Ip^vYbE}0QS}PlHk~@ZQEal+V3wy+Y)=Mcm;h_*un=TK4Hbktk z>ym4+;o;!#KSlyeW}~F7wGjZDn*pY!#xB)Z*i5W`aoCB>tc5tQMwoT@;l!X6tt#{& z_+!p;i`ch8r>w=ZA>;vwzmq~`5dS8PkVt~Aq|f9m^Z-|Tem8D4cK8}1rG@EP5)jjg zz6Uga6WKdjbkck#m?W`cD^v`CAcNv5qt&koqlKSc>Kj#R4b2*khg^2J0?9Y3AJI}3oB=4f?Cwtl9$xAiex3i<6j+tuq5Asmq6U%adWlv+thQ0l&Phf zK%q&fhErsA!@6e_&$GH{v6xXA?N~QmmxI8ybeVgf%|K=Gs+rVfRdc@Db)^WrK4?HQ z+lN<#KHv?qXuc9uS$Zbg8vM`FGxnm?yw)6WEh``%D<-+a6X}r`YpH1oM~~eioiUp> zQ#S?`g`c>VY-MZ>Dn@$xLWJR`LW!dAoDeagDX~n&Ru}fMQkZrVDbG+17m<7b;%lct z|9LH7R;94e!L8+9wkjwWTth4vYux8AbFbEyc>q00 zI7y*py%?1MYvMdyHa@Wb&GCed^#fMS9U}yk3CD4`?}3rZjUw~%*tcP5 zC9exfiJ*d!mrxNpFX~cwte`~Aew$PyP*C`t1=CHw+f0JxK_F&ZndK;-Q_?;tSBvqF zaJ3q&`S|22Oewn0IlEq+G>{w2YWPQhmZRo^@JZkAH?aL`?D`6LSa1L^*XaJ1Z3)g& zDvyC`Z*Aw5AnsSTVfcM%1?fO^4aZP2pgFk2vosnGBEi{JYpEJ?7)p+#eYLjSX~_8= zUib^U&mBS~pI3|+)g9CVKV2S_r~^qFuu}9iWoj=P5Ou7g&sP`dN26nRZb|K7yjkKS z;Di2J~HJ4Ih%R=}8jKg%Q-S)7)$VavORy+ZD&|Kp?`U zz3!QcH_l`EMrb}-+SwZ>q2#KWWlhNzo!7K#b7n*YzVA-C$dd^Rq*;Lk0DD4#avkg= z3;KEzqc2WP-LXjpG(0$fpoYqKoJ;E6ZbdV5-w6qb8Exh zr1U%^yU17hd+#8JQ298EfmH3f>ydu-1~bguCGZh3*l7qdazeE1d^%3%u#;^hxIW;+ zv@;~S4wUzl(KIe>oVOobLibg0Jb}C>E_iU6^&!6a%!ba&59u6{ zLerl-kikBKAb80;QkET6`^<1v}Ig&P!J2%VCOnMgvBR?cckBn1$Gtgrf+W`-Qo8OY3v!pn&p=b>z-!sHxiD7vG;}v z+;C5GJL~6fu)~0>$uC#gzR!T3Uc21g&R{QX00Jn^`=FaJXq+5YZeK$^QcmdV^Vsi8 z_o?bKj*d4jq)ZRz#cMD>3s4IKmm6JN5DJcZg&T7+bY?r8>%C1)){y_TAa!XpC@7F7 zM5uVf!iomCyn7EUo%FnHR{7!4;*3XdnhXmtCSC$ZbS^EXF*?NDMA1v%^|%MhQ9fzdaVM)-L{yYAxF!gV&H}{jJIlpZoNMvq|I&^VVLgwj(d# zQ4{(R{AzDPH?7UEBwvTVeEpz+@a+1sI`A{@3BsfknOH#Q{FBRMe+DD8@{5@`13EEQ z9>v{2$VKA&24_n`nI7I1MZAzoZ0nML=IhXrkLUjTSS0*>?<$5-o<*Op#-IZDPD%88 zzbp=aW527P|9&B&4ATB^7u5e(GYJIyC*W54d~q1)Eo=+zVZZilV#Kw2K009BySe$P z8aC1FBYF`SnJ+O@Es5)j`;79;mvK`I8xbwp=xxR{kB@-j8KNr_?U^w;*nbsn^o_$USr{nVRd!sPX})awNdT2YW6JGA||S zIFjMy7tA%gXQyd_jyq`-gYabsjR^O`bQlAiP)}|?`xvrF93%w~zta<;@_S4AC~qNR zSiCoHTk*qIKN%OMP3pPoO!Mz+I-6TyKo0aBbC+b`t>8|=q0iw!ek^F)b$QP zoZj_C?bhwR{?}?)Zb+j-WU`c{pU)Lv^}Yd4^K@UxcMCEe*8-^Z%on*Vhvt;D1 z9ymc7$A42S5IoXxUYx$(kUX3_G9HxvM=v)8k8!;@pEgJiGHwj;hik;m?(GZ`9a9ti zAbM_$41i!qJ5EOy1UG7_uhw|G7ID%TrFngfi=O>=a_m04EAfhx9ca`kZO1O7 zs(>i>%_&`F->2sYGpp2E2%0U0JvEPaFd{fP;8lJn8;IjxD?EnF2$biX2%cc#g9hzC zh}{#EcyF$f@DQ`#*xy$+U(@H%HgD72KEJ@2@%GSZ9ZjQcAt#QNE`Av(YReuJtK!iLvEh9{lTLBymiU@zrUoasSewmm*JhiKJq^ zT+h)FOg%Mh%`vivH-q3FMr!gVtsG_sq$WzHMn;TpHZU94VyDX-9s@bZK0UgM%3sQ} z{Tt*@Ja9Agjkmu{OIAPF)A%IChg6OqEFL#d;H>g6R-2%Q_zhOo9#rr@g6Ym_F`k85 z?&S>y3=TwKXH>eZ6rDVAU30TQdUva{oq6Hu4TK~EEnIN#pcuMg#`TozT%r@vx8`SN0W+#(Sc&Dt7#hb>-^%-pCmwcBZ(Y6>@fuv~QVKmK zer}rUlI2QhJ6~8$k7%=|&NG&51uqGDoi!Ct1=8OCxCE9%b(N`dSV3Mz^Rlsw#crH0 zAzw+|UuoZsmc1&8+IPQec#=aR=h$B2_^i@A9UVcyp;;rzmsA^9{5Q7|y}diXxBQUa z&pBvNK5Wc_(&RB6jI|+c*leliV?e0u<7~AO!zj)kT;60z`{N_Nii$T{L{;Pt-%Y8p zF)Xe?R;h52Y~Vl%a2c$wogs0279UMw>b@d_#2T+^*`)5SvMgRSGT8Iwg!7FSu8Lg_ zHPo6r&@k3E^DG)Cg&)6^Vz5+KLSKy;8wx|>wVBbB=Hv88eoA#NL_4`|%G>fji7F)A zYV}#B*By$Ai=#xnuIStp-(GQ^G32e-J^ym*>xkf5-|MN#hUD+L*87so8NJ;}k?-m% zLzCxzH*uM{o7WkVS-!E6cZR^SoHcO?9BgDMs3|LVu+x58FnZ-(_tNrgWzj)-SVp&7 zPc_WGT$fBbB3Vogz4yd8b2(h{pfq+Obw6i{SHIys4E5mTm$J4hQ&QeIXFi0RKtSY6 z_S|Selr$>-Z6sXFq?V^l(Hiy~2sWg?ttkN08Z>^1e1YHJqi?K98sQP{eNn)xM{jQM z1iCbZ{j3MMGD5k$pf2DEN+*mzFAbKP52iF+yxOym^&sHaxZLIET-&t)(T&;iq~ivD zH34ztsIsu=85Iseo@G_jHS4(3+9e@6;5gTUptGh>5a8Q6f7Vs3AlLHsGb={Xe%_0P zQEg8Cc}7*nsp9-byQd2uV3sF!GkJY%$;Fug$jE5PJt(6+2eN8wIDza{*n0^Fx%{Z6 z8~{xz22HtF@8%vhyy;NBU$9qbJmQAz*V&f&W@K6sV_1^!HayNsZrK8t?MkByTgCnA zcm02LWjH=wOVx%Pcn5Sfu<@2WYl%{6EG3C$ze4;AWj=I`ZcJ3Tp;^h_M=zGQYm3fbi08Nyn&s~W z_j*GOeYujjh129(=o{m-=3E0@`XkwW6}Dg%gmiKtyco@ z*LDtF;6%L~HpEc6pWk1X+&uN2o&HR4MAJ1QBj1+eaw|dxd+W^zJ5J7_X|SOV6tXPf zDEC$_^EiY50vb%Q<74oHq^R5Tdvu6V)w$&r3(Ik56zrZemwt;M-gAy&FUXI((UPgq zrQCXHc`8}Y5lM>p&=7W#V51PiELT@1Ig>2=kxN} zI)UFFbAvoxSARXUztHl%uasY?nuMA6M|ptfEyx$^up^3pBorJ{wyrKUfA+(1m2)Xc ztMx{77O(td-TJ(b#Sp;eG>_fi3o9w~Lq9oBN3VI0UPZpwr$$mXgsDiAd4yEXa?zA> z{MR21Sqbqvj+Ko4V{Ls^Q-MJd+<_(=Og&%TAz8pk`uXv3r3JUM;W*XKthL~uJm%!u zy){Wp*;|(o(@Tz}2hS`^$!q>qp5bjt_aeXYuWYjEY}rw`pH~;c9vA6h)G)I+GyJFg z4_*cpyom;4Pfz5mEY&fud)LDhOa3L*Ix5YvY-ln3oas-W>nir&BKiF%Z4wvaaJYov z3$B0d#Qww+KE3NNtqx|bVkD#3^hW3UqA$yKzEx7#Yc2STSu;7RPk7wVe1ud}KAI2( z9oF?NV~5HzcF0#wR~gjL?+wgt@Jb8yHs|NBUO{(%SmEbNsQHdf)pyB-)7 zQPMBvR+t|*H=&SRkVzDrug>N@X|l0)C0WAR*R{v5C)1%Ah&%q!39B5+9eS@w5yfY- zec`laG3PZC$1hgU_~L>XR!zN`bA(I;#penb0V&{X^PO#-?RN;LuQgw`=2oAnGHw`p zr=~ti3&IG(PtVoAC_lqBBlt|mrKPwbhFMdNU(KN~`MH4>2FqKpFJciLa`UUXP9Fb8 z6S}sjc#)Sz`svG|$6dwi(|wEcj=tU3sJ-qsz3Cs^;@BiSjA6OOQbYr?8v+)QCCQpS zQn-|3As@%L?Hx%bM&nX$Rg4Vn8~dhCm>H=-b_KjyW%F3BdCupN7U!_Rd--xxa76lC z=r%4nVSE77mBPBEv#{7Ln~D!O3yh;K=%B8PYnLP~ws#*L*tV~-*5ggvWy73dhj$^~ zt_p`n^vD6Riw=km2-6ha1ekC&g+qC(Am=DJBInd?9PdMRj?C;ns;XC&Z?cpu&)T7P z;FQi?iD{?NVy9r44FeRZ%ByHAFWOTsjO%LSaYzi|%gHS3p~x?a6|+T?9V;icBP zim*!hU>}5_J3sD`(dP76|1MB1yheUO(ki*b=XM|MdvcsO$m>k{{PW)u&Qzs4Hv>+Ec@F+R;(W#* z%^XVzq@Hw_)8=&RZj9_}((CM_XBCwjgP9XdKHPey5H$ACd-uW*s$)a%fw6uOGO7F@ z&}#Cn8gkvmWBFI2xN>J`W+cGMno!s~um08s+56-QjH6Q9blm7d(1ZO0;zVq5q(+&D z{ZnzBye4~(px-**q{>TYm!4^w^CetpD{Yl5xY0|7S10KOSGV@OJqU~`*)8z@>?;8h zL#i-$DJ{q+b~&~18g7-DkBn1%n$pFDK5{&Q6U*}r z?>^YkB@4tHs(Bm)P|zW4sxZnVe3~=#5bw^2^FI4K^*3w7SNRTAW3J6JR5sqH=JcMq zWTlJucrO}Sf6+-wxwbiYK8q86#r4%^*jNp7(OXs4hIUVLe|# zqhU|=>Bt~%(@EFl>Yn2Lyl&7t>e~V(-o8@Ls%pAqDwFk^11z0U*Q%r6T=V2bzc z4#TR+tKUy92*#)oCkwI`D??qqt915{E|+AIv@o0OWqV%Gr#gVqE?O?dp*7c(Y-App zua6H1HyzZP8@^|3F}U=>g&-lX<8a^3vY!!>mlSy+tV=Ah(UJveDO9iJ=-EkwkF7*6 z!F=$)53bAV$F_wh%0Am>W%*mqU*Auhqh?Yz?A0E({`2SX%QabZd(K~rxsp}d7OwW^ zHp8d=Dtl*|ADlhp(Hh9fW~PrlJ9A!jcMjJbj;n`|i`_Cg* zfYRA2?9x6>rr9&3ezx|+Bk!yqYX-Jn*f45q#@x{vm;X+GTG{+>LlyHG>Mp7-^>F?Z z@oAhJM@#H!RJ8D!9jD;2dI;C%WSBipl z8^x9H4A^q%)VKVnEg7$MMx#~rKMeV-3%E9F>U=nVp_h9!JC)EQnQ^=FT>8iNRBNOow+J%gNb$`C}SNjpOtJ!ugGNb35 zx$36qS%Ip4gwgsV8Xr}D!5x<|^*tsNFk-lF#`PVcL+Orax4XOc+wHX*jwkvQG9wbp zMk7wN%l$rUII!ieQkNkiL?uXiDs5c$3a9CpjdSY8|3pMF?tYte`b(y`@9dRh(Z#i6 z2Q1`QrI=2gAej9&*4XmS_KU#F?4$^<8U+V+&;vd^(eqFFC>Qq2Y zq3Xu)Uv)Ne)+(#Aah6a1&_{wMwv&%7-^fYcRDVBx+w57kJ9Yr~t@hNzwBI{Pd6f2d zi!aDL=`lq0U3l95-6hf!>~~?@-2=4Ml(+v7Z(nWci#-;&6gsyGyGiFL=V(tXDM5Gl z4}Jf+vx5FT?_T|AeW!4+b(Ga3ZPQrDE)JkC%*~VR>6d$H=gl)2*jAmA{C}i5jfR zTt|~F)LRh$;eADCdytyG=zY0it(K#2_Ho~bkM+@GRb+nz_Wu#Zvj4O9;?oB|JgU$3 zelNSi6F5F$1TvB%8rMXne1A5qe%alg7eAPCcvDT}kFL|8M8 z{@}axP7Y!jL*&Dn1@exGjC%^)Btf zCbrp9s!hT3bb-$^gMSUYUknL0){N6zLX_mB{jB$ynmO$MQ1M_3_xvgT?G1w_u`PF` z4voq9D``l(Mtx3BCRuzOG-o{c9`)Q`;)k3$W~2IZM-}p8({0SmJ&LFD9hfZF2KTp1 zA9YhoL^OSa@O;(<8RJ*QY8>h8{Q`@hH-6Ub`gW!I&D`yWYOkhb+Yg?eIO1&P!n{5D zv{Pqhla8y*U?)>ea&YM2p|G_VL><4b{ibTZdDwxhx4Gb|eahzPq|ENd5ib@1lMjar2g`F^?n(*9Mu_TI?*W^lVYLF_ht_sm%V z>z=0T(D!q9mHL9^^0O^0)xHVDXxlz~xmC8&{?xTQYyFZ%?S2dQKXK)sC2@b}Rgg?x z`Oc-Ns_(DEGUc}~%g`j%RQ)F2-q+fzA+@ny!f$9P(4%BK^+H`&Tb@$8Nm|8&@wvpi zhvF_VAC(%$7QU}J+Ij5VnnyE#V}E{@BmFk^zHZ3)6VEDRelb5K+Lt-4-kEYzQFUG+ zfD`&poN;(irx@+DjNb^-GAsAa=r5)5^(kh{sWB>U4Ph@+zJJPl97C5*_(hh!;8An5 ziW9nvmEM!b5vkee_84!R7hw83Ae-^RuJ5|N`t8*bE&rYsq4KP2C*ReV zJ2p@xRa{W=l3|?a_cHqSOT2b>S|xqevD*roHkVbU73yWhl8IfjVtP*D?U-%LM*Su< z@Av65A^w}Ew_c%7Jk@im9A>S#LP^-?kaq7t4C6uno%tVn|CX8SJ&EYbds@T%U0a`Y zL8hXS=F-~bJF)P`m#!tZ1;;2K#oLqgZS=`!XMUxGUy19={kd~`G4;?BhP{J&;;GIw zx7%FO0<>xv#)rDP{fds&a;=P|~|rUhjy}4bJoM z-V zwSDgqI@y_$hBs+QF&+4RMXLC`JvAp^FMm5QirqZ@?)EMTbw&~9aJh3}5KnpshIZ`A z`j*9$o@)8#=N>D_X0{pn%Hc4_j0g0tL{CaL)rcNbvX7snI~OWaDo4eVD--A@H`X4X zI?3!?U0^LY!FkjjNm%uS&e~r5Q7pOh4|N8v@4$d~?Y%4~1%ue&-IH@SVGC3^eq~+Q zg9t~BU<;vIjNbH^(ZX1UAt_7ocL$%)_uJz9?W$aFaiZ^xf88rn z;|m{Ml_`mlfnjI=v6B|JJ8!I$dfX$2dpXq7bKe@pQ${!bO0CUVI70psQ0Kmk*-;ao zBegMgis*H~JSzbkFh=-Hnh)1qI1-GNcFiEY7S+A_Q@U_6>lr0?a}y`6!L>FURmAmc zXlJ52x_ozbzCRRL=T5+xJ(HW}*5CsE@dCX@=BKO9}{nLQr7`vtW>vkSaX-}qO-pt!0q&_!9%)}0eybe~#Zn;E%kQhg)#%-@S)p|_{wh9{cV4Ov{| zuAb5-e+tx8Q`w$=Y(BNtTo0JFp&(6m+ueW93mmo_Tk3u?`oKoEd39m}UH{Ob^jnX5 z-_#anMdmSok!)ps{iF2I4-wCFO8?00rNbjT_<^5JUl|q1BKs~)G@XC<`TdbjQsM5o z#S?P4&fAwQv1;b`rykp@91T0OQN`b4$<262W8*=!4_8f2-1Ck9(0?YvPN&?5R&%Wo!3l*_~N_*ne!d7D#I^NGo_|weik$bx(^sZ~fe~ z*YyqJ>)ea&uT9dUU2TcFB%uBLsdd+jpzdA2y4ETyy!F+& zw0?vCq!r|(I&qW{I1|20kS?L!@qOF6f%9~BbD&ve8`+?Aw=-yDX&2Oan!Ihy{KGW;{-{OGoZf3hRud|yRT z3KwFV|DH=R*{Pasc~sorXjG8bcUzahN_XVY&8od-2@7L+V z-~6RKqhiU=1_zUr-0DVHVq4)GD z?S1ljWN!H2D=n21b1CVmGsVX=CA8yJ`#85fYbiNqEYwUixV{Qoo_wyD5N=QPH2HSb zgrF1~kY%HwCf%}gdgy9Pk>p9ud~!BrY&v|))0CqXbJD4`;kB#4czh#E969=hHLc~` z1U6wqnX{&`@%9Pt=uH8Bl=bOm=WTCp5lfjaPxJ0LeqnA#tGkV4u z#y%-{?oydTQF?|2$kx#cTa!Q5Wsl{l_{)z*H7cj|AA7og#co-6gnzpw-r;%OF9F*|nWwI-4nDuk`qT61z(1divb)X;GPE|!;YM5~K5eE2uQpqy zz?!{uSLZ>|34H3i@4SWSus{D&*jVqsJ1yb#JI=d`F%i>0`n*ZwO7=Rx`{*pQZdd2M zN|Kn@^z0&K-`=h1Hh8r~K1pI?LyAISCM#X6qa!B5EDc;Kd?FSC>J=e zHq0Rz0o6nsWcZv>0EHX9lgW3&`+E$!69R54)rSb)-EgtE4gKb=X##V&4OD@@)+%G2 z@N+ipu(tF-4|L{;=kQCB zZ}wM@Ok-?8X!Sf}L$EnFU4)W$701R?SoD!rk_PJ&iGaXA1zM&T{K(e59prAm$91{c zweT*ZBlf5VIfp-Bkwj6)FS=7)EQg=w@1;2eMN=OLHj|e4&}@I#of1C-X1lbvtWnxV zZ*#1T$QjAKOkTB;>=cwGM^RV25j&-Glw5SQV#~i1p_%haESleWe!}p93S%qM;&bNv zN?e=VM0sI)^VgNzb*XQ+C>V{7-$^=ZO-FAPh$?B$IH3s{I-u*`=TpC{CBAJ58y_mB zt9h(!&;<+yPgt?ds|Bnw0%#OG`E!~kg!?>foET^r#Z(Lhz(_OLs-i?~xRuIYQ1uUF zsOrw1x(QWA-|=*dLh;uXpC5UcOZe5^iAVj+8?h&$yi5%JJH9v^uTtgx87FgZ*=?GW zhMhM&{Lg{Qxrzty{%VP?ELeU1bR=_FYtR_=$#AOo{mLI7l&na%zeeI!Pj@u161T{_ zfNFx4Deh;I{E6@%pt{skR27VlRdA{3Wuw;2eRdyDxj(d_`-8*pvpc;)Ahky1`4z%M z(A0~`T!S5TEt7!zx9Ec>aoX$3WMw;sE(xR0jQoXb@#PT=){nES>hEK_WAZd8uUTY3 z**0uv(u?h=-$q`EqHl^;x}0BAIg5_0y;f5o&|9JGaOYHw$x+|8ARFSnb)$p3? zUauTTppn3J){lozKa*1-L6spguS?JYQwR7AvZ!={&*dA34y;eC#xCDfvGk62?Ri?p zenB$65>I>){owD;@x`;IoF=P$=f3qsY%1IDGG1!j&A~jfWD+mtRm<;^T@(()`33~m zbP*>-MJoEHe^N5)&QzN;puu1QP%W6qdf(=lZVCp z+ip(w*Ti~I-Uj}?D8hkG`v3I;$mj;JcuY){(Ys|u>2|;@C*)U^vt4PUsIV+39<)j* z-;tK@$_uReq9F)9H=~oRXHfecti0V%@dXCSdwH;T64hCuI>j{WcJNkLWgOiKH)8!A z#dc&BGgEfV<<@fY{1$jOHKa-T#_A16>TTWVeE|NSbSzS*!F?wA1fzi!I2DXxH4 z%}}7MV_ve$4Z9pn3}mk{iHa6Cjy%n)yPXj- zmpVU%Mg&zYG1A}Eq{g00f6;NfR0*%JNzq3g4)l(wJDeWu`e)o7y@-%Hxl$#ueQ*El zmJU1kQ^BDzN+Z%dRJggJQ)pyVg<%soLW=2rp7JSo4ky)FTbu8q!g(?AOt$;K1r>$} z25V|s2YR#mD5e{X^JNnkqq`Bz9I{N?6ep|4!J(Q7Uh1r~IbFanK@e;EC|j=7fj`q4 ztQygMa(($&?lji`BJ9I8C)*O^$IzdodCxCG3Bq(fm9Biqf}S5Au7!p_D_}yQqVDDd z{@zvR*X74is;6A+6c~g?$z*mo;#u~G_I!b>OkI8Ox44Y|*VK{X&s@S=SZlM=5VagN z@GH;Lc$FqNmer}%#rn!n$|D6Svl;c#TcNozB{U76Tt?6yj`>0@i7Ur>0xt5tF)qgT z!ii#aIZRv&)|&PtRcx+a0)rrs``G=im--D+M^DPrhrV}K93!0>bDhA=cQ#*t_(S5c zP_EmN{NroLdIzqDg;)3|qhK>6H``(agza9$nI!I2s1H(z(C%?kW^k-Dls^|!u;jX$ zXWY#ACUE4w0!^rx_CY4{`2{TWnB(O62W9g3B+$m%Q+y$IcSIXmuHkCM;lADewDFioLiM5eP4{y%%Q#X zXif@Cu9bAeGpQ3)OrFHG2aSXNeDQMyaqw9RmCqzDkB<%qna`xQuiWWRZGP*L4ZOYu zvd2R^Qz#JZy-%qPgUrM<{(9ewik{R)0c@7tG-KeIJ-%fTC*DGi zUN{I{cG3d&Rp_Lsa8f_ zJI_WxzpG$&iMB2}PAyOA4gdtjdMe_^E*1l=y1B6Qh0Y53CfbmjEBAgu5UN^t48m ztE8A@iZ+LreN|wV^&?%d>gkIvaeH(fn0I#Nr|pwdjG3q!i`^xAnqI?!6FKr_bg?MH zApx|pBDa6amP@vg1RB8Y%3o=^lLrZ4DJb?Y0#~oSUTa~_-$_fM;^TBx>JZ1KFXArN zTBdRbJUmh6)j!0s7K=EMrfWy$F*E$a-#mIr@HUIMRe0gQpLKJ-G;`B%1o^@wEwzKO zE&bVREw7Y1^0D4*zcZk%bwC_@lzH)`a4bK{_w%*2$gCv?@pWh=_yzb|`EOz`uFNA1JVcpGBwn4Ke{VpCo_^0K8P310 z?+bey!53nZ_l2qXPYO)qm~VO-IRPio?B%S)W7!sQ17f`j9j$PV?(F$q-uE^;lKZpF zNs~H9jHXBByPR&SPn5e&MvM(#e3YEB&vU!^w$9Pt%XILGsqxq>Jw~X{tesTsxebB~ z1Y;lxVzV{i_^Wq%>-_S$+I*wInB88d=Edm*Gd~0Rx^DfNvVqZ*6IyFPyhjS3N;pi9MZ>->jNg!%62QJr~z-v^0#Rtzcw;RFe z`#nX4Pe`{nDY7GrrITCOOnN=WMs-E+7th|e306b{-4W!))eyV9DdD$pAt1A>?L7Ye z!4^!F=(hqq!dZm?yU>i%DDI)r;eaWRKI{EfP(=0oc7rQ(O|@8gHLr0g$!bE>0oS)f zqf*7u@LQLG zxwmetA>kc*b~=VD+W-WOO->dVAr|bO6cLp7;qTo!^Jmg)xyD}40xJ= zhAYgc@KV~noOM5x_{$&0?BN1X4M!c{l~g2c_V{%oU+0^8t*Lt6Lj4JKCcH0R*U8@8 zj^0*e@QlKj>Dx02=*Y`w9;1t>Jk=(nG*CiV)H_pl4=hDln+-oN;_6>_;;syPsX7FrVJGU?6n2fLG!}bl|Sv1w@KkPB!NAhuO&U+*wSt(br#VN+ zB!Z&hEs5n3^ymJ^7QO}P_W(?#MdexOsRVAnlXZ7;vV_dsKN$EZlB~!7dLg{JceCbK z@%8vQuToq%Twia(CswT2Bk1Rnszv@M9Ih^m@~8;xPq7u{x$H;RY<^x&#+_7GwjzW* zK}iKq7`kfKMfPlc_wEig@{N&om#?Xi1$O1_5)0X*M^{8VI^4PaE4xaD@pj80fYNS# z3eq>}T+$vLKE^diT)!%TYhgMnm9756cX!_KsaB%OQ(5JcuZQj3vx>jo&*@m-%~BTq zl@vW*gzfIcl!TLk4f0fCCZp@GKL~Xp+%h#b_a5B;jZB``Vhllq6isTKE~gob=1Av; z)5-Tq^@9V(tT#&_oJUOprEl9(bqHGw9g4S;>A!8fELD8l9RA#IZwe<>zBIyF!X(t( zm7CuE7Hb4tCur(X;LB?UjYG^zuHmR#PeMtXbh9ReSBIlYFAm}5NYi~AHgmU`j%i$( zA*ALHV=l2IuS>~3YmAFJaWCrDpnJ11o@)^oIFicN2s01%Jij9S&iwS|^lE@$q8q;c z*M4E;u0+msf=Dy`U>=luv&Z3*Vlv|hG*JGvB&_x1)-+=yRqwma8g>4fOxd9a!hoP7 ziORczpwxp{9I}Jvk}(D|G%e4;#d}P6ldhHB%!CIUo(N(>XIUsb6xmrz{BC~+vE)nA zblo6vZ#Zsc+onwl;!TFNwz7q&emyKit{7QGP2KuCR>m4eZpS;qs9( zDDG_>L@41tjgdTwUG1dGQ+>PX_)km`1u4pXzZ6r(52fry4pQ5wJZ?u^9I=}kZhI$6 zg5^NwzVSxx>3&RA3Fn_*!WH8}l}Qij_M~hX)Nc$1WEz=6*eA8K4p~pUUQscTWFkRK z9IFj?TH}30_@J{@$oh+5;@BU+x`FjsJRcQ>7m^lzBWMhhVWm4U6C=UT>(_o(U1;DB zH5Ak99QQ&^2TAsqip!qyjJ%1IMkNGtIGUp@P7zq;gn{LD7Ve=U_$h+RZ4kB>{oOuU z6@D_eKlsCLPXhID@}z{{wC2;RhOdA8u>*S! zB~}ep@xH66P~=#+CRWSj#Kmhgj>P{f*2+|qqDDGUn14fDI zOdVr!6%1+diV?5g&6U~Ld`SfpqPs&mOIQdkX$PeL=vB5RJp=nnelq=<*)baI&F!e- zyOM`9U_Tbm7a4TVnNqX};Q>>EDXclH--tDygM65}&w1xLvTU-HS+j(3=xaYW##VGa zv&IYoHFVkSlMESeCq^QiynSTjrSpu9T`$U2JjyaS=2@aAoP$EeeE94dkVu(y!V`Nd zS`=d;<_RqEFc{QNruIuwoqA29?2uIX&QmQd1y8BwXPA-aU5^+ImPVg?v(8f{bFL_k z1nM5*ej&7&l|e69^FM2vuy<)%Opaw|FT2*ry64IE_d#iV6SS8-oh-}KmOSRkq}f-d z;`0%Wg5T~uWio;Ii%-0E>(Z7pSh|aMa3Ci(}{Rk-(i!hzG$a5V)3ycKlEyEV0Vv9#;^8^NQ{=7SUca9B(o{1`v zw$a)eCez9Y1;&r7?I6Z~UPuh?ofcew0I3P(p7y=g%eqv83)>TzQo|gSMgi0%S*Ja1 z?Tt$$TA+DiJ|HlyjQ>9?TT_h1sQ+P*>adyKZY!#(()+jf< zb!15UC-|;yPH_$7mVO=%0`rRZ{UKrGf@TMr z7BG`@dE`JsHC_fuoxpTSUqiCM*S~uXl-8u79Bz1S@cFZ zfe|^*vwrBwmAL0&$xo6=yQd1biw(6T`((l=9_@4|faa_gJi2~g&e>1W@uNT~L!&@q z!LJ=opUUmWIl79B=N|Qqpu#w&j_<38P_x?liT@#O`nPHbp_ zt(gh+`+V3T`*yQzwXzM%q4%RIF4$C_cur-&=LYalj?0z$B4}&M?^Qa-JXvppA0{D0 zz8GjNSd|qGq*TS^-dOa;NYh3+-cW$OAxxQnb(uc)528~R1D;xK)$3oCh+aF zK>4lltRE!K&mTd_eDZT&`L`)E{`Cx z%S^HGXuPIlrtYz2Wa8T}8?*D;@Lyy}06UQ(Ri>>j7N>gOl3lS?HMQ&;kWa1L;ms)3 zVgc9b&Q@NiWrkULEg?}x>BLwFOrmHw5H?L?ZINc7^o!Jh-mm1<7AQ8Z0e&188cfDd z1B6w@l%~XBIFM|*PbG2=^JibOt`cG9PUHT%@nQW#7M&Ge-~(}?<2-$VPvqM&bCj1= z$xaxvW-A{UN*UVp_UFVX$!zH5zmY=_SVsWQUU~h1J!V zN}A1e@Vh{LJjX0lBKneb^@~r(^m{3I^YefP=5Y}5U!Yg35d^I*`-toIcu%JSqVX(C zusiS=#ZqGiKEvBZFRuM!6{6pwxXa8xiNm^#P?NSmk1o&_Tt8&XUdvyS*>gaNzimY8$6p8Im6sFgaTNVflRQ9)vTt!#gelaupe zX5Y(BDffZ5So%&(+D1YcQwL@4fIPq4AHC(fP8kg=lz3XFg89Rr_xLDtN!qD z$OcL6DK2O#^1lw%`>FA-;j(t*9BDfm*caYnV?3h>Z;y-|)G|mLxuC^-&?9M|*JAGW zcoNeL#r_}I>@|9sDj~*~S=s5c=ZosmRCV%UEKPUQ8d#^_E<?@z<3vJFl;RjK%6R(|TL~xI( z27Y%H91WL3Yx(3@EW0->mLgIIaoHNM)Fta^=?8HP_%Y`w8+(&y())#h%(9ki*T${Lk)0>qY)|+z1x9gF zalHs+r#dvAmU>(}PHJrU>Qv;| zLp10ar_sJ=tUK3io#gOrs0tJ>9LD~O z_;iAGV~TE3JyjmqN}N+yBvY{(JhLl1qx~f!7in7kYze`}`upJSlv`PX2#9lwYqe5x z5O_gUl~5}ATL7J!h7D~|3ND}GO;tWwVJ@_j{B_)LeEE&Fhq9Q3DDOY+UpPyh6vQNBq(~yl1_+zNJ?u8~Qt+ye!5_qc_t~(DR&r3GByAhQuH6m@ zZ%VDNoW7*qgcW8(_<)l3`MqGBL8)?mxQ!k}jeIYuF0t-r&cLZM!hlj`T#Y!uxqRXc zgAD{+t;qzV*#H;Olq{arIW@XXS8Is_KY^@U)jhYz#nE?XCj=$eKikb7n1RY50@B`R@}YI(8vuKhdvYQrI_u z^5x_(*^lY{+ao*gfdyijeF4YnmzIz#3}V}^?MxAGt`5|AA|^(vx)V^NcBPjDUo0mMLN&&CIpHN$rZ;hanHdl?Yxur${yE*if^$_R`HX%0^ZD9VTDH?K_3O&)fS2N zU5L_(ApJf2KbG~P^`3)({MM?=?wKR5ac|}uy6snLma2;-B{#X%d)`0OP=x|}v!HYM z73BG6Uc|!f%e<%q_os8cpWWS@#ue~afJ{G2-&w)vsDhVsDj9q0$4km}o5Sc!%5C;< z8Ui@;EkVo+cawjJ-ul71dW+rl@nE9VWULtTGz*yA&J~Hmk$Zs7H}tU~sE|EX=d;t+ zF6!HogL+tp@8eej=@&oD^}msP@Xxl9T(k{*dg5cVdz(?f4XM6+0hGCFtlYw0Lk=e7 zNaYwn4KcZVoVj+_F7}dAT58QTH(UH8V3|^7)Cpb3xV>PHB#jJ^&*5%8NB$v;W`DB0 zdE0alkR{z;?!uC^Bq4Ns)YF>5%XMW(^4ruu0>)!Q9F|Y7F3V9^Upb-y9pK0HPYXU+ zm?IBs^f*-*Ibf{_rXhBtS#d8~!2Zw*fF?e?OwYVpXni6cfJ^#nE27x}v5)RyK!=Df zb$V;Ujou=p`NKe2<(l(-nFP~HW!WP5-lv$V^6zsu3Qnbpa$0&&{Gwk_3ja3^%P~(n zqy;i|2c@4VZ!6?*PM;%&$hFv?jCIgGa-L}<8YE(^ zlGR}MuG~CW?pwTv&xxtl4t1HAQ59KsoJ7&QIf4p-2v=j12`8Oc>14!GL6*qU~;TRgPVoKJn0+ zG4}%cIGQv?=H!M?2W%E2KIq?3($KkauN7l}3H~l`hgMrw{Xq(3nLWNcdmq)3On?e` z-iTt3dWCEGIMU?GN7bf}XK$}=`anmx-aH>eUU~Hk!G&mNi;MlFY?rgeS{E!klP8ue zRn+?Ql0Y0g8n9P;v^2~wnD{v<=z25R?oIftE(8YRzVep@1DLk6vXNpFAgK0hh{Pp{ z2(k`%oWGX^OjCN_uexj3n>+Q;q5-O5ubQB-210s0m=`&Ze4dMJ^+#vt-(|m&iP-I_ zr>{&bZR1}yHXo;}79tke8l+XHR(VZJ%;`MkTP7%0TP;5v2cp!hF~$f!0ndj=mR=r; zShIq8n&?9EoBq_fy|;SgKzJ4Dp|6E1vbhGm79Z94S0cy7?O&bo8kJX3KU#|G=sIpD}R2u;;!8y>9m~zPM})% zq8S-p@Ya1EZ-4mUkFX%1_Sp`wUb$qlzeGsU8`OsV?rH>6+(Hrv*5NiRiSO&>kJSq75h$?DhNJ zSNx+NP8je|AHcWI#pspJ+e)d@_`S@o>Lfn~BaVEUM3>uP#SIBDV-Do5q`f32oMC!I zpKCiMuq}pb{FE7F_HS%o_s~oeB>bbsn_Z|9{Y6w#OsU4?Z3I1 zBQsruNO)YrmS_^|%WIrEYJ8w_8@LvGB#Whl3;a1UoC=C65PqNM=d@|gDe$Rf3Zfyd zHXh0=PQC2vzO1^aLDAm_Y%DFXwJzpS@zKtG=d<2JB&tvcaZJ~Winwxv?kl5!YU%|8 zmlsSf16+v-f00~OyB3{c`})PdSeJCXX*%wP;z?(M?;#s37j8SBAH>tTPpEYfIt&uq zm_g{+G;_+n0P;x>;}X`{*=XT!(@B#uVtcVE`3Oo%6)u#$zRJU3i`|V9)T7N9-yB_%7S*G;Ix)NvP6~|en_Fx8|20(aP^hf2%r4j1opZ20; zbQ@!w-5b#eMc>+z?6Jb#ug&yIl@E+5OKAN#1@9(hWcR+e%Jpu{%7)|{3aUnH+3m+! zizicFP){cNak|G`_*bbJr9a=r<^ya)nfGZfx+)acDjo)2z zWm>-qf@)G52|zL4dy`CX0x?0i%63IC`mE2=I&WabyL$Q(DIE;PB1mjs%N6lAqgpHK0%X+x zk<(gb*;KJ|kEP+30MusP7ZzFDELS2CJQDeg7yshFwVFJSgBTsFKOy?oiLHXL%%&OB zQBRc~oAl&f=$Y~d1SmfNfh7BAu{(MWu^eS=O+1rXR}mLxwV9)=T#q5%Wl=-FegKt7 zt7(l<2T1AI3HBL)E|S=n%?54^W8i&#xSAeB{EU1cq)&RQ&duLXX2i(<7CxXa5;c#L zqWotJwPV2C`j(x$%Ttz{?aXuXq%Ry_PMcPW?@+b@Q2weAqWa&>&HApZKX3(}k7!A3 z&C@h(58ho}@q4%x7xE^L*t2m@Lwte-YMKkE8S$FAfC!+G{_oKJ{N#vkVM>7Ieqj))W{NXmx5~dW^Pz6ejuMk8SHu7a)d3Ug{8?qquU=T^TAQ=?MWKn5cvYu4 zO>9i3dU=~1)&X$^`En7xlk)^Nu*|eE{)7z<(t|*GlG+4!RBn{_BPJ+R#`%IL6#$Eg z8XuT_lhm{P1z?PH#Xt;y3m2Nu_g)T`_%w1x^Phd;1IamT>g1!~y@srS+Y;P1N?Bt&%N10>>lKj zd?t5ij}+v1cQvW4RG`Q%m#iP?-T@>F=sVL=k)0;hRgv0rLW=`vw^L*ZG^pXp9G4qD zlH1&l28*{lw6T;;@4n$G)Rs$fC#=d*r-&9xmGf^(ako7MYN`cRDHlPp9IKJObIgEk zFdG7Z)Pc)|*><3Hm^Ul$R6A(}Lj@&|UgQ?(NACyWW_Bt~UrUzV=%&2@3ieG^zmZ(el~TSj)UjE8x(>oR|5qFQ>|u)=h)>!bCut<}Vqb=QF%*d^)g+stow>_y ze`HjY4I#`pvCZjdtyGDx@3tH~acmNBjm9&@@Wk;V^e9zI7u)&u!c&_%N~aC>1~?5C zcrg>BRp0d-;MtQ3cnUmq7eTf>GZ-ni%EWr={h2hCBTVnlm#;95P?@e>C0e_MH}voR zZSEU|Bad9sbEeO>Af9r-5#FZC{qekVSjDD;@s&|qvO)M1R9xyfxs`ue{9qan<8O5W@%klGT` zUeZf_cJ~vJ%xuVfAf9Q1IeukJ{NzT(Lsz!A42ZJOgpev-`oi|2c1*GxRy>BMzvS(a zRHZn^`prwaJ1K z6-j|{ikG`X+N~*=mp~$k?9+()SIw;e)!cB`>$ONZjw2Z#sT$A-hYNV;{SnGHuhu0x99;MEQyM z9uRmy-92x3Q?>03arGsJriNwP69q?CDBsN#Z9Wba+?u-b#9>$oFz4ACI3$1DZUxl( zU}}`wW@wI>s0komkRx>BLM?m*M>KAAPuOBRN82;VEy*l}n(y$_oB`95q1pl6D3J_bamIct1? zBgoMJzYgSipVL=fOkVcRm!2%ZznhM{sCx%K_^WtBe0FTAw--JaJBl4yYYwvLU`IVQ zhiU?HvMZpQ#L0Z)}~yuP~~b+hkUDp_zs-EII?t$4{U zW&M(IPK7(#k6~NA)=BMp6Xg;0w!z}@h1kf{KK{?8gG37n6KOluiph~b4z~`R0T^h8 zLS671Bn6B$6Yd7@Paw&&EE)TV7Oe-l*${t2k?Z&V>ii}0=<=W%>U&sDy}j8^y-nD{ z9j(Yk$+Sogs4XeRh3O;;O#*HKb2y}YLf6&UBOi*(RMVq>cE^kd8zA>=n;a`2a^40C z7W*ms_Ew-^4{0sSbb30EZb63tgCOSa5^~ReA7UAGPW+(YC%0sQTGY0PVEeI(otWi>z#qFr&YkOLS8J4fINh4P7|Gh`)$at% z0SQRO+&c?%1F&0}i~1yrm4B;Ub0_Df@iV3tq4hJ=QOTM6FR{wpWn+89D4?ko@dBKt z)%Go^ZYqrZNW6xuM$N|?RfuNTQ9YX2zqAkT>x?UogN*YL?Gtv1PQ+rVvjbH#OkK6m zoKB4t#(vCTYC=*H4$L52r?#by$Oc<{q1qN&{0TL^pptroACf7LCa;F#CS%WfP=x%2 z@P9a>DcYC)AV9sM?DZl>s4H|_nTbu0!Tqh5?f4I@g>EM4=U>X8Tn!+bp4I?Xtl;^# z;Cp5idcgz60YZyLOO#IIo$QAvz)t-T8c7PJ5YQMz88Y2`LvjH!E9n zS{(OmBv}aaK=`nHI0X0_NZjHldM>lT`i3x|#7SBh3eb~0RYlF{WN}@+fkW?_S6S(7 zKk7oIN4D0HF^HXzU0;#IbB(r-3oF@ZGD#IIDKbz->3D2SGMFRi6Beg~0-2R5E(N}z zrnn80dAxcR@ahW<3LVS=OIrj{I{C6Ny7ilmWINX%O_Eykg;=J!ZiX@(vHMP6dap%` z1~RvAD3J$s^F|He!cY<3!$<(jPV5C4BO^py2Jc`~x{P+!uiPG;-Q!$r%}I~1`-Xa+ zr7rt8%MAt_+g3GAJEq!cTjf{`zHsTPXHETFUTBQJv#7C^itsM-{#Zxii;tqmOJa3> zqpqooQ|J@2;;1HZjqD2wK_?JB5inUg0VWgO^>S0@6l)Xis0YIR?l{)(CPitxK zdDoZ9}_}0kGo33Mf#c5&QYsCAlege?8t=gp*RN6wM1%? zM@PdO2ieOrJOBjg&hHp{B`w4Xp`pb+BlTqeqz@RN1Po}O$xDG65R`p8S&Tq2mwhqR z!$KGm1r^;hAGtqM=Ek$Ffq(4GB;DO{@ipOvpqhF6q62iHQvjt_;5YM;IFQ&`Q5pxa z^cJUkXIlfwOOJ)Pj9ePutBnV6X9YmsR0F+ zQpMOUX3omqUNZAiWcIzPl^YQh8hgt2O^NZGXUak${uxg*@vlF21p6VT`fF!7RutK} z2Y3r*7;Ntc(6&iyw`D^tDkX5c3q0jXlE_05gD1FSg&F}+qR8&Mt9r-MK5YWM^>^9y zz`Q6-x}FMP)7Yo*aUS7v8ZX&Eem%bwHWErrHNL#|i%qXH@V&IHH6ND;=N~{z4$iK# zEVkD7;&gqy0T>7pI|-u5Kbd7!(}2doNhCBbcLN6tXiGwzJ!=!qQ*CQJF0Odc@!Vr) zEU9OcRo@xivjC>2Mma$G=A80c<#la#BrNca zz}FuStI+QM)FfO**qqQo??t*;G%ucNaX5k(Lj^c9f8EZ4MixmuCJC|5b0r29%1Y{G zK5-wAz+yTvkHX9Ph~I(YYKd6JmvNKvxcrFkp%JiJjHUpcgg*1wo_I0|r$L&XMewW0 zyyLqc+{N>uJSS6i{AAn)6IX7&21fd zdN;|FR!ZobTQ?#m`O^5Z&d;n0z2)TygTdI4Dchfg`y7(i79p9&xra1p+op#+#8b!U zsJga?)k3_T>hAerCPaH*doHNcm}*m7=|3k%^X+J$k5whHk-m(h4?E7+XD2Ds*SH<9 zJ0+>@l^)1C6w1kqb)}q;N5?&lj@<^Ma`PL!MAy+s3(BoJhoizOa51n_B}x_+3c z2U`B*iZl;GFFj?@e=mcyUH|^53+)_WR0?1DgA)yVRc#_k-@+5L5Pn@buab!={!bP z4%^6WZ(=e;z|5(4#AA9fQYJ?8J$qXW8KfN$o^X?A^G8c(V{sQKX+waUF$J6E^)wNr|Nb7kGZaw((rQDk{~ zJm7HlBkme5Ux9G|F#ZmbM`g-ha$&b<_sq>Xr9F}w*LuTBr6&JU0ManTUu@#F1tL8* zbX*Oncz21zY|DI|%~)oqf;fH>SLQ=)e(DQjLoGYhx1=27;}cs(YlAG;*79k<^#VKy z#mMxvoR9LhSr%MO%*y?B4^#g0HIGrY1%9U7S?Eh#kj`BWmUJ^&AkatLbON41cKt8y z$e^@YQe5BN5vcz)M+5Ca+zNFN+wVNXX5$AXf#tI90yUpxhZYH8hukIQY=w$Ll=hT- zR4Jk&MN%23fd4VOVTBrd3t6WIH~+My*|d9?hzX&yEBNW6%}-^|25jjgz5NUna=WDN;)`m}syeg(WBa}PM3FK6ZbK15|t%13G}z=)78I2{XZEmH-WA}pI>&Xj3{pKs)8M5<$FZG1HkbR|8J)#$d6- z7c*|DYuEd?f;8gwwfNioWGUnaB%DT3f!jRWAO3TZWl)T>t;{ke1Gle(T`%k_qL9@S zAtMs?=_OSUt4zi!Tn*ljFo(Oqg%IcPRPqhx%Ge1`TZ6Y}99a^5IjJH3F8r1mwQE9I zd%3YHUr084^kxTAgVI`wv+7TK?mvELxZ$-B_C(h-?TYBHL7r~nV-Tk)Cqf4T!7QhRsuIoW&JSA6m?(h9k^$x3}Z`H>o`(H1Te|v#V zMK)qvSe5y#1QSV4osBvg6uzVXaT{nXBydM;1S*)cfK9vxIvCt;b#*>5(#Rfr=LfzK;lp|gq)o>WD*)Q?M^3pS> z@tiLA?{ypcjXU<|@IXX0o8F@L;?^Yq_!Z>{7q%6G0Xy%bfw;~J4)`W;V9|nIq^jvm z3HMWAo6YyK6tkKfoZSMM2XxcY;(Yu8#$e6jnK>e|As|BOdVCQGua;Y4UK^j1apwe* zfHeNL6JXgBT*P32ts+s5dm7qQ*fK1MsinDC%Nhe4Z0!Dsof5EX)UO>LANLo9v$}lo z_Kf9hr7V?a7vyL1P8UH~Cf1c)phHRGYi{@*Q157~L>XmZ#XLz-0#i)f8u8u=mali2 zZ>`ZE=dKrZ3G)LTg7ANxd)VfYppSRwnbteriL7{o;UGQ@!z`!Iy z)J1wLeFzw1aJ3 zqRWk%&HYP{#J!QASQWA+?JUR|~gi zhfO8|`v-gXk*mq61O4iN^Rm=`!TDa?&2WE4g-)6-dpfF>I)c2Ljbxh^EVNeeFJTW@+ zh)*rJpR=}ICAEuRF1;8hTB_C_t09>NL%-7gxk~g$k_OML9FDd4u!Sn zehnlNH)8UtTN$Eaw~jZ2#~W|@M^d0qD58w&pXs5N8g~_k&o`VLw`TZ^A|t3~3p@Vb zYmeBVz0J)nS2tBd1FEbpor+-oMw<~0zaVotP>7?%Wp(Q*Bf7lo1bmUd&-g$TF-#WA z_=DmD%{}Tr56mBi>9a6Xh|`(r-Ddt1%XNpq@{sID_?kdIyMW-!eM9-Zi`o^}&#qq(70 zzL_)&@@=^`t+!Xl8t)!r5qqrfC5A&N=X`!}RmDm3WipRWu}bC(+IZ5!D0HJ-kt$_DMySPWK)wt}|4) zTPFCGhk{J^o$0`a<7ee~8EV zk;mrMa)#>&U*pQXK>*TlFx3l^1O|K7zI- zdqY^qdnXqkij^}r5}On5877gbfqOBtDh2m4B2!GbKSlC7pLGiM2w{EV!EaL3@|Hqv zGog**ZTb8;wU)UzZrp(Qa%}rxkJ>xRZY_6L9yNAplG$W(MvJQThF{J4&12r@Ce~)> z9+lGk_=O)s8~4w-&cwK`4~nrKQ_R-iRbbzS+=d)g1ndt;PE>o|s-%!``XnC;uIobX z@zLhGz{MGTZ`0-ykEX>_dK(@-`s|XlfB&y#@B9>~V`DZ4PskWy#5x<-_LvP)s}_={ zs`RQ~U0dTZ@BG5&ZpYVGi{&I;N=oRe<8Nbv&r!_zCX2qIo>1vJV)_0Ua){+rdfPlM z_~OH=-rts2nGPN_5Vo2n$^<$ z{oQRsBSrM*WJbSa#jEbC|EH|)3~I9L+D(X5DN>|&2^}FQNQXyywIC3BVgv+26X_iT z(ovKqO%y?TLPuH%NTe$Y1P}-yMS4+sIrsB^?>Y0$ocmWMGudU8Ywdllm37dh-Q!Ba=_?y5NP7y%~@n_t$A<=ZQ1$EP=iN znMbG7`V%zZpA^7ZugRJbq{@ESj%xjl7bFJOZ&%bb)0EX%S5ro{<)V7v+D)`;gtf(S zl8fe!@1^$i3?7_W$$c#c+MH_D&)~y&RE7M?9Ggp-dG0%-N%l4{sXkV-g97WHSN)f6 zyW?NelmVlcIb|!E2uB|(|8Fh8p|!VwCGy922HbaZsornN{JInZGmThU73}U|3Wa-$MGdk;s(zc*Yub*iG0Wc411nnkVC-}r1 zm=WfS41-~?fD)0d_j0O{iaV0&ihDgx@2wog_x>xoJEGgssMf!cmB8Bn2{;uXt4FCf zU1etOEqhVbG`AiH(mEv*WrRFMGTZT00W z*E;R$K!LzM*bFz`EM=$f?Pc$1U*NC5skx{IVhhW0`^U>QnF~ApvtUVYqyvl6 zp-%V#{heFNL{?_z9rjP(2SK~$LYtz9I#jD}WQS6ZR5_oaWp0s7%@94j}WXj4(s8J@u5PT8#zdd5o`{wZ9(40Fn4E@B{GRK#0%@zV52^E^~L zt=cNDxqSCp=B94wRG@@%iAw)mW7j=L?V4<@Jq0G6hKkS+Vink zCOD1nc_Z|&#p&q_R7KW@q1vGk7t*^22QAkoo~X--AWqHi#)mWarkY2c55X?tWvJp` zXX~f^l*F$poF1K%da6ZwAOX-Mp$U1~3x?3;xsI>4I{M(SJk(6WnTf8B&aU92lAIw@ zz@6cYu|hkriBHmaWTo$#wNuzR#UJ04qbrtjw?$s7M&8Lq<)=nKJ8G2J;j_w1A$av6 z*cyzX>6`LWK~(+_EOA8+!L^(f@X$RBHcj2S#k)5QN5V>{k$Avr!=s->&<)pCY;^FU z{`SmZoMse#6ZS-VS(*FE#%Y-bvlMV|jfmnI|CQRi=^t$V5E}W2gDJS(O~v*8*pjZ? z1w-EFAXdodO**?|qd$oT`wZP3yW`Rortt<7rUd?vBK1}b5&i~741V>u7o(IQS6;Mg?xdr;|)os=96PrNiz~-U3^$ zghJVs>!2PW__Fv#l<8`cFShTPh0q61Di<5rQq5h2k;ULM&mNR;>?h%#`~GCw*-CoZ z?IJR)df0%9s?S5Q_figYU@a?S(;TV>H}LL5uv=XbDD+D|B3)TfwP_fm-7?^&Uv41x zoITLS>oUZO)4Hr%3!YdIN4;EmS@_Ee$}?tKMf_@WX_-xb7=8-%an3%d~Lnrud6JIHZBuoK|jcoX=fh-9D*= zcIt}=OBb5V1fD;qB|)`*zAOFdJ5F=uL?l$oCb$W-woCrNI>tPrI#Ey4K(Wto<<_7A z#+m#BE=tp&Z)z7Xy@)sXeP?1E| z9#ZVSl@UP9Ww z_kyeo$hBwoV-^ubBs@LXLC>SkJ^d!ESru!~b8%7gW0vtuh@A6D|A9vSr~(nW z?6@?RbOEWO+zv9hzLN|xW8{o*Av^$-Tsq!II^f*evaQ9&7&B*24T@B!VLA33nmh!L zgnzRA;3}jKPxXqS$9h79B>(w!k9s{|rhLuBef7^ZVd0uApJ9=prx%TI!fP2he zkFiL7u(;QdcRQ;nMgs2&o=+GszTqum>G9oMmK=_NEjQ`nsF60XTaXThE93p8a47Ol z$0f!mDcM%(zq+6l-5S&ve+z*5C%<$lpolTH45ChYAb}nw0 zH>@1_DKsR)UUz_JFLOHT6xoE~@+vQ1iVM58-2w8^-QAQTcVb`}V8twA#4P7Z!M1{@ zKF>xU8G5SvHL^0?zTF z{|Lt99tk438nYtTab=)ZK;=0X2M-V zU0bXURA`wyOI_ z?tF`yN00mD4lgm(r3mISt%XoIAJzt>)&o2EJp*llIOhxZHLw5U zkNI-kCU7XC^>g-0RR!7s9hFBddqJ4|VYHEE*}uYo9$lTyq#UcfG1i8eg4yciL&=&w zW!?rSRhO@rTPW_W*`uwVic=%E(uIXxIce0GDp5#Vb83N;U1SSAO2 z4R|hp#5u(_=kX62hWHD@)p}A(7mDe8P7jH6`45yB_UpoHY{jk8&P*u^KrU1XZIt_G z*K}Nx)s*ACKl?j_I|v=0%MD~i!TQt*>Q~C&S?-H`RL4oi6sFat_N2Y7+4M!f$2QL3 zuf4wE>g!%%ZWyP45h5)mOJ~#ZMnQ=|w%`^=84f}J{B`=D3{M%@E&?kOUmHB6W)>}P z;&Km~gv~sVM}g$HX8~IEbgz}Il;A9ow)M2R-J+G1wLAXI7j5hyiN2l^)_L%WQCsGa z&5+}C%icU{OP{kv5*_<3#(Q-64bI5e)rxP3&VuyX?IWQ$RRFR;6W|p>xx(h5SkIL( zt7d^TPg8mRYkUr`IA1k)E-|f)q~g=N%k^AqisE}EbU8k! zue`^P#a=fi5(*DBYR~q40$NL(Rt%fy;uj>Wh+kx|tM7z{oUTm(`9-d|@DjbdL%$p& z9a)NBnJoq?O`4PeV zdY@8X7hKoI>eaMek!R~@mIQ=ilk%%F#SDFI)0GxwM$PV@@9vNe%oM7b8g_CR`zzgX z4EQ8H(=t#=6GOzWSzsex1)l@%I{qoi6F*3&*4KdhdF*0^ptO(^AHJ4=E8bf z{#^lb(w(c5_zsFbPx`e-qJzgC3rIR}1*ci`854?^Im(tPQtJ&YyDs?mHIRLz#$wDM zR_#@Hd)Q41cc6Eavjoz-tPnGJ>=E525c4V1BBjDAoikz9E*&euf397#w%y^;9STDZ zbZ*uTRM$Y!(PyXHZTdHnOqM9GFUgCK37&trW7VZia#$2Un7qbHc-$j6E2-mFJql-x z9mRMkp-aTQneSsTR^wc$Pf-|0>g+f=rysXzb9O3XJbLJZ&K!08Ro4Tpc>~{Imwni= zK}AOxZ`QdXQ`UwtyC0qn&#yFK397$P+MSYkHo|$ny`F{!L=;EUKCCgR;tZMUd2=`U zH8$Iq0ndtQi{!yc@ALZpBWR@}32uIFOY2Xnal@QD_OU7eS*#m5@P&)V?fiGbd7UzCnYZG9yKykR}*epsAf- zoBgOHy8eHO2tLKUum1O7r#S74E=HYc5bwcOTN4iP7R)f=I_BNvay8Qhw9>=~J>9~y z!Vg{uPiA0;F}wTiKk{R6bcI60-xlD{$KS1h?e36#6)%$n$1uF7(c2yF!*_q0vfEM= zFrV}0^SR&lyGw8eSH#Lh#K;tIG_wm8y!@*QSy`?e=0i>iVX2uW)+Y6geHoTx~M@SsHO)yN3e z^Hv2&rrsO#m*U79?Z&hhEpn7fFXtaj*sSieP`=@t}$5@OU zNai8ry{CRZxYUvWs8e;PYRgN2Lods*z9t_#ad~#O{DdO8_RBHZF}#hrJdiDcMRB1i z(fgpcm(4vBQTac@S!$JmylRy~CKgCIZ%J%Xaw2d#m!!i`3;O zZBe)4_OjPu(i5<16^IzvJl?mRzgVf)6(#`)Cx!Hvd*NVS0nw)Po$ejj7{PRO{{1)* zvbJu?79lbe6aprR486AV>ndX%5s+go48TXictZawTR zv<46(dL_CZn(TwLO0mL<#I&xzT>V%rf&XH%?^=9)V#}4l^zG5Fld8K9 zgaQHQ8X8%)?QN_#^p`Qi^WWVk_$Q3>xUi4?qrD{VOK=vGz9-jnVgTG$9xaOBFfIlg zlN0KdA71k3bB_OC9>&`tvL3SD`OP_PKpx|zV5?jVv7$IbnG6`Zkgd9>n~vr8r;Xi8 zFoRG32s!K?px0Zbx$ikIy$2skG&FFpX~^@gaG;(r`*qu75>=iDAV($l5Y&X_(FZBA zy$AK9tRV%-K2>ibTX238t&c(eMdv9^e|a5Wq(0O(B1ylvimU0vUEl57fmuf1D!&Ev z($0n_VmOxIV~)TpTA3qwD3pJ zuV={hKssHrHJ!|WSJqP;z7E`ysKspwujyskR&ry9%W?d?H&KSHJUv-<0CN66^ICW; zh<0DwA-UwK!LM?fwhjy4h;lb*eA{>Wv@^|9Q)nj0wI_eU+2e+3KHz`qiKwe156`M@ zBGY%r;$h7y3WzoFuDB3^Y)}P1GTar;b{N+*KGBA!f{9u^-@v+M;)aMOi0|SzF1sV= zq1jed@2MmIqD-pH81O^g_OIM}o-FO|((BOXFn3GJUT6ZphiCAfGMoY#cW%SGA zdt|8p~F&=uj`!b^Kf~+&+HDz z;087M%sCfMf70>3+84ZEcNJ?l`Ai&3Ek3?XayQ%;M2V3@Xo=pYgbvxydz6;6^R9?a zn(A?|ZNwyBAp1!hC%sAh_TR>Qg)UH`ykticW$mzHon=d%qg8T3=9ZB!}EUq9+gVweq=*I3^k32VtKak3H zfw6J~jN+(h>Qo?c6N+f6r}JmNER~6#Zs9jSx7$`naMD z%Qdbg9WU}DtTySYFmOyQo3lom>(`)Y_OFO}#ipG%f4?{VGSlsr1A8|+VO8BxAgzL@ zM||ERZSYl%6{&(mVO(as;2_6*f^HPsvAMI4XJ4&`h*D>nD-e}CU92^S>2g#Ee5_L^ zU?bB9{{|W0n3|_UI$6B4U<$gJncURZkVJ;HYmo{uPH%uncgF8Io>67|5xV6CAudIGc|L*ui z{{aJhG^2=gCYB5 zdCT&>Aih`ej<~n#x~8N{C)vc~>~?k+BZXc!04YNSLPKx=loJ z!y&=-GvAg#^WIB9>{S4cPst0jaCu{X2I$#d$@@?5(X=@T)u!(%vk@tB9cuRpOS~bd zt0yC^vL;=d3oZ{WQeIi6SFS+NDHiWJfh=H#BoS)1N2g1hbENbd`x`iFkFWzL-_dyN zhMT@z$(k;IMO3o#;6avNg)un@4pkUlcAUmaz9E7FUL`MQ2!M=Lhj0VHG8l|mIv5Tc zQz!6i@cgb#cz}v*9xj@vgUXXCwnS~*86l0WTHxJ7+^WzGc(WX)Vrj82z0Or;_0HR? z0x`0K*A|(I-0-pc$7c`Bel475+e^R{Zt=4pJJ@YJ7tpSXnzmvhw9AHP?Aqn@dOc}o zQM|^BD_6e>p$4hrM4~HJqR-~5Uhiw=4id^j7>z>&p>mw=F3eq(FC9u~8oCZT|HzQS zOjd8vmB%$dLk%$Eg-BJ1-o`!bv_<))ga~NEv(P7R4~2#Qawdi8zscU$(xF?iLCmr_ zG;)=Th|9}9!?`rH-UaDqoMTuQI=)h2kK$GV^EB|L zD{RKYM=zLc&Xwt=F5URB*kRhGk@J_J*#GCTGCMez);+!Q3hc+7)*M?Igm`OQ1m|7Il!~h28Qqw@snMh8PB{x6DM7!X5>!JJj5q zSQV7#4e5dZP+Zw)<_QT`Ek9O!+jdxEkQzKD#6oH7Dr~X}PV&YJUceTOikOWV={Kw^ zp4JY`K0LJa38f7jhB;)bgOUIeQ_fP+es_xtU8wQ;eIx?~kbf-IyEZ1e4@YaK#9_Xf zsH9)7Hk?y{c5G7l>spZ8@{;TEBPSIAlQwm()#Sp!7g@eDix3zIL_;oSNB9lE3Xo+` z2x1hcli((b)wIlYw(LVmy!!{w4!=s24*`+5%GJcf&!ewu=j82c31`PtX7fH%iHPx5 z#d2BtSQgp4Zps&=K*#O!=Q$G|t6*=rb!5bLGCM3Z&{W@JJ6V{r+;k?woyHBa_JZJ% zS!pTeGzUTr*T&dkl?|_ig}ZPK*EmYl7+=;jy=+RXT==^5pmbUrFADD$Gc0C4yy~rz z!7B*l^*wTKlNuJKASF~u0t6E@YH09{ix)~JOA!-fS|#YXQDh?a=pvur@ML|(S)p1v3l|2HBngkg}?1vQS#&U z%Xd-0)}wv!4RBjg^znzm&%Qz~l@71rkMVo1Od>>43e|U}1HdjuxhZ~f%bgqI z-M|aapQvK__m50g50tQ?lV3#_|J-b#I)qO`dYf{BT}165@0ycgV%H23dp4n3YlcYt5BtpZca76iGQ^Y77A*u*IW6>hD zj8<2ws!L;(4#q*!X*aBo)Bf=Kn?IoJoV*E%AlkTuz1h5r!CG)?Z$6cI^DK9P;Yo_v z(j*9WKp9LOC-qy2t~`zP_ARp8TcNw5%*@#5DjW}K=bwEgWEd91G3bh1aa8 ztcQQl8Cz|Qs(-CXQLmM$@(7@pq*TgjH0+d&~{zKIz{}Wr`XE_GkT@5lC~2jC)=>XO%lIi2MNQVe;V2s0$J>{GE59m-iKraJ2ULmbmCf2q&ovz~vF4%o3Rrq~$-0QIK!ibT6fwQ?M4E zVyq1d(XYQ-;j2i`+79mX8)ukMnsq7aJx1CAdunz@n=1TJ3G}Kkx68Lsc}$OAdN(NS z%B`hMN(yli5VaP7+({;s%+-F;b&=gEm;*i{qN;QPAhHQ-hfE)cS=h0Qis0U zg%^1U@sE`91^;cGDx6*Cy|d(RADQJ&!9xky;$sR%Av@@AN-Wd3u&`k(4R5jqy)t9D zw2<(`F8{U({_xp71$)|(5u4ph=(dW1O+0(g1?JOWTwGk>@fD>Th*LhSk!jF@f+g6~ zv_i_pdMZ4X+Kf7b@;r%USjP=U*)m&&@mm#l-zob&FmV`8AtyRL$JQ4SS&#d>ijx4` z>;MrnKcqwXW);R@8^Hy#(+wI&I)ki0QXt}6&u{Z0{j@n(1s*#68NcLN*lOK(hr$+N zadpNtNLt=&c+QqTSbqC0kiX{vq31cbe90XtJHJ};MNR&~EGDEg0;2XPdS)5Q?L>s{ zCotG`CgBiBF%iTHM%{+YgJ7t%KbL^!7S2 zavaigA%(q*KZLbCtCXl>{HYUUQyxy0i-Ef3C)4%EiNIKtIE~?_Qj3P6{E6yY*8Ee4 z4#isyutCCDd1fceL;WI^H;4R`id{41nx+BbG22jYrTy~=p~Z8GyvceH^ZQtM)%@MoOC-#0rRd!Yhjo5o99f^R!vGcvCOo};A) zF{L%lVxO%~S$(e~Z%NywSWK}oyAHFVSqJZtL|=m8Q?m6RulA;@((GyN$dHeKOxC14 zt*x{J`_xCvU#4xQ_zk=Y+@k7*#S_5uy3)V6z7)Lg9x%=Rlzt#`=+C9}a zyjcG5{u3(RKRnjSSK)klpY-v@m&VUKKqp4YzssYsq>y8!k&f{|-fLJt95`Q0qD$}P zx$-#dLOWhU!@qOO<%#((oUzgce(Ter^)DR9C=}CDpa`}FCVy%l)rRYH5E_S}cnd(w zZRin|513RLbP?ab|zgx%GEqKg|6UH53(aI*7_5LSbWqA_0+kSCr6qw*;~ zZ(ZD+;0)Pj?p;=9UttMa|NG@OVJXE7^^sRrj5G1aX87q=xxkBcNIHvR?Qf&g>h!*E zm(bi^lAZsu$M^OzgR)V}k^kVc@n90iu7;tRTQ5EItl)jhDkBvAhGAR1`ukm{0~>%+ zsqn;a;{TFD>?RNLY*I?`7f1`agiqJU_@U^fg}a1ervFJjWUIGf6ATMCO9jB{4^2gN z&v5=7+PKvZt{s^czM)Cb9duIK)m@-4@pB`M<Zo5Z%YsTE z>Ur~FIzChUv2v6h!(xuApC!_MYypd#RUzoDmNa{^`rXW@dz_P8Aftb0oxg_9U%*=VvroMu zB#^Qtl^*QyIscXM{vc@6Rhc`oKC3ns%ReFIw$11}b|qirf|gL0#MT5Je?4w`09zcs|lR3(7o2kY4f_~(m)l2OwYK> z5H|rd@3+m>m8*b30>o0BLAA^|J3(U)O<$2bU7f*r`X(8^xIK1IZiO2h63)Jxff;Og zN|Dj&c_|EcD-()~S*5f|(U7@VAKeX5sXGnPbsArOim)qRxQt%@xeSkK2)OqIDCGH{ z=aI1&f^xmnSQBwi+8V*U4ki=ew{jdvJ+X#wqK%96v1RmmHSi_^k0oNCk6V*46kCA+@q11Off@b zQP9-3DAGx&V#;{bD8GN^iOWD4u4|0MD9>&LH=Kqno_~w8n9fUDR7vVdThc>J>&|qg z6*%kWBtN<*yHp`09aG6C-Ix3KSq$!=q+#reC}K;S6}z^=v###`sDDR!zy0rZqao>M z4y3lSCmlAtEg6ypQ8u&H!65si%`-PT-%YFcxV7bL>)gj#^8rd3xhE0zS0LA3X_y0* Qry!7_u9;5NZAA3{0Vma#a{vGU literal 0 HcmV?d00001 diff --git a/smart_device_protocol/docs/sdp_logo_v1.svg b/smart_device_protocol/docs/sdp_logo_v1.svg new file mode 100644 index 000000000..afe3acabf --- /dev/null +++ b/smart_device_protocol/docs/sdp_logo_v1.svg @@ -0,0 +1,83 @@ + + + + + + + + + + image/svg+xml + + + + + + + SDP + SMART DEVICE PROTOCOL + + diff --git a/smart_device_protocol/launch/demo.launch b/smart_device_protocol/launch/demo.launch new file mode 100644 index 000000000..30ad5efc7 --- /dev/null +++ b/smart_device_protocol/launch/demo.launch @@ -0,0 +1,17 @@ + + + + + + + port: $(arg port) + baud: 57600 + tag_id: $(arg tag_id) + + + diff --git a/smart_device_protocol/msg/Packet.msg b/smart_device_protocol/msg/Packet.msg new file mode 100644 index 000000000..7a85c41fe --- /dev/null +++ b/smart_device_protocol/msg/Packet.msg @@ -0,0 +1,18 @@ +uint8 PACKET_TYPE_NONE = 0 +uint8 PACKET_TYPE_TEST = 1 +uint8 PACKET_TYPE_NAMED_STRING = 11 +uint8 PACKET_TYPE_NAMED_INT = 12 +uint8 PACKET_TYPE_NAMED_FLOAT = 13 +uint8 PACKET_TYPE_SENSOR_ENV_III = 21 +uint8 PACKET_TYPE_SENSOR_UNITV2_PERSON_COUNTER = 22 +uint8 PACKET_TYPE_EMERGENCY = 31 +uint8 PACKET_TYPE_TASK_DISPATCHER = 32 +uint8 PACKET_TYPE_TASK_RESULT = 33 +uint8 PACKET_TYPE_TASK_RECEIVED = 34 +uint8 PACKET_TYPE_DEVICE_MESSAGE_BOARD_META = 41 +uint8 PACKET_TYPE_DEVICE_MESSAGE_BOARD_DATA = 42 +uint8 PACKET_TYPE_META = 81 +uint8 PACKET_TYPE_DATA = 82 + +uint8[] mac_address # Must be 6 +uint8[] data diff --git a/smart_device_protocol/msg/UWBDistance.msg b/smart_device_protocol/msg/UWBDistance.msg new file mode 100644 index 000000000..5f811f7ab --- /dev/null +++ b/smart_device_protocol/msg/UWBDistance.msg @@ -0,0 +1,3 @@ +std_msgs/Header header +int8 id +float32 distance \ No newline at end of file diff --git a/smart_device_protocol/node_scripts/broadcast_v1_test_packet.py b/smart_device_protocol/node_scripts/broadcast_v1_test_packet.py new file mode 100644 index 000000000..020899660 --- /dev/null +++ b/smart_device_protocol/node_scripts/broadcast_v1_test_packet.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import rospy + +from smart_device_protocol.esp_now_ros_interface import ESPNOWROSInterface +from smart_device_protocol.packet_generator import create_test_packet + +if __name__ == "__main__": + rospy.init_node("broadcast_test_packet") + + interface = ESPNOWROSInterface() + + rate = rospy.Rate(0.2) + count = 0 + while not rospy.is_shutdown(): + rate.sleep() + data = create_test_packet(num_int=count, string="count: {}".format(count)) + interface.send((255, 255, 255, 255, 255, 255), data) + rospy.loginfo("send data: {}".format(data)) + count += 1 diff --git a/smart_device_protocol/node_scripts/esp_now_v1_packet_printer.py b/smart_device_protocol/node_scripts/esp_now_v1_packet_printer.py new file mode 100644 index 000000000..a73d2c641 --- /dev/null +++ b/smart_device_protocol/node_scripts/esp_now_v1_packet_printer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +import rospy + +from smart_device_protocol.esp_now_ros_interface import ESPNOWROSInterface +from smart_device_protocol.packet_parser import parse_packet + + +def callback(src_address, data): + result = parse_packet(data) + rospy.loginfo("Packet from {} : {}".format(src_address, result)) + + +if __name__ == "__main__": + rospy.init_node("esp_now_packet_printer") + interface = ESPNOWROSInterface(callback) + rospy.spin() diff --git a/smart_device_protocol/node_scripts/sdp_v2_device_interface_printer.py b/smart_device_protocol/node_scripts/sdp_v2_device_interface_printer.py new file mode 100644 index 000000000..3ee8c4546 --- /dev/null +++ b/smart_device_protocol/node_scripts/sdp_v2_device_interface_printer.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +import rospy + +from smart_device_protocol.smart_device_protocol_interface import DeviceDictSDPInterface + + +if __name__ == "__main__": + rospy.init_node("smart_device_protocol_device_interface_printer") + sdp_interface = DeviceDictSDPInterface() + while not rospy.is_shutdown(): + print("Current Device Interfaces:") + for src_address, device_interface in sdp_interface.device_interfaces.items(): + print("Address: {}, Device: {}".format(src_address, device_interface)) + rospy.sleep(1.0) diff --git a/smart_device_protocol/node_scripts/sdp_v2_packet_printer.py b/smart_device_protocol/node_scripts/sdp_v2_packet_printer.py new file mode 100644 index 000000000..8f1b6b12b --- /dev/null +++ b/smart_device_protocol/node_scripts/sdp_v2_packet_printer.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +import rospy + +from smart_device_protocol.smart_device_protocol_interface import SDPInterface + + +def callback(src_address, frame): + print("{} Packet from {}".format(type(frame), src_address)) + print("{}".format(frame)) + + +if __name__ == "__main__": + rospy.init_node("smart_device_protocol_packet_printer") + interface = SDPInterface(callback_data=callback, callback_meta=callback) + rospy.spin() diff --git a/smart_device_protocol/package.xml b/smart_device_protocol/package.xml new file mode 100644 index 000000000..f983d64b9 --- /dev/null +++ b/smart_device_protocol/package.xml @@ -0,0 +1,25 @@ + + + smart_device_protocol + 0.5.0 + The smart_device_protocol package + + Koki Shinjo + + BSD + + catkin + + catkin_virtualenv + std_msgs + message_generation + rosserial_arduino + message_runtime + rosserial_python + + rostest + + + requirements.txt + + diff --git a/smart_device_protocol/python/smart_device_protocol/__init__.py b/smart_device_protocol/python/smart_device_protocol/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/smart_device_protocol/python/smart_device_protocol/esp_now_ros_interface.py b/smart_device_protocol/python/smart_device_protocol/esp_now_ros_interface.py new file mode 100644 index 000000000..1dc7d7781 --- /dev/null +++ b/smart_device_protocol/python/smart_device_protocol/esp_now_ros_interface.py @@ -0,0 +1,43 @@ +import struct + +import rospy + +from smart_device_protocol.msg import Packet + + +class ESPNOWROSInterface: + def __init__( + self, + callback=None, + recv_topic="/smart_device_protocol/recv", + send_topic="/smart_device_protocol/send", + ): + self.raw_callback = callback + self.sub = rospy.Subscriber(recv_topic, Packet, self.callback) + self.pub = rospy.Publisher(send_topic, Packet, queue_size=1) + + def callback(self, msg): + src_address = struct.unpack("6B", msg.mac_address) + data = msg.data + if self.raw_callback is not None: + self.raw_callback(src_address, data) + + def send(self, target_address, data, num_trial=1): + """ + Args: + target_address (list of int) + data (bytes) + """ + msg = Packet() + msg.mac_address = struct.pack( + "6B", + target_address[0], + target_address[1], + target_address[2], + target_address[3], + target_address[4], + target_address[5], + ) + msg.data = data + for _ in range(num_trial): + self.pub.publish(msg) diff --git a/smart_device_protocol/python/smart_device_protocol/packet_generator.py b/smart_device_protocol/python/smart_device_protocol/packet_generator.py new file mode 100644 index 000000000..e6fe63413 --- /dev/null +++ b/smart_device_protocol/python/smart_device_protocol/packet_generator.py @@ -0,0 +1,70 @@ +import struct + +from smart_device_protocol.msg import Packet + + +# Version 1 of the packet generator +def create_test_packet( + num_int: int = -120, num_float: float = -1.0, string: str = "Hello, world!" +): + return ( + struct.pack(" Tuple[Tuple, Union[MetaFrame, DataFrame]]: + src_address = struct.unpack("6B", packet.mac_address) + packet_type = struct.unpack(" 50: + task_args = ( + struct.unpack("{}s".format(len(packet) - 50), packet[50:])[0] + .decode("utf-8") + .replace("\x00", "") + ) + else: + task_args = "" + return packet_type, caller_name, target_name, task_name, task_args + + elif packet_type == Packet.PACKET_TYPE_TASK_RECEIVED: + worker_name = ( + struct.unpack("16s", packet[2:18])[0].decode("utf-8").replace("\x00", "") + ) + caller_name = ( + struct.unpack("16s", packet[18:34])[0].decode("utf-8").replace("\x00", "") + ) + task_name = ( + struct.unpack("16s", packet[34:50])[0].decode("utf-8").replace("\x00", "") + ) + return packet_type, worker_name, caller_name, task_name + + elif packet_type == Packet.PACKET_TYPE_TASK_RESULT: + caller_name = ( + struct.unpack("16s", packet[2:18])[0].decode("utf-8").replace("\x00", "") + ) + target_name = ( + struct.unpack("16s", packet[18:34])[0].decode("utf-8").replace("\x00", "") + ) + task_name = ( + struct.unpack("16s", packet[34:50])[0].decode("utf-8").replace("\x00", "") + ) + if len(packet) > 50: + task_result = ( + struct.unpack("{}s".format(len(packet) - 50), packet[50:])[0] + .decode("utf-8") + .replace("\x00", "") + ) + else: + task_result = "" + return packet_type, caller_name, target_name, task_name, task_result + + elif packet_type == Packet.PACKET_TYPE_DEVICE_MESSAGE_BOARD_META: + device_name = ( + struct.unpack("64s", packet[2 : 2 + 64])[0] + .decode("utf-8") + .replace("\x00", "") + ) + return packet_type, device_name + + elif packet_type == Packet.PACKET_TYPE_DEVICE_MESSAGE_BOARD_DATA: + source_name = ( + struct.unpack("64s", packet[2 : 2 + 64])[0] + .decode("utf-8") + .replace("\x00", "") + ) + timeout_duration = struct.unpack(" bytes: + data = struct.pack(" 0 and len(serialization_format) > 0: + interface_descriptions.append( + (packet_description, serialization_format) + ) + return MetaFrame( + device_name=device_name, interface_descriptions=interface_descriptions + ) + + +class DataFrame(BaseFrame): + def __init__( + self, + packet_description: str, + content: List[Union[bool, int, float, str]], + serialization_format=None, + ): + self._packet_description = packet_description + if serialization_format is not None: + self._serialization_format = serialization_format + else: + serialization_format = "" + for entry in content: + if type(entry) is bool: + serialization_format += "?" + elif type(entry) is int: + serialization_format += "i" + elif type(entry) is float: + serialization_format += "f" + elif type(entry) is str: + encoded_entry = entry.encode("utf-8") + if len(encoded_entry) <= 16: + serialization_format += "s" + elif len(encoded_entry) <= 64: + serialization_format += "S" + else: + raise ValueError( + f"String entry of content is longer than 64 bytes: {len(encoded_entry)}" + ) + else: + raise ValueError( + f"There is an unknown type of content: {type(entry)}" + ) + self._serialization_format = serialization_format + self._content = content + + def __repr__(self): + output = f"packet_description: [{self._packet_description}]\n" + output += f"serialization_format: [{self._serialization_format}]\n" + output += f"content: {self._content}" + return output + + def __eq__(self, other): + if isinstance(other, MetaFrame): + return self.__dict__ == other.__dict__ + return False + + @property + def packet_description(self): + return self._packet_description + + @property + def serialization_format(self): + return self._serialization_format + + @property + def content(self): + return self._content + + @property + def interface_description(self): + return (self._packet_description, self._serialization_format) + + def to_bytes(self) -> bytes: + data: bytes = ( + struct.pack(" self._timeout: + rospy.logwarn( + "Remove timeout device: {}, {}".format( + src_address, device_interface["device_name"] + ) + ) + self._device_interfaces.pop(src_address) + + @property + def device_interfaces(self): + return self._device_interfaces + + def send( + self, target: Union[Tuple, str], frame: Union[DataFrame, MetaFrame], num_trial=1 + ): + if isinstance(target, str): + for src_address, device_interface in self._device_interfaces.items(): + if device_interface["device_name"] == target: + target_address = src_address + break + else: + raise ValueError(f"Unknown device name: {target}") + else: + target_address = target + super().send(target_address, frame, num_trial) + + +class DeviceDictSDPInterfaceWithInterfaceCallback(DeviceDictSDPInterface): + def __init__( + self, + callbacks_data: Dict[ + Tuple[str, str], Callable[[Union[List[int], Tuple[int]], List], None] + ] = {}, + callback_meta=None, + timeout: float = 10.0, + ): + self._callbacks_data = callbacks_data + self._callback_meta = callback_meta + super().__init__( + self._callback_data_for_interface, self._callback_meta, timeout + ) + + def _callback_data_for_interface(self, src_address, frame): + interface_description = frame.interface_description + if interface_description in self._callbacks_data: + self._callbacks_data[interface_description](src_address, frame) + + def register_callback(self, interface_description, callback): + self._callbacks_data[interface_description] = callback + + def unregister_callback(self, interface_description): + del self._callbacks_data[interface_description] diff --git a/smart_device_protocol/python/smart_device_protocol/utils.py b/smart_device_protocol/python/smart_device_protocol/utils.py new file mode 100644 index 000000000..c56d1ce72 --- /dev/null +++ b/smart_device_protocol/python/smart_device_protocol/utils.py @@ -0,0 +1,24 @@ +import importlib +from typing import Tuple + + +def import_ros_type(ros_type_str: str) -> type: + package_name, message_name = ros_type_str.split("/") + module = importlib.import_module(f"{package_name}.msg") + rostype = getattr(module, message_name) + return rostype + + +def address_tuple_to_str(address: Tuple) -> str: + return "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}".format( + address[0], + address[1], + address[2], + address[3], + address[4], + address[5], + ) + + +def address_str_to_tuple(address: str) -> Tuple: + return tuple([int(x, 16) for x in address.split(":")]) diff --git a/smart_device_protocol/requirements.txt b/smart_device_protocol/requirements.txt new file mode 100644 index 000000000..e69de29bb diff --git a/smart_device_protocol/ros_lib/.gitignore b/smart_device_protocol/ros_lib/.gitignore new file mode 100644 index 000000000..57c53d50a --- /dev/null +++ b/smart_device_protocol/ros_lib/.gitignore @@ -0,0 +1 @@ +./* diff --git a/smart_device_protocol/ros_lib/ros_lib/ArduinoHardware.h b/smart_device_protocol/ros_lib/ros_lib/ArduinoHardware.h new file mode 100644 index 000000000..08fbbd5e6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ArduinoHardware.h @@ -0,0 +1,118 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_ARDUINO_HARDWARE_H_ +#define ROS_ARDUINO_HARDWARE_H_ + +#if ARDUINO>=100 + #include // Arduino 1.0 +#else + #include // Arduino 0022 +#endif + +#if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__MKL26Z64__) || defined(__IMXRT1062__) + #if defined(USE_TEENSY_HW_SERIAL) + #define SERIAL_CLASS HardwareSerial // Teensy HW Serial + #else + #include // Teensy 3.0 and 3.1 + #define SERIAL_CLASS usb_serial_class + #endif +#elif defined(_SAM3XA_) + #include // Arduino Due + #define SERIAL_CLASS UARTClass +#elif defined(USE_USBCON) + // Arduino Leonardo USB Serial Port + #define SERIAL_CLASS Serial_ +#elif (defined(__STM32F1__) and !(defined(USE_STM32_HW_SERIAL))) or defined(SPARK) + // Stm32duino Maple mini USB Serial Port + #define SERIAL_CLASS USBSerial +#else + #include // Arduino AVR + #define SERIAL_CLASS HardwareSerial +#endif + +class ArduinoHardware { + public: + ArduinoHardware(SERIAL_CLASS* io , long baud= 57600){ + iostream = io; + baud_ = baud; + } + ArduinoHardware() + { +#if defined(USBCON) and !(defined(USE_USBCON)) + /* Leonardo support */ + iostream = &Serial1; +#elif defined(USE_TEENSY_HW_SERIAL) or defined(USE_STM32_HW_SERIAL) + iostream = &Serial1; +#else + iostream = &Serial; +#endif + baud_ = 57600; + } + ArduinoHardware(ArduinoHardware& h){ + this->iostream = h.iostream; + this->baud_ = h.baud_; + } + + void setPort(SERIAL_CLASS* io){ + this->iostream = io; + } + + void setBaud(long baud){ + this->baud_= baud; + } + + int getBaud(){return baud_;} + + void init(){ +#if defined(USE_USBCON) + // Startup delay as a fail-safe to upload a new sketch + delay(3000); +#endif + iostream->begin(baud_); + } + + int read(){return iostream->read();}; + void write(uint8_t* data, int length){ + iostream->write(data, length); + } + + unsigned long time(){return millis();} + + protected: + SERIAL_CLASS* iostream; + long baud_; +}; + +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ArduinoTcpHardware.h b/smart_device_protocol/ros_lib/ros_lib/ArduinoTcpHardware.h new file mode 100644 index 000000000..43c508cae --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ArduinoTcpHardware.h @@ -0,0 +1,116 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_ARDUINO_TCP_HARDWARE_H_ +#define ROS_ARDUINO_TCP_HARDWARE_H_ + +#include +#if defined(ESP8266) + #include +#elif defined(ESP32) + #include // Using Espressif's WiFi.h +#else + #include + #include +#endif + +class ArduinoHardware { +public: + ArduinoHardware() + { + } + + void setConnection(IPAddress &server, int port = 11411) + { + server_ = server; + serverPort_ = port; + } + + IPAddress getLocalIP() + { +#if defined(ESP8266) or defined(ESP32) + return tcp_.localIP(); +#else + return Ethernet.localIP(); +#endif + } + + void init() + { + if(tcp_.connected()) + { + tcp_.stop(); + } + tcp_.connect(server_, serverPort_); + } + + int read(){ + if (tcp_.connected()) + { + return tcp_.read(); + } + else + { + tcp_.stop(); + tcp_.connect(server_, serverPort_); + } + return -1; + } + + void write(const uint8_t* data, int length) + { + tcp_.write(data, length); + } + + unsigned long time() + { + return millis(); + } + + bool connected() + { + return tcp_.connected(); + } + +protected: +#if defined(ESP8266) or defined(ESP32) + WiFiClient tcp_; +#else + EthernetClient tcp_; +#endif + IPAddress server_; + uint16_t serverPort_ = 11411; +}; + +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestAction.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestAction.h new file mode 100644 index 000000000..b3d40c9d2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestAction_h +#define _ROS_actionlib_TestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TestActionGoal.h" +#include "actionlib/TestActionResult.h" +#include "actionlib/TestActionFeedback.h" + +namespace actionlib +{ + + class TestAction : public ros::Msg + { + public: + typedef actionlib::TestActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef actionlib::TestActionResult _action_result_type; + _action_result_type action_result; + typedef actionlib::TestActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + TestAction(): + 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/TestAction"; }; + virtual const char * getMD5() override { return "991e87a72802262dfbe5d1b3cf6efc9a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionFeedback.h new file mode 100644 index 000000000..d828823ce --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestActionFeedback_h +#define _ROS_actionlib_TestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestFeedback.h" + +namespace actionlib +{ + + class TestActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef actionlib::TestFeedback _feedback_type; + _feedback_type feedback; + + TestActionFeedback(): + 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/TestActionFeedback"; }; + virtual const char * getMD5() override { return "6d3d0bf7fb3dda24779c010a9f3eb7cb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionGoal.h new file mode 100644 index 000000000..3265948b2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestActionGoal_h +#define _ROS_actionlib_TestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TestGoal.h" + +namespace actionlib +{ + + class TestActionGoal : 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::TestGoal _goal_type; + _goal_type goal; + + TestActionGoal(): + 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/TestActionGoal"; }; + virtual const char * getMD5() override { return "348369c5b403676156094e8c159720bf"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionResult.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionResult.h new file mode 100644 index 000000000..349483361 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestActionResult_h +#define _ROS_actionlib_TestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestResult.h" + +namespace actionlib +{ + + class TestActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef actionlib::TestResult _result_type; + _result_type result; + + TestActionResult(): + 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/TestActionResult"; }; + virtual const char * getMD5() override { return "3d669e3a63aa986c667ea7b0f46ce85e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestFeedback.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestFeedback.h new file mode 100644 index 000000000..536fe7e89 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestFeedback.h @@ -0,0 +1,62 @@ +#ifndef _ROS_actionlib_TestFeedback_h +#define _ROS_actionlib_TestFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestFeedback : public ros::Msg + { + public: + typedef int32_t _feedback_type; + _feedback_type feedback; + + TestFeedback(): + feedback(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_feedback; + u_feedback.real = this->feedback; + *(outbuffer + offset + 0) = (u_feedback.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_feedback.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_feedback.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_feedback.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->feedback); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_feedback; + u_feedback.base = 0; + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->feedback = u_feedback.real; + offset += sizeof(this->feedback); + return offset; + } + + virtual const char * getType() override { return "actionlib/TestFeedback"; }; + virtual const char * getMD5() override { return "49ceb5b32ea3af22073ede4a0328249e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestGoal.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestGoal.h new file mode 100644 index 000000000..959ffc18e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestGoal.h @@ -0,0 +1,62 @@ +#ifndef _ROS_actionlib_TestGoal_h +#define _ROS_actionlib_TestGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestGoal : public ros::Msg + { + public: + typedef int32_t _goal_type; + _goal_type goal; + + TestGoal(): + goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal; + u_goal.real = this->goal; + *(outbuffer + offset + 0) = (u_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal; + u_goal.base = 0; + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->goal = u_goal.real; + offset += sizeof(this->goal); + return offset; + } + + virtual const char * getType() override { return "actionlib/TestGoal"; }; + virtual const char * getMD5() override { return "18df0149936b7aa95588e3862476ebde"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestAction.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestAction.h new file mode 100644 index 000000000..8ae0fec91 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestRequestAction_h +#define _ROS_actionlib_TestRequestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TestRequestActionGoal.h" +#include "actionlib/TestRequestActionResult.h" +#include "actionlib/TestRequestActionFeedback.h" + +namespace actionlib +{ + + class TestRequestAction : public ros::Msg + { + public: + typedef actionlib::TestRequestActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef actionlib::TestRequestActionResult _action_result_type; + _action_result_type action_result; + typedef actionlib::TestRequestActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + TestRequestAction(): + 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/TestRequestAction"; }; + virtual const char * getMD5() override { return "dc44b1f4045dbf0d1db54423b3b86b30"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionFeedback.h new file mode 100644 index 000000000..20b43a9e4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestRequestActionFeedback_h +#define _ROS_actionlib_TestRequestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestRequestFeedback.h" + +namespace actionlib +{ + + class TestRequestActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef actionlib::TestRequestFeedback _feedback_type; + _feedback_type feedback; + + TestRequestActionFeedback(): + 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/TestRequestActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionGoal.h new file mode 100644 index 000000000..8f3ca2535 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestRequestActionGoal_h +#define _ROS_actionlib_TestRequestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TestRequestGoal.h" + +namespace actionlib +{ + + class TestRequestActionGoal : 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::TestRequestGoal _goal_type; + _goal_type goal; + + TestRequestActionGoal(): + 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/TestRequestActionGoal"; }; + virtual const char * getMD5() override { return "1889556d3fef88f821c7cb004e4251f3"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionResult.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionResult.h new file mode 100644 index 000000000..8f487f1fa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestRequestActionResult_h +#define _ROS_actionlib_TestRequestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestRequestResult.h" + +namespace actionlib +{ + + class TestRequestActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef actionlib::TestRequestResult _result_type; + _result_type result; + + TestRequestActionResult(): + 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/TestRequestActionResult"; }; + virtual const char * getMD5() override { return "0476d1fdf437a3a6e7d6d0e9f5561298"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestFeedback.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestFeedback.h new file mode 100644 index 000000000..5e85b6376 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_actionlib_TestRequestFeedback_h +#define _ROS_actionlib_TestRequestFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestRequestFeedback : public ros::Msg + { + public: + + TestRequestFeedback() + { + } + + 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 "actionlib/TestRequestFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestGoal.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestGoal.h new file mode 100644 index 000000000..41a1a5d52 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestGoal.h @@ -0,0 +1,215 @@ +#ifndef _ROS_actionlib_TestRequestGoal_h +#define _ROS_actionlib_TestRequestGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace actionlib +{ + + class TestRequestGoal : public ros::Msg + { + public: + typedef int32_t _terminate_status_type; + _terminate_status_type terminate_status; + typedef bool _ignore_cancel_type; + _ignore_cancel_type ignore_cancel; + typedef const char* _result_text_type; + _result_text_type result_text; + typedef int32_t _the_result_type; + _the_result_type the_result; + typedef bool _is_simple_client_type; + _is_simple_client_type is_simple_client; + typedef ros::Duration _delay_accept_type; + _delay_accept_type delay_accept; + typedef ros::Duration _delay_terminate_type; + _delay_terminate_type delay_terminate; + typedef ros::Duration _pause_status_type; + _pause_status_type pause_status; + enum { TERMINATE_SUCCESS = 0 }; + enum { TERMINATE_ABORTED = 1 }; + enum { TERMINATE_REJECTED = 2 }; + enum { TERMINATE_LOSE = 3 }; + enum { TERMINATE_DROP = 4 }; + enum { TERMINATE_EXCEPTION = 5 }; + + TestRequestGoal(): + terminate_status(0), + ignore_cancel(0), + result_text(""), + the_result(0), + is_simple_client(0), + delay_accept(), + delay_terminate(), + pause_status() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_terminate_status; + u_terminate_status.real = this->terminate_status; + *(outbuffer + offset + 0) = (u_terminate_status.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_terminate_status.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_terminate_status.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_terminate_status.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->terminate_status); + union { + bool real; + uint8_t base; + } u_ignore_cancel; + u_ignore_cancel.real = this->ignore_cancel; + *(outbuffer + offset + 0) = (u_ignore_cancel.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->ignore_cancel); + uint32_t length_result_text = strlen(this->result_text); + varToArr(outbuffer + offset, length_result_text); + offset += 4; + memcpy(outbuffer + offset, this->result_text, length_result_text); + offset += length_result_text; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.real = this->the_result; + *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_client; + u_is_simple_client.real = this->is_simple_client; + *(outbuffer + offset + 0) = (u_is_simple_client.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_simple_client); + *(outbuffer + offset + 0) = (this->delay_accept.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_accept.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_accept.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_accept.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_accept.sec); + *(outbuffer + offset + 0) = (this->delay_accept.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_accept.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_accept.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_accept.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_accept.nsec); + *(outbuffer + offset + 0) = (this->delay_terminate.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_terminate.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_terminate.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_terminate.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_terminate.sec); + *(outbuffer + offset + 0) = (this->delay_terminate.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_terminate.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_terminate.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_terminate.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_terminate.nsec); + *(outbuffer + offset + 0) = (this->pause_status.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pause_status.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pause_status.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pause_status.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->pause_status.sec); + *(outbuffer + offset + 0) = (this->pause_status.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pause_status.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pause_status.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pause_status.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->pause_status.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_terminate_status; + u_terminate_status.base = 0; + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->terminate_status = u_terminate_status.real; + offset += sizeof(this->terminate_status); + union { + bool real; + uint8_t base; + } u_ignore_cancel; + u_ignore_cancel.base = 0; + u_ignore_cancel.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->ignore_cancel = u_ignore_cancel.real; + offset += sizeof(this->ignore_cancel); + uint32_t length_result_text; + arrToVar(length_result_text, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_result_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_result_text-1]=0; + this->result_text = (char *)(inbuffer + offset-1); + offset += length_result_text; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.base = 0; + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->the_result = u_the_result.real; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_client; + u_is_simple_client.base = 0; + u_is_simple_client.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_simple_client = u_is_simple_client.real; + offset += sizeof(this->is_simple_client); + this->delay_accept.sec = ((uint32_t) (*(inbuffer + offset))); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_accept.sec); + this->delay_accept.nsec = ((uint32_t) (*(inbuffer + offset))); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_accept.nsec); + this->delay_terminate.sec = ((uint32_t) (*(inbuffer + offset))); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_terminate.sec); + this->delay_terminate.nsec = ((uint32_t) (*(inbuffer + offset))); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_terminate.nsec); + this->pause_status.sec = ((uint32_t) (*(inbuffer + offset))); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pause_status.sec); + this->pause_status.nsec = ((uint32_t) (*(inbuffer + offset))); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pause_status.nsec); + return offset; + } + + virtual const char * getType() override { return "actionlib/TestRequestGoal"; }; + virtual const char * getMD5() override { return "db5d00ba98302d6c6dd3737e9a03ceea"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestResult.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestResult.h new file mode 100644 index 000000000..f13811f03 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestRequestResult.h @@ -0,0 +1,80 @@ +#ifndef _ROS_actionlib_TestRequestResult_h +#define _ROS_actionlib_TestRequestResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestRequestResult : public ros::Msg + { + public: + typedef int32_t _the_result_type; + _the_result_type the_result; + typedef bool _is_simple_server_type; + _is_simple_server_type is_simple_server; + + TestRequestResult(): + the_result(0), + is_simple_server(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.real = this->the_result; + *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_server; + u_is_simple_server.real = this->is_simple_server; + *(outbuffer + offset + 0) = (u_is_simple_server.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_simple_server); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.base = 0; + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->the_result = u_the_result.real; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_server; + u_is_simple_server.base = 0; + u_is_simple_server.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_simple_server = u_is_simple_server.real; + offset += sizeof(this->is_simple_server); + return offset; + } + + virtual const char * getType() override { return "actionlib/TestRequestResult"; }; + virtual const char * getMD5() override { return "61c2364524499c7c5017e2f3fce7ba06"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TestResult.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestResult.h new file mode 100644 index 000000000..4d3dc17dd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TestResult.h @@ -0,0 +1,62 @@ +#ifndef _ROS_actionlib_TestResult_h +#define _ROS_actionlib_TestResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestResult : public ros::Msg + { + public: + typedef int32_t _result_type; + _result_type result; + + TestResult(): + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_result; + u_result.real = this->result; + *(outbuffer + offset + 0) = (u_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_result; + u_result.base = 0; + u_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->result = u_result.real; + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return "actionlib/TestResult"; }; + virtual const char * getMD5() override { return "034a8e20d6a306665e3a5b340fab3f09"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsAction.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsAction.h new file mode 100644 index 000000000..7e1dfb3ec --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TwoIntsAction_h +#define _ROS_actionlib_TwoIntsAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TwoIntsActionGoal.h" +#include "actionlib/TwoIntsActionResult.h" +#include "actionlib/TwoIntsActionFeedback.h" + +namespace actionlib +{ + + class TwoIntsAction : public ros::Msg + { + public: + typedef actionlib::TwoIntsActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef actionlib::TwoIntsActionResult _action_result_type; + _action_result_type action_result; + typedef actionlib::TwoIntsActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + TwoIntsAction(): + 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/TwoIntsAction"; }; + virtual const char * getMD5() override { return "6d1aa538c4bd6183a2dfb7fcac41ee50"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionFeedback.h new file mode 100644 index 000000000..76ecc4fb9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TwoIntsActionFeedback_h +#define _ROS_actionlib_TwoIntsActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TwoIntsFeedback.h" + +namespace actionlib +{ + + class TwoIntsActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef actionlib::TwoIntsFeedback _feedback_type; + _feedback_type feedback; + + TwoIntsActionFeedback(): + 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/TwoIntsActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionGoal.h new file mode 100644 index 000000000..f791b5a09 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TwoIntsActionGoal_h +#define _ROS_actionlib_TwoIntsActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TwoIntsGoal.h" + +namespace actionlib +{ + + class TwoIntsActionGoal : 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::TwoIntsGoal _goal_type; + _goal_type goal; + + TwoIntsActionGoal(): + 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/TwoIntsActionGoal"; }; + virtual const char * getMD5() override { return "684a2db55d6ffb8046fb9d6764ce0860"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionResult.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionResult.h new file mode 100644 index 000000000..74f0ac776 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TwoIntsActionResult_h +#define _ROS_actionlib_TwoIntsActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TwoIntsResult.h" + +namespace actionlib +{ + + class TwoIntsActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef actionlib::TwoIntsResult _result_type; + _result_type result; + + TwoIntsActionResult(): + 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/TwoIntsActionResult"; }; + virtual const char * getMD5() override { return "3ba7dea8b8cddcae4528ade4ef74b6e7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsFeedback.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsFeedback.h new file mode 100644 index 000000000..53e624c87 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_actionlib_TwoIntsFeedback_h +#define _ROS_actionlib_TwoIntsFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsFeedback : public ros::Msg + { + public: + + TwoIntsFeedback() + { + } + + 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 "actionlib/TwoIntsFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsGoal.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsGoal.h new file mode 100644 index 000000000..9ca2d8b8b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsGoal.h @@ -0,0 +1,102 @@ +#ifndef _ROS_actionlib_TwoIntsGoal_h +#define _ROS_actionlib_TwoIntsGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsGoal : public ros::Msg + { + public: + typedef int64_t _a_type; + _a_type a; + typedef int64_t _b_type; + _b_type b; + + TwoIntsGoal(): + 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 "actionlib/TwoIntsGoal"; }; + virtual const char * getMD5() override { return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsResult.h b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsResult.h new file mode 100644 index 000000000..1447bcc7f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib/TwoIntsResult.h @@ -0,0 +1,70 @@ +#ifndef _ROS_actionlib_TwoIntsResult_h +#define _ROS_actionlib_TwoIntsResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsResult : public ros::Msg + { + public: + typedef int64_t _sum_type; + _sum_type sum; + + TwoIntsResult(): + 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 "actionlib/TwoIntsResult"; }; + virtual const char * getMD5() override { return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalID.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalID.h new file mode 100644 index 000000000..cdf8c55d4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalID.h @@ -0,0 +1,79 @@ +#ifndef _ROS_actionlib_msgs_GoalID_h +#define _ROS_actionlib_msgs_GoalID_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace actionlib_msgs +{ + + class GoalID : public ros::Msg + { + public: + typedef ros::Time _stamp_type; + _stamp_type stamp; + typedef const char* _id_type; + _id_type id; + + GoalID(): + stamp(), + id("") + { + } + + 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); + uint32_t length_id = strlen(this->id); + varToArr(outbuffer + offset, length_id); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + 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); + 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; + return offset; + } + + virtual const char * getType() override { return "actionlib_msgs/GoalID"; }; + virtual const char * getMD5() override { return "302881f31927c1df708a2dbab0e80ee8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalStatus.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalStatus.h new file mode 100644 index 000000000..49abea359 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalStatus.h @@ -0,0 +1,78 @@ +#ifndef _ROS_actionlib_msgs_GoalStatus_h +#define _ROS_actionlib_msgs_GoalStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_msgs/GoalID.h" + +namespace actionlib_msgs +{ + + class GoalStatus : public ros::Msg + { + public: + typedef actionlib_msgs::GoalID _goal_id_type; + _goal_id_type goal_id; + typedef uint8_t _status_type; + _status_type status; + typedef const char* _text_type; + _text_type text; + enum { PENDING = 0 }; + enum { ACTIVE = 1 }; + enum { PREEMPTED = 2 }; + enum { SUCCEEDED = 3 }; + enum { ABORTED = 4 }; + enum { REJECTED = 5 }; + enum { PREEMPTING = 6 }; + enum { RECALLING = 7 }; + enum { RECALLED = 8 }; + enum { LOST = 9 }; + + GoalStatus(): + goal_id(), + status(0), + text("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->goal_id.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->status >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + 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->goal_id.deserialize(inbuffer + offset); + this->status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->status); + 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 "actionlib_msgs/GoalStatus"; }; + virtual const char * getMD5() override { return "d388f9b87b3c471f784434d671988d4a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalStatusArray.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalStatusArray.h new file mode 100644 index 000000000..2a96e1cdc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_msgs/GoalStatusArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_actionlib_msgs_GoalStatusArray_h +#define _ROS_actionlib_msgs_GoalStatusArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" + +namespace actionlib_msgs +{ + + class GoalStatusArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t status_list_length; + typedef actionlib_msgs::GoalStatus _status_list_type; + _status_list_type st_status_list; + _status_list_type * status_list; + + GoalStatusArray(): + header(), + status_list_length(0), st_status_list(), status_list(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->status_list_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->status_list_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->status_list_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->status_list_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->status_list_length); + for( uint32_t i = 0; i < status_list_length; i++){ + offset += this->status_list[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t status_list_lengthT = ((uint32_t) (*(inbuffer + offset))); + status_list_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + status_list_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + status_list_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->status_list_length); + if(status_list_lengthT > status_list_length) + this->status_list = (actionlib_msgs::GoalStatus*)realloc(this->status_list, status_list_lengthT * sizeof(actionlib_msgs::GoalStatus)); + status_list_length = status_list_lengthT; + for( uint32_t i = 0; i < status_list_length; i++){ + offset += this->st_status_list.deserialize(inbuffer + offset); + memcpy( &(this->status_list[i]), &(this->st_status_list), sizeof(actionlib_msgs::GoalStatus)); + } + return offset; + } + + virtual const char * getType() override { return "actionlib_msgs/GoalStatusArray"; }; + virtual const char * getMD5() override { return "8b2b82f13216d0a8ea88bd3af735e619"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingAction.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingAction.h new file mode 100644 index 000000000..4d3205fe2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingAction.h @@ -0,0 +1,56 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h new file mode 100644 index 000000000..09822471a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h @@ -0,0 +1,56 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h new file mode 100644 index 000000000..d70aba172 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h @@ -0,0 +1,56 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionResult.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionResult.h new file mode 100644 index 000000000..5c7270ce4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingActionResult.h @@ -0,0 +1,56 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingFeedback.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingFeedback.h new file mode 100644 index 000000000..9d3db9374 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingFeedback.h @@ -0,0 +1,134 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingGoal.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingGoal.h new file mode 100644 index 000000000..837d33574 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingGoal.h @@ -0,0 +1,62 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingResult.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingResult.h new file mode 100644 index 000000000..e8dfa44ef --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/AveragingResult.h @@ -0,0 +1,86 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciAction.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciAction.h new file mode 100644 index 000000000..f9047ba56 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciAction.h @@ -0,0 +1,56 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h new file mode 100644 index 000000000..8d725673b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h @@ -0,0 +1,56 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h new file mode 100644 index 000000000..5428d7034 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h @@ -0,0 +1,56 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h new file mode 100644 index 000000000..0a3edc69a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h @@ -0,0 +1,56 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h new file mode 100644 index 000000000..ac3af91af --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h @@ -0,0 +1,82 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciGoal.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciGoal.h new file mode 100644 index 000000000..c8dd567ce --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciGoal.h @@ -0,0 +1,62 @@ +#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/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciResult.h b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciResult.h new file mode 100644 index 000000000..40c703e6a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/actionlib_tutorials/FibonacciResult.h @@ -0,0 +1,82 @@ +#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/smart_device_protocol/ros_lib/ros_lib/app_manager/App.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/App.h new file mode 100644 index 000000000..5803b7de1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/App.h @@ -0,0 +1,104 @@ +#ifndef _ROS_app_manager_App_h +#define _ROS_app_manager_App_h + +#include +#include +#include +#include "ros/msg.h" +#include "app_manager/Icon.h" +#include "app_manager/ClientApp.h" + +namespace app_manager +{ + + class App : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _display_name_type; + _display_name_type display_name; + typedef app_manager::Icon _icon_type; + _icon_type icon; + uint32_t client_apps_length; + typedef app_manager::ClientApp _client_apps_type; + _client_apps_type st_client_apps; + _client_apps_type * client_apps; + + App(): + name(""), + display_name(""), + icon(), + client_apps_length(0), st_client_apps(), client_apps(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_display_name = strlen(this->display_name); + varToArr(outbuffer + offset, length_display_name); + offset += 4; + memcpy(outbuffer + offset, this->display_name, length_display_name); + offset += length_display_name; + offset += this->icon.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->client_apps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->client_apps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->client_apps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->client_apps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->client_apps_length); + for( uint32_t i = 0; i < client_apps_length; i++){ + offset += this->client_apps[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_display_name; + arrToVar(length_display_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_display_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_display_name-1]=0; + this->display_name = (char *)(inbuffer + offset-1); + offset += length_display_name; + offset += this->icon.deserialize(inbuffer + offset); + uint32_t client_apps_lengthT = ((uint32_t) (*(inbuffer + offset))); + client_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + client_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + client_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->client_apps_length); + if(client_apps_lengthT > client_apps_length) + this->client_apps = (app_manager::ClientApp*)realloc(this->client_apps, client_apps_lengthT * sizeof(app_manager::ClientApp)); + client_apps_length = client_apps_lengthT; + for( uint32_t i = 0; i < client_apps_length; i++){ + offset += this->st_client_apps.deserialize(inbuffer + offset); + memcpy( &(this->client_apps[i]), &(this->st_client_apps), sizeof(app_manager::ClientApp)); + } + return offset; + } + + virtual const char * getType() override { return "app_manager/App"; }; + virtual const char * getMD5() override { return "643c1db5f71b615a47789ff5e190811e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/AppInstallationState.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/AppInstallationState.h new file mode 100644 index 000000000..aedea6141 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/AppInstallationState.h @@ -0,0 +1,89 @@ +#ifndef _ROS_app_manager_AppInstallationState_h +#define _ROS_app_manager_AppInstallationState_h + +#include +#include +#include +#include "ros/msg.h" +#include "app_manager/ExchangeApp.h" + +namespace app_manager +{ + + class AppInstallationState : public ros::Msg + { + public: + uint32_t installed_apps_length; + typedef app_manager::ExchangeApp _installed_apps_type; + _installed_apps_type st_installed_apps; + _installed_apps_type * installed_apps; + uint32_t available_apps_length; + typedef app_manager::ExchangeApp _available_apps_type; + _available_apps_type st_available_apps; + _available_apps_type * available_apps; + + AppInstallationState(): + installed_apps_length(0), st_installed_apps(), installed_apps(nullptr), + available_apps_length(0), st_available_apps(), available_apps(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->installed_apps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->installed_apps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->installed_apps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->installed_apps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->installed_apps_length); + for( uint32_t i = 0; i < installed_apps_length; i++){ + offset += this->installed_apps[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->available_apps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->available_apps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->available_apps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->available_apps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->available_apps_length); + for( uint32_t i = 0; i < available_apps_length; i++){ + offset += this->available_apps[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t installed_apps_lengthT = ((uint32_t) (*(inbuffer + offset))); + installed_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + installed_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + installed_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->installed_apps_length); + if(installed_apps_lengthT > installed_apps_length) + this->installed_apps = (app_manager::ExchangeApp*)realloc(this->installed_apps, installed_apps_lengthT * sizeof(app_manager::ExchangeApp)); + installed_apps_length = installed_apps_lengthT; + for( uint32_t i = 0; i < installed_apps_length; i++){ + offset += this->st_installed_apps.deserialize(inbuffer + offset); + memcpy( &(this->installed_apps[i]), &(this->st_installed_apps), sizeof(app_manager::ExchangeApp)); + } + uint32_t available_apps_lengthT = ((uint32_t) (*(inbuffer + offset))); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->available_apps_length); + if(available_apps_lengthT > available_apps_length) + this->available_apps = (app_manager::ExchangeApp*)realloc(this->available_apps, available_apps_lengthT * sizeof(app_manager::ExchangeApp)); + available_apps_length = available_apps_lengthT; + for( uint32_t i = 0; i < available_apps_length; i++){ + offset += this->st_available_apps.deserialize(inbuffer + offset); + memcpy( &(this->available_apps[i]), &(this->st_available_apps), sizeof(app_manager::ExchangeApp)); + } + return offset; + } + + virtual const char * getType() override { return "app_manager/AppInstallationState"; }; + virtual const char * getMD5() override { return "46d45bbda08250199267aff8c0ee8c41"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/AppList.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/AppList.h new file mode 100644 index 000000000..9a5a8de66 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/AppList.h @@ -0,0 +1,89 @@ +#ifndef _ROS_app_manager_AppList_h +#define _ROS_app_manager_AppList_h + +#include +#include +#include +#include "ros/msg.h" +#include "app_manager/App.h" + +namespace app_manager +{ + + class AppList : public ros::Msg + { + public: + uint32_t running_apps_length; + typedef app_manager::App _running_apps_type; + _running_apps_type st_running_apps; + _running_apps_type * running_apps; + uint32_t available_apps_length; + typedef app_manager::App _available_apps_type; + _available_apps_type st_available_apps; + _available_apps_type * available_apps; + + AppList(): + running_apps_length(0), st_running_apps(), running_apps(nullptr), + available_apps_length(0), st_available_apps(), available_apps(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->running_apps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->running_apps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->running_apps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->running_apps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->running_apps_length); + for( uint32_t i = 0; i < running_apps_length; i++){ + offset += this->running_apps[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->available_apps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->available_apps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->available_apps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->available_apps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->available_apps_length); + for( uint32_t i = 0; i < available_apps_length; i++){ + offset += this->available_apps[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t running_apps_lengthT = ((uint32_t) (*(inbuffer + offset))); + running_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + running_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + running_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->running_apps_length); + if(running_apps_lengthT > running_apps_length) + this->running_apps = (app_manager::App*)realloc(this->running_apps, running_apps_lengthT * sizeof(app_manager::App)); + running_apps_length = running_apps_lengthT; + for( uint32_t i = 0; i < running_apps_length; i++){ + offset += this->st_running_apps.deserialize(inbuffer + offset); + memcpy( &(this->running_apps[i]), &(this->st_running_apps), sizeof(app_manager::App)); + } + uint32_t available_apps_lengthT = ((uint32_t) (*(inbuffer + offset))); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->available_apps_length); + if(available_apps_lengthT > available_apps_length) + this->available_apps = (app_manager::App*)realloc(this->available_apps, available_apps_lengthT * sizeof(app_manager::App)); + available_apps_length = available_apps_lengthT; + for( uint32_t i = 0; i < available_apps_length; i++){ + offset += this->st_available_apps.deserialize(inbuffer + offset); + memcpy( &(this->available_apps[i]), &(this->st_available_apps), sizeof(app_manager::App)); + } + return offset; + } + + virtual const char * getType() override { return "app_manager/AppList"; }; + virtual const char * getMD5() override { return "8a71ede6bf51909653c7c551f462cb30"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/AppStatus.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/AppStatus.h new file mode 100644 index 000000000..c2a4fbaca --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/AppStatus.h @@ -0,0 +1,82 @@ +#ifndef _ROS_app_manager_AppStatus_h +#define _ROS_app_manager_AppStatus_h + +#include +#include +#include +#include "ros/msg.h" + +namespace app_manager +{ + + class AppStatus : public ros::Msg + { + public: + typedef int32_t _type_type; + _type_type type; + typedef const char* _status_type; + _status_type status; + enum { INFO = 0 }; + enum { WARN = 1 }; + enum { ERROR = 2 }; + + AppStatus(): + type(0), + status("") + { + } + + 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); + 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 { + 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 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 "app_manager/AppStatus"; }; + virtual const char * getMD5() override { return "4f59466d6810d5e9557e6b8ff75c9437"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/ClientApp.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/ClientApp.h new file mode 100644 index 000000000..db21935b9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/ClientApp.h @@ -0,0 +1,106 @@ +#ifndef _ROS_app_manager_ClientApp_h +#define _ROS_app_manager_ClientApp_h + +#include +#include +#include +#include "ros/msg.h" +#include "app_manager/KeyValue.h" + +namespace app_manager +{ + + class ClientApp : public ros::Msg + { + public: + typedef const char* _client_type_type; + _client_type_type client_type; + uint32_t manager_data_length; + typedef app_manager::KeyValue _manager_data_type; + _manager_data_type st_manager_data; + _manager_data_type * manager_data; + uint32_t app_data_length; + typedef app_manager::KeyValue _app_data_type; + _app_data_type st_app_data; + _app_data_type * app_data; + + ClientApp(): + client_type(""), + manager_data_length(0), st_manager_data(), manager_data(nullptr), + app_data_length(0), st_app_data(), app_data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_client_type = strlen(this->client_type); + varToArr(outbuffer + offset, length_client_type); + offset += 4; + memcpy(outbuffer + offset, this->client_type, length_client_type); + offset += length_client_type; + *(outbuffer + offset + 0) = (this->manager_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->manager_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->manager_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->manager_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->manager_data_length); + for( uint32_t i = 0; i < manager_data_length; i++){ + offset += this->manager_data[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->app_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->app_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->app_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->app_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->app_data_length); + for( uint32_t i = 0; i < app_data_length; i++){ + offset += this->app_data[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_client_type; + arrToVar(length_client_type, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_client_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_client_type-1]=0; + this->client_type = (char *)(inbuffer + offset-1); + offset += length_client_type; + uint32_t manager_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + manager_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + manager_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + manager_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->manager_data_length); + if(manager_data_lengthT > manager_data_length) + this->manager_data = (app_manager::KeyValue*)realloc(this->manager_data, manager_data_lengthT * sizeof(app_manager::KeyValue)); + manager_data_length = manager_data_lengthT; + for( uint32_t i = 0; i < manager_data_length; i++){ + offset += this->st_manager_data.deserialize(inbuffer + offset); + memcpy( &(this->manager_data[i]), &(this->st_manager_data), sizeof(app_manager::KeyValue)); + } + uint32_t app_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + app_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + app_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + app_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->app_data_length); + if(app_data_lengthT > app_data_length) + this->app_data = (app_manager::KeyValue*)realloc(this->app_data, app_data_lengthT * sizeof(app_manager::KeyValue)); + app_data_length = app_data_lengthT; + for( uint32_t i = 0; i < app_data_length; i++){ + offset += this->st_app_data.deserialize(inbuffer + offset); + memcpy( &(this->app_data[i]), &(this->st_app_data), sizeof(app_manager::KeyValue)); + } + return offset; + } + + virtual const char * getType() override { return "app_manager/ClientApp"; }; + virtual const char * getMD5() override { return "0a8112672c3fbf73cb62ec78d67e41bb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/ExchangeApp.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/ExchangeApp.h new file mode 100644 index 000000000..f3b7c397b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/ExchangeApp.h @@ -0,0 +1,147 @@ +#ifndef _ROS_app_manager_ExchangeApp_h +#define _ROS_app_manager_ExchangeApp_h + +#include +#include +#include +#include "ros/msg.h" +#include "app_manager/Icon.h" + +namespace app_manager +{ + + class ExchangeApp : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _display_name_type; + _display_name_type display_name; + typedef const char* _version_type; + _version_type version; + typedef const char* _latest_version_type; + _latest_version_type latest_version; + typedef const char* _description_type; + _description_type description; + typedef app_manager::Icon _icon_type; + _icon_type icon; + typedef bool _hidden_type; + _hidden_type hidden; + + ExchangeApp(): + name(""), + display_name(""), + version(""), + latest_version(""), + description(""), + icon(), + hidden(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; + uint32_t length_display_name = strlen(this->display_name); + varToArr(outbuffer + offset, length_display_name); + offset += 4; + memcpy(outbuffer + offset, this->display_name, length_display_name); + offset += length_display_name; + uint32_t length_version = strlen(this->version); + varToArr(outbuffer + offset, length_version); + offset += 4; + memcpy(outbuffer + offset, this->version, length_version); + offset += length_version; + uint32_t length_latest_version = strlen(this->latest_version); + varToArr(outbuffer + offset, length_latest_version); + offset += 4; + memcpy(outbuffer + offset, this->latest_version, length_latest_version); + offset += length_latest_version; + uint32_t length_description = strlen(this->description); + varToArr(outbuffer + offset, length_description); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + offset += this->icon.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_hidden; + u_hidden.real = this->hidden; + *(outbuffer + offset + 0) = (u_hidden.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->hidden); + 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_display_name; + arrToVar(length_display_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_display_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_display_name-1]=0; + this->display_name = (char *)(inbuffer + offset-1); + offset += length_display_name; + uint32_t length_version; + arrToVar(length_version, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_version; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_version-1]=0; + this->version = (char *)(inbuffer + offset-1); + offset += length_version; + uint32_t length_latest_version; + arrToVar(length_latest_version, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_latest_version; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_latest_version-1]=0; + this->latest_version = (char *)(inbuffer + offset-1); + offset += length_latest_version; + uint32_t length_description; + arrToVar(length_description, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + offset += this->icon.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_hidden; + u_hidden.base = 0; + u_hidden.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->hidden = u_hidden.real; + offset += sizeof(this->hidden); + return offset; + } + + virtual const char * getType() override { return "app_manager/ExchangeApp"; }; + virtual const char * getMD5() override { return "ccad20aa9f390121e44c61d218038d78"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/GetAppDetails.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/GetAppDetails.h new file mode 100644 index 000000000..a8d8330af --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/GetAppDetails.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_GetAppDetails_h +#define _ROS_SERVICE_GetAppDetails_h +#include +#include +#include +#include "ros/msg.h" +#include "app_manager/ExchangeApp.h" + +namespace app_manager +{ + +static const char GETAPPDETAILS[] = "app_manager/GetAppDetails"; + + class GetAppDetailsRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + + GetAppDetailsRequest(): + 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 GETAPPDETAILS; }; + virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class GetAppDetailsResponse : public ros::Msg + { + public: + typedef app_manager::ExchangeApp _app_type; + _app_type app; + + GetAppDetailsResponse(): + app() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->app.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->app.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETAPPDETAILS; }; + virtual const char * getMD5() override { return "404cd76612a719d24ac22fba2d495de8"; }; + + }; + + class GetAppDetails { + public: + typedef GetAppDetailsRequest Request; + typedef GetAppDetailsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/GetInstallationState.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/GetInstallationState.h new file mode 100644 index 000000000..8546ef12a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/GetInstallationState.h @@ -0,0 +1,139 @@ +#ifndef _ROS_SERVICE_GetInstallationState_h +#define _ROS_SERVICE_GetInstallationState_h +#include +#include +#include +#include "ros/msg.h" +#include "app_manager/ExchangeApp.h" + +namespace app_manager +{ + +static const char GETINSTALLATIONSTATE[] = "app_manager/GetInstallationState"; + + class GetInstallationStateRequest : public ros::Msg + { + public: + typedef bool _remote_update_type; + _remote_update_type remote_update; + + GetInstallationStateRequest(): + remote_update(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_remote_update; + u_remote_update.real = this->remote_update; + *(outbuffer + offset + 0) = (u_remote_update.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->remote_update); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_remote_update; + u_remote_update.base = 0; + u_remote_update.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->remote_update = u_remote_update.real; + offset += sizeof(this->remote_update); + return offset; + } + + virtual const char * getType() override { return GETINSTALLATIONSTATE; }; + virtual const char * getMD5() override { return "f7e64723808960ca985ba81f45f1b8a7"; }; + + }; + + class GetInstallationStateResponse : public ros::Msg + { + public: + uint32_t installed_apps_length; + typedef app_manager::ExchangeApp _installed_apps_type; + _installed_apps_type st_installed_apps; + _installed_apps_type * installed_apps; + uint32_t available_apps_length; + typedef app_manager::ExchangeApp _available_apps_type; + _available_apps_type st_available_apps; + _available_apps_type * available_apps; + + GetInstallationStateResponse(): + installed_apps_length(0), st_installed_apps(), installed_apps(nullptr), + available_apps_length(0), st_available_apps(), available_apps(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->installed_apps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->installed_apps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->installed_apps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->installed_apps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->installed_apps_length); + for( uint32_t i = 0; i < installed_apps_length; i++){ + offset += this->installed_apps[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->available_apps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->available_apps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->available_apps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->available_apps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->available_apps_length); + for( uint32_t i = 0; i < available_apps_length; i++){ + offset += this->available_apps[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t installed_apps_lengthT = ((uint32_t) (*(inbuffer + offset))); + installed_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + installed_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + installed_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->installed_apps_length); + if(installed_apps_lengthT > installed_apps_length) + this->installed_apps = (app_manager::ExchangeApp*)realloc(this->installed_apps, installed_apps_lengthT * sizeof(app_manager::ExchangeApp)); + installed_apps_length = installed_apps_lengthT; + for( uint32_t i = 0; i < installed_apps_length; i++){ + offset += this->st_installed_apps.deserialize(inbuffer + offset); + memcpy( &(this->installed_apps[i]), &(this->st_installed_apps), sizeof(app_manager::ExchangeApp)); + } + uint32_t available_apps_lengthT = ((uint32_t) (*(inbuffer + offset))); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->available_apps_length); + if(available_apps_lengthT > available_apps_length) + this->available_apps = (app_manager::ExchangeApp*)realloc(this->available_apps, available_apps_lengthT * sizeof(app_manager::ExchangeApp)); + available_apps_length = available_apps_lengthT; + for( uint32_t i = 0; i < available_apps_length; i++){ + offset += this->st_available_apps.deserialize(inbuffer + offset); + memcpy( &(this->available_apps[i]), &(this->st_available_apps), sizeof(app_manager::ExchangeApp)); + } + return offset; + } + + virtual const char * getType() override { return GETINSTALLATIONSTATE; }; + virtual const char * getMD5() override { return "46d45bbda08250199267aff8c0ee8c41"; }; + + }; + + class GetInstallationState { + public: + typedef GetInstallationStateRequest Request; + typedef GetInstallationStateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/Icon.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/Icon.h new file mode 100644 index 000000000..0274ce9a9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/Icon.h @@ -0,0 +1,82 @@ +#ifndef _ROS_app_manager_Icon_h +#define _ROS_app_manager_Icon_h + +#include +#include +#include +#include "ros/msg.h" + +namespace app_manager +{ + + class Icon : public ros::Msg + { + public: + typedef const char* _format_type; + _format_type format; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + Icon(): + format(""), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_format = strlen(this->format); + varToArr(outbuffer + offset, length_format); + offset += 4; + memcpy(outbuffer + offset, this->format, length_format); + offset += length_format; + *(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_format; + arrToVar(length_format, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_format; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_format-1]=0; + this->format = (char *)(inbuffer + offset-1); + offset += length_format; + 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 "app_manager/Icon"; }; + virtual const char * getMD5() override { return "e378a502c24c5aa2af7065d57c580d12"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/InstallApp.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/InstallApp.h new file mode 100644 index 000000000..f72d9b309 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/InstallApp.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_InstallApp_h +#define _ROS_SERVICE_InstallApp_h +#include +#include +#include +#include "ros/msg.h" + +namespace app_manager +{ + +static const char INSTALLAPP[] = "app_manager/InstallApp"; + + class InstallAppRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + + InstallAppRequest(): + 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 INSTALLAPP; }; + virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class InstallAppResponse : public ros::Msg + { + public: + typedef bool _installed_type; + _installed_type installed; + typedef const char* _message_type; + _message_type message; + + InstallAppResponse(): + installed(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_installed; + u_installed.real = this->installed; + *(outbuffer + offset + 0) = (u_installed.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->installed); + 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_installed; + u_installed.base = 0; + u_installed.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->installed = u_installed.real; + offset += sizeof(this->installed); + 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 INSTALLAPP; }; + virtual const char * getMD5() override { return "08871bc6dbc6813537edf236ff26a1e2"; }; + + }; + + class InstallApp { + public: + typedef InstallAppRequest Request; + typedef InstallAppResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/KeyValue.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/KeyValue.h new file mode 100644 index 000000000..bdc2583fa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/KeyValue.h @@ -0,0 +1,72 @@ +#ifndef _ROS_app_manager_KeyValue_h +#define _ROS_app_manager_KeyValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace app_manager +{ + + 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 "app_manager/KeyValue"; }; + virtual const char * getMD5() override { return "cf57fdc6617a881a88c16e768132149c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/ListApps.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/ListApps.h new file mode 100644 index 000000000..62d02cc94 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/ListApps.h @@ -0,0 +1,121 @@ +#ifndef _ROS_SERVICE_ListApps_h +#define _ROS_SERVICE_ListApps_h +#include +#include +#include +#include "ros/msg.h" +#include "app_manager/App.h" + +namespace app_manager +{ + +static const char LISTAPPS[] = "app_manager/ListApps"; + + class ListAppsRequest : public ros::Msg + { + public: + + ListAppsRequest() + { + } + + 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 LISTAPPS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ListAppsResponse : public ros::Msg + { + public: + uint32_t running_apps_length; + typedef app_manager::App _running_apps_type; + _running_apps_type st_running_apps; + _running_apps_type * running_apps; + uint32_t available_apps_length; + typedef app_manager::App _available_apps_type; + _available_apps_type st_available_apps; + _available_apps_type * available_apps; + + ListAppsResponse(): + running_apps_length(0), st_running_apps(), running_apps(nullptr), + available_apps_length(0), st_available_apps(), available_apps(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->running_apps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->running_apps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->running_apps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->running_apps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->running_apps_length); + for( uint32_t i = 0; i < running_apps_length; i++){ + offset += this->running_apps[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->available_apps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->available_apps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->available_apps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->available_apps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->available_apps_length); + for( uint32_t i = 0; i < available_apps_length; i++){ + offset += this->available_apps[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t running_apps_lengthT = ((uint32_t) (*(inbuffer + offset))); + running_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + running_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + running_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->running_apps_length); + if(running_apps_lengthT > running_apps_length) + this->running_apps = (app_manager::App*)realloc(this->running_apps, running_apps_lengthT * sizeof(app_manager::App)); + running_apps_length = running_apps_lengthT; + for( uint32_t i = 0; i < running_apps_length; i++){ + offset += this->st_running_apps.deserialize(inbuffer + offset); + memcpy( &(this->running_apps[i]), &(this->st_running_apps), sizeof(app_manager::App)); + } + uint32_t available_apps_lengthT = ((uint32_t) (*(inbuffer + offset))); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + available_apps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->available_apps_length); + if(available_apps_lengthT > available_apps_length) + this->available_apps = (app_manager::App*)realloc(this->available_apps, available_apps_lengthT * sizeof(app_manager::App)); + available_apps_length = available_apps_lengthT; + for( uint32_t i = 0; i < available_apps_length; i++){ + offset += this->st_available_apps.deserialize(inbuffer + offset); + memcpy( &(this->available_apps[i]), &(this->st_available_apps), sizeof(app_manager::App)); + } + return offset; + } + + virtual const char * getType() override { return LISTAPPS; }; + virtual const char * getMD5() override { return "8a71ede6bf51909653c7c551f462cb30"; }; + + }; + + class ListApps { + public: + typedef ListAppsRequest Request; + typedef ListAppsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/StartApp.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/StartApp.h new file mode 100644 index 000000000..6470e6781 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/StartApp.h @@ -0,0 +1,189 @@ +#ifndef _ROS_SERVICE_StartApp_h +#define _ROS_SERVICE_StartApp_h +#include +#include +#include +#include "ros/msg.h" +#include "app_manager/KeyValue.h" + +namespace app_manager +{ + +static const char STARTAPP[] = "app_manager/StartApp"; + + class StartAppRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + uint32_t args_length; + typedef app_manager::KeyValue _args_type; + _args_type st_args; + _args_type * args; + + StartAppRequest(): + name(""), + args_length(0), st_args(), args(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; + *(outbuffer + offset + 0) = (this->args_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->args_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->args_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->args_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->args_length); + for( uint32_t i = 0; i < args_length; i++){ + offset += this->args[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 args_lengthT = ((uint32_t) (*(inbuffer + offset))); + args_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + args_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + args_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->args_length); + if(args_lengthT > args_length) + this->args = (app_manager::KeyValue*)realloc(this->args, args_lengthT * sizeof(app_manager::KeyValue)); + args_length = args_lengthT; + for( uint32_t i = 0; i < args_length; i++){ + offset += this->st_args.deserialize(inbuffer + offset); + memcpy( &(this->args[i]), &(this->st_args), sizeof(app_manager::KeyValue)); + } + return offset; + } + + virtual const char * getType() override { return STARTAPP; }; + virtual const char * getMD5() override { return "fcc3fd7d3a99df15b4752d0b8160ea6c"; }; + + }; + + class StartAppResponse : public ros::Msg + { + public: + typedef bool _started_type; + _started_type started; + typedef int32_t _error_code_type; + _error_code_type error_code; + typedef const char* _message_type; + _message_type message; + typedef const char* _namespace_type; + _namespace_type namespace; + + StartAppResponse(): + started(0), + error_code(0), + message(""), + namespace("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_started; + u_started.real = this->started; + *(outbuffer + offset + 0) = (u_started.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->started); + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.real = this->error_code; + *(outbuffer + offset + 0) = (u_error_code.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_error_code.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_error_code.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_error_code.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->error_code); + uint32_t length_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + uint32_t length_namespace = strlen(this->namespace); + varToArr(outbuffer + offset, length_namespace); + offset += 4; + memcpy(outbuffer + offset, this->namespace, length_namespace); + offset += length_namespace; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_started; + u_started.base = 0; + u_started.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->started = u_started.real; + offset += sizeof(this->started); + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.base = 0; + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->error_code = u_error_code.real; + offset += sizeof(this->error_code); + 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; + uint32_t length_namespace; + arrToVar(length_namespace, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_namespace-1]=0; + this->namespace = (char *)(inbuffer + offset-1); + offset += length_namespace; + return offset; + } + + virtual const char * getType() override { return STARTAPP; }; + virtual const char * getMD5() override { return "29589baf2876ff624d4cb5688c12265e"; }; + + }; + + class StartApp { + public: + typedef StartAppRequest Request; + typedef StartAppResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/StatusCodes.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/StatusCodes.h new file mode 100644 index 000000000..f51274198 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/StatusCodes.h @@ -0,0 +1,45 @@ +#ifndef _ROS_app_manager_StatusCodes_h +#define _ROS_app_manager_StatusCodes_h + +#include +#include +#include +#include "ros/msg.h" + +namespace app_manager +{ + + class StatusCodes : public ros::Msg + { + public: + enum { SUCCESS = 0 }; + enum { BAD_REQUEST = 400 }; + enum { NOT_FOUND = 404 }; + enum { NOT_RUNNING = 430 }; + enum { INTERNAL_ERROR = 500 }; + enum { APP_INVALID = 510 }; + enum { MULTIAPP_NOT_SUPPORTED = 511 }; + + StatusCodes() + { + } + + 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 "app_manager/StatusCodes"; }; + virtual const char * getMD5() override { return "5f286aed2b2ab4b227e7b7185bae624d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/StopApp.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/StopApp.h new file mode 100644 index 000000000..39e63859b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/StopApp.h @@ -0,0 +1,146 @@ +#ifndef _ROS_SERVICE_StopApp_h +#define _ROS_SERVICE_StopApp_h +#include +#include +#include +#include "ros/msg.h" + +namespace app_manager +{ + +static const char STOPAPP[] = "app_manager/StopApp"; + + class StopAppRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + + StopAppRequest(): + 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 STOPAPP; }; + virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class StopAppResponse : public ros::Msg + { + public: + typedef bool _stopped_type; + _stopped_type stopped; + typedef int32_t _error_code_type; + _error_code_type error_code; + typedef const char* _message_type; + _message_type message; + + StopAppResponse(): + stopped(0), + error_code(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_stopped; + u_stopped.real = this->stopped; + *(outbuffer + offset + 0) = (u_stopped.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stopped); + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.real = this->error_code; + *(outbuffer + offset + 0) = (u_error_code.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_error_code.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_error_code.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_error_code.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->error_code); + 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_stopped; + u_stopped.base = 0; + u_stopped.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stopped = u_stopped.real; + offset += sizeof(this->stopped); + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.base = 0; + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->error_code = u_error_code.real; + offset += sizeof(this->error_code); + 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 STOPAPP; }; + virtual const char * getMD5() override { return "1f94f0ff0fc0fde186f728634f98a3cb"; }; + + }; + + class StopApp { + public: + typedef StopAppRequest Request; + typedef StopAppResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/app_manager/UninstallApp.h b/smart_device_protocol/ros_lib/ros_lib/app_manager/UninstallApp.h new file mode 100644 index 000000000..66fb4d42d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/app_manager/UninstallApp.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_UninstallApp_h +#define _ROS_SERVICE_UninstallApp_h +#include +#include +#include +#include "ros/msg.h" + +namespace app_manager +{ + +static const char UNINSTALLAPP[] = "app_manager/UninstallApp"; + + class UninstallAppRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + + UninstallAppRequest(): + 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 UNINSTALLAPP; }; + virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class UninstallAppResponse : public ros::Msg + { + public: + typedef bool _uninstalled_type; + _uninstalled_type uninstalled; + typedef const char* _message_type; + _message_type message; + + UninstallAppResponse(): + uninstalled(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_uninstalled; + u_uninstalled.real = this->uninstalled; + *(outbuffer + offset + 0) = (u_uninstalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->uninstalled); + 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_uninstalled; + u_uninstalled.base = 0; + u_uninstalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->uninstalled = u_uninstalled.real; + offset += sizeof(this->uninstalled); + 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 UNINSTALLAPP; }; + virtual const char * getMD5() override { return "335f3f18ef026f9358ef38ecb7785332"; }; + + }; + + class UninstallApp { + public: + typedef UninstallAppRequest Request; + typedef UninstallAppResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/apriltag_ros/AnalyzeSingleImage.h b/smart_device_protocol/ros_lib/ros_lib/apriltag_ros/AnalyzeSingleImage.h new file mode 100644 index 000000000..1f5457816 --- /dev/null +++ b/smart_device_protocol/ros_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 "apriltag_ros/AprilTagDetectionArray.h" +#include "sensor_msgs/CameraInfo.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/smart_device_protocol/ros_lib/ros_lib/apriltag_ros/AprilTagDetection.h b/smart_device_protocol/ros_lib/ros_lib/apriltag_ros/AprilTagDetection.h new file mode 100644 index 000000000..5982381de --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/apriltag_ros/AprilTagDetectionArray.h b/smart_device_protocol/ros_lib/ros_lib/apriltag_ros/AprilTagDetectionArray.h new file mode 100644 index 000000000..65681199d --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioData.h b/smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioData.h new file mode 100644 index 000000000..1b1288381 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioData.h @@ -0,0 +1,65 @@ +#ifndef _ROS_audio_common_msgs_AudioData_h +#define _ROS_audio_common_msgs_AudioData_h + +#include +#include +#include +#include "ros/msg.h" + +namespace audio_common_msgs +{ + + class AudioData : public ros::Msg + { + public: + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + AudioData(): + 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++){ + *(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 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 "audio_common_msgs/AudioData"; }; + virtual const char * getMD5() override { return "f43a8e1b362b75baa741461b46adc7e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioDataStamped.h b/smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioDataStamped.h new file mode 100644 index 000000000..ef2aeddf2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioDataStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_audio_common_msgs_AudioDataStamped_h +#define _ROS_audio_common_msgs_AudioDataStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "audio_common_msgs/AudioData.h" + +namespace audio_common_msgs +{ + + class AudioDataStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef audio_common_msgs::AudioData _audio_type; + _audio_type audio; + + AudioDataStamped(): + header(), + audio() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->audio.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->audio.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "audio_common_msgs/AudioDataStamped"; }; + virtual const char * getMD5() override { return "3cdd84a06846af0dca4d0434908f9d96"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioInfo.h b/smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioInfo.h new file mode 100644 index 000000000..380bda53d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/audio_common_msgs/AudioInfo.h @@ -0,0 +1,105 @@ +#ifndef _ROS_audio_common_msgs_AudioInfo_h +#define _ROS_audio_common_msgs_AudioInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace audio_common_msgs +{ + + class AudioInfo : public ros::Msg + { + public: + typedef uint8_t _channels_type; + _channels_type channels; + typedef uint32_t _sample_rate_type; + _sample_rate_type sample_rate; + typedef const char* _sample_format_type; + _sample_format_type sample_format; + typedef uint32_t _bitrate_type; + _bitrate_type bitrate; + typedef const char* _coding_format_type; + _coding_format_type coding_format; + + AudioInfo(): + channels(0), + sample_rate(0), + sample_format(""), + bitrate(0), + coding_format("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->channels >> (8 * 0)) & 0xFF; + offset += sizeof(this->channels); + *(outbuffer + offset + 0) = (this->sample_rate >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sample_rate >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sample_rate >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sample_rate >> (8 * 3)) & 0xFF; + offset += sizeof(this->sample_rate); + uint32_t length_sample_format = strlen(this->sample_format); + varToArr(outbuffer + offset, length_sample_format); + offset += 4; + memcpy(outbuffer + offset, this->sample_format, length_sample_format); + offset += length_sample_format; + *(outbuffer + offset + 0) = (this->bitrate >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->bitrate >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->bitrate >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->bitrate >> (8 * 3)) & 0xFF; + offset += sizeof(this->bitrate); + uint32_t length_coding_format = strlen(this->coding_format); + varToArr(outbuffer + offset, length_coding_format); + offset += 4; + memcpy(outbuffer + offset, this->coding_format, length_coding_format); + offset += length_coding_format; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->channels = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->channels); + this->sample_rate = ((uint32_t) (*(inbuffer + offset))); + this->sample_rate |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sample_rate |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sample_rate |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sample_rate); + uint32_t length_sample_format; + arrToVar(length_sample_format, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_sample_format; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_sample_format-1]=0; + this->sample_format = (char *)(inbuffer + offset-1); + offset += length_sample_format; + this->bitrate = ((uint32_t) (*(inbuffer + offset))); + this->bitrate |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->bitrate |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->bitrate |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->bitrate); + uint32_t length_coding_format; + arrToVar(length_coding_format, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_coding_format; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_coding_format-1]=0; + this->coding_format = (char *)(inbuffer + offset-1); + offset += length_coding_format; + return offset; + } + + virtual const char * getType() override { return "audio_common_msgs/AudioInfo"; }; + virtual const char * getMD5() override { return "9413d9b7029680d3b1db6ed0ae535f88"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/axis_camera/Axis.h b/smart_device_protocol/ros_lib/ros_lib/axis_camera/Axis.h new file mode 100644 index 000000000..19241c622 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/axis_camera/Axis.h @@ -0,0 +1,200 @@ +#ifndef _ROS_axis_camera_Axis_h +#define _ROS_axis_camera_Axis_h + +#include +#include +#include +#include "ros/msg.h" + +namespace axis_camera +{ + + class Axis : public ros::Msg + { + public: + typedef float _pan_type; + _pan_type pan; + typedef float _tilt_type; + _tilt_type tilt; + typedef float _zoom_type; + _zoom_type zoom; + typedef float _focus_type; + _focus_type focus; + typedef float _brightness_type; + _brightness_type brightness; + typedef float _iris_type; + _iris_type iris; + typedef bool _autofocus_type; + _autofocus_type autofocus; + + Axis(): + pan(0), + tilt(0), + zoom(0), + focus(0), + brightness(0), + iris(0), + autofocus(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_pan; + u_pan.real = this->pan; + *(outbuffer + offset + 0) = (u_pan.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_pan.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_pan.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_pan.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->pan); + union { + float real; + uint32_t base; + } u_tilt; + u_tilt.real = this->tilt; + *(outbuffer + offset + 0) = (u_tilt.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_tilt.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_tilt.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_tilt.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->tilt); + union { + float real; + uint32_t base; + } u_zoom; + u_zoom.real = this->zoom; + *(outbuffer + offset + 0) = (u_zoom.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_zoom.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_zoom.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_zoom.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->zoom); + union { + float real; + uint32_t base; + } u_focus; + u_focus.real = this->focus; + *(outbuffer + offset + 0) = (u_focus.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_focus.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_focus.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_focus.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->focus); + union { + float real; + uint32_t base; + } u_brightness; + u_brightness.real = this->brightness; + *(outbuffer + offset + 0) = (u_brightness.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_brightness.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_brightness.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_brightness.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->brightness); + union { + float real; + uint32_t base; + } u_iris; + u_iris.real = this->iris; + *(outbuffer + offset + 0) = (u_iris.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_iris.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_iris.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_iris.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->iris); + union { + bool real; + uint8_t base; + } u_autofocus; + u_autofocus.real = this->autofocus; + *(outbuffer + offset + 0) = (u_autofocus.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->autofocus); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_pan; + u_pan.base = 0; + u_pan.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_pan.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_pan.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_pan.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->pan = u_pan.real; + offset += sizeof(this->pan); + union { + float real; + uint32_t base; + } u_tilt; + u_tilt.base = 0; + u_tilt.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_tilt.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_tilt.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_tilt.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->tilt = u_tilt.real; + offset += sizeof(this->tilt); + union { + float real; + uint32_t base; + } u_zoom; + u_zoom.base = 0; + u_zoom.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_zoom.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_zoom.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_zoom.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->zoom = u_zoom.real; + offset += sizeof(this->zoom); + union { + float real; + uint32_t base; + } u_focus; + u_focus.base = 0; + u_focus.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_focus.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_focus.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_focus.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->focus = u_focus.real; + offset += sizeof(this->focus); + union { + float real; + uint32_t base; + } u_brightness; + u_brightness.base = 0; + u_brightness.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_brightness.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_brightness.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_brightness.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->brightness = u_brightness.real; + offset += sizeof(this->brightness); + union { + float real; + uint32_t base; + } u_iris; + u_iris.base = 0; + u_iris.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_iris.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_iris.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_iris.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->iris = u_iris.real; + offset += sizeof(this->iris); + union { + bool real; + uint8_t base; + } u_autofocus; + u_autofocus.base = 0; + u_autofocus.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->autofocus = u_autofocus.real; + offset += sizeof(this->autofocus); + return offset; + } + + virtual const char * getType() override { return "axis_camera/Axis"; }; + virtual const char * getMD5() override { return "7559be9cb80074f71cea3a03f4b3abe0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/base_local_planner/Position2DInt.h b/smart_device_protocol/ros_lib/ros_lib/base_local_planner/Position2DInt.h new file mode 100644 index 000000000..805045587 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/bond/Constants.h b/smart_device_protocol/ros_lib/ros_lib/bond/Constants.h new file mode 100644 index 000000000..705ac3d54 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/bond/Constants.h @@ -0,0 +1,44 @@ +#ifndef _ROS_bond_Constants_h +#define _ROS_bond_Constants_h + +#include +#include +#include +#include "ros/msg.h" + +namespace bond +{ + + class Constants : public ros::Msg + { + public: + enum { DEAD_PUBLISH_PERIOD = 0.05 }; + enum { DEFAULT_CONNECT_TIMEOUT = 10.0 }; + enum { DEFAULT_HEARTBEAT_TIMEOUT = 4.0 }; + enum { DEFAULT_DISCONNECT_TIMEOUT = 2.0 }; + enum { DEFAULT_HEARTBEAT_PERIOD = 1.0 }; + enum { DISABLE_HEARTBEAT_TIMEOUT_PARAM = /bond_disable_heartbeat_timeout }; + + Constants() + { + } + + 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 "bond/Constants"; }; + virtual const char * getMD5() override { return "6fc594dc1d7bd7919077042712f8c8b0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/bond/Status.h b/smart_device_protocol/ros_lib/ros_lib/bond/Status.h new file mode 100644 index 000000000..31de53589 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/bond/Status.h @@ -0,0 +1,144 @@ +#ifndef _ROS_bond_Status_h +#define _ROS_bond_Status_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace bond +{ + + class Status : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _id_type; + _id_type id; + typedef const char* _instance_id_type; + _instance_id_type instance_id; + typedef bool _active_type; + _active_type active; + typedef float _heartbeat_timeout_type; + _heartbeat_timeout_type heartbeat_timeout; + typedef float _heartbeat_period_type; + _heartbeat_period_type heartbeat_period; + + Status(): + header(), + id(""), + instance_id(""), + active(0), + heartbeat_timeout(0), + heartbeat_period(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_id = strlen(this->id); + varToArr(outbuffer + offset, length_id); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + uint32_t length_instance_id = strlen(this->instance_id); + varToArr(outbuffer + offset, length_instance_id); + offset += 4; + memcpy(outbuffer + offset, this->instance_id, length_instance_id); + offset += length_instance_id; + union { + bool real; + uint8_t base; + } u_active; + u_active.real = this->active; + *(outbuffer + offset + 0) = (u_active.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->active); + union { + float real; + uint32_t base; + } u_heartbeat_timeout; + u_heartbeat_timeout.real = this->heartbeat_timeout; + *(outbuffer + offset + 0) = (u_heartbeat_timeout.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heartbeat_timeout.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heartbeat_timeout.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heartbeat_timeout.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heartbeat_timeout); + union { + float real; + uint32_t base; + } u_heartbeat_period; + u_heartbeat_period.real = this->heartbeat_period; + *(outbuffer + offset + 0) = (u_heartbeat_period.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heartbeat_period.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heartbeat_period.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heartbeat_period.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heartbeat_period); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + 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; + uint32_t length_instance_id; + arrToVar(length_instance_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_instance_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_instance_id-1]=0; + this->instance_id = (char *)(inbuffer + offset-1); + offset += length_instance_id; + union { + bool real; + uint8_t base; + } u_active; + u_active.base = 0; + u_active.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->active = u_active.real; + offset += sizeof(this->active); + union { + float real; + uint32_t base; + } u_heartbeat_timeout; + u_heartbeat_timeout.base = 0; + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heartbeat_timeout = u_heartbeat_timeout.real; + offset += sizeof(this->heartbeat_timeout); + union { + float real; + uint32_t base; + } u_heartbeat_period; + u_heartbeat_period.base = 0; + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heartbeat_period = u_heartbeat_period.real; + offset += sizeof(this->heartbeat_period); + return offset; + } + + virtual const char * getType() override { return "bond/Status"; }; + virtual const char * getMD5() override { return "eacc84bf5d65b6777d4c50f463dfb9c8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h new file mode 100644 index 000000000..bbff85a39 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryAction_h +#define _ROS_control_msgs_FollowJointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/FollowJointTrajectoryActionGoal.h" +#include "control_msgs/FollowJointTrajectoryActionResult.h" +#include "control_msgs/FollowJointTrajectoryActionFeedback.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryAction : public ros::Msg + { + public: + typedef control_msgs::FollowJointTrajectoryActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef control_msgs::FollowJointTrajectoryActionResult _action_result_type; + _action_result_type action_result; + typedef control_msgs::FollowJointTrajectoryActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + FollowJointTrajectoryAction(): + 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 "control_msgs/FollowJointTrajectoryAction"; }; + virtual const char * getMD5() override { return "bc4f9b743838566551c0390c65f1a248"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h new file mode 100644 index 000000000..1fcc93d30 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionFeedback_h +#define _ROS_control_msgs_FollowJointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/FollowJointTrajectoryFeedback.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef control_msgs::FollowJointTrajectoryFeedback _feedback_type; + _feedback_type feedback; + + FollowJointTrajectoryActionFeedback(): + 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 "control_msgs/FollowJointTrajectoryActionFeedback"; }; + virtual const char * getMD5() override { return "d8920dc4eae9fc107e00999cce4be641"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h new file mode 100644 index 000000000..c314b6a58 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionGoal_h +#define _ROS_control_msgs_FollowJointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/FollowJointTrajectoryGoal.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionGoal : 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 control_msgs::FollowJointTrajectoryGoal _goal_type; + _goal_type goal; + + FollowJointTrajectoryActionGoal(): + 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 "control_msgs/FollowJointTrajectoryActionGoal"; }; + virtual const char * getMD5() override { return "cff5c1d533bf2f82dd0138d57f4304bb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h new file mode 100644 index 000000000..9f68bf3ad --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionResult_h +#define _ROS_control_msgs_FollowJointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/FollowJointTrajectoryResult.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef control_msgs::FollowJointTrajectoryResult _result_type; + _result_type result; + + FollowJointTrajectoryActionResult(): + 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 "control_msgs/FollowJointTrajectoryActionResult"; }; + virtual const char * getMD5() override { return "c4fb3b000dc9da4fd99699380efcc5d9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h new file mode 100644 index 000000000..b2949e2a2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h @@ -0,0 +1,97 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryFeedback_h +#define _ROS_control_msgs_FollowJointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + typedef trajectory_msgs::JointTrajectoryPoint _desired_type; + _desired_type desired; + typedef trajectory_msgs::JointTrajectoryPoint _actual_type; + _actual_type actual; + typedef trajectory_msgs::JointTrajectoryPoint _error_type; + _error_type error; + + FollowJointTrajectoryFeedback(): + header(), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "control_msgs/FollowJointTrajectoryFeedback"; }; + virtual const char * getMD5() override { return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h new file mode 100644 index 000000000..6b643a591 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h @@ -0,0 +1,119 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryGoal_h +#define _ROS_control_msgs_FollowJointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "control_msgs/JointTolerance.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryGoal : public ros::Msg + { + public: + typedef trajectory_msgs::JointTrajectory _trajectory_type; + _trajectory_type trajectory; + uint32_t path_tolerance_length; + typedef control_msgs::JointTolerance _path_tolerance_type; + _path_tolerance_type st_path_tolerance; + _path_tolerance_type * path_tolerance; + uint32_t goal_tolerance_length; + typedef control_msgs::JointTolerance _goal_tolerance_type; + _goal_tolerance_type st_goal_tolerance; + _goal_tolerance_type * goal_tolerance; + typedef ros::Duration _goal_time_tolerance_type; + _goal_time_tolerance_type goal_time_tolerance; + + FollowJointTrajectoryGoal(): + trajectory(), + path_tolerance_length(0), st_path_tolerance(), path_tolerance(nullptr), + goal_tolerance_length(0), st_goal_tolerance(), goal_tolerance(nullptr), + goal_time_tolerance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->path_tolerance_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->path_tolerance_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->path_tolerance_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->path_tolerance_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->path_tolerance_length); + for( uint32_t i = 0; i < path_tolerance_length; i++){ + offset += this->path_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->goal_tolerance_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_tolerance_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_tolerance_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_tolerance_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_tolerance_length); + for( uint32_t i = 0; i < goal_tolerance_length; i++){ + offset += this->goal_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->goal_time_tolerance.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_time_tolerance.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_time_tolerance.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_time_tolerance.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_time_tolerance.sec); + *(outbuffer + offset + 0) = (this->goal_time_tolerance.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_time_tolerance.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_time_tolerance.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_time_tolerance.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_time_tolerance.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + uint32_t path_tolerance_lengthT = ((uint32_t) (*(inbuffer + offset))); + path_tolerance_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + path_tolerance_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + path_tolerance_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->path_tolerance_length); + if(path_tolerance_lengthT > path_tolerance_length) + this->path_tolerance = (control_msgs::JointTolerance*)realloc(this->path_tolerance, path_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + path_tolerance_length = path_tolerance_lengthT; + for( uint32_t i = 0; i < path_tolerance_length; i++){ + offset += this->st_path_tolerance.deserialize(inbuffer + offset); + memcpy( &(this->path_tolerance[i]), &(this->st_path_tolerance), sizeof(control_msgs::JointTolerance)); + } + uint32_t goal_tolerance_lengthT = ((uint32_t) (*(inbuffer + offset))); + goal_tolerance_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + goal_tolerance_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + goal_tolerance_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_tolerance_length); + if(goal_tolerance_lengthT > goal_tolerance_length) + this->goal_tolerance = (control_msgs::JointTolerance*)realloc(this->goal_tolerance, goal_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + goal_tolerance_length = goal_tolerance_lengthT; + for( uint32_t i = 0; i < goal_tolerance_length; i++){ + offset += this->st_goal_tolerance.deserialize(inbuffer + offset); + memcpy( &(this->goal_tolerance[i]), &(this->st_goal_tolerance), sizeof(control_msgs::JointTolerance)); + } + this->goal_time_tolerance.sec = ((uint32_t) (*(inbuffer + offset))); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_time_tolerance.sec); + this->goal_time_tolerance.nsec = ((uint32_t) (*(inbuffer + offset))); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_time_tolerance.nsec); + return offset; + } + + virtual const char * getType() override { return "control_msgs/FollowJointTrajectoryGoal"; }; + virtual const char * getMD5() override { return "69636787b6ecbde4d61d711979bc7ecb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h new file mode 100644 index 000000000..559b57f2a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h @@ -0,0 +1,85 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryResult_h +#define _ROS_control_msgs_FollowJointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryResult : public ros::Msg + { + public: + typedef int32_t _error_code_type; + _error_code_type error_code; + typedef const char* _error_string_type; + _error_string_type error_string; + enum { SUCCESSFUL = 0 }; + enum { INVALID_GOAL = -1 }; + enum { INVALID_JOINTS = -2 }; + enum { OLD_HEADER_TIMESTAMP = -3 }; + enum { PATH_TOLERANCE_VIOLATED = -4 }; + enum { GOAL_TOLERANCE_VIOLATED = -5 }; + + FollowJointTrajectoryResult(): + error_code(0), + error_string("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.real = this->error_code; + *(outbuffer + offset + 0) = (u_error_code.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_error_code.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_error_code.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_error_code.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->error_code); + uint32_t length_error_string = strlen(this->error_string); + varToArr(outbuffer + offset, length_error_string); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.base = 0; + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->error_code = u_error_code.real; + offset += sizeof(this->error_code); + uint32_t length_error_string; + arrToVar(length_error_string, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_string; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_string-1]=0; + this->error_string = (char *)(inbuffer + offset-1); + offset += length_error_string; + return offset; + } + + virtual const char * getType() override { return "control_msgs/FollowJointTrajectoryResult"; }; + virtual const char * getMD5() override { return "493383b18409bfb604b4e26c676401d2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommand.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommand.h new file mode 100644 index 000000000..5c363dd55 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommand.h @@ -0,0 +1,48 @@ +#ifndef _ROS_control_msgs_GripperCommand_h +#define _ROS_control_msgs_GripperCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommand : public ros::Msg + { + public: + typedef float _position_type; + _position_type position; + typedef float _max_effort_type; + _max_effort_type max_effort; + + GripperCommand(): + position(0), + max_effort(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->max_effort); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_effort)); + return offset; + } + + virtual const char * getType() override { return "control_msgs/GripperCommand"; }; + virtual const char * getMD5() override { return "680acaff79486f017132a7f198d40f08"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandAction.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandAction.h new file mode 100644 index 000000000..8dd6e304e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_GripperCommandAction_h +#define _ROS_control_msgs_GripperCommandAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/GripperCommandActionGoal.h" +#include "control_msgs/GripperCommandActionResult.h" +#include "control_msgs/GripperCommandActionFeedback.h" + +namespace control_msgs +{ + + class GripperCommandAction : public ros::Msg + { + public: + typedef control_msgs::GripperCommandActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef control_msgs::GripperCommandActionResult _action_result_type; + _action_result_type action_result; + typedef control_msgs::GripperCommandActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + GripperCommandAction(): + 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 "control_msgs/GripperCommandAction"; }; + virtual const char * getMD5() override { return "950b2a6ebe831f5d4f4ceaba3d8be01e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionFeedback.h new file mode 100644 index 000000000..6f6d6cbc5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_GripperCommandActionFeedback_h +#define _ROS_control_msgs_GripperCommandActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/GripperCommandFeedback.h" + +namespace control_msgs +{ + + class GripperCommandActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef control_msgs::GripperCommandFeedback _feedback_type; + _feedback_type feedback; + + GripperCommandActionFeedback(): + 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 "control_msgs/GripperCommandActionFeedback"; }; + virtual const char * getMD5() override { return "653dff30c045f5e6ff3feb3409f4558d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionGoal.h new file mode 100644 index 000000000..b096c9218 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_GripperCommandActionGoal_h +#define _ROS_control_msgs_GripperCommandActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/GripperCommandGoal.h" + +namespace control_msgs +{ + + class GripperCommandActionGoal : 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 control_msgs::GripperCommandGoal _goal_type; + _goal_type goal; + + GripperCommandActionGoal(): + 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 "control_msgs/GripperCommandActionGoal"; }; + virtual const char * getMD5() override { return "aa581f648a35ed681db2ec0bf7a82bea"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionResult.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionResult.h new file mode 100644 index 000000000..eb91a9ba4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_GripperCommandActionResult_h +#define _ROS_control_msgs_GripperCommandActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/GripperCommandResult.h" + +namespace control_msgs +{ + + class GripperCommandActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef control_msgs::GripperCommandResult _result_type; + _result_type result; + + GripperCommandActionResult(): + 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 "control_msgs/GripperCommandActionResult"; }; + virtual const char * getMD5() override { return "143702cb2df0f163c5283cedc5efc6b6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandFeedback.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandFeedback.h new file mode 100644 index 000000000..5fd14aa59 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandFeedback.h @@ -0,0 +1,84 @@ +#ifndef _ROS_control_msgs_GripperCommandFeedback_h +#define _ROS_control_msgs_GripperCommandFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommandFeedback : public ros::Msg + { + public: + typedef float _position_type; + _position_type position; + typedef float _effort_type; + _effort_type effort; + typedef bool _stalled_type; + _stalled_type stalled; + typedef bool _reached_goal_type; + _reached_goal_type reached_goal; + + GripperCommandFeedback(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual const char * getType() override { return "control_msgs/GripperCommandFeedback"; }; + virtual const char * getMD5() override { return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandGoal.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandGoal.h new file mode 100644 index 000000000..a4e9da5be --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_control_msgs_GripperCommandGoal_h +#define _ROS_control_msgs_GripperCommandGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/GripperCommand.h" + +namespace control_msgs +{ + + class GripperCommandGoal : public ros::Msg + { + public: + typedef control_msgs::GripperCommand _command_type; + _command_type command; + + GripperCommandGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "control_msgs/GripperCommandGoal"; }; + virtual const char * getMD5() override { return "86fd82f4ddc48a4cb6856cfa69217e43"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandResult.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandResult.h new file mode 100644 index 000000000..8f08033de --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/GripperCommandResult.h @@ -0,0 +1,84 @@ +#ifndef _ROS_control_msgs_GripperCommandResult_h +#define _ROS_control_msgs_GripperCommandResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommandResult : public ros::Msg + { + public: + typedef float _position_type; + _position_type position; + typedef float _effort_type; + _effort_type effort; + typedef bool _stalled_type; + _stalled_type stalled; + typedef bool _reached_goal_type; + _reached_goal_type reached_goal; + + GripperCommandResult(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual const char * getType() override { return "control_msgs/GripperCommandResult"; }; + virtual const char * getMD5() override { return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointControllerState.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointControllerState.h new file mode 100644 index 000000000..bbc4836f5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointControllerState.h @@ -0,0 +1,112 @@ +#ifndef _ROS_control_msgs_JointControllerState_h +#define _ROS_control_msgs_JointControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class JointControllerState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _set_point_type; + _set_point_type set_point; + typedef float _process_value_type; + _process_value_type process_value; + typedef float _process_value_dot_type; + _process_value_dot_type process_value_dot; + typedef float _error_type; + _error_type error; + typedef float _time_step_type; + _time_step_type time_step; + typedef float _command_type; + _command_type command; + 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; + + JointControllerState(): + header(), + set_point(0), + process_value(0), + process_value_dot(0), + error(0), + time_step(0), + command(0), + p(0), + i(0), + d(0), + i_clamp(0), + antiwindup(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->set_point); + offset += serializeAvrFloat64(outbuffer + offset, this->process_value); + offset += serializeAvrFloat64(outbuffer + offset, this->process_value_dot); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + offset += serializeAvrFloat64(outbuffer + offset, this->command); + 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 += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->set_point)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->process_value)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->process_value_dot)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->command)); + 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 "control_msgs/JointControllerState"; }; + virtual const char * getMD5() override { return "987ad85e4756f3aef7f1e5e7fe0595d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointJog.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointJog.h new file mode 100644 index 000000000..69445f103 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointJog.h @@ -0,0 +1,136 @@ +#ifndef _ROS_control_msgs_JointJog_h +#define _ROS_control_msgs_JointJog_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class JointJog : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t displacements_length; + typedef float _displacements_type; + _displacements_type st_displacements; + _displacements_type * displacements; + uint32_t velocities_length; + typedef float _velocities_type; + _velocities_type st_velocities; + _velocities_type * velocities; + typedef float _duration_type; + _duration_type duration; + + JointJog(): + header(), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + displacements_length(0), st_displacements(), displacements(nullptr), + velocities_length(0), st_velocities(), velocities(nullptr), + duration(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset + 0) = (this->displacements_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->displacements_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->displacements_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->displacements_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->displacements_length); + for( uint32_t i = 0; i < displacements_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->displacements[i]); + } + *(outbuffer + offset + 0) = (this->velocities_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->velocities_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->velocities_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->velocities_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->velocities_length); + for( uint32_t i = 0; i < velocities_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocities[i]); + } + offset += serializeAvrFloat64(outbuffer + offset, this->duration); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint32_t displacements_lengthT = ((uint32_t) (*(inbuffer + offset))); + displacements_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + displacements_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + displacements_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->displacements_length); + if(displacements_lengthT > displacements_length) + this->displacements = (float*)realloc(this->displacements, displacements_lengthT * sizeof(float)); + displacements_length = displacements_lengthT; + for( uint32_t i = 0; i < displacements_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_displacements)); + memcpy( &(this->displacements[i]), &(this->st_displacements), sizeof(float)); + } + uint32_t velocities_lengthT = ((uint32_t) (*(inbuffer + offset))); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->velocities_length); + if(velocities_lengthT > velocities_length) + this->velocities = (float*)realloc(this->velocities, velocities_lengthT * sizeof(float)); + velocities_length = velocities_lengthT; + for( uint32_t i = 0; i < velocities_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocities)); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(float)); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->duration)); + return offset; + } + + virtual const char * getType() override { return "control_msgs/JointJog"; }; + virtual const char * getMD5() override { return "1685da700c8c2e1254afc92a5fb89c96"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTolerance.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTolerance.h new file mode 100644 index 000000000..61ddc7e5f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTolerance.h @@ -0,0 +1,70 @@ +#ifndef _ROS_control_msgs_JointTolerance_h +#define _ROS_control_msgs_JointTolerance_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTolerance : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef float _position_type; + _position_type position; + typedef float _velocity_type; + _velocity_type velocity; + typedef float _acceleration_type; + _acceleration_type acceleration; + + JointTolerance(): + name(""), + position(0), + velocity(0), + acceleration(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; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration); + 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; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acceleration)); + return offset; + } + + virtual const char * getType() override { return "control_msgs/JointTolerance"; }; + virtual const char * getMD5() override { return "f544fe9c16cf04547e135dd6063ff5be"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryAction.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryAction.h new file mode 100644 index 000000000..1e171321e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_JointTrajectoryAction_h +#define _ROS_control_msgs_JointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/JointTrajectoryActionGoal.h" +#include "control_msgs/JointTrajectoryActionResult.h" +#include "control_msgs/JointTrajectoryActionFeedback.h" + +namespace control_msgs +{ + + class JointTrajectoryAction : public ros::Msg + { + public: + typedef control_msgs::JointTrajectoryActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef control_msgs::JointTrajectoryActionResult _action_result_type; + _action_result_type action_result; + typedef control_msgs::JointTrajectoryActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + JointTrajectoryAction(): + 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 "control_msgs/JointTrajectoryAction"; }; + virtual const char * getMD5() override { return "a04ba3ee8f6a2d0985a6aeaf23d9d7ad"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h new file mode 100644 index 000000000..1163dbe16 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionFeedback_h +#define _ROS_control_msgs_JointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/JointTrajectoryFeedback.h" + +namespace control_msgs +{ + + class JointTrajectoryActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef control_msgs::JointTrajectoryFeedback _feedback_type; + _feedback_type feedback; + + JointTrajectoryActionFeedback(): + 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 "control_msgs/JointTrajectoryActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h new file mode 100644 index 000000000..e20f9e903 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionGoal_h +#define _ROS_control_msgs_JointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/JointTrajectoryGoal.h" + +namespace control_msgs +{ + + class JointTrajectoryActionGoal : 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 control_msgs::JointTrajectoryGoal _goal_type; + _goal_type goal; + + JointTrajectoryActionGoal(): + 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 "control_msgs/JointTrajectoryActionGoal"; }; + virtual const char * getMD5() override { return "a99e83ef6185f9fdd7693efe99623a86"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionResult.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionResult.h new file mode 100644 index 000000000..bbf6d08b6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionResult_h +#define _ROS_control_msgs_JointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/JointTrajectoryResult.h" + +namespace control_msgs +{ + + class JointTrajectoryActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef control_msgs::JointTrajectoryResult _result_type; + _result_type result; + + JointTrajectoryActionResult(): + 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 "control_msgs/JointTrajectoryActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryControllerState.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryControllerState.h new file mode 100644 index 000000000..0ecf8223d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryControllerState.h @@ -0,0 +1,97 @@ +#ifndef _ROS_control_msgs_JointTrajectoryControllerState_h +#define _ROS_control_msgs_JointTrajectoryControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace control_msgs +{ + + class JointTrajectoryControllerState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + typedef trajectory_msgs::JointTrajectoryPoint _desired_type; + _desired_type desired; + typedef trajectory_msgs::JointTrajectoryPoint _actual_type; + _actual_type actual; + typedef trajectory_msgs::JointTrajectoryPoint _error_type; + _error_type error; + + JointTrajectoryControllerState(): + header(), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "control_msgs/JointTrajectoryControllerState"; }; + virtual const char * getMD5() override { return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryFeedback.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryFeedback.h new file mode 100644 index 000000000..62a2b16be --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_JointTrajectoryFeedback_h +#define _ROS_control_msgs_JointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTrajectoryFeedback : public ros::Msg + { + public: + + JointTrajectoryFeedback() + { + } + + 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 "control_msgs/JointTrajectoryFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryGoal.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryGoal.h new file mode 100644 index 000000000..d576b2efd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_control_msgs_JointTrajectoryGoal_h +#define _ROS_control_msgs_JointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" + +namespace control_msgs +{ + + class JointTrajectoryGoal : public ros::Msg + { + public: + typedef trajectory_msgs::JointTrajectory _trajectory_type; + _trajectory_type trajectory; + + JointTrajectoryGoal(): + trajectory() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "control_msgs/JointTrajectoryGoal"; }; + virtual const char * getMD5() override { return "2a0eff76c870e8595636c2a562ca298e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryResult.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryResult.h new file mode 100644 index 000000000..87daa6a8a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/JointTrajectoryResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_JointTrajectoryResult_h +#define _ROS_control_msgs_JointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTrajectoryResult : public ros::Msg + { + public: + + JointTrajectoryResult() + { + } + + 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 "control_msgs/JointTrajectoryResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/PidState.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PidState.h new file mode 100644 index 000000000..5214a7d8b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PidState.h @@ -0,0 +1,123 @@ +#ifndef _ROS_control_msgs_PidState_h +#define _ROS_control_msgs_PidState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class PidState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef ros::Duration _timestep_type; + _timestep_type timestep; + typedef float _error_type; + _error_type error; + typedef float _error_dot_type; + _error_dot_type error_dot; + typedef float _p_error_type; + _p_error_type p_error; + typedef float _i_error_type; + _i_error_type i_error; + typedef float _d_error_type; + _d_error_type d_error; + typedef float _p_term_type; + _p_term_type p_term; + typedef float _i_term_type; + _i_term_type i_term; + typedef float _d_term_type; + _d_term_type d_term; + typedef float _i_max_type; + _i_max_type i_max; + typedef float _i_min_type; + _i_min_type i_min; + typedef float _output_type; + _output_type output; + + PidState(): + header(), + timestep(), + error(0), + error_dot(0), + p_error(0), + i_error(0), + d_error(0), + p_term(0), + i_term(0), + d_term(0), + i_max(0), + i_min(0), + output(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->timestep.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timestep.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timestep.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timestep.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timestep.sec); + *(outbuffer + offset + 0) = (this->timestep.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timestep.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timestep.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timestep.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timestep.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + offset += serializeAvrFloat64(outbuffer + offset, this->error_dot); + offset += serializeAvrFloat64(outbuffer + offset, this->p_error); + offset += serializeAvrFloat64(outbuffer + offset, this->i_error); + offset += serializeAvrFloat64(outbuffer + offset, this->d_error); + offset += serializeAvrFloat64(outbuffer + offset, this->p_term); + offset += serializeAvrFloat64(outbuffer + offset, this->i_term); + offset += serializeAvrFloat64(outbuffer + offset, this->d_term); + offset += serializeAvrFloat64(outbuffer + offset, this->i_max); + offset += serializeAvrFloat64(outbuffer + offset, this->i_min); + offset += serializeAvrFloat64(outbuffer + offset, this->output); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->timestep.sec = ((uint32_t) (*(inbuffer + offset))); + this->timestep.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timestep.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timestep.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timestep.sec); + this->timestep.nsec = ((uint32_t) (*(inbuffer + offset))); + this->timestep.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timestep.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timestep.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timestep.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error_dot)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->p_error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->i_error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->d_error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->p_term)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->i_term)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->d_term)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->i_max)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->i_min)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->output)); + return offset; + } + + virtual const char * getType() override { return "control_msgs/PidState"; }; + virtual const char * getMD5() override { return "b138ec00e886c10e73f27e8712252ea6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadAction.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadAction.h new file mode 100644 index 000000000..8b6514bcf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_PointHeadAction_h +#define _ROS_control_msgs_PointHeadAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/PointHeadActionGoal.h" +#include "control_msgs/PointHeadActionResult.h" +#include "control_msgs/PointHeadActionFeedback.h" + +namespace control_msgs +{ + + class PointHeadAction : public ros::Msg + { + public: + typedef control_msgs::PointHeadActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef control_msgs::PointHeadActionResult _action_result_type; + _action_result_type action_result; + typedef control_msgs::PointHeadActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PointHeadAction(): + 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 "control_msgs/PointHeadAction"; }; + virtual const char * getMD5() override { return "7252920f1243de1b741f14f214125371"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionFeedback.h new file mode 100644 index 000000000..0bbab3c5e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_PointHeadActionFeedback_h +#define _ROS_control_msgs_PointHeadActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/PointHeadFeedback.h" + +namespace control_msgs +{ + + class PointHeadActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef control_msgs::PointHeadFeedback _feedback_type; + _feedback_type feedback; + + PointHeadActionFeedback(): + 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 "control_msgs/PointHeadActionFeedback"; }; + virtual const char * getMD5() override { return "33c9244957176bbba97dd641119e8460"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionGoal.h new file mode 100644 index 000000000..d411bc3c9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_PointHeadActionGoal_h +#define _ROS_control_msgs_PointHeadActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/PointHeadGoal.h" + +namespace control_msgs +{ + + class PointHeadActionGoal : 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 control_msgs::PointHeadGoal _goal_type; + _goal_type goal; + + PointHeadActionGoal(): + 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 "control_msgs/PointHeadActionGoal"; }; + virtual const char * getMD5() override { return "b53a8323d0ba7b310ba17a2d3a82a6b8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionResult.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionResult.h new file mode 100644 index 000000000..16db0fc03 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_PointHeadActionResult_h +#define _ROS_control_msgs_PointHeadActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/PointHeadResult.h" + +namespace control_msgs +{ + + class PointHeadActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef control_msgs::PointHeadResult _result_type; + _result_type result; + + PointHeadActionResult(): + 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 "control_msgs/PointHeadActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadFeedback.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadFeedback.h new file mode 100644 index 000000000..1e06504c2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadFeedback.h @@ -0,0 +1,43 @@ +#ifndef _ROS_control_msgs_PointHeadFeedback_h +#define _ROS_control_msgs_PointHeadFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class PointHeadFeedback : public ros::Msg + { + public: + typedef float _pointing_angle_error_type; + _pointing_angle_error_type pointing_angle_error; + + PointHeadFeedback(): + pointing_angle_error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->pointing_angle_error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pointing_angle_error)); + return offset; + } + + virtual const char * getType() override { return "control_msgs/PointHeadFeedback"; }; + virtual const char * getMD5() override { return "cce80d27fd763682da8805a73316cab4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadGoal.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadGoal.h new file mode 100644 index 000000000..2f4b68700 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadGoal.h @@ -0,0 +1,96 @@ +#ifndef _ROS_control_msgs_PointHeadGoal_h +#define _ROS_control_msgs_PointHeadGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PointStamped.h" +#include "geometry_msgs/Vector3.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class PointHeadGoal : public ros::Msg + { + public: + typedef geometry_msgs::PointStamped _target_type; + _target_type target; + typedef geometry_msgs::Vector3 _pointing_axis_type; + _pointing_axis_type pointing_axis; + typedef const char* _pointing_frame_type; + _pointing_frame_type pointing_frame; + typedef ros::Duration _min_duration_type; + _min_duration_type min_duration; + typedef float _max_velocity_type; + _max_velocity_type max_velocity; + + PointHeadGoal(): + target(), + pointing_axis(), + pointing_frame(""), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->target.serialize(outbuffer + offset); + offset += this->pointing_axis.serialize(outbuffer + offset); + uint32_t length_pointing_frame = strlen(this->pointing_frame); + varToArr(outbuffer + offset, length_pointing_frame); + offset += 4; + memcpy(outbuffer + offset, this->pointing_frame, length_pointing_frame); + offset += length_pointing_frame; + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->target.deserialize(inbuffer + offset); + offset += this->pointing_axis.deserialize(inbuffer + offset); + uint32_t length_pointing_frame; + arrToVar(length_pointing_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pointing_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pointing_frame-1]=0; + this->pointing_frame = (char *)(inbuffer + offset-1); + offset += length_pointing_frame; + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + return offset; + } + + virtual const char * getType() override { return "control_msgs/PointHeadGoal"; }; + virtual const char * getMD5() override { return "8b92b1cd5e06c8a94c917dc3209a4c1d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadResult.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadResult.h new file mode 100644 index 000000000..54668b868 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/PointHeadResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_PointHeadResult_h +#define _ROS_control_msgs_PointHeadResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class PointHeadResult : public ros::Msg + { + public: + + PointHeadResult() + { + } + + 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 "control_msgs/PointHeadResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/QueryCalibrationState.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/QueryCalibrationState.h new file mode 100644 index 000000000..5e249774f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/QueryCalibrationState.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_QueryCalibrationState_h +#define _ROS_SERVICE_QueryCalibrationState_h +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + +static const char QUERYCALIBRATIONSTATE[] = "control_msgs/QueryCalibrationState"; + + class QueryCalibrationStateRequest : public ros::Msg + { + public: + + QueryCalibrationStateRequest() + { + } + + 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 QUERYCALIBRATIONSTATE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class QueryCalibrationStateResponse : public ros::Msg + { + public: + typedef bool _is_calibrated_type; + _is_calibrated_type is_calibrated; + + QueryCalibrationStateResponse(): + is_calibrated(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.real = this->is_calibrated; + *(outbuffer + offset + 0) = (u_is_calibrated.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_calibrated); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.base = 0; + u_is_calibrated.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_calibrated = u_is_calibrated.real; + offset += sizeof(this->is_calibrated); + return offset; + } + + virtual const char * getType() override { return QUERYCALIBRATIONSTATE; }; + virtual const char * getMD5() override { return "28af3beedcb84986b8e470dc5470507d"; }; + + }; + + class QueryCalibrationState { + public: + typedef QueryCalibrationStateRequest Request; + typedef QueryCalibrationStateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/QueryTrajectoryState.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/QueryTrajectoryState.h new file mode 100644 index 000000000..73d28dcd4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/QueryTrajectoryState.h @@ -0,0 +1,206 @@ +#ifndef _ROS_SERVICE_QueryTrajectoryState_h +#define _ROS_SERVICE_QueryTrajectoryState_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace control_msgs +{ + +static const char QUERYTRAJECTORYSTATE[] = "control_msgs/QueryTrajectoryState"; + + class QueryTrajectoryStateRequest : public ros::Msg + { + public: + typedef ros::Time _time_type; + _time_type time; + + QueryTrajectoryStateRequest(): + time() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.sec); + *(outbuffer + offset + 0) = (this->time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->time.sec = ((uint32_t) (*(inbuffer + offset))); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.sec); + this->time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.nsec); + return offset; + } + + virtual const char * getType() override { return QUERYTRAJECTORYSTATE; }; + virtual const char * getMD5() override { return "556a4fb76023a469987922359d08a844"; }; + + }; + + class QueryTrajectoryStateResponse : public ros::Msg + { + public: + uint32_t name_length; + typedef char* _name_type; + _name_type st_name; + _name_type * name; + uint32_t position_length; + typedef float _position_type; + _position_type st_position; + _position_type * position; + uint32_t velocity_length; + typedef float _velocity_type; + _velocity_type st_velocity; + _velocity_type * velocity; + uint32_t acceleration_length; + typedef float _acceleration_type; + _acceleration_type st_acceleration; + _acceleration_type * acceleration; + + QueryTrajectoryStateResponse(): + name_length(0), st_name(), name(nullptr), + position_length(0), st_position(), position(nullptr), + velocity_length(0), st_velocity(), velocity(nullptr), + acceleration_length(0), st_acceleration(), acceleration(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->name_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->name_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->name_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->name_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->name_length); + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + varToArr(outbuffer + offset, length_namei); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset + 0) = (this->position_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->position_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->position_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->position_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->position_length); + for( uint32_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset + 0) = (this->velocity_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->velocity_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->velocity_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->velocity_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->velocity_length); + for( uint32_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset + 0) = (this->acceleration_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->acceleration_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->acceleration_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->acceleration_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->acceleration_length); + for( uint32_t i = 0; i < acceleration_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t name_lengthT = ((uint32_t) (*(inbuffer + offset))); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->name_length); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + name_length = name_lengthT; + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + arrToVar(length_st_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint32_t position_lengthT = ((uint32_t) (*(inbuffer + offset))); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->position_length); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + position_length = position_lengthT; + for( uint32_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint32_t velocity_lengthT = ((uint32_t) (*(inbuffer + offset))); + velocity_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + velocity_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + velocity_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->velocity_length); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + velocity_length = velocity_lengthT; + for( uint32_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint32_t acceleration_lengthT = ((uint32_t) (*(inbuffer + offset))); + acceleration_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + acceleration_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + acceleration_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->acceleration_length); + if(acceleration_lengthT > acceleration_length) + this->acceleration = (float*)realloc(this->acceleration, acceleration_lengthT * sizeof(float)); + acceleration_length = acceleration_lengthT; + for( uint32_t i = 0; i < acceleration_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_acceleration)); + memcpy( &(this->acceleration[i]), &(this->st_acceleration), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return QUERYTRAJECTORYSTATE; }; + virtual const char * getMD5() override { return "1f1a6554ad060f44d013e71868403c1a"; }; + + }; + + class QueryTrajectoryState { + public: + typedef QueryTrajectoryStateRequest Request; + typedef QueryTrajectoryStateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionAction.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionAction.h new file mode 100644 index 000000000..c5ca8e19a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_SingleJointPositionAction_h +#define _ROS_control_msgs_SingleJointPositionAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/SingleJointPositionActionGoal.h" +#include "control_msgs/SingleJointPositionActionResult.h" +#include "control_msgs/SingleJointPositionActionFeedback.h" + +namespace control_msgs +{ + + class SingleJointPositionAction : public ros::Msg + { + public: + typedef control_msgs::SingleJointPositionActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef control_msgs::SingleJointPositionActionResult _action_result_type; + _action_result_type action_result; + typedef control_msgs::SingleJointPositionActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + SingleJointPositionAction(): + 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 "control_msgs/SingleJointPositionAction"; }; + virtual const char * getMD5() override { return "c4a786b7d53e5d0983decf967a5a779e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h new file mode 100644 index 000000000..1e840480d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionFeedback_h +#define _ROS_control_msgs_SingleJointPositionActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/SingleJointPositionFeedback.h" + +namespace control_msgs +{ + + class SingleJointPositionActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef control_msgs::SingleJointPositionFeedback _feedback_type; + _feedback_type feedback; + + SingleJointPositionActionFeedback(): + 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 "control_msgs/SingleJointPositionActionFeedback"; }; + virtual const char * getMD5() override { return "3503b7cf8972f90d245850a5d8796cfa"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h new file mode 100644 index 000000000..a6a198dee --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionGoal_h +#define _ROS_control_msgs_SingleJointPositionActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/SingleJointPositionGoal.h" + +namespace control_msgs +{ + + class SingleJointPositionActionGoal : 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 control_msgs::SingleJointPositionGoal _goal_type; + _goal_type goal; + + SingleJointPositionActionGoal(): + 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 "control_msgs/SingleJointPositionActionGoal"; }; + virtual const char * getMD5() override { return "4b0d3d091471663e17749c1d0db90f61"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionResult.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionResult.h new file mode 100644 index 000000000..c2f4aad20 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionResult_h +#define _ROS_control_msgs_SingleJointPositionActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/SingleJointPositionResult.h" + +namespace control_msgs +{ + + class SingleJointPositionActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef control_msgs::SingleJointPositionResult _result_type; + _result_type result; + + SingleJointPositionActionResult(): + 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 "control_msgs/SingleJointPositionActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionFeedback.h new file mode 100644 index 000000000..444eb38e5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionFeedback.h @@ -0,0 +1,59 @@ +#ifndef _ROS_control_msgs_SingleJointPositionFeedback_h +#define _ROS_control_msgs_SingleJointPositionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class SingleJointPositionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _position_type; + _position_type position; + typedef float _velocity_type; + _velocity_type velocity; + typedef float _error_type; + _error_type error; + + SingleJointPositionFeedback(): + header(), + position(0), + velocity(0), + error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + return offset; + } + + virtual const char * getType() override { return "control_msgs/SingleJointPositionFeedback"; }; + virtual const char * getMD5() override { return "8cee65610a3d08e0a1bded82f146f1fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionGoal.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionGoal.h new file mode 100644 index 000000000..acbbcd96e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionGoal.h @@ -0,0 +1,72 @@ +#ifndef _ROS_control_msgs_SingleJointPositionGoal_h +#define _ROS_control_msgs_SingleJointPositionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class SingleJointPositionGoal : public ros::Msg + { + public: + typedef float _position_type; + _position_type position; + typedef ros::Duration _min_duration_type; + _min_duration_type min_duration; + typedef float _max_velocity_type; + _max_velocity_type max_velocity; + + SingleJointPositionGoal(): + position(0), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + return offset; + } + + virtual const char * getType() override { return "control_msgs/SingleJointPositionGoal"; }; + virtual const char * getMD5() override { return "fbaaa562a23a013fd5053e5f72cbb35c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionResult.h b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionResult.h new file mode 100644 index 000000000..7062c8ecb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_msgs/SingleJointPositionResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_SingleJointPositionResult_h +#define _ROS_control_msgs_SingleJointPositionResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class SingleJointPositionResult : public ros::Msg + { + public: + + SingleJointPositionResult() + { + } + + 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 "control_msgs/SingleJointPositionResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/control_toolbox/SetPidGains.h b/smart_device_protocol/ros_lib/ros_lib/control_toolbox/SetPidGains.h new file mode 100644 index 000000000..a31a09b34 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/control_toolbox/SetPidGains.h @@ -0,0 +1,108 @@ +#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/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllerState.h b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllerState.h new file mode 100644 index 000000000..edcd0fa10 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllerState.h @@ -0,0 +1,115 @@ +#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/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllerStatistics.h b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllerStatistics.h new file mode 100644 index 000000000..66c722748 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllerStatistics.h @@ -0,0 +1,231 @@ +#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/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllersStatistics.h b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllersStatistics.h new file mode 100644 index 000000000..8c15f868c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ControllersStatistics.h @@ -0,0 +1,70 @@ +#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/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/HardwareInterfaceResources.h b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/HardwareInterfaceResources.h new file mode 100644 index 000000000..21cb6b82c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/HardwareInterfaceResources.h @@ -0,0 +1,92 @@ +#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/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ListControllerTypes.h b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ListControllerTypes.h new file mode 100644 index 000000000..8b354ae68 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ListControllerTypes.h @@ -0,0 +1,144 @@ +#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/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ListControllers.h b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ListControllers.h new file mode 100644 index 000000000..613db1fb9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ListControllers.h @@ -0,0 +1,96 @@ +#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/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/LoadController.h b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/LoadController.h new file mode 100644 index 000000000..5774fc3ab --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/LoadController.h @@ -0,0 +1,105 @@ +#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/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ReloadControllerLibraries.h b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ReloadControllerLibraries.h new file mode 100644 index 000000000..a2fbef2fb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/ReloadControllerLibraries.h @@ -0,0 +1,106 @@ +#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/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/SwitchController.h b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/SwitchController.h new file mode 100644 index 000000000..3222e8b57 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/SwitchController.h @@ -0,0 +1,211 @@ +#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/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/UnloadController.h b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/UnloadController.h new file mode 100644 index 000000000..da59ff533 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/controller_manager_msgs/UnloadController.h @@ -0,0 +1,105 @@ +#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/smart_device_protocol/ros_lib/ros_lib/costmap_2d/VoxelGrid.h b/smart_device_protocol/ros_lib/ros_lib/costmap_2d/VoxelGrid.h new file mode 100644 index 000000000..4998dabf5 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/costmap_converter/ObstacleArrayMsg.h b/smart_device_protocol/ros_lib/ros_lib/costmap_converter/ObstacleArrayMsg.h new file mode 100644 index 000000000..ce52a5be9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/costmap_converter/ObstacleArrayMsg.h @@ -0,0 +1,70 @@ +#ifndef _ROS_costmap_converter_ObstacleArrayMsg_h +#define _ROS_costmap_converter_ObstacleArrayMsg_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "costmap_converter/ObstacleMsg.h" + +namespace costmap_converter +{ + + class ObstacleArrayMsg : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t obstacles_length; + typedef costmap_converter::ObstacleMsg _obstacles_type; + _obstacles_type st_obstacles; + _obstacles_type * obstacles; + + ObstacleArrayMsg(): + header(), + obstacles_length(0), st_obstacles(), obstacles(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->obstacles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->obstacles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->obstacles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->obstacles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->obstacles_length); + for( uint32_t i = 0; i < obstacles_length; i++){ + offset += this->obstacles[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t obstacles_lengthT = ((uint32_t) (*(inbuffer + offset))); + obstacles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + obstacles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + obstacles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->obstacles_length); + if(obstacles_lengthT > obstacles_length) + this->obstacles = (costmap_converter::ObstacleMsg*)realloc(this->obstacles, obstacles_lengthT * sizeof(costmap_converter::ObstacleMsg)); + obstacles_length = obstacles_lengthT; + for( uint32_t i = 0; i < obstacles_length; i++){ + offset += this->st_obstacles.deserialize(inbuffer + offset); + memcpy( &(this->obstacles[i]), &(this->st_obstacles), sizeof(costmap_converter::ObstacleMsg)); + } + return offset; + } + + virtual const char * getType() override { return "costmap_converter/ObstacleArrayMsg"; }; + virtual const char * getMD5() override { return "8a1bdcde72c65ca7d3ce8ebf52d43516"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/costmap_converter/ObstacleMsg.h b/smart_device_protocol/ros_lib/ros_lib/costmap_converter/ObstacleMsg.h new file mode 100644 index 000000000..4b556c50a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/costmap_converter/ObstacleMsg.h @@ -0,0 +1,99 @@ +#ifndef _ROS_costmap_converter_ObstacleMsg_h +#define _ROS_costmap_converter_ObstacleMsg_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Polygon.h" +#include "geometry_msgs/Quaternion.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace costmap_converter +{ + + class ObstacleMsg : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Polygon _polygon_type; + _polygon_type polygon; + typedef float _radius_type; + _radius_type radius; + typedef int64_t _id_type; + _id_type id; + typedef geometry_msgs::Quaternion _orientation_type; + _orientation_type orientation; + typedef geometry_msgs::TwistWithCovariance _velocities_type; + _velocities_type velocities; + + ObstacleMsg(): + header(), + polygon(), + radius(0), + id(0), + orientation(), + velocities() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->polygon.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->radius); + union { + int64_t real; + uint64_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; + *(outbuffer + offset + 4) = (u_id.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_id.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_id.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_id.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->id); + offset += this->orientation.serialize(outbuffer + offset); + offset += this->velocities.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->polygon.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->radius)); + union { + int64_t real; + uint64_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_id.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_id.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_id.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_id.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->id = u_id.real; + offset += sizeof(this->id); + offset += this->orientation.deserialize(inbuffer + offset); + offset += this->velocities.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "costmap_converter/ObstacleMsg"; }; + virtual const char * getMD5() override { return "a37f90c2e2437cb2b570855e1c703488"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/AddDiagnostics.h b/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/AddDiagnostics.h new file mode 100644 index 000000000..c6b9c38c3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/AddDiagnostics.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_AddDiagnostics_h +#define _ROS_SERVICE_AddDiagnostics_h +#include +#include +#include +#include "ros/msg.h" + +namespace diagnostic_msgs +{ + +static const char ADDDIAGNOSTICS[] = "diagnostic_msgs/AddDiagnostics"; + + class AddDiagnosticsRequest : public ros::Msg + { + public: + typedef const char* _load_namespace_type; + _load_namespace_type load_namespace; + + AddDiagnosticsRequest(): + load_namespace("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_load_namespace = strlen(this->load_namespace); + varToArr(outbuffer + offset, length_load_namespace); + offset += 4; + memcpy(outbuffer + offset, this->load_namespace, length_load_namespace); + offset += length_load_namespace; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_load_namespace; + arrToVar(length_load_namespace, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_load_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_load_namespace-1]=0; + this->load_namespace = (char *)(inbuffer + offset-1); + offset += length_load_namespace; + return offset; + } + + virtual const char * getType() override { return ADDDIAGNOSTICS; }; + virtual const char * getMD5() override { return "c26cf6e164288fbc6050d74f838bcdf0"; }; + + }; + + class AddDiagnosticsResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _message_type; + _message_type message; + + AddDiagnosticsResponse(): + 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 ADDDIAGNOSTICS; }; + virtual const char * getMD5() override { return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class AddDiagnostics { + public: + typedef AddDiagnosticsRequest Request; + typedef AddDiagnosticsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/DiagnosticArray.h b/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/DiagnosticArray.h new file mode 100644 index 000000000..7fe719233 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/DiagnosticArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_diagnostic_msgs_DiagnosticArray_h +#define _ROS_diagnostic_msgs_DiagnosticArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "diagnostic_msgs/DiagnosticStatus.h" + +namespace diagnostic_msgs +{ + + class DiagnosticArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t status_length; + typedef diagnostic_msgs::DiagnosticStatus _status_type; + _status_type st_status; + _status_type * status; + + DiagnosticArray(): + header(), + status_length(0), st_status(), status(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->status_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->status_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->status_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->status_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->status_length); + for( uint32_t i = 0; i < status_length; i++){ + offset += this->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 status_lengthT = ((uint32_t) (*(inbuffer + offset))); + status_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + status_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + status_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->status_length); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + status_length = status_lengthT; + for( uint32_t i = 0; i < status_length; i++){ + offset += this->st_status.deserialize(inbuffer + offset); + memcpy( &(this->status[i]), &(this->st_status), sizeof(diagnostic_msgs::DiagnosticStatus)); + } + return offset; + } + + virtual const char * getType() override { return "diagnostic_msgs/DiagnosticArray"; }; + virtual const char * getMD5() override { return "60810da900de1dd6ddd437c3503511da"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h b/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h new file mode 100644 index 000000000..b5a74ea04 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h @@ -0,0 +1,137 @@ +#ifndef _ROS_diagnostic_msgs_DiagnosticStatus_h +#define _ROS_diagnostic_msgs_DiagnosticStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "diagnostic_msgs/KeyValue.h" + +namespace diagnostic_msgs +{ + + class DiagnosticStatus : public ros::Msg + { + public: + typedef int8_t _level_type; + _level_type level; + typedef const char* _name_type; + _name_type name; + typedef const char* _message_type; + _message_type message; + typedef const char* _hardware_id_type; + _hardware_id_type hardware_id; + uint32_t values_length; + typedef diagnostic_msgs::KeyValue _values_type; + _values_type st_values; + _values_type * values; + enum { OK = 0 }; + enum { WARN = 1 }; + enum { ERROR = 2 }; + enum { STALE = 3 }; + + DiagnosticStatus(): + level(0), + name(""), + message(""), + hardware_id(""), + values_length(0), st_values(), values(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_level; + u_level.real = this->level; + *(outbuffer + offset + 0) = (u_level.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + 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_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + uint32_t length_hardware_id = strlen(this->hardware_id); + varToArr(outbuffer + offset, length_hardware_id); + offset += 4; + memcpy(outbuffer + offset, this->hardware_id, length_hardware_id); + offset += length_hardware_id; + *(outbuffer + offset + 0) = (this->values_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->values_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->values_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->values_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->values_length); + for( uint32_t i = 0; i < values_length; i++){ + offset += this->values[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_level; + u_level.base = 0; + u_level.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->level = u_level.real; + offset += sizeof(this->level); + 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_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; + uint32_t length_hardware_id; + arrToVar(length_hardware_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_hardware_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_hardware_id-1]=0; + this->hardware_id = (char *)(inbuffer + offset-1); + offset += length_hardware_id; + uint32_t values_lengthT = ((uint32_t) (*(inbuffer + offset))); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->values_length); + if(values_lengthT > values_length) + this->values = (diagnostic_msgs::KeyValue*)realloc(this->values, values_lengthT * sizeof(diagnostic_msgs::KeyValue)); + values_length = values_lengthT; + for( uint32_t i = 0; i < values_length; i++){ + offset += this->st_values.deserialize(inbuffer + offset); + memcpy( &(this->values[i]), &(this->st_values), sizeof(diagnostic_msgs::KeyValue)); + } + return offset; + } + + virtual const char * getType() override { return "diagnostic_msgs/DiagnosticStatus"; }; + virtual const char * getMD5() override { return "d0ce08bc6e5ba34c7754f563a9cabaf1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/KeyValue.h b/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/KeyValue.h new file mode 100644 index 000000000..ac3abb101 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/KeyValue.h @@ -0,0 +1,72 @@ +#ifndef _ROS_diagnostic_msgs_KeyValue_h +#define _ROS_diagnostic_msgs_KeyValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace diagnostic_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 "diagnostic_msgs/KeyValue"; }; + virtual const char * getMD5() override { return "cf57fdc6617a881a88c16e768132149c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/SelfTest.h b/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/SelfTest.h new file mode 100644 index 000000000..7e014b95d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/diagnostic_msgs/SelfTest.h @@ -0,0 +1,131 @@ +#ifndef _ROS_SERVICE_SelfTest_h +#define _ROS_SERVICE_SelfTest_h +#include +#include +#include +#include "ros/msg.h" +#include "diagnostic_msgs/DiagnosticStatus.h" + +namespace diagnostic_msgs +{ + +static const char SELFTEST[] = "diagnostic_msgs/SelfTest"; + + class SelfTestRequest : public ros::Msg + { + public: + + SelfTestRequest() + { + } + + 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 SELFTEST; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SelfTestResponse : public ros::Msg + { + public: + typedef const char* _id_type; + _id_type id; + typedef int8_t _passed_type; + _passed_type passed; + uint32_t status_length; + typedef diagnostic_msgs::DiagnosticStatus _status_type; + _status_type st_status; + _status_type * status; + + SelfTestResponse(): + id(""), + passed(0), + status_length(0), st_status(), status(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_id = strlen(this->id); + varToArr(outbuffer + offset, length_id); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + union { + int8_t real; + uint8_t base; + } u_passed; + u_passed.real = this->passed; + *(outbuffer + offset + 0) = (u_passed.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->passed); + *(outbuffer + offset + 0) = (this->status_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->status_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->status_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->status_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->status_length); + for( uint32_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + union { + int8_t real; + uint8_t base; + } u_passed; + u_passed.base = 0; + u_passed.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->passed = u_passed.real; + offset += sizeof(this->passed); + uint32_t status_lengthT = ((uint32_t) (*(inbuffer + offset))); + status_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + status_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + status_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->status_length); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + status_length = status_lengthT; + for( uint32_t i = 0; i < status_length; i++){ + offset += this->st_status.deserialize(inbuffer + offset); + memcpy( &(this->status[i]), &(this->st_status), sizeof(diagnostic_msgs::DiagnosticStatus)); + } + return offset; + } + + virtual const char * getType() override { return SELFTEST; }; + virtual const char * getMD5() override { return "ac21b1bab7ab17546986536c22eb34e9"; }; + + }; + + class SelfTest { + public: + typedef SelfTestRequest Request; + typedef SelfTestResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogResponse.h b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogResponse.h new file mode 100644 index 000000000..c0c42f1b8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogResponse.h @@ -0,0 +1,178 @@ +#ifndef _ROS_dialogflow_task_executive_DialogResponse_h +#define _ROS_dialogflow_task_executive_DialogResponse_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace dialogflow_task_executive +{ + + class DialogResponse : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _query_type; + _query_type query; + typedef const char* _action_type; + _action_type action; + typedef const char* _response_type; + _response_type response; + typedef const char* _parameters_type; + _parameters_type parameters; + typedef bool _fulfilled_type; + _fulfilled_type fulfilled; + typedef float _speech_score_type; + _speech_score_type speech_score; + typedef float _intent_score_type; + _intent_score_type intent_score; + + DialogResponse(): + header(), + query(""), + action(""), + response(""), + parameters(""), + fulfilled(0), + speech_score(0), + intent_score(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_query = strlen(this->query); + varToArr(outbuffer + offset, length_query); + offset += 4; + memcpy(outbuffer + offset, this->query, length_query); + offset += length_query; + uint32_t length_action = strlen(this->action); + varToArr(outbuffer + offset, length_action); + offset += 4; + memcpy(outbuffer + offset, this->action, length_action); + offset += length_action; + uint32_t length_response = strlen(this->response); + varToArr(outbuffer + offset, length_response); + offset += 4; + memcpy(outbuffer + offset, this->response, length_response); + offset += length_response; + uint32_t length_parameters = strlen(this->parameters); + varToArr(outbuffer + offset, length_parameters); + offset += 4; + memcpy(outbuffer + offset, this->parameters, length_parameters); + offset += length_parameters; + union { + bool real; + uint8_t base; + } u_fulfilled; + u_fulfilled.real = this->fulfilled; + *(outbuffer + offset + 0) = (u_fulfilled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->fulfilled); + union { + float real; + uint32_t base; + } u_speech_score; + u_speech_score.real = this->speech_score; + *(outbuffer + offset + 0) = (u_speech_score.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_speech_score.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_speech_score.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_speech_score.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->speech_score); + union { + float real; + uint32_t base; + } u_intent_score; + u_intent_score.real = this->intent_score; + *(outbuffer + offset + 0) = (u_intent_score.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intent_score.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intent_score.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intent_score.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intent_score); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_query; + arrToVar(length_query, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_query; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_query-1]=0; + this->query = (char *)(inbuffer + offset-1); + offset += length_query; + uint32_t length_action; + arrToVar(length_action, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_action; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_action-1]=0; + this->action = (char *)(inbuffer + offset-1); + offset += length_action; + uint32_t length_response; + arrToVar(length_response, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_response; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_response-1]=0; + this->response = (char *)(inbuffer + offset-1); + offset += length_response; + uint32_t length_parameters; + arrToVar(length_parameters, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parameters; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parameters-1]=0; + this->parameters = (char *)(inbuffer + offset-1); + offset += length_parameters; + union { + bool real; + uint8_t base; + } u_fulfilled; + u_fulfilled.base = 0; + u_fulfilled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->fulfilled = u_fulfilled.real; + offset += sizeof(this->fulfilled); + union { + float real; + uint32_t base; + } u_speech_score; + u_speech_score.base = 0; + u_speech_score.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_speech_score.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_speech_score.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_speech_score.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->speech_score = u_speech_score.real; + offset += sizeof(this->speech_score); + union { + float real; + uint32_t base; + } u_intent_score; + u_intent_score.base = 0; + u_intent_score.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_intent_score.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_intent_score.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_intent_score.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->intent_score = u_intent_score.real; + offset += sizeof(this->intent_score); + return offset; + } + + virtual const char * getType() override { return "dialogflow_task_executive/DialogResponse"; }; + virtual const char * getMD5() override { return "bddc398570fb068a0f7d5a65c2c34cb5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextAction.h b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextAction.h new file mode 100644 index 000000000..b86192e7e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_dialogflow_task_executive_DialogTextAction_h +#define _ROS_dialogflow_task_executive_DialogTextAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "dialogflow_task_executive/DialogTextActionGoal.h" +#include "dialogflow_task_executive/DialogTextActionResult.h" +#include "dialogflow_task_executive/DialogTextActionFeedback.h" + +namespace dialogflow_task_executive +{ + + class DialogTextAction : public ros::Msg + { + public: + typedef dialogflow_task_executive::DialogTextActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef dialogflow_task_executive::DialogTextActionResult _action_result_type; + _action_result_type action_result; + typedef dialogflow_task_executive::DialogTextActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + DialogTextAction(): + 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 "dialogflow_task_executive/DialogTextAction"; }; + virtual const char * getMD5() override { return "6e457c92f187469e064600d4d7bad518"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionFeedback.h new file mode 100644 index 000000000..88ff6ae5c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_dialogflow_task_executive_DialogTextActionFeedback_h +#define _ROS_dialogflow_task_executive_DialogTextActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "dialogflow_task_executive/DialogTextFeedback.h" + +namespace dialogflow_task_executive +{ + + class DialogTextActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef dialogflow_task_executive::DialogTextFeedback _feedback_type; + _feedback_type feedback; + + DialogTextActionFeedback(): + 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 "dialogflow_task_executive/DialogTextActionFeedback"; }; + virtual const char * getMD5() override { return "78d9346a781caddd481e52b70b462a2e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionGoal.h new file mode 100644 index 000000000..4360d9ae1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_dialogflow_task_executive_DialogTextActionGoal_h +#define _ROS_dialogflow_task_executive_DialogTextActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "dialogflow_task_executive/DialogTextGoal.h" + +namespace dialogflow_task_executive +{ + + class DialogTextActionGoal : 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 dialogflow_task_executive::DialogTextGoal _goal_type; + _goal_type goal; + + DialogTextActionGoal(): + 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 "dialogflow_task_executive/DialogTextActionGoal"; }; + virtual const char * getMD5() override { return "21f9decb4d62a44aa93e2bd8088c7df9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionResult.h b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionResult.h new file mode 100644 index 000000000..813b22ce3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_dialogflow_task_executive_DialogTextActionResult_h +#define _ROS_dialogflow_task_executive_DialogTextActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "dialogflow_task_executive/DialogTextResult.h" + +namespace dialogflow_task_executive +{ + + class DialogTextActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef dialogflow_task_executive::DialogTextResult _result_type; + _result_type result; + + DialogTextActionResult(): + 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 "dialogflow_task_executive/DialogTextActionResult"; }; + virtual const char * getMD5() override { return "064bee682b09e4fb44617e4f8739bcf5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextFeedback.h b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextFeedback.h new file mode 100644 index 000000000..5a12f027b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextFeedback.h @@ -0,0 +1,72 @@ +#ifndef _ROS_dialogflow_task_executive_DialogTextFeedback_h +#define _ROS_dialogflow_task_executive_DialogTextFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dialogflow_task_executive +{ + + class DialogTextFeedback : public ros::Msg + { + public: + typedef const char* _session_type; + _session_type session; + typedef const char* _status_type; + _status_type status; + + DialogTextFeedback(): + session(""), + status("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_session = strlen(this->session); + varToArr(outbuffer + offset, length_session); + offset += 4; + memcpy(outbuffer + offset, this->session, length_session); + offset += length_session; + 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; + uint32_t length_session; + arrToVar(length_session, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_session; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_session-1]=0; + this->session = (char *)(inbuffer + offset-1); + offset += length_session; + 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 "dialogflow_task_executive/DialogTextFeedback"; }; + virtual const char * getMD5() override { return "18931f63f36e4ad1ea67d6ba7c77dceb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextGoal.h b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextGoal.h new file mode 100644 index 000000000..68638c1d7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextGoal.h @@ -0,0 +1,55 @@ +#ifndef _ROS_dialogflow_task_executive_DialogTextGoal_h +#define _ROS_dialogflow_task_executive_DialogTextGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dialogflow_task_executive +{ + + class DialogTextGoal : public ros::Msg + { + public: + typedef const char* _query_type; + _query_type query; + + DialogTextGoal(): + query("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_query = strlen(this->query); + varToArr(outbuffer + offset, length_query); + offset += 4; + memcpy(outbuffer + offset, this->query, length_query); + offset += length_query; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_query; + arrToVar(length_query, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_query; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_query-1]=0; + this->query = (char *)(inbuffer + offset-1); + offset += length_query; + return offset; + } + + virtual const char * getType() override { return "dialogflow_task_executive/DialogTextGoal"; }; + virtual const char * getMD5() override { return "6490a46152f373285fe18f491ed93702"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextResult.h b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextResult.h new file mode 100644 index 000000000..177b9b4a8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dialogflow_task_executive/DialogTextResult.h @@ -0,0 +1,79 @@ +#ifndef _ROS_dialogflow_task_executive_DialogTextResult_h +#define _ROS_dialogflow_task_executive_DialogTextResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "dialogflow_task_executive/DialogResponse.h" + +namespace dialogflow_task_executive +{ + + class DialogTextResult : public ros::Msg + { + public: + typedef dialogflow_task_executive::DialogResponse _response_type; + _response_type response; + typedef const char* _session_type; + _session_type session; + typedef bool _done_type; + _done_type done; + + DialogTextResult(): + response(), + session(""), + done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->response.serialize(outbuffer + offset); + uint32_t length_session = strlen(this->session); + varToArr(outbuffer + offset, length_session); + offset += 4; + memcpy(outbuffer + offset, this->session, length_session); + offset += length_session; + 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; + offset += this->response.deserialize(inbuffer + offset); + uint32_t length_session; + arrToVar(length_session, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_session; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_session-1]=0; + this->session = (char *)(inbuffer + offset-1); + offset += length_session; + 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 "dialogflow_task_executive/DialogTextResult"; }; + virtual const char * getMD5() override { return "50694725a4e7e905ed7a64bf3000dffe"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/driver_base/ConfigString.h b/smart_device_protocol/ros_lib/ros_lib/driver_base/ConfigString.h new file mode 100644 index 000000000..43d26fb43 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/driver_base/ConfigString.h @@ -0,0 +1,72 @@ +#ifndef _ROS_driver_base_ConfigString_h +#define _ROS_driver_base_ConfigString_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class ConfigString : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _value_type; + _value_type value; + + ConfigString(): + name(""), + value("") + { + } + + 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_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_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_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 "driver_base/ConfigString"; }; + virtual const char * getMD5() override { return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/driver_base/ConfigValue.h b/smart_device_protocol/ros_lib/ros_lib/driver_base/ConfigValue.h new file mode 100644 index 000000000..adda1b95d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/driver_base/ConfigValue.h @@ -0,0 +1,60 @@ +#ifndef _ROS_driver_base_ConfigValue_h +#define _ROS_driver_base_ConfigValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class ConfigValue : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef float _value_type; + _value_type value; + + ConfigValue(): + name(""), + value(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; + offset += serializeAvrFloat64(outbuffer + offset, this->value); + 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; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + virtual const char * getType() override { return "driver_base/ConfigValue"; }; + virtual const char * getMD5() override { return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/driver_base/SensorLevels.h b/smart_device_protocol/ros_lib/ros_lib/driver_base/SensorLevels.h new file mode 100644 index 000000000..98ea69db9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/driver_base/SensorLevels.h @@ -0,0 +1,41 @@ +#ifndef _ROS_driver_base_SensorLevels_h +#define _ROS_driver_base_SensorLevels_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class SensorLevels : public ros::Msg + { + public: + enum { RECONFIGURE_CLOSE = 3 }; + enum { RECONFIGURE_STOP = 1 }; + enum { RECONFIGURE_RUNNING = 0 }; + + SensorLevels() + { + } + + 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 "driver_base/SensorLevels"; }; + virtual const char * getMD5() override { return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/duration.cpp b/smart_device_protocol/ros_lib/ros_lib/duration.cpp new file mode 100644 index 000000000..d2dfdd6f3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/duration.cpp @@ -0,0 +1,83 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "ros/duration.h" + +namespace ros +{ +void normalizeSecNSecSigned(int32_t &sec, int32_t &nsec) +{ + int32_t nsec_part = nsec; + int32_t sec_part = sec; + + while (nsec_part > 1000000000L) + { + nsec_part -= 1000000000L; + ++sec_part; + } + while (nsec_part < 0) + { + nsec_part += 1000000000L; + --sec_part; + } + sec = sec_part; + nsec = nsec_part; +} + +Duration& Duration::operator+=(const Duration &rhs) +{ + sec += rhs.sec; + nsec += rhs.nsec; + normalizeSecNSecSigned(sec, nsec); + return *this; +} + +Duration& Duration::operator-=(const Duration &rhs) +{ + sec += -rhs.sec; + nsec += -rhs.nsec; + normalizeSecNSecSigned(sec, nsec); + return *this; +} + +Duration& Duration::operator*=(double scale) +{ + sec *= scale; + nsec *= scale; + normalizeSecNSecSigned(sec, nsec); + return *this; +} + +} diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/BoolParameter.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/BoolParameter.h new file mode 100644 index 000000000..00da01b65 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/BoolParameter.h @@ -0,0 +1,73 @@ +#ifndef _ROS_dynamic_reconfigure_BoolParameter_h +#define _ROS_dynamic_reconfigure_BoolParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class BoolParameter : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef bool _value_type; + _value_type value; + + BoolParameter(): + name(""), + value(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; + 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; + 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 { + 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 "dynamic_reconfigure/BoolParameter"; }; + virtual const char * getMD5() override { return "23f05028c1a699fb83e22401228c3a9e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Config.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Config.h new file mode 100644 index 000000000..3651ea5a0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Config.h @@ -0,0 +1,168 @@ +#ifndef _ROS_dynamic_reconfigure_Config_h +#define _ROS_dynamic_reconfigure_Config_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/BoolParameter.h" +#include "dynamic_reconfigure/IntParameter.h" +#include "dynamic_reconfigure/StrParameter.h" +#include "dynamic_reconfigure/DoubleParameter.h" +#include "dynamic_reconfigure/GroupState.h" + +namespace dynamic_reconfigure +{ + + class Config : public ros::Msg + { + public: + uint32_t bools_length; + typedef dynamic_reconfigure::BoolParameter _bools_type; + _bools_type st_bools; + _bools_type * bools; + uint32_t ints_length; + typedef dynamic_reconfigure::IntParameter _ints_type; + _ints_type st_ints; + _ints_type * ints; + uint32_t strs_length; + typedef dynamic_reconfigure::StrParameter _strs_type; + _strs_type st_strs; + _strs_type * strs; + uint32_t doubles_length; + typedef dynamic_reconfigure::DoubleParameter _doubles_type; + _doubles_type st_doubles; + _doubles_type * doubles; + uint32_t groups_length; + typedef dynamic_reconfigure::GroupState _groups_type; + _groups_type st_groups; + _groups_type * groups; + + Config(): + bools_length(0), st_bools(), bools(nullptr), + ints_length(0), st_ints(), ints(nullptr), + strs_length(0), st_strs(), strs(nullptr), + doubles_length(0), st_doubles(), doubles(nullptr), + groups_length(0), st_groups(), groups(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->bools_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->bools_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->bools_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->bools_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->bools_length); + for( uint32_t i = 0; i < bools_length; i++){ + offset += this->bools[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->ints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ints_length); + for( uint32_t i = 0; i < ints_length; i++){ + offset += this->ints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->strs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->strs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->strs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->strs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->strs_length); + for( uint32_t i = 0; i < strs_length; i++){ + offset += this->strs[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->doubles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->doubles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->doubles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->doubles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->doubles_length); + for( uint32_t i = 0; i < doubles_length; i++){ + offset += this->doubles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->groups_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->groups_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->groups_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->groups_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->groups_length); + for( uint32_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t bools_lengthT = ((uint32_t) (*(inbuffer + offset))); + bools_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + bools_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + bools_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->bools_length); + if(bools_lengthT > bools_length) + this->bools = (dynamic_reconfigure::BoolParameter*)realloc(this->bools, bools_lengthT * sizeof(dynamic_reconfigure::BoolParameter)); + bools_length = bools_lengthT; + for( uint32_t i = 0; i < bools_length; i++){ + offset += this->st_bools.deserialize(inbuffer + offset); + memcpy( &(this->bools[i]), &(this->st_bools), sizeof(dynamic_reconfigure::BoolParameter)); + } + uint32_t ints_lengthT = ((uint32_t) (*(inbuffer + offset))); + ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ints_length); + if(ints_lengthT > ints_length) + this->ints = (dynamic_reconfigure::IntParameter*)realloc(this->ints, ints_lengthT * sizeof(dynamic_reconfigure::IntParameter)); + ints_length = ints_lengthT; + for( uint32_t i = 0; i < ints_length; i++){ + offset += this->st_ints.deserialize(inbuffer + offset); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(dynamic_reconfigure::IntParameter)); + } + uint32_t strs_lengthT = ((uint32_t) (*(inbuffer + offset))); + strs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + strs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + strs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->strs_length); + if(strs_lengthT > strs_length) + this->strs = (dynamic_reconfigure::StrParameter*)realloc(this->strs, strs_lengthT * sizeof(dynamic_reconfigure::StrParameter)); + strs_length = strs_lengthT; + for( uint32_t i = 0; i < strs_length; i++){ + offset += this->st_strs.deserialize(inbuffer + offset); + memcpy( &(this->strs[i]), &(this->st_strs), sizeof(dynamic_reconfigure::StrParameter)); + } + uint32_t doubles_lengthT = ((uint32_t) (*(inbuffer + offset))); + doubles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + doubles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + doubles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->doubles_length); + if(doubles_lengthT > doubles_length) + this->doubles = (dynamic_reconfigure::DoubleParameter*)realloc(this->doubles, doubles_lengthT * sizeof(dynamic_reconfigure::DoubleParameter)); + doubles_length = doubles_lengthT; + for( uint32_t i = 0; i < doubles_length; i++){ + offset += this->st_doubles.deserialize(inbuffer + offset); + memcpy( &(this->doubles[i]), &(this->st_doubles), sizeof(dynamic_reconfigure::DoubleParameter)); + } + uint32_t groups_lengthT = ((uint32_t) (*(inbuffer + offset))); + groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->groups_length); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::GroupState*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::GroupState)); + groups_length = groups_lengthT; + for( uint32_t i = 0; i < groups_length; i++){ + offset += this->st_groups.deserialize(inbuffer + offset); + memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::GroupState)); + } + return offset; + } + + virtual const char * getType() override { return "dynamic_reconfigure/Config"; }; + virtual const char * getMD5() override { return "958f16a05573709014982821e6822580"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/ConfigDescription.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/ConfigDescription.h new file mode 100644 index 000000000..d53a35b9f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/ConfigDescription.h @@ -0,0 +1,80 @@ +#ifndef _ROS_dynamic_reconfigure_ConfigDescription_h +#define _ROS_dynamic_reconfigure_ConfigDescription_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/Group.h" +#include "dynamic_reconfigure/Config.h" + +namespace dynamic_reconfigure +{ + + class ConfigDescription : public ros::Msg + { + public: + uint32_t groups_length; + typedef dynamic_reconfigure::Group _groups_type; + _groups_type st_groups; + _groups_type * groups; + typedef dynamic_reconfigure::Config _max_type; + _max_type max; + typedef dynamic_reconfigure::Config _min_type; + _min_type min; + typedef dynamic_reconfigure::Config _dflt_type; + _dflt_type dflt; + + ConfigDescription(): + groups_length(0), st_groups(), groups(nullptr), + max(), + min(), + dflt() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->groups_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->groups_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->groups_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->groups_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->groups_length); + for( uint32_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + offset += this->max.serialize(outbuffer + offset); + offset += this->min.serialize(outbuffer + offset); + offset += this->dflt.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t groups_lengthT = ((uint32_t) (*(inbuffer + offset))); + groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->groups_length); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::Group*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::Group)); + groups_length = groups_lengthT; + for( uint32_t i = 0; i < groups_length; i++){ + offset += this->st_groups.deserialize(inbuffer + offset); + memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::Group)); + } + offset += this->max.deserialize(inbuffer + offset); + offset += this->min.deserialize(inbuffer + offset); + offset += this->dflt.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "dynamic_reconfigure/ConfigDescription"; }; + virtual const char * getMD5() override { return "757ce9d44ba8ddd801bb30bc456f946f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/DoubleParameter.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/DoubleParameter.h new file mode 100644 index 000000000..d74298f4a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/DoubleParameter.h @@ -0,0 +1,60 @@ +#ifndef _ROS_dynamic_reconfigure_DoubleParameter_h +#define _ROS_dynamic_reconfigure_DoubleParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class DoubleParameter : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef float _value_type; + _value_type value; + + DoubleParameter(): + name(""), + value(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; + offset += serializeAvrFloat64(outbuffer + offset, this->value); + 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; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + virtual const char * getType() override { return "dynamic_reconfigure/DoubleParameter"; }; + virtual const char * getMD5() override { return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Group.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Group.h new file mode 100644 index 000000000..07710882a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Group.h @@ -0,0 +1,146 @@ +#ifndef _ROS_dynamic_reconfigure_Group_h +#define _ROS_dynamic_reconfigure_Group_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/ParamDescription.h" + +namespace dynamic_reconfigure +{ + + class Group : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _type_type; + _type_type type; + uint32_t parameters_length; + typedef dynamic_reconfigure::ParamDescription _parameters_type; + _parameters_type st_parameters; + _parameters_type * parameters; + typedef int32_t _parent_type; + _parent_type parent; + typedef int32_t _id_type; + _id_type id; + + Group(): + name(""), + type(""), + parameters_length(0), st_parameters(), parameters(nullptr), + parent(0), + id(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; + 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->parameters_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->parameters_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->parameters_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->parameters_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->parameters_length); + for( uint32_t i = 0; i < parameters_length; i++){ + offset += this->parameters[i].serialize(outbuffer + offset); + } + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.real = this->parent; + *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent); + 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); + 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; + uint32_t parameters_lengthT = ((uint32_t) (*(inbuffer + offset))); + parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->parameters_length); + if(parameters_lengthT > parameters_length) + this->parameters = (dynamic_reconfigure::ParamDescription*)realloc(this->parameters, parameters_lengthT * sizeof(dynamic_reconfigure::ParamDescription)); + parameters_length = parameters_lengthT; + for( uint32_t i = 0; i < parameters_length; i++){ + offset += this->st_parameters.deserialize(inbuffer + offset); + memcpy( &(this->parameters[i]), &(this->st_parameters), sizeof(dynamic_reconfigure::ParamDescription)); + } + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.base = 0; + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->parent = u_parent.real; + offset += sizeof(this->parent); + 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); + return offset; + } + + virtual const char * getType() override { return "dynamic_reconfigure/Group"; }; + virtual const char * getMD5() override { return "9e8cd9e9423c94823db3614dd8b1cf7a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/GroupState.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/GroupState.h new file mode 100644 index 000000000..0339d1fc8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/GroupState.h @@ -0,0 +1,121 @@ +#ifndef _ROS_dynamic_reconfigure_GroupState_h +#define _ROS_dynamic_reconfigure_GroupState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class GroupState : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef bool _state_type; + _state_type state; + typedef int32_t _id_type; + _id_type id; + typedef int32_t _parent_type; + _parent_type parent; + + GroupState(): + name(""), + state(0), + id(0), + parent(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; + union { + bool real; + uint8_t base; + } u_state; + u_state.real = this->state; + *(outbuffer + offset + 0) = (u_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + 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_parent; + u_parent.real = this->parent; + *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent); + 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; + union { + bool real; + uint8_t base; + } u_state; + u_state.base = 0; + u_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->state = u_state.real; + offset += sizeof(this->state); + 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_parent; + u_parent.base = 0; + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->parent = u_parent.real; + offset += sizeof(this->parent); + return offset; + } + + virtual const char * getType() override { return "dynamic_reconfigure/GroupState"; }; + virtual const char * getMD5() override { return "a2d87f51dc22930325041a2f8b1571f8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/IntParameter.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/IntParameter.h new file mode 100644 index 000000000..32926f4cb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/IntParameter.h @@ -0,0 +1,79 @@ +#ifndef _ROS_dynamic_reconfigure_IntParameter_h +#define _ROS_dynamic_reconfigure_IntParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class IntParameter : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef int32_t _value_type; + _value_type value; + + IntParameter(): + name(""), + value(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; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + 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; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + virtual const char * getType() override { return "dynamic_reconfigure/IntParameter"; }; + virtual const char * getMD5() override { return "65fedc7a0cbfb8db035e46194a350bf1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/ParamDescription.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/ParamDescription.h new file mode 100644 index 000000000..fde17e564 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/ParamDescription.h @@ -0,0 +1,119 @@ +#ifndef _ROS_dynamic_reconfigure_ParamDescription_h +#define _ROS_dynamic_reconfigure_ParamDescription_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class ParamDescription : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _type_type; + _type_type type; + typedef uint32_t _level_type; + _level_type level; + typedef const char* _description_type; + _description_type description; + typedef const char* _edit_method_type; + _edit_method_type edit_method; + + ParamDescription(): + name(""), + type(""), + level(0), + description(""), + edit_method("") + { + } + + 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->level >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->level >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->level >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->level >> (8 * 3)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_description = strlen(this->description); + varToArr(outbuffer + offset, length_description); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + uint32_t length_edit_method = strlen(this->edit_method); + varToArr(outbuffer + offset, length_edit_method); + offset += 4; + memcpy(outbuffer + offset, this->edit_method, length_edit_method); + offset += length_edit_method; + 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->level = ((uint32_t) (*(inbuffer + offset))); + this->level |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->level |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->level |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->level); + uint32_t length_description; + arrToVar(length_description, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + uint32_t length_edit_method; + arrToVar(length_edit_method, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_edit_method; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_edit_method-1]=0; + this->edit_method = (char *)(inbuffer + offset-1); + offset += length_edit_method; + return offset; + } + + virtual const char * getType() override { return "dynamic_reconfigure/ParamDescription"; }; + virtual const char * getMD5() override { return "7434fcb9348c13054e0c3b267c8cb34d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Reconfigure.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Reconfigure.h new file mode 100644 index 000000000..53ab31993 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/Reconfigure.h @@ -0,0 +1,81 @@ +#ifndef _ROS_SERVICE_Reconfigure_h +#define _ROS_SERVICE_Reconfigure_h +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/Config.h" + +namespace dynamic_reconfigure +{ + +static const char RECONFIGURE[] = "dynamic_reconfigure/Reconfigure"; + + class ReconfigureRequest : public ros::Msg + { + public: + typedef dynamic_reconfigure::Config _config_type; + _config_type config; + + ReconfigureRequest(): + config() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return RECONFIGURE; }; + virtual const char * getMD5() override { return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class ReconfigureResponse : public ros::Msg + { + public: + typedef dynamic_reconfigure::Config _config_type; + _config_type config; + + ReconfigureResponse(): + config() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return RECONFIGURE; }; + virtual const char * getMD5() override { return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class Reconfigure { + public: + typedef ReconfigureRequest Request; + typedef ReconfigureResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/SensorLevels.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/SensorLevels.h new file mode 100644 index 000000000..5001af72d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/SensorLevels.h @@ -0,0 +1,41 @@ +#ifndef _ROS_dynamic_reconfigure_SensorLevels_h +#define _ROS_dynamic_reconfigure_SensorLevels_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class SensorLevels : public ros::Msg + { + public: + enum { RECONFIGURE_CLOSE = 3 }; + enum { RECONFIGURE_STOP = 1 }; + enum { RECONFIGURE_RUNNING = 0 }; + + SensorLevels() + { + } + + 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 "dynamic_reconfigure/SensorLevels"; }; + virtual const char * getMD5() override { return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/StrParameter.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/StrParameter.h new file mode 100644 index 000000000..900753c79 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_reconfigure/StrParameter.h @@ -0,0 +1,72 @@ +#ifndef _ROS_dynamic_reconfigure_StrParameter_h +#define _ROS_dynamic_reconfigure_StrParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class StrParameter : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _value_type; + _value_type value; + + StrParameter(): + name(""), + value("") + { + } + + 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_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_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_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 "dynamic_reconfigure/StrParameter"; }; + virtual const char * getMD5() override { return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/AssocTF.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/AssocTF.h new file mode 100644 index 000000000..92318401a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/AssocTF.h @@ -0,0 +1,110 @@ +#ifndef _ROS_SERVICE_AssocTF_h +#define _ROS_SERVICE_AssocTF_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace dynamic_tf_publisher +{ + +static const char ASSOCTF[] = "dynamic_tf_publisher/AssocTF"; + + class AssocTFRequest : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _parent_frame_type; + _parent_frame_type parent_frame; + typedef const char* _child_frame_type; + _child_frame_type child_frame; + + AssocTFRequest(): + header(), + parent_frame(""), + child_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_parent_frame = strlen(this->parent_frame); + varToArr(outbuffer + offset, length_parent_frame); + offset += 4; + memcpy(outbuffer + offset, this->parent_frame, length_parent_frame); + offset += length_parent_frame; + uint32_t length_child_frame = strlen(this->child_frame); + varToArr(outbuffer + offset, length_child_frame); + offset += 4; + memcpy(outbuffer + offset, this->child_frame, length_child_frame); + offset += length_child_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_parent_frame; + arrToVar(length_parent_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parent_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parent_frame-1]=0; + this->parent_frame = (char *)(inbuffer + offset-1); + offset += length_parent_frame; + uint32_t length_child_frame; + arrToVar(length_child_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame-1]=0; + this->child_frame = (char *)(inbuffer + offset-1); + offset += length_child_frame; + return offset; + } + + virtual const char * getType() override { return ASSOCTF; }; + virtual const char * getMD5() override { return "984a9f3f6741b2b5568909b82fec6355"; }; + + }; + + class AssocTFResponse : public ros::Msg + { + public: + + AssocTFResponse() + { + } + + 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 ASSOCTF; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class AssocTF { + public: + typedef AssocTFRequest Request; + typedef AssocTFResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/DeleteTF.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/DeleteTF.h new file mode 100644 index 000000000..d6b40fd8b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/DeleteTF.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_DeleteTF_h +#define _ROS_SERVICE_DeleteTF_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace dynamic_tf_publisher +{ + +static const char DELETETF[] = "dynamic_tf_publisher/DeleteTF"; + + class DeleteTFRequest : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + + DeleteTFRequest(): + header() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return DELETETF; }; + virtual const char * getMD5() override { return "d7be0bb39af8fb9129d5a76e6b63a290"; }; + + }; + + class DeleteTFResponse : public ros::Msg + { + public: + + DeleteTFResponse() + { + } + + 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 DELETETF; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DeleteTF { + public: + typedef DeleteTFRequest Request; + typedef DeleteTFResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/DissocTF.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/DissocTF.h new file mode 100644 index 000000000..45853f67e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/DissocTF.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_DissocTF_h +#define _ROS_SERVICE_DissocTF_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace dynamic_tf_publisher +{ + +static const char DISSOCTF[] = "dynamic_tf_publisher/DissocTF"; + + class DissocTFRequest : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _frame_id_type; + _frame_id_type frame_id; + + DissocTFRequest(): + header(), + frame_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + 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); + 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 DISSOCTF; }; + virtual const char * getMD5() override { return "5fa93cf9f65be2325fa0008ddcc90131"; }; + + }; + + class DissocTFResponse : public ros::Msg + { + public: + + DissocTFResponse() + { + } + + 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 DISSOCTF; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DissocTF { + public: + typedef DissocTFRequest Request; + typedef DissocTFResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/SetDynamicTF.h b/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/SetDynamicTF.h new file mode 100644 index 000000000..a654d5d33 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/dynamic_tf_publisher/SetDynamicTF.h @@ -0,0 +1,100 @@ +#ifndef _ROS_SERVICE_SetDynamicTF_h +#define _ROS_SERVICE_SetDynamicTF_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace dynamic_tf_publisher +{ + +static const char SETDYNAMICTF[] = "dynamic_tf_publisher/SetDynamicTF"; + + class SetDynamicTFRequest : public ros::Msg + { + public: + typedef float _freq_type; + _freq_type freq; + typedef geometry_msgs::TransformStamped _cur_tf_type; + _cur_tf_type cur_tf; + + SetDynamicTFRequest(): + freq(0), + cur_tf() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_freq; + u_freq.real = this->freq; + *(outbuffer + offset + 0) = (u_freq.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_freq.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_freq.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_freq.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->freq); + offset += this->cur_tf.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_freq; + u_freq.base = 0; + u_freq.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_freq.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_freq.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_freq.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->freq = u_freq.real; + offset += sizeof(this->freq); + offset += this->cur_tf.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETDYNAMICTF; }; + virtual const char * getMD5() override { return "257be6eb2c49e846d6c3c12c85bb0fb1"; }; + + }; + + class SetDynamicTFResponse : public ros::Msg + { + public: + + SetDynamicTFResponse() + { + } + + 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 SETDYNAMICTF; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetDynamicTF { + public: + typedef SetDynamicTFRequest Request; + typedef SetDynamicTFResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/ActuatorInfo.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/ActuatorInfo.h new file mode 100644 index 000000000..5ca9edd67 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/ActuatorInfo.h @@ -0,0 +1,149 @@ +#ifndef _ROS_ethercat_hardware_ActuatorInfo_h +#define _ROS_ethercat_hardware_ActuatorInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace ethercat_hardware +{ + + class ActuatorInfo : public ros::Msg + { + public: + typedef uint32_t _id_type; + _id_type id; + typedef const char* _name_type; + _name_type name; + typedef const char* _robot_name_type; + _robot_name_type robot_name; + typedef const char* _motor_make_type; + _motor_make_type motor_make; + typedef const char* _motor_model_type; + _motor_model_type motor_model; + typedef float _max_current_type; + _max_current_type max_current; + typedef float _speed_constant_type; + _speed_constant_type speed_constant; + typedef float _motor_resistance_type; + _motor_resistance_type motor_resistance; + typedef float _motor_torque_constant_type; + _motor_torque_constant_type motor_torque_constant; + typedef float _encoder_reduction_type; + _encoder_reduction_type encoder_reduction; + typedef float _pulses_per_revolution_type; + _pulses_per_revolution_type pulses_per_revolution; + + ActuatorInfo(): + id(0), + name(""), + robot_name(""), + motor_make(""), + motor_model(""), + max_current(0), + speed_constant(0), + motor_resistance(0), + motor_torque_constant(0), + encoder_reduction(0), + pulses_per_revolution(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; + *(outbuffer + offset + 2) = (this->id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->id >> (8 * 3)) & 0xFF; + offset += sizeof(this->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; + uint32_t length_robot_name = strlen(this->robot_name); + varToArr(outbuffer + offset, length_robot_name); + offset += 4; + memcpy(outbuffer + offset, this->robot_name, length_robot_name); + offset += length_robot_name; + uint32_t length_motor_make = strlen(this->motor_make); + varToArr(outbuffer + offset, length_motor_make); + offset += 4; + memcpy(outbuffer + offset, this->motor_make, length_motor_make); + offset += length_motor_make; + uint32_t length_motor_model = strlen(this->motor_model); + varToArr(outbuffer + offset, length_motor_model); + offset += 4; + memcpy(outbuffer + offset, this->motor_model, length_motor_model); + offset += length_motor_model; + offset += serializeAvrFloat64(outbuffer + offset, this->max_current); + offset += serializeAvrFloat64(outbuffer + offset, this->speed_constant); + offset += serializeAvrFloat64(outbuffer + offset, this->motor_resistance); + offset += serializeAvrFloat64(outbuffer + offset, this->motor_torque_constant); + offset += serializeAvrFloat64(outbuffer + offset, this->encoder_reduction); + offset += serializeAvrFloat64(outbuffer + offset, this->pulses_per_revolution); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->id = ((uint32_t) (*(inbuffer + offset))); + this->id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->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; + uint32_t length_robot_name; + arrToVar(length_robot_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot_name-1]=0; + this->robot_name = (char *)(inbuffer + offset-1); + offset += length_robot_name; + uint32_t length_motor_make; + arrToVar(length_motor_make, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_motor_make; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_motor_make-1]=0; + this->motor_make = (char *)(inbuffer + offset-1); + offset += length_motor_make; + uint32_t length_motor_model; + arrToVar(length_motor_model, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_motor_model; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_motor_model-1]=0; + this->motor_model = (char *)(inbuffer + offset-1); + offset += length_motor_model; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_current)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->speed_constant)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->motor_resistance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->motor_torque_constant)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->encoder_reduction)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pulses_per_revolution)); + return offset; + } + + virtual const char * getType() override { return "ethercat_hardware/ActuatorInfo"; }; + virtual const char * getMD5() override { return "40f44d8ec4380adc0b63713486eecb09"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/BoardInfo.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/BoardInfo.h new file mode 100644 index 000000000..f7e2c0815 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/BoardInfo.h @@ -0,0 +1,166 @@ +#ifndef _ROS_ethercat_hardware_BoardInfo_h +#define _ROS_ethercat_hardware_BoardInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace ethercat_hardware +{ + + class BoardInfo : public ros::Msg + { + public: + typedef const char* _description_type; + _description_type description; + typedef uint32_t _product_code_type; + _product_code_type product_code; + typedef uint32_t _pcb_type; + _pcb_type pcb; + typedef uint32_t _pca_type; + _pca_type pca; + typedef uint32_t _serial_type; + _serial_type serial; + typedef uint32_t _firmware_major_type; + _firmware_major_type firmware_major; + typedef uint32_t _firmware_minor_type; + _firmware_minor_type firmware_minor; + typedef float _board_resistance_type; + _board_resistance_type board_resistance; + typedef float _max_pwm_ratio_type; + _max_pwm_ratio_type max_pwm_ratio; + typedef float _hw_max_current_type; + _hw_max_current_type hw_max_current; + typedef bool _poor_measured_motor_voltage_type; + _poor_measured_motor_voltage_type poor_measured_motor_voltage; + + BoardInfo(): + description(""), + product_code(0), + pcb(0), + pca(0), + serial(0), + firmware_major(0), + firmware_minor(0), + board_resistance(0), + max_pwm_ratio(0), + hw_max_current(0), + poor_measured_motor_voltage(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_description = strlen(this->description); + varToArr(outbuffer + offset, length_description); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + *(outbuffer + offset + 0) = (this->product_code >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->product_code >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->product_code >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->product_code >> (8 * 3)) & 0xFF; + offset += sizeof(this->product_code); + *(outbuffer + offset + 0) = (this->pcb >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pcb >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pcb >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pcb >> (8 * 3)) & 0xFF; + offset += sizeof(this->pcb); + *(outbuffer + offset + 0) = (this->pca >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pca >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pca >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pca >> (8 * 3)) & 0xFF; + offset += sizeof(this->pca); + *(outbuffer + offset + 0) = (this->serial >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->serial >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->serial >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->serial >> (8 * 3)) & 0xFF; + offset += sizeof(this->serial); + *(outbuffer + offset + 0) = (this->firmware_major >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->firmware_major >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->firmware_major >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->firmware_major >> (8 * 3)) & 0xFF; + offset += sizeof(this->firmware_major); + *(outbuffer + offset + 0) = (this->firmware_minor >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->firmware_minor >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->firmware_minor >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->firmware_minor >> (8 * 3)) & 0xFF; + offset += sizeof(this->firmware_minor); + offset += serializeAvrFloat64(outbuffer + offset, this->board_resistance); + offset += serializeAvrFloat64(outbuffer + offset, this->max_pwm_ratio); + offset += serializeAvrFloat64(outbuffer + offset, this->hw_max_current); + union { + bool real; + uint8_t base; + } u_poor_measured_motor_voltage; + u_poor_measured_motor_voltage.real = this->poor_measured_motor_voltage; + *(outbuffer + offset + 0) = (u_poor_measured_motor_voltage.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->poor_measured_motor_voltage); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_description; + arrToVar(length_description, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + this->product_code = ((uint32_t) (*(inbuffer + offset))); + this->product_code |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->product_code |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->product_code |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->product_code); + this->pcb = ((uint32_t) (*(inbuffer + offset))); + this->pcb |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pcb |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pcb |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pcb); + this->pca = ((uint32_t) (*(inbuffer + offset))); + this->pca |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pca |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pca |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pca); + this->serial = ((uint32_t) (*(inbuffer + offset))); + this->serial |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->serial |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->serial |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->serial); + this->firmware_major = ((uint32_t) (*(inbuffer + offset))); + this->firmware_major |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->firmware_major |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->firmware_major |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->firmware_major); + this->firmware_minor = ((uint32_t) (*(inbuffer + offset))); + this->firmware_minor |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->firmware_minor |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->firmware_minor |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->firmware_minor); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->board_resistance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_pwm_ratio)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->hw_max_current)); + union { + bool real; + uint8_t base; + } u_poor_measured_motor_voltage; + u_poor_measured_motor_voltage.base = 0; + u_poor_measured_motor_voltage.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->poor_measured_motor_voltage = u_poor_measured_motor_voltage.real; + offset += sizeof(this->poor_measured_motor_voltage); + return offset; + } + + virtual const char * getType() override { return "ethercat_hardware/BoardInfo"; }; + virtual const char * getMD5() override { return "ffcb87ef2725c5fab7d0d8fcd4c7e7bc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTemperature.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTemperature.h new file mode 100644 index 000000000..2883b189e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTemperature.h @@ -0,0 +1,82 @@ +#ifndef _ROS_ethercat_hardware_MotorTemperature_h +#define _ROS_ethercat_hardware_MotorTemperature_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace ethercat_hardware +{ + + class MotorTemperature : public ros::Msg + { + public: + typedef ros::Time _stamp_type; + _stamp_type stamp; + typedef float _winding_temperature_type; + _winding_temperature_type winding_temperature; + typedef float _housing_temperature_type; + _housing_temperature_type housing_temperature; + typedef float _ambient_temperature_type; + _ambient_temperature_type ambient_temperature; + typedef float _heating_power_type; + _heating_power_type heating_power; + + MotorTemperature(): + stamp(), + winding_temperature(0), + housing_temperature(0), + ambient_temperature(0), + heating_power(0) + { + } + + 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); + offset += serializeAvrFloat64(outbuffer + offset, this->winding_temperature); + offset += serializeAvrFloat64(outbuffer + offset, this->housing_temperature); + offset += serializeAvrFloat64(outbuffer + offset, this->ambient_temperature); + offset += serializeAvrFloat64(outbuffer + offset, this->heating_power); + 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); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->winding_temperature)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->housing_temperature)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ambient_temperature)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->heating_power)); + return offset; + } + + virtual const char * getType() override { return "ethercat_hardware/MotorTemperature"; }; + virtual const char * getMD5() override { return "d8c7239cd096d6f25b75bff6b63f2162"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTrace.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTrace.h new file mode 100644 index 000000000..0e53d1510 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTrace.h @@ -0,0 +1,99 @@ +#ifndef _ROS_ethercat_hardware_MotorTrace_h +#define _ROS_ethercat_hardware_MotorTrace_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ethercat_hardware/BoardInfo.h" +#include "ethercat_hardware/ActuatorInfo.h" +#include "ethercat_hardware/MotorTraceSample.h" + +namespace ethercat_hardware +{ + + class MotorTrace : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _reason_type; + _reason_type reason; + typedef ethercat_hardware::BoardInfo _board_info_type; + _board_info_type board_info; + typedef ethercat_hardware::ActuatorInfo _actuator_info_type; + _actuator_info_type actuator_info; + uint32_t samples_length; + typedef ethercat_hardware::MotorTraceSample _samples_type; + _samples_type st_samples; + _samples_type * samples; + + MotorTrace(): + header(), + reason(""), + board_info(), + actuator_info(), + samples_length(0), st_samples(), samples(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_reason = strlen(this->reason); + varToArr(outbuffer + offset, length_reason); + offset += 4; + memcpy(outbuffer + offset, this->reason, length_reason); + offset += length_reason; + offset += this->board_info.serialize(outbuffer + offset); + offset += this->actuator_info.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->samples_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->samples_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->samples_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->samples_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->samples_length); + for( uint32_t i = 0; i < samples_length; i++){ + offset += this->samples[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_reason; + arrToVar(length_reason, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reason; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reason-1]=0; + this->reason = (char *)(inbuffer + offset-1); + offset += length_reason; + offset += this->board_info.deserialize(inbuffer + offset); + offset += this->actuator_info.deserialize(inbuffer + offset); + uint32_t samples_lengthT = ((uint32_t) (*(inbuffer + offset))); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->samples_length); + if(samples_lengthT > samples_length) + this->samples = (ethercat_hardware::MotorTraceSample*)realloc(this->samples, samples_lengthT * sizeof(ethercat_hardware::MotorTraceSample)); + samples_length = samples_lengthT; + for( uint32_t i = 0; i < samples_length; i++){ + offset += this->st_samples.deserialize(inbuffer + offset); + memcpy( &(this->samples[i]), &(this->st_samples), sizeof(ethercat_hardware::MotorTraceSample)); + } + return offset; + } + + virtual const char * getType() override { return "ethercat_hardware/MotorTrace"; }; + virtual const char * getMD5() override { return "ada0b8b7f00967d292bd5bb4f59d4bd8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTraceSample.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTraceSample.h new file mode 100644 index 000000000..1cf2bf97d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/MotorTraceSample.h @@ -0,0 +1,144 @@ +#ifndef _ROS_ethercat_hardware_MotorTraceSample_h +#define _ROS_ethercat_hardware_MotorTraceSample_h + +#include +#include +#include +#include "ros/msg.h" + +namespace ethercat_hardware +{ + + class MotorTraceSample : public ros::Msg + { + public: + typedef float _timestamp_type; + _timestamp_type timestamp; + typedef bool _enabled_type; + _enabled_type enabled; + typedef float _supply_voltage_type; + _supply_voltage_type supply_voltage; + typedef float _measured_motor_voltage_type; + _measured_motor_voltage_type measured_motor_voltage; + typedef float _programmed_pwm_type; + _programmed_pwm_type programmed_pwm; + typedef float _executed_current_type; + _executed_current_type executed_current; + typedef float _measured_current_type; + _measured_current_type measured_current; + typedef float _velocity_type; + _velocity_type velocity; + typedef float _encoder_position_type; + _encoder_position_type encoder_position; + typedef uint32_t _encoder_error_count_type; + _encoder_error_count_type encoder_error_count; + typedef float _motor_voltage_error_limit_type; + _motor_voltage_error_limit_type motor_voltage_error_limit; + typedef float _filtered_motor_voltage_error_type; + _filtered_motor_voltage_error_type filtered_motor_voltage_error; + typedef float _filtered_abs_motor_voltage_error_type; + _filtered_abs_motor_voltage_error_type filtered_abs_motor_voltage_error; + typedef float _filtered_measured_voltage_error_type; + _filtered_measured_voltage_error_type filtered_measured_voltage_error; + typedef float _filtered_abs_measured_voltage_error_type; + _filtered_abs_measured_voltage_error_type filtered_abs_measured_voltage_error; + typedef float _filtered_current_error_type; + _filtered_current_error_type filtered_current_error; + typedef float _filtered_abs_current_error_type; + _filtered_abs_current_error_type filtered_abs_current_error; + + MotorTraceSample(): + timestamp(0), + enabled(0), + supply_voltage(0), + measured_motor_voltage(0), + programmed_pwm(0), + executed_current(0), + measured_current(0), + velocity(0), + encoder_position(0), + encoder_error_count(0), + motor_voltage_error_limit(0), + filtered_motor_voltage_error(0), + filtered_abs_motor_voltage_error(0), + filtered_measured_voltage_error(0), + filtered_abs_measured_voltage_error(0), + filtered_current_error(0), + filtered_abs_current_error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->timestamp); + union { + bool real; + uint8_t base; + } u_enabled; + u_enabled.real = this->enabled; + *(outbuffer + offset + 0) = (u_enabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->enabled); + offset += serializeAvrFloat64(outbuffer + offset, this->supply_voltage); + offset += serializeAvrFloat64(outbuffer + offset, this->measured_motor_voltage); + offset += serializeAvrFloat64(outbuffer + offset, this->programmed_pwm); + offset += serializeAvrFloat64(outbuffer + offset, this->executed_current); + offset += serializeAvrFloat64(outbuffer + offset, this->measured_current); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->encoder_position); + *(outbuffer + offset + 0) = (this->encoder_error_count >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->encoder_error_count >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->encoder_error_count >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->encoder_error_count >> (8 * 3)) & 0xFF; + offset += sizeof(this->encoder_error_count); + offset += serializeAvrFloat64(outbuffer + offset, this->motor_voltage_error_limit); + offset += serializeAvrFloat64(outbuffer + offset, this->filtered_motor_voltage_error); + offset += serializeAvrFloat64(outbuffer + offset, this->filtered_abs_motor_voltage_error); + offset += serializeAvrFloat64(outbuffer + offset, this->filtered_measured_voltage_error); + offset += serializeAvrFloat64(outbuffer + offset, this->filtered_abs_measured_voltage_error); + offset += serializeAvrFloat64(outbuffer + offset, this->filtered_current_error); + offset += serializeAvrFloat64(outbuffer + offset, this->filtered_abs_current_error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->timestamp)); + union { + bool real; + uint8_t base; + } u_enabled; + u_enabled.base = 0; + u_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->enabled = u_enabled.real; + offset += sizeof(this->enabled); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->supply_voltage)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->measured_motor_voltage)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->programmed_pwm)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->executed_current)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->measured_current)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->encoder_position)); + this->encoder_error_count = ((uint32_t) (*(inbuffer + offset))); + this->encoder_error_count |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->encoder_error_count |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->encoder_error_count |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->encoder_error_count); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->motor_voltage_error_limit)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->filtered_motor_voltage_error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->filtered_abs_motor_voltage_error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->filtered_measured_voltage_error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->filtered_abs_measured_voltage_error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->filtered_current_error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->filtered_abs_current_error)); + return offset; + } + + virtual const char * getType() override { return "ethercat_hardware/MotorTraceSample"; }; + virtual const char * getMD5() override { return "3734a66334bc2033448f9c561d39c5e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/RawFTData.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/RawFTData.h new file mode 100644 index 000000000..25a57b806 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/RawFTData.h @@ -0,0 +1,128 @@ +#ifndef _ROS_ethercat_hardware_RawFTData_h +#define _ROS_ethercat_hardware_RawFTData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ethercat_hardware/RawFTDataSample.h" + +namespace ethercat_hardware +{ + + class RawFTData : public ros::Msg + { + public: + uint32_t samples_length; + typedef ethercat_hardware::RawFTDataSample _samples_type; + _samples_type st_samples; + _samples_type * samples; + typedef int64_t _sample_count_type; + _sample_count_type sample_count; + typedef int64_t _missed_samples_type; + _missed_samples_type missed_samples; + + RawFTData(): + samples_length(0), st_samples(), samples(nullptr), + sample_count(0), + missed_samples(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->samples_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->samples_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->samples_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->samples_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->samples_length); + for( uint32_t i = 0; i < samples_length; i++){ + offset += this->samples[i].serialize(outbuffer + offset); + } + union { + int64_t real; + uint64_t base; + } u_sample_count; + u_sample_count.real = this->sample_count; + *(outbuffer + offset + 0) = (u_sample_count.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sample_count.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sample_count.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sample_count.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sample_count.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sample_count.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sample_count.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sample_count.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sample_count); + union { + int64_t real; + uint64_t base; + } u_missed_samples; + u_missed_samples.real = this->missed_samples; + *(outbuffer + offset + 0) = (u_missed_samples.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_missed_samples.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_missed_samples.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_missed_samples.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_missed_samples.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_missed_samples.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_missed_samples.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_missed_samples.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->missed_samples); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t samples_lengthT = ((uint32_t) (*(inbuffer + offset))); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->samples_length); + if(samples_lengthT > samples_length) + this->samples = (ethercat_hardware::RawFTDataSample*)realloc(this->samples, samples_lengthT * sizeof(ethercat_hardware::RawFTDataSample)); + samples_length = samples_lengthT; + for( uint32_t i = 0; i < samples_length; i++){ + offset += this->st_samples.deserialize(inbuffer + offset); + memcpy( &(this->samples[i]), &(this->st_samples), sizeof(ethercat_hardware::RawFTDataSample)); + } + union { + int64_t real; + uint64_t base; + } u_sample_count; + u_sample_count.base = 0; + u_sample_count.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sample_count.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sample_count.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sample_count.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sample_count.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sample_count.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sample_count.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sample_count.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sample_count = u_sample_count.real; + offset += sizeof(this->sample_count); + union { + int64_t real; + uint64_t base; + } u_missed_samples; + u_missed_samples.base = 0; + u_missed_samples.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_missed_samples.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_missed_samples.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_missed_samples.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_missed_samples.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_missed_samples.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_missed_samples.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_missed_samples.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->missed_samples = u_missed_samples.real; + offset += sizeof(this->missed_samples); + return offset; + } + + virtual const char * getType() override { return "ethercat_hardware/RawFTData"; }; + virtual const char * getMD5() override { return "85f5ed45095367bfb8fb2e57954c0b89"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/RawFTDataSample.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/RawFTDataSample.h new file mode 100644 index 000000000..32e89f33d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/RawFTDataSample.h @@ -0,0 +1,108 @@ +#ifndef _ROS_ethercat_hardware_RawFTDataSample_h +#define _ROS_ethercat_hardware_RawFTDataSample_h + +#include +#include +#include +#include "ros/msg.h" + +namespace ethercat_hardware +{ + + class RawFTDataSample : public ros::Msg + { + public: + typedef uint64_t _sample_count_type; + _sample_count_type sample_count; + uint32_t data_length; + typedef int16_t _data_type; + _data_type st_data; + _data_type * data; + typedef uint16_t _vhalf_type; + _vhalf_type vhalf; + + RawFTDataSample(): + sample_count(0), + data_length(0), st_data(), data(nullptr), + vhalf(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->sample_count >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sample_count >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sample_count >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sample_count >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->sample_count >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->sample_count >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->sample_count >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->sample_count >> (8 * 7)) & 0xFF; + offset += sizeof(this->sample_count); + *(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 { + int16_t real; + uint16_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; + offset += sizeof(this->data[i]); + } + *(outbuffer + offset + 0) = (this->vhalf >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vhalf >> (8 * 1)) & 0xFF; + offset += sizeof(this->vhalf); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->sample_count = ((uint64_t) (*(inbuffer + offset))); + this->sample_count |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sample_count |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sample_count |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sample_count |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->sample_count |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->sample_count |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->sample_count |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->sample_count); + 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 = (int16_t*)realloc(this->data, data_lengthT * sizeof(int16_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int16_t)); + } + this->vhalf = ((uint16_t) (*(inbuffer + offset))); + this->vhalf |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->vhalf); + return offset; + } + + virtual const char * getType() override { return "ethercat_hardware/RawFTDataSample"; }; + virtual const char * getMD5() override { return "6c3b6e352fd24802b2d95b606df80de6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorFirmwareRead.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorFirmwareRead.h new file mode 100644 index 000000000..1edc68e92 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorFirmwareRead.h @@ -0,0 +1,172 @@ +#ifndef _ROS_SERVICE_SoftProcessorFirmwareRead_h +#define _ROS_SERVICE_SoftProcessorFirmwareRead_h +#include +#include +#include +#include "ros/msg.h" + +namespace ethercat_hardware +{ + +static const char SOFTPROCESSORFIRMWAREREAD[] = "ethercat_hardware/SoftProcessorFirmwareRead"; + + class SoftProcessorFirmwareReadRequest : public ros::Msg + { + public: + typedef const char* _actuator_name_type; + _actuator_name_type actuator_name; + typedef const char* _processor_name_type; + _processor_name_type processor_name; + + SoftProcessorFirmwareReadRequest(): + actuator_name(""), + processor_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_actuator_name = strlen(this->actuator_name); + varToArr(outbuffer + offset, length_actuator_name); + offset += 4; + memcpy(outbuffer + offset, this->actuator_name, length_actuator_name); + offset += length_actuator_name; + uint32_t length_processor_name = strlen(this->processor_name); + varToArr(outbuffer + offset, length_processor_name); + offset += 4; + memcpy(outbuffer + offset, this->processor_name, length_processor_name); + offset += length_processor_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_actuator_name; + arrToVar(length_actuator_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_actuator_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_actuator_name-1]=0; + this->actuator_name = (char *)(inbuffer + offset-1); + offset += length_actuator_name; + uint32_t length_processor_name; + arrToVar(length_processor_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_processor_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_processor_name-1]=0; + this->processor_name = (char *)(inbuffer + offset-1); + offset += length_processor_name; + return offset; + } + + virtual const char * getType() override { return SOFTPROCESSORFIRMWAREREAD; }; + virtual const char * getMD5() override { return "777be25d71e9e85e62fa14223ffddb6b"; }; + + }; + + class SoftProcessorFirmwareReadResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_msg_type; + _error_msg_type error_msg; + uint32_t instructions_length; + typedef uint32_t _instructions_type; + _instructions_type st_instructions; + _instructions_type * instructions; + + SoftProcessorFirmwareReadResponse(): + success(0), + error_msg(""), + instructions_length(0), st_instructions(), instructions(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); + uint32_t length_error_msg = strlen(this->error_msg); + varToArr(outbuffer + offset, length_error_msg); + offset += 4; + memcpy(outbuffer + offset, this->error_msg, length_error_msg); + offset += length_error_msg; + *(outbuffer + offset + 0) = (this->instructions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->instructions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->instructions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->instructions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->instructions_length); + for( uint32_t i = 0; i < instructions_length; i++){ + *(outbuffer + offset + 0) = (this->instructions[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->instructions[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->instructions[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->instructions[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->instructions[i]); + } + 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_error_msg; + arrToVar(length_error_msg, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_msg-1]=0; + this->error_msg = (char *)(inbuffer + offset-1); + offset += length_error_msg; + uint32_t instructions_lengthT = ((uint32_t) (*(inbuffer + offset))); + instructions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + instructions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + instructions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->instructions_length); + if(instructions_lengthT > instructions_length) + this->instructions = (uint32_t*)realloc(this->instructions, instructions_lengthT * sizeof(uint32_t)); + instructions_length = instructions_lengthT; + for( uint32_t i = 0; i < instructions_length; i++){ + this->st_instructions = ((uint32_t) (*(inbuffer + offset))); + this->st_instructions |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_instructions |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_instructions |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_instructions); + memcpy( &(this->instructions[i]), &(this->st_instructions), sizeof(uint32_t)); + } + return offset; + } + + virtual const char * getType() override { return SOFTPROCESSORFIRMWAREREAD; }; + virtual const char * getMD5() override { return "d36ea5e74d6ac75d45ab5ae553b4d4e6"; }; + + }; + + class SoftProcessorFirmwareRead { + public: + typedef SoftProcessorFirmwareReadRequest Request; + typedef SoftProcessorFirmwareReadResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorFirmwareWrite.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorFirmwareWrite.h new file mode 100644 index 000000000..46bcc08f6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorFirmwareWrite.h @@ -0,0 +1,172 @@ +#ifndef _ROS_SERVICE_SoftProcessorFirmwareWrite_h +#define _ROS_SERVICE_SoftProcessorFirmwareWrite_h +#include +#include +#include +#include "ros/msg.h" + +namespace ethercat_hardware +{ + +static const char SOFTPROCESSORFIRMWAREWRITE[] = "ethercat_hardware/SoftProcessorFirmwareWrite"; + + class SoftProcessorFirmwareWriteRequest : public ros::Msg + { + public: + typedef const char* _actuator_name_type; + _actuator_name_type actuator_name; + typedef const char* _processor_name_type; + _processor_name_type processor_name; + uint32_t instructions_length; + typedef uint32_t _instructions_type; + _instructions_type st_instructions; + _instructions_type * instructions; + + SoftProcessorFirmwareWriteRequest(): + actuator_name(""), + processor_name(""), + instructions_length(0), st_instructions(), instructions(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_actuator_name = strlen(this->actuator_name); + varToArr(outbuffer + offset, length_actuator_name); + offset += 4; + memcpy(outbuffer + offset, this->actuator_name, length_actuator_name); + offset += length_actuator_name; + uint32_t length_processor_name = strlen(this->processor_name); + varToArr(outbuffer + offset, length_processor_name); + offset += 4; + memcpy(outbuffer + offset, this->processor_name, length_processor_name); + offset += length_processor_name; + *(outbuffer + offset + 0) = (this->instructions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->instructions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->instructions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->instructions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->instructions_length); + for( uint32_t i = 0; i < instructions_length; i++){ + *(outbuffer + offset + 0) = (this->instructions[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->instructions[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->instructions[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->instructions[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->instructions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_actuator_name; + arrToVar(length_actuator_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_actuator_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_actuator_name-1]=0; + this->actuator_name = (char *)(inbuffer + offset-1); + offset += length_actuator_name; + uint32_t length_processor_name; + arrToVar(length_processor_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_processor_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_processor_name-1]=0; + this->processor_name = (char *)(inbuffer + offset-1); + offset += length_processor_name; + uint32_t instructions_lengthT = ((uint32_t) (*(inbuffer + offset))); + instructions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + instructions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + instructions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->instructions_length); + if(instructions_lengthT > instructions_length) + this->instructions = (uint32_t*)realloc(this->instructions, instructions_lengthT * sizeof(uint32_t)); + instructions_length = instructions_lengthT; + for( uint32_t i = 0; i < instructions_length; i++){ + this->st_instructions = ((uint32_t) (*(inbuffer + offset))); + this->st_instructions |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_instructions |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_instructions |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_instructions); + memcpy( &(this->instructions[i]), &(this->st_instructions), sizeof(uint32_t)); + } + return offset; + } + + virtual const char * getType() override { return SOFTPROCESSORFIRMWAREWRITE; }; + virtual const char * getMD5() override { return "5234f035d5f911e880df479ac901a6e0"; }; + + }; + + class SoftProcessorFirmwareWriteResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_msg_type; + _error_msg_type error_msg; + + SoftProcessorFirmwareWriteResponse(): + success(0), + error_msg("") + { + } + + 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_error_msg = strlen(this->error_msg); + varToArr(outbuffer + offset, length_error_msg); + offset += 4; + memcpy(outbuffer + offset, this->error_msg, length_error_msg); + offset += length_error_msg; + 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_error_msg; + arrToVar(length_error_msg, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_msg-1]=0; + this->error_msg = (char *)(inbuffer + offset-1); + offset += length_error_msg; + return offset; + } + + virtual const char * getType() override { return SOFTPROCESSORFIRMWAREWRITE; }; + virtual const char * getMD5() override { return "d006c48be24db1173a071ca9af4c8179"; }; + + }; + + class SoftProcessorFirmwareWrite { + public: + typedef SoftProcessorFirmwareWriteRequest Request; + typedef SoftProcessorFirmwareWriteResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorReset.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorReset.h new file mode 100644 index 000000000..b8eb75b21 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_hardware/SoftProcessorReset.h @@ -0,0 +1,139 @@ +#ifndef _ROS_SERVICE_SoftProcessorReset_h +#define _ROS_SERVICE_SoftProcessorReset_h +#include +#include +#include +#include "ros/msg.h" + +namespace ethercat_hardware +{ + +static const char SOFTPROCESSORRESET[] = "ethercat_hardware/SoftProcessorReset"; + + class SoftProcessorResetRequest : public ros::Msg + { + public: + typedef const char* _actuator_name_type; + _actuator_name_type actuator_name; + typedef const char* _processor_name_type; + _processor_name_type processor_name; + + SoftProcessorResetRequest(): + actuator_name(""), + processor_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_actuator_name = strlen(this->actuator_name); + varToArr(outbuffer + offset, length_actuator_name); + offset += 4; + memcpy(outbuffer + offset, this->actuator_name, length_actuator_name); + offset += length_actuator_name; + uint32_t length_processor_name = strlen(this->processor_name); + varToArr(outbuffer + offset, length_processor_name); + offset += 4; + memcpy(outbuffer + offset, this->processor_name, length_processor_name); + offset += length_processor_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_actuator_name; + arrToVar(length_actuator_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_actuator_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_actuator_name-1]=0; + this->actuator_name = (char *)(inbuffer + offset-1); + offset += length_actuator_name; + uint32_t length_processor_name; + arrToVar(length_processor_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_processor_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_processor_name-1]=0; + this->processor_name = (char *)(inbuffer + offset-1); + offset += length_processor_name; + return offset; + } + + virtual const char * getType() override { return SOFTPROCESSORRESET; }; + virtual const char * getMD5() override { return "777be25d71e9e85e62fa14223ffddb6b"; }; + + }; + + class SoftProcessorResetResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_msg_type; + _error_msg_type error_msg; + + SoftProcessorResetResponse(): + success(0), + error_msg("") + { + } + + 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_error_msg = strlen(this->error_msg); + varToArr(outbuffer + offset, length_error_msg); + offset += 4; + memcpy(outbuffer + offset, this->error_msg, length_error_msg); + offset += length_error_msg; + 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_error_msg; + arrToVar(length_error_msg, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_msg-1]=0; + this->error_msg = (char *)(inbuffer + offset-1); + offset += length_error_msg; + return offset; + } + + virtual const char * getType() override { return SOFTPROCESSORRESET; }; + virtual const char * getMD5() override { return "d006c48be24db1173a071ca9af4c8179"; }; + + }; + + class SoftProcessorReset { + public: + typedef SoftProcessorResetRequest Request; + typedef SoftProcessorResetResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/MultiWaveform.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/MultiWaveform.h new file mode 100644 index 000000000..fcd8cd19a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/MultiWaveform.h @@ -0,0 +1,74 @@ +#ifndef _ROS_ethercat_trigger_controllers_MultiWaveform_h +#define _ROS_ethercat_trigger_controllers_MultiWaveform_h + +#include +#include +#include +#include "ros/msg.h" +#include "ethercat_trigger_controllers/MultiWaveformTransition.h" + +namespace ethercat_trigger_controllers +{ + + class MultiWaveform : public ros::Msg + { + public: + typedef float _period_type; + _period_type period; + typedef float _zero_offset_type; + _zero_offset_type zero_offset; + uint32_t transitions_length; + typedef ethercat_trigger_controllers::MultiWaveformTransition _transitions_type; + _transitions_type st_transitions; + _transitions_type * transitions; + + MultiWaveform(): + period(0), + zero_offset(0), + transitions_length(0), st_transitions(), transitions(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->period); + offset += serializeAvrFloat64(outbuffer + offset, this->zero_offset); + *(outbuffer + offset + 0) = (this->transitions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->transitions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->transitions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->transitions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->transitions_length); + for( uint32_t i = 0; i < transitions_length; i++){ + offset += this->transitions[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->period)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->zero_offset)); + uint32_t transitions_lengthT = ((uint32_t) (*(inbuffer + offset))); + transitions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + transitions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + transitions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->transitions_length); + if(transitions_lengthT > transitions_length) + this->transitions = (ethercat_trigger_controllers::MultiWaveformTransition*)realloc(this->transitions, transitions_lengthT * sizeof(ethercat_trigger_controllers::MultiWaveformTransition)); + transitions_length = transitions_lengthT; + for( uint32_t i = 0; i < transitions_length; i++){ + offset += this->st_transitions.deserialize(inbuffer + offset); + memcpy( &(this->transitions[i]), &(this->st_transitions), sizeof(ethercat_trigger_controllers::MultiWaveformTransition)); + } + return offset; + } + + virtual const char * getType() override { return "ethercat_trigger_controllers/MultiWaveform"; }; + virtual const char * getMD5() override { return "6a8e166563c159e73f391a302e7b37f6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/MultiWaveformTransition.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/MultiWaveformTransition.h new file mode 100644 index 000000000..2e38968bb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/MultiWaveformTransition.h @@ -0,0 +1,73 @@ +#ifndef _ROS_ethercat_trigger_controllers_MultiWaveformTransition_h +#define _ROS_ethercat_trigger_controllers_MultiWaveformTransition_h + +#include +#include +#include +#include "ros/msg.h" + +namespace ethercat_trigger_controllers +{ + + class MultiWaveformTransition : public ros::Msg + { + public: + typedef float _time_type; + _time_type time; + typedef uint32_t _value_type; + _value_type value; + typedef const char* _topic_type; + _topic_type topic; + + MultiWaveformTransition(): + time(0), + value(0), + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->time); + *(outbuffer + offset + 0) = (this->value >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->value >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->value >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->value >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time)); + this->value = ((uint32_t) (*(inbuffer + offset))); + this->value |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->value |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->value |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->value); + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return "ethercat_trigger_controllers/MultiWaveformTransition"; }; + virtual const char * getMD5() override { return "bdd47e5d1c3d77473af2df9833a0608a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/SetMultiWaveform.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/SetMultiWaveform.h new file mode 100644 index 000000000..995815fb2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/SetMultiWaveform.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_SetMultiWaveform_h +#define _ROS_SERVICE_SetMultiWaveform_h +#include +#include +#include +#include "ros/msg.h" +#include "ethercat_trigger_controllers/MultiWaveform.h" + +namespace ethercat_trigger_controllers +{ + +static const char SETMULTIWAVEFORM[] = "ethercat_trigger_controllers/SetMultiWaveform"; + + class SetMultiWaveformRequest : public ros::Msg + { + public: + typedef ethercat_trigger_controllers::MultiWaveform _waveform_type; + _waveform_type waveform; + + SetMultiWaveformRequest(): + waveform() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->waveform.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->waveform.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETMULTIWAVEFORM; }; + virtual const char * getMD5() override { return "bfedad8205348a9bcc90e6ae4b778d86"; }; + + }; + + class SetMultiWaveformResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetMultiWaveformResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETMULTIWAVEFORM; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetMultiWaveform { + public: + typedef SetMultiWaveformRequest Request; + typedef SetMultiWaveformResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/SetWaveform.h b/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/SetWaveform.h new file mode 100644 index 000000000..5fd88c66e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ethercat_trigger_controllers/SetWaveform.h @@ -0,0 +1,157 @@ +#ifndef _ROS_SERVICE_SetWaveform_h +#define _ROS_SERVICE_SetWaveform_h +#include +#include +#include +#include "ros/msg.h" + +namespace ethercat_trigger_controllers +{ + +static const char SETWAVEFORM[] = "ethercat_trigger_controllers/SetWaveform"; + + class SetWaveformRequest : public ros::Msg + { + public: + typedef float _rep_rate_type; + _rep_rate_type rep_rate; + typedef float _phase_type; + _phase_type phase; + typedef float _duty_cycle_type; + _duty_cycle_type duty_cycle; + typedef int32_t _running_type; + _running_type running; + typedef int32_t _active_low_type; + _active_low_type active_low; + typedef int32_t _pulsed_type; + _pulsed_type pulsed; + + SetWaveformRequest(): + rep_rate(0), + phase(0), + duty_cycle(0), + running(0), + active_low(0), + pulsed(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->rep_rate); + offset += serializeAvrFloat64(outbuffer + offset, this->phase); + offset += serializeAvrFloat64(outbuffer + offset, this->duty_cycle); + union { + int32_t real; + uint32_t base; + } u_running; + u_running.real = this->running; + *(outbuffer + offset + 0) = (u_running.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_running.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_running.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_running.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->running); + union { + int32_t real; + uint32_t base; + } u_active_low; + u_active_low.real = this->active_low; + *(outbuffer + offset + 0) = (u_active_low.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_active_low.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_active_low.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_active_low.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->active_low); + union { + int32_t real; + uint32_t base; + } u_pulsed; + u_pulsed.real = this->pulsed; + *(outbuffer + offset + 0) = (u_pulsed.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_pulsed.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_pulsed.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_pulsed.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->pulsed); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->rep_rate)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->phase)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->duty_cycle)); + union { + int32_t real; + uint32_t base; + } u_running; + u_running.base = 0; + u_running.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_running.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_running.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_running.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->running = u_running.real; + offset += sizeof(this->running); + union { + int32_t real; + uint32_t base; + } u_active_low; + u_active_low.base = 0; + u_active_low.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_active_low.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_active_low.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_active_low.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->active_low = u_active_low.real; + offset += sizeof(this->active_low); + union { + int32_t real; + uint32_t base; + } u_pulsed; + u_pulsed.base = 0; + u_pulsed.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_pulsed.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_pulsed.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_pulsed.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->pulsed = u_pulsed.real; + offset += sizeof(this->pulsed); + return offset; + } + + virtual const char * getType() override { return SETWAVEFORM; }; + virtual const char * getMD5() override { return "988450e1ddd386f3967c381c19b2330c"; }; + + }; + + class SetWaveformResponse : public ros::Msg + { + public: + + SetWaveformResponse() + { + } + + 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 SETWAVEFORM; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetWaveform { + public: + typedef SetWaveformRequest Request; + typedef SetWaveformResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/ADC/ADC.pde b/smart_device_protocol/ros_lib/ros_lib/examples/ADC/ADC.pde new file mode 100644 index 000000000..a6cabe90b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/ADC/ADC.pde @@ -0,0 +1,52 @@ +/* + * rosserial ADC Example + * + * This is a poor man's Oscilloscope. It does not have the sampling + * rate or accuracy of a commerical scope, but it is great to get + * an analog value into ROS in a pinch. + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif +#include +#include + +ros::NodeHandle nh; + +rosserial_arduino::Adc adc_msg; +ros::Publisher p("adc", &adc_msg); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + + nh.advertise(p); +} + +//We average the analog reading to elminate some of the noise +int averageAnalog(int pin){ + int v=0; + for(int i=0; i<4; i++) v+= analogRead(pin); + return v/4; +} + +long adc_timer; + +void loop() +{ + adc_msg.adc0 = averageAnalog(0); + adc_msg.adc1 = averageAnalog(1); + adc_msg.adc2 = averageAnalog(2); + adc_msg.adc3 = averageAnalog(3); + adc_msg.adc4 = averageAnalog(4); + adc_msg.adc5 = averageAnalog(5); + + p.publish(&adc_msg); + + nh.spinOnce(); +} + diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/Blink/Blink.pde b/smart_device_protocol/ros_lib/ros_lib/examples/Blink/Blink.pde new file mode 100644 index 000000000..041c4df11 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/Blink/Blink.pde @@ -0,0 +1,29 @@ +/* + * rosserial Subscriber Example + * Blinks an LED on callback + */ + +#include +#include + +ros::NodeHandle nh; + +void messageCb( const std_msgs::Empty& toggle_msg){ + digitalWrite(LED_BUILTIN, HIGH-digitalRead(LED_BUILTIN)); // blink the led +} + +ros::Subscriber sub("toggle_led", &messageCb ); + +void setup() +{ + pinMode(LED_BUILTIN, OUTPUT); + nh.initNode(); + nh.subscribe(sub); +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/BlinkM/BlinkM.pde b/smart_device_protocol/ros_lib/ros_lib/examples/BlinkM/BlinkM.pde new file mode 100644 index 000000000..f54ea286d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/BlinkM/BlinkM.pde @@ -0,0 +1,162 @@ +/* +* RosSerial BlinkM Example +* This program shows how to control a blinkm +* from an arduino using RosSerial +*/ + +#include + + +#include +#include + + +//include Wire/ twi for the BlinkM +#include +extern "C" { +#include "utility/twi.h" +} + +#include "BlinkM_funcs.h" +const byte blinkm_addr = 0x09; //default blinkm address + + +void setLED( bool solid, char color) +{ + + if (solid) + { + switch (color) + { + + case 'w': // white + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0xff,0xff); + break; + + case 'r': //RED + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0,0); + break; + + case 'g':// Green + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0xff,0); + break; + + case 'b':// Blue + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0,0xff); + break; + + case 'c':// Cyan + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0xff,0xff); + break; + + case 'm': // Magenta + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0,0xff); + break; + + case 'y': // yellow + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0xff,0); + break; + + default: // Black + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0,0); + break; + } + } + + + else + { + switch (color) + { + case 'r': // Blink Red + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 3,0,0 ); + break; + case 'w': // Blink white + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 2,0,0 ); + break; + case 'g': // Blink Green + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 4,0,0 ); + break; + + case 'b': // Blink Blue + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 5,0,0 ); + break; + + case 'c': //Blink Cyan + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 6,0,0 ); + break; + + case 'm': //Blink Magenta + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 7,0,0 ); + break; + + case 'y': //Blink Yellow + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 8,0,0 ); + break; + + default: //OFF + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 9,0,0 ); + break; + } + + } +} + +void light_cb( const std_msgs::String& light_cmd){ + bool solid =false; + char color; + if (strlen( (const char* ) light_cmd.data) ==2 ){ + solid = (light_cmd.data[0] == 'S') || (light_cmd.data[0] == 's'); + color = light_cmd.data[1]; + } + else{ + solid= false; + color = light_cmd.data[0]; + } + + setLED(solid, color); +} + + + +ros::NodeHandle nh; +ros::Subscriber sub("blinkm" , light_cb); + + +void setup() +{ + + pinMode(13, OUTPUT); //set up the LED + + BlinkM_beginWithPower(); + delay(100); + BlinkM_stopScript(blinkm_addr); // turn off startup script + setLED(false, 0); //turn off the led + + nh.initNode(); + nh.subscribe(sub); + +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/BlinkM/BlinkM_funcs.h b/smart_device_protocol/ros_lib/ros_lib/examples/BlinkM/BlinkM_funcs.h new file mode 100644 index 000000000..94cabeb03 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/BlinkM/BlinkM_funcs.h @@ -0,0 +1,440 @@ +/* + * BlinkM_funcs.h -- Arduino 'library' to control BlinkM + * -------------- + * + * + * Note: original version of this file lives with the BlinkMTester sketch + * + * Note: all the functions are declared 'static' because + * it saves about 1.5 kbyte in code space in final compiled sketch. + * A C++ library of this costs a 1kB more. + * + * 2007-8, Tod E. Kurt, ThingM, http://thingm.com/ + * + * version: 20081101 + * + * history: + * 20080101 - initial release + * 20080203 - added setStartupParam(), bugfix receiveBytes() from Dan Julio + * 20081101 - fixed to work with Arduino-0012, added MaxM commands, + * added test script read/write functions, cleaned up some functions + * 20090121 - added I2C bus scan functions, has dependencies on private + * functions inside Wire library, so might break in the future + * 20100420 - added BlinkM_startPower and _stopPower + * + */ + +#include + +extern "C" { +#include "utility/twi.h" // from Wire library, so we can do bus scanning +} + + +// format of light script lines: duration, command, arg1,arg2,arg3 +typedef struct _blinkm_script_line { + uint8_t dur; + uint8_t cmd[4]; // cmd,arg1,arg2,arg3 +} blinkm_script_line; + + +// Call this first (when powering BlinkM from a power supply) +static void BlinkM_begin() +{ + Wire.begin(); // join i2c bus (address optional for master) +} + +/* + * actually can't do this either, because twi_init() has THREE callocs in it too + * +static void BlinkM_reset() +{ + twi_init(); // can't just call Wire.begin() again because of calloc()s there +} +*/ + +// +// each call to twi_writeTo() should return 0 if device is there +// or other value (usually 2) if nothing is at that address +// +static void BlinkM_scanI2CBus(byte from, byte to, + void(*callback)(byte add, byte result) ) +{ + byte rc; + byte data = 0; // not used, just an address to feed to twi_writeTo() + for( byte addr = from; addr <= to; addr++ ) { + rc = twi_writeTo(addr, &data, 0, 1, 1); + callback( addr, rc ); + } +} + +// +// +static int8_t BlinkM_findFirstI2CDevice() +{ + byte rc; + byte data = 0; // not used, just an address to feed to twi_writeTo() + for( byte addr=1; addr < 120; addr++ ) { // only scan addrs 1-120 + rc = twi_writeTo(addr, &data, 0, 1, 1); + if( rc == 0 ) return addr; // found an address + } + return -1; // no device found in range given +} + +// FIXME: make this more Arduino-like +static void BlinkM_startPowerWithPins(byte pwrpin, byte gndpin) +{ + DDRC |= _BV(pwrpin) | _BV(gndpin); // make outputs + PORTC &=~ _BV(gndpin); + PORTC |= _BV(pwrpin); +} + +// FIXME: make this more Arduino-like +static void BlinkM_stopPowerWithPins(byte pwrpin, byte gndpin) +{ + DDRC &=~ (_BV(pwrpin) | _BV(gndpin)); +} + +// +static void BlinkM_startPower() +{ + BlinkM_startPowerWithPins( PORTC3, PORTC2 ); +} + +// +static void BlinkM_stopPower() +{ + BlinkM_stopPowerWithPins( PORTC3, PORTC2 ); +} + +// General version of BlinkM_beginWithPower(). +// Call this first when BlinkM is plugged directly into Arduino +static void BlinkM_beginWithPowerPins(byte pwrpin, byte gndpin) +{ + BlinkM_startPowerWithPins(pwrpin,gndpin); + delay(100); // wait for things to stabilize + Wire.begin(); +} + +// Call this first when BlinkM is plugged directly into Arduino +// FIXME: make this more Arduino-like +static void BlinkM_beginWithPower() +{ + BlinkM_beginWithPowerPins( PORTC3, PORTC2 ); +} + +// sends a generic command +static void BlinkM_sendCmd(byte addr, byte* cmd, int cmdlen) +{ + Wire.beginTransmission(addr); + for( byte i=0; idur = Wire.read(); + script_line->cmd[0] = Wire.read(); + script_line->cmd[1] = Wire.read(); + script_line->cmd[2] = Wire.read(); + script_line->cmd[3] = Wire.read(); +} + +// +static void BlinkM_writeScriptLine(byte addr, byte script_id, + byte pos, byte dur, + byte cmd, byte arg1, byte arg2, byte arg3) +{ +#ifdef BLINKM_FUNCS_DEBUG + Serial.print("writing line:"); Serial.print(pos,DEC); + Serial.print(" with cmd:"); Serial.print(cmd); + Serial.print(" arg1:"); Serial.println(arg1,HEX); +#endif + Wire.beginTransmission(addr); + Wire.write('W'); + Wire.write(script_id); + Wire.write(pos); + Wire.write(dur); + Wire.write(cmd); + Wire.write(arg1); + Wire.write(arg2); + Wire.write(arg3); + Wire.endTransmission(); + +} + +// +static void BlinkM_writeScript(byte addr, byte script_id, + byte len, byte reps, + blinkm_script_line* lines) +{ +#ifdef BLINKM_FUNCS_DEBUG + Serial.print("writing script to addr:"); Serial.print(addr,DEC); + Serial.print(", script_id:"); Serial.println(script_id,DEC); +#endif + for(byte i=0; i < len; i++) { + blinkm_script_line l = lines[i]; + BlinkM_writeScriptLine( addr, script_id, i, l.dur, + l.cmd[0], l.cmd[1], l.cmd[2], l.cmd[3]); + delay(20); // must wait for EEPROM to be programmed + } + BlinkM_setScriptLengthReps(addr, script_id, len, reps); +} + +// +static void BlinkM_setStartupParams(byte addr, byte mode, byte script_id, + byte reps, byte fadespeed, byte timeadj) +{ + Wire.beginTransmission(addr); + Wire.write('B'); + Wire.write(mode); // default 0x01 == Play script + Wire.write(script_id); // default 0x00 == script #0 + Wire.write(reps); // default 0x00 == repeat infinitely + Wire.write(fadespeed); // default 0x08 == usually overridden by sketch + Wire.write(timeadj); // default 0x00 == sometimes overridden by sketch + Wire.endTransmission(); +} + + +// Gets digital inputs of the BlinkM +// returns -1 on failure +static int BlinkM_getInputsO(byte addr) +{ + Wire.beginTransmission(addr); + Wire.write('i'); + Wire.endTransmission(); + Wire.requestFrom(addr, (byte)1); + if( Wire.available() ) { + byte b = Wire.read(); + return b; + } + return -1; +} + +// Gets digital inputs of the BlinkM +// stores them in passed in array +// returns -1 on failure +static int BlinkM_getInputs(byte addr, byte inputs[]) +{ + Wire.beginTransmission(addr); + Wire.write('i'); + Wire.endTransmission(); + Wire.requestFrom(addr, (byte)4); + while( Wire.available() < 4 ) ; // FIXME: wait until we get 4 bytes + + inputs[0] = Wire.read(); + inputs[1] = Wire.read(); + inputs[2] = Wire.read(); + inputs[3] = Wire.read(); + + return 0; +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/BlinkerWithClass/BlinkerWithClass.ino b/smart_device_protocol/ros_lib/ros_lib/examples/BlinkerWithClass/BlinkerWithClass.ino new file mode 100644 index 000000000..4e04b5425 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/BlinkerWithClass/BlinkerWithClass.ino @@ -0,0 +1,70 @@ +#include +#include +#include + +ros::NodeHandle nh; + +class Blinker +{ +public: + Blinker(byte pin, uint16_t period) + : pin_(pin), period_(period), + subscriber_("set_blink_period", &Blinker::set_period_callback, this), + service_server_("activate_blinker", &Blinker::service_callback, this) + {} + + void init(ros::NodeHandle& nh) + { + pinMode(pin_, OUTPUT); + nh.subscribe(subscriber_); + nh.advertiseService(service_server_); + } + + void run() + { + if(active_ && ((millis() - last_time_) >= period_)) + { + last_time_ = millis(); + digitalWrite(pin_, !digitalRead(pin_)); + } + } + + void set_period_callback(const std_msgs::UInt16& msg) + { + period_ = msg.data; + } + + void service_callback(const std_srvs::SetBool::Request& req, + std_srvs::SetBool::Response& res) + { + active_ = req.data; + res.success = true; + if(req.data) + res.message = "Blinker ON"; + else + res.message = "Blinker OFF"; + } + +private: + const byte pin_; + bool active_ = true; + uint16_t period_; + uint32_t last_time_; + ros::Subscriber subscriber_; + ros::ServiceServer service_server_; +}; + +Blinker blinker(LED_BUILTIN, 500); + +void setup() +{ + nh.initNode(); + blinker.init(nh); +} + +void loop() +{ + blinker.run(); + nh.spinOnce(); + delay(1); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/Clapper/Clapper.pde b/smart_device_protocol/ros_lib/ros_lib/examples/Clapper/Clapper.pde new file mode 100644 index 000000000..712b6f9f9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/Clapper/Clapper.pde @@ -0,0 +1,94 @@ +/* + * rosserial Clapper Example + * + * This code is a very simple example of the kinds of + * custom sensors that you can easily set up with rosserial + * and Arduino. This code uses a microphone attached to + * analog pin 5 detect two claps (2 loud sounds). + * You can use this clapper, for example, to command a robot + * in the area to come do your bidding. + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif +#include +#include + +ros::NodeHandle nh; + +std_msgs::Empty clap_msg; +ros::Publisher p("clap", &clap_msg); + +enum clapper_state { clap1, clap_one_waiting, pause, clap2}; +clapper_state clap; + +int volume_thresh = 200; //a clap sound needs to be: + //abs(clap_volume) > average noise + volume_thresh +int mic_pin = 5; +int adc_ave=0; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + + nh.advertise(p); + + //measure the average volume of the noise in the area + for (int i =0; i<10;i++) adc_ave += analogRead(mic_pin); + adc_ave /= 10; +} + +long event_timer; + +void loop() +{ + int mic_val = 0; + for(int i=0; i<4; i++) mic_val += analogRead(mic_pin); + + mic_val = mic_val/4-adc_ave; + + switch(clap){ + case clap1: + if (abs(mic_val) > volume_thresh){ + clap = clap_one_waiting; + event_timer = millis(); + } + break; + case clap_one_waiting: + if ( (abs(mic_val) < 30) && ( (millis() - event_timer) > 20 ) ) + { + clap= pause; + event_timer = millis(); + + } + break; + case pause: // make sure there is a pause between + // the loud sounds + if ( mic_val > volume_thresh) + { + clap = clap1; + + } + else if ( (millis()-event_timer)> 60) { + clap = clap2; + event_timer = millis(); + + } + break; + case clap2: + if (abs(mic_val) > volume_thresh){ //we have got a double clap! + clap = clap1; + p.publish(&clap_msg); + } + else if ( (millis()-event_timer)> 200) { + clap= clap1; // no clap detected, reset state machine + } + + break; + } + nh.spinOnce(); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/Esp8266HelloWorld/Esp8266HelloWorld.ino b/smart_device_protocol/ros_lib/ros_lib/examples/Esp8266HelloWorld/Esp8266HelloWorld.ino new file mode 100644 index 000000000..0e4cf9128 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/Esp8266HelloWorld/Esp8266HelloWorld.ino @@ -0,0 +1,75 @@ +/* + * rosserial Publisher Example + * Prints "hello world!" + * This intend to connect to a Wifi Access Point + * and a rosserial socket server. + * You can launch the rosserial socket server with + * roslaunch rosserial_server socket.launch + * The default port is 11411 + * + */ +#include +#include +#include + +const char* ssid = "your-ssid"; +const char* password = "your-password"; +// Set the rosserial socket server IP address +IPAddress server(192,168,1,1); +// Set the rosserial socket server port +const uint16_t serverPort = 11411; + +ros::NodeHandle nh; +// Make a chatter publisher +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +// Be polite and say hello +char hello[13] = "hello world!"; + +void setup() +{ + // Use ESP8266 serial to monitor the process + Serial.begin(115200); + Serial.println(); + Serial.print("Connecting to "); + Serial.println(ssid); + + // Connect the ESP8266 the the wifi AP + WiFi.begin(ssid, password); + while (WiFi.status() != WL_CONNECTED) { + delay(500); + Serial.print("."); + } + Serial.println(""); + Serial.println("WiFi connected"); + Serial.println("IP address: "); + Serial.println(WiFi.localIP()); + + // Set the connection to rosserial socket server + nh.getHardware()->setConnection(server, serverPort); + nh.initNode(); + + // Another way to get IP + Serial.print("IP = "); + Serial.println(nh.getHardware()->getLocalIP()); + + // Start to be polite + nh.advertise(chatter); +} + +void loop() +{ + + if (nh.connected()) { + Serial.println("Connected"); + // Say hello + str_msg.data = hello; + chatter.publish( &str_msg ); + } else { + Serial.println("Not Connected"); + } + nh.spinOnce(); + // Loop exproximativly at 1Hz + delay(1000); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/HelloWorld/HelloWorld.pde b/smart_device_protocol/ros_lib/ros_lib/examples/HelloWorld/HelloWorld.pde new file mode 100644 index 000000000..247441315 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/HelloWorld/HelloWorld.pde @@ -0,0 +1,28 @@ +/* + * rosserial Publisher Example + * Prints "hello world!" + */ + +#include +#include + +ros::NodeHandle nh; + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(1000); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/IrRanger/IrRanger.pde b/smart_device_protocol/ros_lib/ros_lib/examples/IrRanger/IrRanger.pde new file mode 100644 index 000000000..240b5a107 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/IrRanger/IrRanger.pde @@ -0,0 +1,64 @@ +/* + * rosserial IR Ranger Example + * + * This example is calibrated for the Sharp GP2D120XJ00F. + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +sensor_msgs::Range range_msg; +ros::Publisher pub_range( "range_data", &range_msg); + +const int analog_pin = 0; +unsigned long range_timer; + +/* + * getRange() - samples the analog input from the ranger + * and converts it into meters. + */ +float getRange(int pin_num){ + int sample; + // Get data + sample = analogRead(pin_num)/4; + // if the ADC reading is too low, + // then we are really far away from anything + if(sample < 10) + return 254; // max range + // Magic numbers to get cm + sample= 1309/(sample-3); + return (sample - 1)/100; //convert to meters +} + +char frameid[] = "/ir_ranger"; + +void setup() +{ + nh.initNode(); + nh.advertise(pub_range); + + range_msg.radiation_type = sensor_msgs::Range::INFRARED; + range_msg.header.frame_id = frameid; + range_msg.field_of_view = 0.01; + range_msg.min_range = 0.03; + range_msg.max_range = 0.4; + +} + +void loop() +{ + // publish the range value every 50 milliseconds + // since it takes that long for the sensor to stabilize + if ( (millis()-range_timer) > 50){ + range_msg.range = getRange(analog_pin); + range_msg.header.stamp = nh.now(); + pub_range.publish(&range_msg); + range_timer = millis() + 50; + } + nh.spinOnce(); +} + diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/Logging/Logging.pde b/smart_device_protocol/ros_lib/ros_lib/examples/Logging/Logging.pde new file mode 100644 index 000000000..400a9cdb6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/Logging/Logging.pde @@ -0,0 +1,45 @@ +/* + * rosserial PubSub Example + * Prints "hello world!" and toggles led + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + + +char debug[]= "debug statements"; +char info[] = "infos"; +char warn[] = "warnings"; +char error[] = "errors"; +char fatal[] = "fatalities"; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + + nh.logdebug(debug); + nh.loginfo(info); + nh.logwarn(warn); + nh.logerror(error); + nh.logfatal(fatal); + + nh.spinOnce(); + delay(500); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/Odom/Odom.pde b/smart_device_protocol/ros_lib/ros_lib/examples/Odom/Odom.pde new file mode 100644 index 000000000..584102099 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/Odom/Odom.pde @@ -0,0 +1,53 @@ +/* + * rosserial Planar Odometry Example + */ + +#include +#include +#include +#include + +ros::NodeHandle nh; + +geometry_msgs::TransformStamped t; +tf::TransformBroadcaster broadcaster; + +double x = 1.0; +double y = 0.0; +double theta = 1.57; + +char base_link[] = "/base_link"; +char odom[] = "/odom"; + +void setup() +{ + nh.initNode(); + broadcaster.init(nh); +} + +void loop() +{ + // drive in a circle + double dx = 0.2; + double dtheta = 0.18; + x += cos(theta)*dx*0.1; + y += sin(theta)*dx*0.1; + theta += dtheta*0.1; + if(theta > 3.14) + theta=-3.14; + + // tf odom->base_link + t.header.frame_id = odom; + t.child_frame_id = base_link; + + t.transform.translation.x = x; + t.transform.translation.y = y; + + t.transform.rotation = tf::createQuaternionFromYaw(theta); + t.header.stamp = nh.now(); + + broadcaster.sendTransform(t); + nh.spinOnce(); + + delay(10); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/ServiceClient/ServiceClient.pde b/smart_device_protocol/ros_lib/ros_lib/examples/ServiceClient/ServiceClient.pde new file mode 100644 index 000000000..75093a985 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/ServiceClient/ServiceClient.pde @@ -0,0 +1,38 @@ +/* + * rosserial Service Client + */ + +#include +#include +#include + +ros::NodeHandle nh; +using rosserial_arduino::Test; + +ros::ServiceClient client("test_srv"); + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.serviceClient(client); + nh.advertise(chatter); + while(!nh.connected()) nh.spinOnce(); + nh.loginfo("Startup complete"); +} + +void loop() +{ + Test::Request req; + Test::Response res; + req.input = hello; + client.call(req, res); + str_msg.data = res.output; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(100); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/ServiceClient/client.py b/smart_device_protocol/ros_lib/ros_lib/examples/ServiceClient/client.py new file mode 100644 index 000000000..79f9aab6b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/ServiceClient/client.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +""" +Sample code to use with ServiceClient.pde +""" + +import roslib; roslib.load_manifest("rosserial_arduino") +import rospy + +from rosserial_arduino.srv import * + +def callback(req): + print("The arduino is calling! Please send it a message:") + t = TestResponse() + t.output = raw_input() + return t + +rospy.init_node("service_client_test") +rospy.Service("test_srv", Test, callback) +rospy.spin() diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/ServiceServer/ServiceServer.pde b/smart_device_protocol/ros_lib/ros_lib/examples/ServiceServer/ServiceServer.pde new file mode 100644 index 000000000..2d3fd7095 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/ServiceServer/ServiceServer.pde @@ -0,0 +1,40 @@ +/* + * rosserial Service Server + */ + +#include +#include +#include + +ros::NodeHandle nh; +using rosserial_arduino::Test; + +int i; +void callback(const Test::Request & req, Test::Response & res){ + if((i++)%2) + res.output = "hello"; + else + res.output = "world"; +} + +ros::ServiceServer server("test_srv",&callback); + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.advertiseService(server); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(10); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/ServoControl/ServoControl.pde b/smart_device_protocol/ros_lib/ros_lib/examples/ServoControl/ServoControl.pde new file mode 100644 index 000000000..24db409b6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/ServoControl/ServoControl.pde @@ -0,0 +1,49 @@ +/* + * rosserial Servo Control Example + * + * This sketch demonstrates the control of hobby R/C servos + * using ROS and the arduiono + * + * For the full tutorial write up, visit + * www.ros.org/wiki/rosserial_arduino_demos + * + * For more information on the Arduino Servo Library + * Checkout : + * http://www.arduino.cc/en/Reference/Servo + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif + +#include +#include +#include + +ros::NodeHandle nh; + +Servo servo; + +void servo_cb( const std_msgs::UInt16& cmd_msg){ + servo.write(cmd_msg.data); //set servo angle, should be from 0-180 + digitalWrite(13, HIGH-digitalRead(13)); //toggle led +} + + +ros::Subscriber sub("servo", servo_cb); + +void setup(){ + pinMode(13, OUTPUT); + + nh.initNode(); + nh.subscribe(sub); + + servo.attach(9); //attach it to pin 9 +} + +void loop(){ + nh.spinOnce(); + delay(1); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/TcpBlink/TcpBlink.ino b/smart_device_protocol/ros_lib/ros_lib/examples/TcpBlink/TcpBlink.ino new file mode 100644 index 000000000..013ffd2e0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/TcpBlink/TcpBlink.ino @@ -0,0 +1,47 @@ +/* + * rosserial Subscriber Example using TCP on Arduino Shield (Wiznet W5100 based) + * Blinks an LED on callback + */ +#include +#include + +#define ROSSERIAL_ARDUINO_TCP + +#include +#include + +ros::NodeHandle nh; + +// Shield settings +byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; +IPAddress ip(192, 168, 0, 177); + +// Server settings +IPAddress server(192, 168, 0, 11); +uint16_t serverPort = 11411; + +const uint8_t ledPin = 6; // 13 already used for SPI connection with the shield + +void messageCb( const std_msgs::Empty&){ + digitalWrite(ledPin, HIGH-digitalRead(ledPin)); // blink the led +} + +ros::Subscriber sub("toggle_led", &messageCb ); + +void setup() +{ + Ethernet.begin(mac, ip); + // give the Ethernet shield a second to initialize: + delay(1000); + pinMode(ledPin, OUTPUT); + nh.getHardware()->setConnection(server, serverPort); + nh.initNode(); + nh.subscribe(sub); +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/TcpHelloWorld/TcpHelloWorld.ino b/smart_device_protocol/ros_lib/ros_lib/examples/TcpHelloWorld/TcpHelloWorld.ino new file mode 100644 index 000000000..6f5dd352a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/TcpHelloWorld/TcpHelloWorld.ino @@ -0,0 +1,84 @@ +/* + * rosserial Publisher Example + * Prints "hello world!" + * This intend to connect to an Arduino Ethernet Shield + * and a rosserial socket server. + * You can launch the rosserial socket server with + * roslaunch rosserial_server socket.launch + * The default port is 11411 + * + */ +#include +#include + +// To use the TCP version of rosserial_arduino +#define ROSSERIAL_ARDUINO_TCP + +#include +#include + +// Set the shield settings +byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; +IPAddress ip(192, 168, 0, 177); + +// Set the rosserial socket server IP address +IPAddress server(192,168,0,11); +// Set the rosserial socket server port +const uint16_t serverPort = 11411; + +ros::NodeHandle nh; +// Make a chatter publisher +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +// Be polite and say hello +char hello[13] = "hello world!"; +uint16_t period = 1000; +uint32_t last_time = 0; + +void setup() +{ + // Use serial to monitor the process + Serial.begin(115200); + + // Connect the Ethernet + Ethernet.begin(mac, ip); + + // Let some time for the Ethernet Shield to be initialized + delay(1000); + + Serial.println(""); + Serial.println("Ethernet connected"); + Serial.println("IP address: "); + Serial.println(Ethernet.localIP()); + + // Set the connection to rosserial socket server + nh.getHardware()->setConnection(server, serverPort); + nh.initNode(); + + // Another way to get IP + Serial.print("IP = "); + Serial.println(nh.getHardware()->getLocalIP()); + + // Start to be polite + nh.advertise(chatter); +} + +void loop() +{ + if(millis() - last_time >= period) + { + last_time = millis(); + if (nh.connected()) + { + Serial.println("Connected"); + // Say hello + str_msg.data = hello; + chatter.publish( &str_msg ); + } else { + Serial.println("Not Connected"); + } + } + nh.spinOnce(); + delay(1); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/Temperature/Temperature.pde b/smart_device_protocol/ros_lib/ros_lib/examples/Temperature/Temperature.pde new file mode 100644 index 000000000..2c2f865bc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/Temperature/Temperature.pde @@ -0,0 +1,72 @@ +/* + * rosserial Temperature Sensor Example + * + * This tutorial demonstrates the usage of the + * Sparkfun TMP102 Digital Temperature Breakout board + * http://www.sparkfun.com/products/9418 + * + * Source Code Based off of: + * http://wiring.org.co/learning/libraries/tmp102sparkfun.html + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +std_msgs::Float32 temp_msg; +ros::Publisher pub_temp("temperature", &temp_msg); + + +// From the datasheet the BMP module address LSB distinguishes +// between read (1) and write (0) operations, corresponding to +// address 0x91 (read) and 0x90 (write). +// shift the address 1 bit right (0x91 or 0x90), the Wire library only needs the 7 +// most significant bits for the address 0x91 >> 1 = 0x48 +// 0x90 >> 1 = 0x48 (72) + +int sensorAddress = 0x91 >> 1; // From datasheet sensor address is 0x91 + // shift the address 1 bit right, the Wire library only needs the 7 + // most significant bits for the address + + +void setup() +{ + Wire.begin(); // join i2c bus (address optional for master) + + nh.initNode(); + nh.advertise(pub_temp); + +} + +long publisher_timer; + +void loop() +{ + + if (millis() > publisher_timer) { + // step 1: request reading from sensor + Wire.requestFrom(sensorAddress,2); + delay(10); + if (2 <= Wire.available()) // if two bytes were received + { + byte msb; + byte lsb; + int temperature; + + msb = Wire.read(); // receive high byte (full degrees) + lsb = Wire.read(); // receive low byte (fraction degrees) + temperature = ((msb) << 4); // MSB + temperature |= (lsb >> 4); // LSB + + temp_msg.data = temperature*0.0625; + pub_temp.publish(&temp_msg); + } + + publisher_timer = millis() + 1000; + } + + nh.spinOnce(); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/TimeTF/TimeTF.pde b/smart_device_protocol/ros_lib/ros_lib/examples/TimeTF/TimeTF.pde new file mode 100644 index 000000000..16fbb7036 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/TimeTF/TimeTF.pde @@ -0,0 +1,37 @@ +/* + * rosserial Time and TF Example + * Publishes a transform at current time + */ + +#include +#include +#include + +ros::NodeHandle nh; + +geometry_msgs::TransformStamped t; +tf::TransformBroadcaster broadcaster; + +char base_link[] = "/base_link"; +char odom[] = "/odom"; + +void setup() +{ + nh.initNode(); + broadcaster.init(nh); +} + +void loop() +{ + t.header.frame_id = odom; + t.child_frame_id = base_link; + t.transform.translation.x = 1.0; + t.transform.rotation.x = 0.0; + t.transform.rotation.y = 0.0; + t.transform.rotation.z = 0.0; + t.transform.rotation.w = 1.0; + t.header.stamp = nh.now(); + broadcaster.sendTransform(t); + nh.spinOnce(); + delay(10); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/Ultrasound/Ultrasound.pde b/smart_device_protocol/ros_lib/ros_lib/examples/Ultrasound/Ultrasound.pde new file mode 100644 index 000000000..d5870cbf8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/Ultrasound/Ultrasound.pde @@ -0,0 +1,61 @@ +/* + * rosserial Ultrasound Example + * + * This example is for the Maxbotix Ultrasound rangers. + */ + +#include +#include +#include + +ros::NodeHandle nh; + +sensor_msgs::Range range_msg; +ros::Publisher pub_range( "/ultrasound", &range_msg); + +const int adc_pin = 0; + +char frameid[] = "/ultrasound"; + +float getRange_Ultrasound(int pin_num){ + int val = 0; + for(int i=0; i<4; i++) val += analogRead(pin_num); + float range = val; + return range /322.519685; // (0.0124023437 /4) ; //cvt to meters +} + +void setup() +{ + nh.initNode(); + nh.advertise(pub_range); + + + range_msg.radiation_type = sensor_msgs::Range::ULTRASOUND; + range_msg.header.frame_id = frameid; + range_msg.field_of_view = 0.1; // fake + range_msg.min_range = 0.0; + range_msg.max_range = 6.47; + + pinMode(8,OUTPUT); + digitalWrite(8, LOW); +} + + +long range_time; + +void loop() +{ + + //publish the adc value every 50 milliseconds + //since it takes that long for the sensor to stablize + if ( millis() >= range_time ){ + int r =0; + + range_msg.range = getRange_Ultrasound(5); + range_msg.header.stamp = nh.now(); + pub_range.publish(&range_msg); + range_time = millis() + 50; + } + + nh.spinOnce(); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/button_example/button_example.pde b/smart_device_protocol/ros_lib/ros_lib/examples/button_example/button_example.pde new file mode 100644 index 000000000..04045427c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/button_example/button_example.pde @@ -0,0 +1,61 @@ +/* + * Button Example for Rosserial + */ + +#include +#include + + +ros::NodeHandle nh; + +std_msgs::Bool pushed_msg; +ros::Publisher pub_button("pushed", &pushed_msg); + +const int button_pin = 7; +const int led_pin = 13; + +bool last_reading; +long last_debounce_time=0; +long debounce_delay=50; +bool published = true; + +void setup() +{ + nh.initNode(); + nh.advertise(pub_button); + + //initialize an LED output pin + //and a input pin for our push button + pinMode(led_pin, OUTPUT); + pinMode(button_pin, INPUT); + + //Enable the pullup resistor on the button + digitalWrite(button_pin, HIGH); + + //The button is a normally button + last_reading = ! digitalRead(button_pin); + +} + +void loop() +{ + + bool reading = ! digitalRead(button_pin); + + if (last_reading!= reading){ + last_debounce_time = millis(); + published = false; + } + + //if the button value has not changed for the debounce delay, we know its stable + if ( !published && (millis() - last_debounce_time) > debounce_delay) { + digitalWrite(led_pin, reading); + pushed_msg.data = reading; + pub_button.publish(&pushed_msg); + published = true; + } + + last_reading = reading; + + nh.spinOnce(); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/examples/pubsub/pubsub.pde b/smart_device_protocol/ros_lib/ros_lib/examples/pubsub/pubsub.pde new file mode 100644 index 000000000..753d8ed02 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/examples/pubsub/pubsub.pde @@ -0,0 +1,40 @@ +/* + * rosserial PubSub Example + * Prints "hello world!" and toggles led + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +void messageCb( const std_msgs::Empty& toggle_msg){ + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", messageCb ); + + + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(chatter); + nh.subscribe(sub); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(500); +} diff --git a/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorAction.h b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorAction.h new file mode 100644 index 000000000..1bc223068 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_face_detector_FaceDetectorAction_h +#define _ROS_face_detector_FaceDetectorAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "face_detector/FaceDetectorActionGoal.h" +#include "face_detector/FaceDetectorActionResult.h" +#include "face_detector/FaceDetectorActionFeedback.h" + +namespace face_detector +{ + + class FaceDetectorAction : public ros::Msg + { + public: + typedef face_detector::FaceDetectorActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef face_detector::FaceDetectorActionResult _action_result_type; + _action_result_type action_result; + typedef face_detector::FaceDetectorActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + FaceDetectorAction(): + 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 "face_detector/FaceDetectorAction"; }; + virtual const char * getMD5() override { return "665c888633df000242196f7098a55805"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionFeedback.h new file mode 100644 index 000000000..7d7c7622f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_face_detector_FaceDetectorActionFeedback_h +#define _ROS_face_detector_FaceDetectorActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "face_detector/FaceDetectorFeedback.h" + +namespace face_detector +{ + + class FaceDetectorActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef face_detector::FaceDetectorFeedback _feedback_type; + _feedback_type feedback; + + FaceDetectorActionFeedback(): + 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 "face_detector/FaceDetectorActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionGoal.h new file mode 100644 index 000000000..5d9eb7724 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_face_detector_FaceDetectorActionGoal_h +#define _ROS_face_detector_FaceDetectorActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "face_detector/FaceDetectorGoal.h" + +namespace face_detector +{ + + class FaceDetectorActionGoal : 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 face_detector::FaceDetectorGoal _goal_type; + _goal_type goal; + + FaceDetectorActionGoal(): + 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 "face_detector/FaceDetectorActionGoal"; }; + virtual const char * getMD5() override { return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionResult.h b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionResult.h new file mode 100644 index 000000000..3482045a7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_face_detector_FaceDetectorActionResult_h +#define _ROS_face_detector_FaceDetectorActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "face_detector/FaceDetectorResult.h" + +namespace face_detector +{ + + class FaceDetectorActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef face_detector::FaceDetectorResult _result_type; + _result_type result; + + FaceDetectorActionResult(): + 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 "face_detector/FaceDetectorActionResult"; }; + virtual const char * getMD5() override { return "d3986ecc4dd47eb1142da1c68ce02ae7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorFeedback.h b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorFeedback.h new file mode 100644 index 000000000..06fd9759b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_face_detector_FaceDetectorFeedback_h +#define _ROS_face_detector_FaceDetectorFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace face_detector +{ + + class FaceDetectorFeedback : public ros::Msg + { + public: + + FaceDetectorFeedback() + { + } + + 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 "face_detector/FaceDetectorFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorGoal.h b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorGoal.h new file mode 100644 index 000000000..ded219b1c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_face_detector_FaceDetectorGoal_h +#define _ROS_face_detector_FaceDetectorGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace face_detector +{ + + class FaceDetectorGoal : public ros::Msg + { + public: + + FaceDetectorGoal() + { + } + + 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 "face_detector/FaceDetectorGoal"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorResult.h b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorResult.h new file mode 100644 index 000000000..79f3eebab --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/face_detector/FaceDetectorResult.h @@ -0,0 +1,64 @@ +#ifndef _ROS_face_detector_FaceDetectorResult_h +#define _ROS_face_detector_FaceDetectorResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "people_msgs/PositionMeasurement.h" + +namespace face_detector +{ + + class FaceDetectorResult : public ros::Msg + { + public: + uint32_t face_positions_length; + typedef people_msgs::PositionMeasurement _face_positions_type; + _face_positions_type st_face_positions; + _face_positions_type * face_positions; + + FaceDetectorResult(): + face_positions_length(0), st_face_positions(), face_positions(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->face_positions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->face_positions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->face_positions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->face_positions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->face_positions_length); + for( uint32_t i = 0; i < face_positions_length; i++){ + offset += this->face_positions[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t face_positions_lengthT = ((uint32_t) (*(inbuffer + offset))); + face_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + face_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + face_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->face_positions_length); + if(face_positions_lengthT > face_positions_length) + this->face_positions = (people_msgs::PositionMeasurement*)realloc(this->face_positions, face_positions_lengthT * sizeof(people_msgs::PositionMeasurement)); + face_positions_length = face_positions_lengthT; + for( uint32_t i = 0; i < face_positions_length; i++){ + offset += this->st_face_positions.deserialize(inbuffer + offset); + memcpy( &(this->face_positions[i]), &(this->st_face_positions), sizeof(people_msgs::PositionMeasurement)); + } + return offset; + } + + virtual const char * getType() override { return "face_detector/FaceDetectorResult"; }; + virtual const char * getMD5() override { return "b5dc843df183dbab7f0ab2f5ef5b6f9d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockAction.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockAction.h new file mode 100644 index 000000000..66dedc342 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_auto_dock_msgs_DockAction_h +#define _ROS_fetch_auto_dock_msgs_DockAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "fetch_auto_dock_msgs/DockActionGoal.h" +#include "fetch_auto_dock_msgs/DockActionResult.h" +#include "fetch_auto_dock_msgs/DockActionFeedback.h" + +namespace fetch_auto_dock_msgs +{ + + class DockAction : public ros::Msg + { + public: + typedef fetch_auto_dock_msgs::DockActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef fetch_auto_dock_msgs::DockActionResult _action_result_type; + _action_result_type action_result; + typedef fetch_auto_dock_msgs::DockActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + DockAction(): + 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 "fetch_auto_dock_msgs/DockAction"; }; + virtual const char * getMD5() override { return "cce26d4fecf14ada90d5d392d0b75e38"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionFeedback.h new file mode 100644 index 000000000..339934b9b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_auto_dock_msgs_DockActionFeedback_h +#define _ROS_fetch_auto_dock_msgs_DockActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "fetch_auto_dock_msgs/DockFeedback.h" + +namespace fetch_auto_dock_msgs +{ + + class DockActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef fetch_auto_dock_msgs::DockFeedback _feedback_type; + _feedback_type feedback; + + DockActionFeedback(): + 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 "fetch_auto_dock_msgs/DockActionFeedback"; }; + virtual const char * getMD5() override { return "6a07b7150fca355bea027d8c95ed9e67"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionGoal.h new file mode 100644 index 000000000..39a050547 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_auto_dock_msgs_DockActionGoal_h +#define _ROS_fetch_auto_dock_msgs_DockActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "fetch_auto_dock_msgs/DockGoal.h" + +namespace fetch_auto_dock_msgs +{ + + class DockActionGoal : 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 fetch_auto_dock_msgs::DockGoal _goal_type; + _goal_type goal; + + DockActionGoal(): + 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 "fetch_auto_dock_msgs/DockActionGoal"; }; + virtual const char * getMD5() override { return "69333baaf59d995d4a69e40ea04b8312"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionResult.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionResult.h new file mode 100644 index 000000000..2a4513bbe --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_auto_dock_msgs_DockActionResult_h +#define _ROS_fetch_auto_dock_msgs_DockActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "fetch_auto_dock_msgs/DockResult.h" + +namespace fetch_auto_dock_msgs +{ + + class DockActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef fetch_auto_dock_msgs::DockResult _result_type; + _result_type result; + + DockActionResult(): + 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 "fetch_auto_dock_msgs/DockActionResult"; }; + virtual const char * getMD5() override { return "62d3add0cb6cbe61284964df4bb1e09b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockFeedback.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockFeedback.h new file mode 100644 index 000000000..a6e0feebf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockFeedback.h @@ -0,0 +1,50 @@ +#ifndef _ROS_fetch_auto_dock_msgs_DockFeedback_h +#define _ROS_fetch_auto_dock_msgs_DockFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "geometry_msgs/Twist.h" + +namespace fetch_auto_dock_msgs +{ + + class DockFeedback : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _dock_pose_type; + _dock_pose_type dock_pose; + typedef geometry_msgs::Twist _command_type; + _command_type command; + + DockFeedback(): + dock_pose(), + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->dock_pose.serialize(outbuffer + offset); + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->dock_pose.deserialize(inbuffer + offset); + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "fetch_auto_dock_msgs/DockFeedback"; }; + virtual const char * getMD5() override { return "c91416905ed1b41536bce4f154e2b284"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockGoal.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockGoal.h new file mode 100644 index 000000000..d6265bc04 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockGoal.h @@ -0,0 +1,79 @@ +#ifndef _ROS_fetch_auto_dock_msgs_DockGoal_h +#define _ROS_fetch_auto_dock_msgs_DockGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace fetch_auto_dock_msgs +{ + + class DockGoal : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _dock_pose_type; + _dock_pose_type dock_pose; + typedef const char* _dock_id_type; + _dock_id_type dock_id; + typedef bool _use_move_base_type; + _use_move_base_type use_move_base; + + DockGoal(): + dock_pose(), + dock_id(""), + use_move_base(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->dock_pose.serialize(outbuffer + offset); + uint32_t length_dock_id = strlen(this->dock_id); + varToArr(outbuffer + offset, length_dock_id); + offset += 4; + memcpy(outbuffer + offset, this->dock_id, length_dock_id); + offset += length_dock_id; + union { + bool real; + uint8_t base; + } u_use_move_base; + u_use_move_base.real = this->use_move_base; + *(outbuffer + offset + 0) = (u_use_move_base.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->use_move_base); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->dock_pose.deserialize(inbuffer + offset); + uint32_t length_dock_id; + arrToVar(length_dock_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dock_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dock_id-1]=0; + this->dock_id = (char *)(inbuffer + offset-1); + offset += length_dock_id; + union { + bool real; + uint8_t base; + } u_use_move_base; + u_use_move_base.base = 0; + u_use_move_base.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->use_move_base = u_use_move_base.real; + offset += sizeof(this->use_move_base); + return offset; + } + + virtual const char * getType() override { return "fetch_auto_dock_msgs/DockGoal"; }; + virtual const char * getMD5() override { return "3802143c05afa4995a977654bae73c88"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockResult.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockResult.h new file mode 100644 index 000000000..8818892e8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/DockResult.h @@ -0,0 +1,73 @@ +#ifndef _ROS_fetch_auto_dock_msgs_DockResult_h +#define _ROS_fetch_auto_dock_msgs_DockResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace fetch_auto_dock_msgs +{ + + class DockResult : public ros::Msg + { + public: + typedef bool _docked_type; + _docked_type docked; + typedef const char* _dock_id_type; + _dock_id_type dock_id; + + DockResult(): + docked(0), + dock_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_docked; + u_docked.real = this->docked; + *(outbuffer + offset + 0) = (u_docked.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->docked); + uint32_t length_dock_id = strlen(this->dock_id); + varToArr(outbuffer + offset, length_dock_id); + offset += 4; + memcpy(outbuffer + offset, this->dock_id, length_dock_id); + offset += length_dock_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_docked; + u_docked.base = 0; + u_docked.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->docked = u_docked.real; + offset += sizeof(this->docked); + uint32_t length_dock_id; + arrToVar(length_dock_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dock_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dock_id-1]=0; + this->dock_id = (char *)(inbuffer + offset-1); + offset += length_dock_id; + return offset; + } + + virtual const char * getType() override { return "fetch_auto_dock_msgs/DockResult"; }; + virtual const char * getMD5() override { return "3c9af1b0b876b5336e9869a2cfc41c1c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockAction.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockAction.h new file mode 100644 index 000000000..92fe0ca0d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_auto_dock_msgs_UndockAction_h +#define _ROS_fetch_auto_dock_msgs_UndockAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "fetch_auto_dock_msgs/UndockActionGoal.h" +#include "fetch_auto_dock_msgs/UndockActionResult.h" +#include "fetch_auto_dock_msgs/UndockActionFeedback.h" + +namespace fetch_auto_dock_msgs +{ + + class UndockAction : public ros::Msg + { + public: + typedef fetch_auto_dock_msgs::UndockActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef fetch_auto_dock_msgs::UndockActionResult _action_result_type; + _action_result_type action_result; + typedef fetch_auto_dock_msgs::UndockActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + UndockAction(): + 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 "fetch_auto_dock_msgs/UndockAction"; }; + virtual const char * getMD5() override { return "67f75452c196985277234c9f084093d5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionFeedback.h new file mode 100644 index 000000000..aefdb561d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_auto_dock_msgs_UndockActionFeedback_h +#define _ROS_fetch_auto_dock_msgs_UndockActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "fetch_auto_dock_msgs/UndockFeedback.h" + +namespace fetch_auto_dock_msgs +{ + + class UndockActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef fetch_auto_dock_msgs::UndockFeedback _feedback_type; + _feedback_type feedback; + + UndockActionFeedback(): + 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 "fetch_auto_dock_msgs/UndockActionFeedback"; }; + virtual const char * getMD5() override { return "6a07b7150fca355bea027d8c95ed9e67"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionGoal.h new file mode 100644 index 000000000..0455353fa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_auto_dock_msgs_UndockActionGoal_h +#define _ROS_fetch_auto_dock_msgs_UndockActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "fetch_auto_dock_msgs/UndockGoal.h" + +namespace fetch_auto_dock_msgs +{ + + class UndockActionGoal : 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 fetch_auto_dock_msgs::UndockGoal _goal_type; + _goal_type goal; + + UndockActionGoal(): + 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 "fetch_auto_dock_msgs/UndockActionGoal"; }; + virtual const char * getMD5() override { return "83d89c5d575f723697d44b3ce0db1099"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionResult.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionResult.h new file mode 100644 index 000000000..8a4cf6fc1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_auto_dock_msgs_UndockActionResult_h +#define _ROS_fetch_auto_dock_msgs_UndockActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "fetch_auto_dock_msgs/UndockResult.h" + +namespace fetch_auto_dock_msgs +{ + + class UndockActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef fetch_auto_dock_msgs::UndockResult _result_type; + _result_type result; + + UndockActionResult(): + 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 "fetch_auto_dock_msgs/UndockActionResult"; }; + virtual const char * getMD5() override { return "6868978f7aa1c3f7fba76547d2092ae9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockFeedback.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockFeedback.h new file mode 100644 index 000000000..972a630c6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockFeedback.h @@ -0,0 +1,50 @@ +#ifndef _ROS_fetch_auto_dock_msgs_UndockFeedback_h +#define _ROS_fetch_auto_dock_msgs_UndockFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "geometry_msgs/Twist.h" + +namespace fetch_auto_dock_msgs +{ + + class UndockFeedback : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _dock_pose_type; + _dock_pose_type dock_pose; + typedef geometry_msgs::Twist _command_type; + _command_type command; + + UndockFeedback(): + dock_pose(), + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->dock_pose.serialize(outbuffer + offset); + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->dock_pose.deserialize(inbuffer + offset); + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "fetch_auto_dock_msgs/UndockFeedback"; }; + virtual const char * getMD5() override { return "c91416905ed1b41536bce4f154e2b284"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockGoal.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockGoal.h new file mode 100644 index 000000000..0d361f124 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_auto_dock_msgs_UndockGoal_h +#define _ROS_fetch_auto_dock_msgs_UndockGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace fetch_auto_dock_msgs +{ + + class UndockGoal : public ros::Msg + { + public: + typedef bool _rotate_in_place_type; + _rotate_in_place_type rotate_in_place; + + UndockGoal(): + rotate_in_place(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_rotate_in_place; + u_rotate_in_place.real = this->rotate_in_place; + *(outbuffer + offset + 0) = (u_rotate_in_place.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->rotate_in_place); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_rotate_in_place; + u_rotate_in_place.base = 0; + u_rotate_in_place.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->rotate_in_place = u_rotate_in_place.real; + offset += sizeof(this->rotate_in_place); + return offset; + } + + virtual const char * getType() override { return "fetch_auto_dock_msgs/UndockGoal"; }; + virtual const char * getMD5() override { return "dc4d50a0ddde1312dc506a49b185c018"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockResult.h b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockResult.h new file mode 100644 index 000000000..326a2348f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_auto_dock_msgs/UndockResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_auto_dock_msgs_UndockResult_h +#define _ROS_fetch_auto_dock_msgs_UndockResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace fetch_auto_dock_msgs +{ + + class UndockResult : public ros::Msg + { + public: + typedef bool _undocked_type; + _undocked_type undocked; + + UndockResult(): + undocked(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_undocked; + u_undocked.real = this->undocked; + *(outbuffer + offset + 0) = (u_undocked.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->undocked); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_undocked; + u_undocked.base = 0; + u_undocked.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->undocked = u_undocked.real; + offset += sizeof(this->undocked); + return offset; + } + + virtual const char * getType() override { return "fetch_auto_dock_msgs/UndockResult"; }; + virtual const char * getMD5() override { return "26f25fb4c0c6a6805fac81b37bb7b9c9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/BoardState.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/BoardState.h new file mode 100644 index 000000000..57d1ac4c9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/BoardState.h @@ -0,0 +1,267 @@ +#ifndef _ROS_fetch_driver_msgs_BoardState_h +#define _ROS_fetch_driver_msgs_BoardState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace fetch_driver_msgs +{ + + class BoardState : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef int32_t _board_type_type; + _board_type_type board_type; + typedef int16_t _board_revision_type; + _board_revision_type board_revision; + typedef int16_t _software_revision_type; + _software_revision_type software_revision; + typedef int8_t _boot_status_type; + _boot_status_type boot_status; + typedef uint16_t _board_flags_type; + _board_flags_type board_flags; + typedef uint64_t _system_time_type; + _system_time_type system_time; + typedef float _voltage_type; + _voltage_type voltage; + typedef float _temperature_type; + _temperature_type temperature; + typedef uint32_t _packets_sent_type; + _packets_sent_type packets_sent; + typedef uint32_t _packets_recv_type; + _packets_recv_type packets_recv; + typedef uint32_t _packets_bad_type; + _packets_bad_type packets_bad; + typedef uint32_t _packets_back_type; + _packets_back_type packets_back; + + BoardState(): + name(""), + board_type(0), + board_revision(0), + software_revision(0), + boot_status(0), + board_flags(0), + system_time(0), + voltage(0), + temperature(0), + packets_sent(0), + packets_recv(0), + packets_bad(0), + packets_back(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; + union { + int32_t real; + uint32_t base; + } u_board_type; + u_board_type.real = this->board_type; + *(outbuffer + offset + 0) = (u_board_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_board_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_board_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_board_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->board_type); + union { + int16_t real; + uint16_t base; + } u_board_revision; + u_board_revision.real = this->board_revision; + *(outbuffer + offset + 0) = (u_board_revision.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_board_revision.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->board_revision); + union { + int16_t real; + uint16_t base; + } u_software_revision; + u_software_revision.real = this->software_revision; + *(outbuffer + offset + 0) = (u_software_revision.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_software_revision.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->software_revision); + union { + int8_t real; + uint8_t base; + } u_boot_status; + u_boot_status.real = this->boot_status; + *(outbuffer + offset + 0) = (u_boot_status.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->boot_status); + *(outbuffer + offset + 0) = (this->board_flags >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->board_flags >> (8 * 1)) & 0xFF; + offset += sizeof(this->board_flags); + *(outbuffer + offset + 0) = (this->system_time >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->system_time >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->system_time >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->system_time >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->system_time >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->system_time >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->system_time >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->system_time >> (8 * 7)) & 0xFF; + offset += sizeof(this->system_time); + 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_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->packets_sent >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->packets_sent >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->packets_sent >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->packets_sent >> (8 * 3)) & 0xFF; + offset += sizeof(this->packets_sent); + *(outbuffer + offset + 0) = (this->packets_recv >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->packets_recv >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->packets_recv >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->packets_recv >> (8 * 3)) & 0xFF; + offset += sizeof(this->packets_recv); + *(outbuffer + offset + 0) = (this->packets_bad >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->packets_bad >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->packets_bad >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->packets_bad >> (8 * 3)) & 0xFF; + offset += sizeof(this->packets_bad); + *(outbuffer + offset + 0) = (this->packets_back >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->packets_back >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->packets_back >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->packets_back >> (8 * 3)) & 0xFF; + offset += sizeof(this->packets_back); + 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; + union { + int32_t real; + uint32_t base; + } u_board_type; + u_board_type.base = 0; + u_board_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_board_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_board_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_board_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->board_type = u_board_type.real; + offset += sizeof(this->board_type); + union { + int16_t real; + uint16_t base; + } u_board_revision; + u_board_revision.base = 0; + u_board_revision.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_board_revision.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->board_revision = u_board_revision.real; + offset += sizeof(this->board_revision); + union { + int16_t real; + uint16_t base; + } u_software_revision; + u_software_revision.base = 0; + u_software_revision.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_software_revision.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->software_revision = u_software_revision.real; + offset += sizeof(this->software_revision); + union { + int8_t real; + uint8_t base; + } u_boot_status; + u_boot_status.base = 0; + u_boot_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->boot_status = u_boot_status.real; + offset += sizeof(this->boot_status); + this->board_flags = ((uint16_t) (*(inbuffer + offset))); + this->board_flags |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->board_flags); + this->system_time = ((uint64_t) (*(inbuffer + offset))); + this->system_time |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->system_time |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->system_time |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->system_time |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->system_time |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->system_time |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->system_time |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->system_time); + 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_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->packets_sent = ((uint32_t) (*(inbuffer + offset))); + this->packets_sent |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->packets_sent |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->packets_sent |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->packets_sent); + this->packets_recv = ((uint32_t) (*(inbuffer + offset))); + this->packets_recv |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->packets_recv |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->packets_recv |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->packets_recv); + this->packets_bad = ((uint32_t) (*(inbuffer + offset))); + this->packets_bad |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->packets_bad |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->packets_bad |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->packets_bad); + this->packets_back = ((uint32_t) (*(inbuffer + offset))); + this->packets_back |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->packets_back |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->packets_back |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->packets_back); + return offset; + } + + virtual const char * getType() override { return "fetch_driver_msgs/BoardState"; }; + virtual const char * getMD5() override { return "064739d3117a5b1aac96ad254216e299"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/ChargerState.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/ChargerState.h new file mode 100644 index 000000000..3064d92f0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/ChargerState.h @@ -0,0 +1,379 @@ +#ifndef _ROS_fetch_driver_msgs_ChargerState_h +#define _ROS_fetch_driver_msgs_ChargerState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace fetch_driver_msgs +{ + + class ChargerState : public ros::Msg + { + public: + typedef uint8_t _state_type; + _state_type state; + typedef uint8_t _error_type; + _error_type error; + typedef uint8_t _charging_mode_type; + _charging_mode_type charging_mode; + typedef uint8_t _limit_cause_type; + _limit_cause_type limit_cause; + typedef uint8_t _balancing_mode_type; + _balancing_mode_type balancing_mode; + typedef float _battery_voltage_type; + _battery_voltage_type battery_voltage; + typedef float _battery_half_voltage_type; + _battery_half_voltage_type battery_half_voltage; + typedef float _charger_voltage_type; + _charger_voltage_type charger_voltage; + typedef float _supply_voltage_type; + _supply_voltage_type supply_voltage; + typedef float _phase1_current_type; + _phase1_current_type phase1_current; + typedef float _phase2_current_type; + _phase2_current_type phase2_current; + typedef float _charger_temp_type; + _charger_temp_type charger_temp; + typedef float _battery_temp_type; + _battery_temp_type battery_temp; + typedef float _supply_connector_temp_type; + _supply_connector_temp_type supply_connector_temp; + typedef float _fan_speed_type; + _fan_speed_type fan_speed; + typedef float _battery_capacity_type; + _battery_capacity_type battery_capacity; + typedef float _battery_energy_type; + _battery_energy_type battery_energy; + typedef bool _is_charger_detected_type; + _is_charger_detected_type is_charger_detected; + + ChargerState(): + state(0), + error(0), + charging_mode(0), + limit_cause(0), + balancing_mode(0), + battery_voltage(0), + battery_half_voltage(0), + charger_voltage(0), + supply_voltage(0), + phase1_current(0), + phase2_current(0), + charger_temp(0), + battery_temp(0), + supply_connector_temp(0), + fan_speed(0), + battery_capacity(0), + battery_energy(0), + is_charger_detected(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF; + offset += sizeof(this->error); + *(outbuffer + offset + 0) = (this->charging_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->charging_mode); + *(outbuffer + offset + 0) = (this->limit_cause >> (8 * 0)) & 0xFF; + offset += sizeof(this->limit_cause); + *(outbuffer + offset + 0) = (this->balancing_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->balancing_mode); + union { + float real; + uint32_t base; + } u_battery_voltage; + u_battery_voltage.real = this->battery_voltage; + *(outbuffer + offset + 0) = (u_battery_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_battery_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_battery_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_battery_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery_voltage); + union { + float real; + uint32_t base; + } u_battery_half_voltage; + u_battery_half_voltage.real = this->battery_half_voltage; + *(outbuffer + offset + 0) = (u_battery_half_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_battery_half_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_battery_half_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_battery_half_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery_half_voltage); + union { + float real; + uint32_t base; + } u_charger_voltage; + u_charger_voltage.real = this->charger_voltage; + *(outbuffer + offset + 0) = (u_charger_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_charger_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_charger_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_charger_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->charger_voltage); + union { + float real; + uint32_t base; + } u_supply_voltage; + u_supply_voltage.real = this->supply_voltage; + *(outbuffer + offset + 0) = (u_supply_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_supply_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_supply_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_supply_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->supply_voltage); + union { + float real; + uint32_t base; + } u_phase1_current; + u_phase1_current.real = this->phase1_current; + *(outbuffer + offset + 0) = (u_phase1_current.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_phase1_current.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_phase1_current.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_phase1_current.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->phase1_current); + union { + float real; + uint32_t base; + } u_phase2_current; + u_phase2_current.real = this->phase2_current; + *(outbuffer + offset + 0) = (u_phase2_current.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_phase2_current.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_phase2_current.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_phase2_current.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->phase2_current); + union { + float real; + uint32_t base; + } u_charger_temp; + u_charger_temp.real = this->charger_temp; + *(outbuffer + offset + 0) = (u_charger_temp.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_charger_temp.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_charger_temp.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_charger_temp.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->charger_temp); + union { + float real; + uint32_t base; + } u_battery_temp; + u_battery_temp.real = this->battery_temp; + *(outbuffer + offset + 0) = (u_battery_temp.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_battery_temp.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_battery_temp.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_battery_temp.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery_temp); + union { + float real; + uint32_t base; + } u_supply_connector_temp; + u_supply_connector_temp.real = this->supply_connector_temp; + *(outbuffer + offset + 0) = (u_supply_connector_temp.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_supply_connector_temp.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_supply_connector_temp.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_supply_connector_temp.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->supply_connector_temp); + union { + float real; + uint32_t base; + } u_fan_speed; + u_fan_speed.real = this->fan_speed; + *(outbuffer + offset + 0) = (u_fan_speed.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_fan_speed.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_fan_speed.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_fan_speed.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->fan_speed); + union { + float real; + uint32_t base; + } u_battery_capacity; + u_battery_capacity.real = this->battery_capacity; + *(outbuffer + offset + 0) = (u_battery_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_battery_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_battery_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_battery_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery_capacity); + union { + float real; + uint32_t base; + } u_battery_energy; + u_battery_energy.real = this->battery_energy; + *(outbuffer + offset + 0) = (u_battery_energy.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_battery_energy.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_battery_energy.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_battery_energy.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery_energy); + union { + bool real; + uint8_t base; + } u_is_charger_detected; + u_is_charger_detected.real = this->is_charger_detected; + *(outbuffer + offset + 0) = (u_is_charger_detected.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_charger_detected); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + this->error = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->error); + this->charging_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->charging_mode); + this->limit_cause = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->limit_cause); + this->balancing_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->balancing_mode); + union { + float real; + uint32_t base; + } u_battery_voltage; + u_battery_voltage.base = 0; + u_battery_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_battery_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_battery_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_battery_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->battery_voltage = u_battery_voltage.real; + offset += sizeof(this->battery_voltage); + union { + float real; + uint32_t base; + } u_battery_half_voltage; + u_battery_half_voltage.base = 0; + u_battery_half_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_battery_half_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_battery_half_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_battery_half_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->battery_half_voltage = u_battery_half_voltage.real; + offset += sizeof(this->battery_half_voltage); + union { + float real; + uint32_t base; + } u_charger_voltage; + u_charger_voltage.base = 0; + u_charger_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_charger_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_charger_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_charger_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->charger_voltage = u_charger_voltage.real; + offset += sizeof(this->charger_voltage); + union { + float real; + uint32_t base; + } u_supply_voltage; + u_supply_voltage.base = 0; + u_supply_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_supply_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_supply_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_supply_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->supply_voltage = u_supply_voltage.real; + offset += sizeof(this->supply_voltage); + union { + float real; + uint32_t base; + } u_phase1_current; + u_phase1_current.base = 0; + u_phase1_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_phase1_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_phase1_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_phase1_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->phase1_current = u_phase1_current.real; + offset += sizeof(this->phase1_current); + union { + float real; + uint32_t base; + } u_phase2_current; + u_phase2_current.base = 0; + u_phase2_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_phase2_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_phase2_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_phase2_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->phase2_current = u_phase2_current.real; + offset += sizeof(this->phase2_current); + union { + float real; + uint32_t base; + } u_charger_temp; + u_charger_temp.base = 0; + u_charger_temp.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_charger_temp.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_charger_temp.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_charger_temp.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->charger_temp = u_charger_temp.real; + offset += sizeof(this->charger_temp); + union { + float real; + uint32_t base; + } u_battery_temp; + u_battery_temp.base = 0; + u_battery_temp.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_battery_temp.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_battery_temp.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_battery_temp.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->battery_temp = u_battery_temp.real; + offset += sizeof(this->battery_temp); + union { + float real; + uint32_t base; + } u_supply_connector_temp; + u_supply_connector_temp.base = 0; + u_supply_connector_temp.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_supply_connector_temp.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_supply_connector_temp.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_supply_connector_temp.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->supply_connector_temp = u_supply_connector_temp.real; + offset += sizeof(this->supply_connector_temp); + union { + float real; + uint32_t base; + } u_fan_speed; + u_fan_speed.base = 0; + u_fan_speed.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_fan_speed.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_fan_speed.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_fan_speed.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->fan_speed = u_fan_speed.real; + offset += sizeof(this->fan_speed); + union { + float real; + uint32_t base; + } u_battery_capacity; + u_battery_capacity.base = 0; + u_battery_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_battery_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_battery_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_battery_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->battery_capacity = u_battery_capacity.real; + offset += sizeof(this->battery_capacity); + union { + float real; + uint32_t base; + } u_battery_energy; + u_battery_energy.base = 0; + u_battery_energy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_battery_energy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_battery_energy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_battery_energy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->battery_energy = u_battery_energy.real; + offset += sizeof(this->battery_energy); + union { + bool real; + uint8_t base; + } u_is_charger_detected; + u_is_charger_detected.base = 0; + u_is_charger_detected.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_charger_detected = u_is_charger_detected.real; + offset += sizeof(this->is_charger_detected); + return offset; + } + + virtual const char * getType() override { return "fetch_driver_msgs/ChargerState"; }; + virtual const char * getMD5() override { return "d34eaaa0d5a93d36674702202ec485d9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingAction.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingAction.h new file mode 100644 index 000000000..36b750728 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_driver_msgs_DisableChargingAction_h +#define _ROS_fetch_driver_msgs_DisableChargingAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "fetch_driver_msgs/DisableChargingActionGoal.h" +#include "fetch_driver_msgs/DisableChargingActionResult.h" +#include "fetch_driver_msgs/DisableChargingActionFeedback.h" + +namespace fetch_driver_msgs +{ + + class DisableChargingAction : public ros::Msg + { + public: + typedef fetch_driver_msgs::DisableChargingActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef fetch_driver_msgs::DisableChargingActionResult _action_result_type; + _action_result_type action_result; + typedef fetch_driver_msgs::DisableChargingActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + DisableChargingAction(): + 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 "fetch_driver_msgs/DisableChargingAction"; }; + virtual const char * getMD5() override { return "779104bea58517403422a5cae55a1bb1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionFeedback.h new file mode 100644 index 000000000..dc4c37fa8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_driver_msgs_DisableChargingActionFeedback_h +#define _ROS_fetch_driver_msgs_DisableChargingActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "fetch_driver_msgs/DisableChargingFeedback.h" + +namespace fetch_driver_msgs +{ + + class DisableChargingActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef fetch_driver_msgs::DisableChargingFeedback _feedback_type; + _feedback_type feedback; + + DisableChargingActionFeedback(): + 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 "fetch_driver_msgs/DisableChargingActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionGoal.h new file mode 100644 index 000000000..29f4c4988 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_driver_msgs_DisableChargingActionGoal_h +#define _ROS_fetch_driver_msgs_DisableChargingActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "fetch_driver_msgs/DisableChargingGoal.h" + +namespace fetch_driver_msgs +{ + + class DisableChargingActionGoal : 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 fetch_driver_msgs::DisableChargingGoal _goal_type; + _goal_type goal; + + DisableChargingActionGoal(): + 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 "fetch_driver_msgs/DisableChargingActionGoal"; }; + virtual const char * getMD5() override { return "2cdef171810817cf95b4cd420433b17f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionResult.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionResult.h new file mode 100644 index 000000000..0563325af --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_driver_msgs_DisableChargingActionResult_h +#define _ROS_fetch_driver_msgs_DisableChargingActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "fetch_driver_msgs/DisableChargingResult.h" + +namespace fetch_driver_msgs +{ + + class DisableChargingActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef fetch_driver_msgs::DisableChargingResult _result_type; + _result_type result; + + DisableChargingActionResult(): + 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 "fetch_driver_msgs/DisableChargingActionResult"; }; + virtual const char * getMD5() override { return "303f1e5dc2c6adb3e46cf4339a1cdb1d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingFeedback.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingFeedback.h new file mode 100644 index 000000000..fddd69a22 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_fetch_driver_msgs_DisableChargingFeedback_h +#define _ROS_fetch_driver_msgs_DisableChargingFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace fetch_driver_msgs +{ + + class DisableChargingFeedback : public ros::Msg + { + public: + + DisableChargingFeedback() + { + } + + 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 "fetch_driver_msgs/DisableChargingFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingGoal.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingGoal.h new file mode 100644 index 000000000..77420093a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingGoal.h @@ -0,0 +1,62 @@ +#ifndef _ROS_fetch_driver_msgs_DisableChargingGoal_h +#define _ROS_fetch_driver_msgs_DisableChargingGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace fetch_driver_msgs +{ + + class DisableChargingGoal : public ros::Msg + { + public: + typedef ros::Duration _disable_duration_type; + _disable_duration_type disable_duration; + + DisableChargingGoal(): + disable_duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->disable_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->disable_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->disable_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->disable_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->disable_duration.sec); + *(outbuffer + offset + 0) = (this->disable_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->disable_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->disable_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->disable_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->disable_duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->disable_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->disable_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->disable_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->disable_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->disable_duration.sec); + this->disable_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->disable_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->disable_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->disable_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->disable_duration.nsec); + return offset; + } + + virtual const char * getType() override { return "fetch_driver_msgs/DisableChargingGoal"; }; + virtual const char * getMD5() override { return "53aa7041ef836ed316df1a458b2d4178"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingResult.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingResult.h new file mode 100644 index 000000000..67f8d241b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/DisableChargingResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_fetch_driver_msgs_DisableChargingResult_h +#define _ROS_fetch_driver_msgs_DisableChargingResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace fetch_driver_msgs +{ + + class DisableChargingResult : public ros::Msg + { + public: + typedef bool _charging_disabled_type; + _charging_disabled_type charging_disabled; + + DisableChargingResult(): + charging_disabled(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_charging_disabled; + u_charging_disabled.real = this->charging_disabled; + *(outbuffer + offset + 0) = (u_charging_disabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->charging_disabled); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_charging_disabled; + u_charging_disabled.base = 0; + u_charging_disabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->charging_disabled = u_charging_disabled.real; + offset += sizeof(this->charging_disabled); + return offset; + } + + virtual const char * getType() override { return "fetch_driver_msgs/DisableChargingResult"; }; + virtual const char * getMD5() override { return "27dccd3ed9b50034b06448bfbba88780"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/GripperState.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/GripperState.h new file mode 100644 index 000000000..ab59bde3e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/GripperState.h @@ -0,0 +1,158 @@ +#ifndef _ROS_fetch_driver_msgs_GripperState_h +#define _ROS_fetch_driver_msgs_GripperState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "fetch_driver_msgs/BoardState.h" +#include "fetch_driver_msgs/MotorState.h" +#include "fetch_driver_msgs/JointState.h" + +namespace fetch_driver_msgs +{ + + class GripperState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _ready_type; + _ready_type ready; + typedef bool _faulted_type; + _faulted_type faulted; + uint32_t boards_length; + typedef fetch_driver_msgs::BoardState _boards_type; + _boards_type st_boards; + _boards_type * boards; + uint32_t motors_length; + typedef fetch_driver_msgs::MotorState _motors_type; + _motors_type st_motors; + _motors_type * motors; + uint32_t joints_length; + typedef fetch_driver_msgs::JointState _joints_type; + _joints_type st_joints; + _joints_type * joints; + + GripperState(): + header(), + ready(0), + faulted(0), + boards_length(0), st_boards(), boards(nullptr), + motors_length(0), st_motors(), motors(nullptr), + joints_length(0), st_joints(), joints(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_ready; + u_ready.real = this->ready; + *(outbuffer + offset + 0) = (u_ready.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->ready); + union { + bool real; + uint8_t base; + } u_faulted; + u_faulted.real = this->faulted; + *(outbuffer + offset + 0) = (u_faulted.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->faulted); + *(outbuffer + offset + 0) = (this->boards_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->boards_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->boards_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->boards_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->boards_length); + for( uint32_t i = 0; i < boards_length; i++){ + offset += this->boards[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->motors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->motors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->motors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->motors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->motors_length); + for( uint32_t i = 0; i < motors_length; i++){ + offset += this->motors[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->joints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joints_length); + for( uint32_t i = 0; i < joints_length; i++){ + offset += this->joints[i].serialize(outbuffer + offset); + } + 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_ready; + u_ready.base = 0; + u_ready.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->ready = u_ready.real; + offset += sizeof(this->ready); + union { + bool real; + uint8_t base; + } u_faulted; + u_faulted.base = 0; + u_faulted.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->faulted = u_faulted.real; + offset += sizeof(this->faulted); + uint32_t boards_lengthT = ((uint32_t) (*(inbuffer + offset))); + boards_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + boards_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + boards_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->boards_length); + if(boards_lengthT > boards_length) + this->boards = (fetch_driver_msgs::BoardState*)realloc(this->boards, boards_lengthT * sizeof(fetch_driver_msgs::BoardState)); + boards_length = boards_lengthT; + for( uint32_t i = 0; i < boards_length; i++){ + offset += this->st_boards.deserialize(inbuffer + offset); + memcpy( &(this->boards[i]), &(this->st_boards), sizeof(fetch_driver_msgs::BoardState)); + } + uint32_t motors_lengthT = ((uint32_t) (*(inbuffer + offset))); + motors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + motors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + motors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->motors_length); + if(motors_lengthT > motors_length) + this->motors = (fetch_driver_msgs::MotorState*)realloc(this->motors, motors_lengthT * sizeof(fetch_driver_msgs::MotorState)); + motors_length = motors_lengthT; + for( uint32_t i = 0; i < motors_length; i++){ + offset += this->st_motors.deserialize(inbuffer + offset); + memcpy( &(this->motors[i]), &(this->st_motors), sizeof(fetch_driver_msgs::MotorState)); + } + uint32_t joints_lengthT = ((uint32_t) (*(inbuffer + offset))); + joints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joints_length); + if(joints_lengthT > joints_length) + this->joints = (fetch_driver_msgs::JointState*)realloc(this->joints, joints_lengthT * sizeof(fetch_driver_msgs::JointState)); + joints_length = joints_lengthT; + for( uint32_t i = 0; i < joints_length; i++){ + offset += this->st_joints.deserialize(inbuffer + offset); + memcpy( &(this->joints[i]), &(this->st_joints), sizeof(fetch_driver_msgs::JointState)); + } + return offset; + } + + virtual const char * getType() override { return "fetch_driver_msgs/GripperState"; }; + virtual const char * getMD5() override { return "3b442b195034293254bd9964c5dac688"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/Gyro.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/Gyro.h new file mode 100644 index 000000000..5f0ddfce0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/Gyro.h @@ -0,0 +1,87 @@ +#ifndef _ROS_fetch_driver_msgs_Gyro_h +#define _ROS_fetch_driver_msgs_Gyro_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace fetch_driver_msgs +{ + + class Gyro : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _flags_type; + _flags_type flags; + typedef geometry_msgs::Vector3 _data_type; + _data_type data; + typedef geometry_msgs::Vector3 _raw_type; + _raw_type raw; + typedef geometry_msgs::Vector3 _scale_type; + _scale_type scale; + typedef geometry_msgs::Vector3 _offset_type; + _offset_type offset; + enum { GLITCH = 1 }; + enum { INIT_ERROR = 2 }; + enum { READ_ERROR = 4 }; + enum { INTERRUPT_TOO_SLOW = 8 }; + enum { INTERRUPT_TOO_FAST = 16 }; + enum { SENSOR_NOT_PRESENT = 32 }; + enum { DEFINITELY_MOVING = 536870912 }; + enum { DEFINITELY_STOPPED = 1073741824 }; + enum { ANY_ERROR = 2147483648 }; + + Gyro(): + header(), + flags(0), + data(), + raw(), + scale(), + offset() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(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; + offset += sizeof(this->flags); + offset += this->data.serialize(outbuffer + offset); + offset += this->raw.serialize(outbuffer + offset); + offset += this->scale.serialize(outbuffer + offset); + offset += this->offset.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->flags = ((uint32_t) (*(inbuffer + offset))); + this->flags |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->flags |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->flags |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->flags); + offset += this->data.deserialize(inbuffer + offset); + offset += this->raw.deserialize(inbuffer + offset); + offset += this->scale.deserialize(inbuffer + offset); + offset += this->offset.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "fetch_driver_msgs/Gyro"; }; + virtual const char * getMD5() override { return "7e55d268dcc35aae7026f0428ed61292"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/JointState.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/JointState.h new file mode 100644 index 000000000..061717e90 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/JointState.h @@ -0,0 +1,206 @@ +#ifndef _ROS_fetch_driver_msgs_JointState_h +#define _ROS_fetch_driver_msgs_JointState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace fetch_driver_msgs +{ + + class JointState : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef uint8_t _control_mode_type; + _control_mode_type control_mode; + typedef float _desired_position_type; + _desired_position_type desired_position; + typedef float _desired_velocity_type; + _desired_velocity_type desired_velocity; + typedef float _desired_effort_type; + _desired_effort_type desired_effort; + typedef float _position_type; + _position_type position; + typedef float _velocity_type; + _velocity_type velocity; + typedef float _effort_type; + _effort_type effort; + + JointState(): + name(""), + control_mode(0), + desired_position(0), + desired_velocity(0), + desired_effort(0), + position(0), + velocity(0), + effort(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->control_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->control_mode); + union { + float real; + uint32_t base; + } u_desired_position; + u_desired_position.real = this->desired_position; + *(outbuffer + offset + 0) = (u_desired_position.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_desired_position.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_desired_position.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_desired_position.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->desired_position); + union { + float real; + uint32_t base; + } u_desired_velocity; + u_desired_velocity.real = this->desired_velocity; + *(outbuffer + offset + 0) = (u_desired_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_desired_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_desired_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_desired_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->desired_velocity); + union { + float real; + uint32_t base; + } u_desired_effort; + u_desired_effort.real = this->desired_effort; + *(outbuffer + offset + 0) = (u_desired_effort.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_desired_effort.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_desired_effort.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_desired_effort.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->desired_effort); + union { + float real; + uint32_t base; + } u_position; + u_position.real = this->position; + *(outbuffer + offset + 0) = (u_position.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_position.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_position.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_position.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->position); + union { + float real; + uint32_t base; + } u_velocity; + u_velocity.real = this->velocity; + *(outbuffer + offset + 0) = (u_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->velocity); + union { + float real; + uint32_t base; + } u_effort; + u_effort.real = this->effort; + *(outbuffer + offset + 0) = (u_effort.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_effort.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_effort.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_effort.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->effort); + 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->control_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->control_mode); + union { + float real; + uint32_t base; + } u_desired_position; + u_desired_position.base = 0; + u_desired_position.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_desired_position.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_desired_position.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_desired_position.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->desired_position = u_desired_position.real; + offset += sizeof(this->desired_position); + union { + float real; + uint32_t base; + } u_desired_velocity; + u_desired_velocity.base = 0; + u_desired_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_desired_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_desired_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_desired_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->desired_velocity = u_desired_velocity.real; + offset += sizeof(this->desired_velocity); + union { + float real; + uint32_t base; + } u_desired_effort; + u_desired_effort.base = 0; + u_desired_effort.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_desired_effort.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_desired_effort.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_desired_effort.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->desired_effort = u_desired_effort.real; + offset += sizeof(this->desired_effort); + union { + float real; + uint32_t base; + } u_position; + u_position.base = 0; + u_position.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_position.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_position.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_position.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->position = u_position.real; + offset += sizeof(this->position); + union { + float real; + uint32_t base; + } u_velocity; + u_velocity.base = 0; + u_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->velocity = u_velocity.real; + offset += sizeof(this->velocity); + union { + float real; + uint32_t base; + } u_effort; + u_effort.base = 0; + u_effort.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_effort.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_effort.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_effort.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->effort = u_effort.real; + offset += sizeof(this->effort); + return offset; + } + + virtual const char * getType() override { return "fetch_driver_msgs/JointState"; }; + virtual const char * getMD5() override { return "20cf035aa8e1812b6fd2af53c6aa178a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/MotorState.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/MotorState.h new file mode 100644 index 000000000..941d8b498 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/MotorState.h @@ -0,0 +1,261 @@ +#ifndef _ROS_fetch_driver_msgs_MotorState_h +#define _ROS_fetch_driver_msgs_MotorState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace fetch_driver_msgs +{ + + class MotorState : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef uint8_t _state_type; + _state_type state; + typedef uint8_t _error_type; + _error_type error; + typedef float _velocity_type; + _velocity_type velocity; + typedef float _effort_type; + _effort_type effort; + typedef float _position_type; + _position_type position; + typedef float _temperature_type; + _temperature_type temperature; + typedef float _motor_ratio_type; + _motor_ratio_type motor_ratio; + typedef float _motor_angle_offset_type; + _motor_angle_offset_type motor_angle_offset; + typedef float _motor_angle_offset_estimated_type; + _motor_angle_offset_estimated_type motor_angle_offset_estimated; + typedef float _joint_ratio_type; + _joint_ratio_type joint_ratio; + + MotorState(): + name(""), + state(0), + error(0), + velocity(0), + effort(0), + position(0), + temperature(0), + motor_ratio(0), + motor_angle_offset(0), + motor_angle_offset_estimated(0), + joint_ratio(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->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF; + offset += sizeof(this->error); + union { + float real; + uint32_t base; + } u_velocity; + u_velocity.real = this->velocity; + *(outbuffer + offset + 0) = (u_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->velocity); + union { + float real; + uint32_t base; + } u_effort; + u_effort.real = this->effort; + *(outbuffer + offset + 0) = (u_effort.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_effort.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_effort.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_effort.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->effort); + union { + float real; + uint32_t base; + } u_position; + u_position.real = this->position; + *(outbuffer + offset + 0) = (u_position.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_position.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_position.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_position.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->position); + 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_motor_ratio; + u_motor_ratio.real = this->motor_ratio; + *(outbuffer + offset + 0) = (u_motor_ratio.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_motor_ratio.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_motor_ratio.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_motor_ratio.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->motor_ratio); + union { + float real; + uint32_t base; + } u_motor_angle_offset; + u_motor_angle_offset.real = this->motor_angle_offset; + *(outbuffer + offset + 0) = (u_motor_angle_offset.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_motor_angle_offset.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_motor_angle_offset.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_motor_angle_offset.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->motor_angle_offset); + union { + float real; + uint32_t base; + } u_motor_angle_offset_estimated; + u_motor_angle_offset_estimated.real = this->motor_angle_offset_estimated; + *(outbuffer + offset + 0) = (u_motor_angle_offset_estimated.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_motor_angle_offset_estimated.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_motor_angle_offset_estimated.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_motor_angle_offset_estimated.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->motor_angle_offset_estimated); + union { + float real; + uint32_t base; + } u_joint_ratio; + u_joint_ratio.real = this->joint_ratio; + *(outbuffer + offset + 0) = (u_joint_ratio.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_joint_ratio.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_joint_ratio.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_joint_ratio.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_ratio); + 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->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + this->error = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->error); + union { + float real; + uint32_t base; + } u_velocity; + u_velocity.base = 0; + u_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->velocity = u_velocity.real; + offset += sizeof(this->velocity); + union { + float real; + uint32_t base; + } u_effort; + u_effort.base = 0; + u_effort.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_effort.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_effort.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_effort.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->effort = u_effort.real; + offset += sizeof(this->effort); + union { + float real; + uint32_t base; + } u_position; + u_position.base = 0; + u_position.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_position.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_position.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_position.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->position = u_position.real; + offset += sizeof(this->position); + 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_motor_ratio; + u_motor_ratio.base = 0; + u_motor_ratio.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_motor_ratio.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_motor_ratio.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_motor_ratio.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->motor_ratio = u_motor_ratio.real; + offset += sizeof(this->motor_ratio); + union { + float real; + uint32_t base; + } u_motor_angle_offset; + u_motor_angle_offset.base = 0; + u_motor_angle_offset.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_motor_angle_offset.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_motor_angle_offset.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_motor_angle_offset.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->motor_angle_offset = u_motor_angle_offset.real; + offset += sizeof(this->motor_angle_offset); + union { + float real; + uint32_t base; + } u_motor_angle_offset_estimated; + u_motor_angle_offset_estimated.base = 0; + u_motor_angle_offset_estimated.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_motor_angle_offset_estimated.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_motor_angle_offset_estimated.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_motor_angle_offset_estimated.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->motor_angle_offset_estimated = u_motor_angle_offset_estimated.real; + offset += sizeof(this->motor_angle_offset_estimated); + union { + float real; + uint32_t base; + } u_joint_ratio; + u_joint_ratio.base = 0; + u_joint_ratio.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_joint_ratio.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_joint_ratio.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_joint_ratio.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->joint_ratio = u_joint_ratio.real; + offset += sizeof(this->joint_ratio); + return offset; + } + + virtual const char * getType() override { return "fetch_driver_msgs/MotorState"; }; + virtual const char * getMD5() override { return "b726a0cde2dd21efcdc6db33af6de8d2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/RobotState.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/RobotState.h new file mode 100644 index 000000000..a6cdf8301 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/RobotState.h @@ -0,0 +1,208 @@ +#ifndef _ROS_fetch_driver_msgs_RobotState_h +#define _ROS_fetch_driver_msgs_RobotState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "fetch_driver_msgs/BoardState.h" +#include "fetch_driver_msgs/MotorState.h" +#include "fetch_driver_msgs/JointState.h" +#include "power_msgs/BreakerState.h" +#include "fetch_driver_msgs/ChargerState.h" + +namespace fetch_driver_msgs +{ + + class RobotState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _ready_type; + _ready_type ready; + typedef bool _faulted_type; + _faulted_type faulted; + typedef bool _runstopped_type; + _runstopped_type runstopped; + uint32_t boards_length; + typedef fetch_driver_msgs::BoardState _boards_type; + _boards_type st_boards; + _boards_type * boards; + uint32_t motors_length; + typedef fetch_driver_msgs::MotorState _motors_type; + _motors_type st_motors; + _motors_type * motors; + uint32_t joints_length; + typedef fetch_driver_msgs::JointState _joints_type; + _joints_type st_joints; + _joints_type * joints; + uint32_t breakers_length; + typedef power_msgs::BreakerState _breakers_type; + _breakers_type st_breakers; + _breakers_type * breakers; + typedef fetch_driver_msgs::ChargerState _charger_type; + _charger_type charger; + + RobotState(): + header(), + ready(0), + faulted(0), + runstopped(0), + boards_length(0), st_boards(), boards(nullptr), + motors_length(0), st_motors(), motors(nullptr), + joints_length(0), st_joints(), joints(nullptr), + breakers_length(0), st_breakers(), breakers(nullptr), + charger() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_ready; + u_ready.real = this->ready; + *(outbuffer + offset + 0) = (u_ready.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->ready); + union { + bool real; + uint8_t base; + } u_faulted; + u_faulted.real = this->faulted; + *(outbuffer + offset + 0) = (u_faulted.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->faulted); + union { + bool real; + uint8_t base; + } u_runstopped; + u_runstopped.real = this->runstopped; + *(outbuffer + offset + 0) = (u_runstopped.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->runstopped); + *(outbuffer + offset + 0) = (this->boards_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->boards_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->boards_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->boards_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->boards_length); + for( uint32_t i = 0; i < boards_length; i++){ + offset += this->boards[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->motors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->motors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->motors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->motors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->motors_length); + for( uint32_t i = 0; i < motors_length; i++){ + offset += this->motors[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->joints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joints_length); + for( uint32_t i = 0; i < joints_length; i++){ + offset += this->joints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->breakers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->breakers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->breakers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->breakers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->breakers_length); + for( uint32_t i = 0; i < breakers_length; i++){ + offset += this->breakers[i].serialize(outbuffer + offset); + } + offset += this->charger.serialize(outbuffer + offset); + 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_ready; + u_ready.base = 0; + u_ready.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->ready = u_ready.real; + offset += sizeof(this->ready); + union { + bool real; + uint8_t base; + } u_faulted; + u_faulted.base = 0; + u_faulted.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->faulted = u_faulted.real; + offset += sizeof(this->faulted); + union { + bool real; + uint8_t base; + } u_runstopped; + u_runstopped.base = 0; + u_runstopped.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->runstopped = u_runstopped.real; + offset += sizeof(this->runstopped); + uint32_t boards_lengthT = ((uint32_t) (*(inbuffer + offset))); + boards_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + boards_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + boards_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->boards_length); + if(boards_lengthT > boards_length) + this->boards = (fetch_driver_msgs::BoardState*)realloc(this->boards, boards_lengthT * sizeof(fetch_driver_msgs::BoardState)); + boards_length = boards_lengthT; + for( uint32_t i = 0; i < boards_length; i++){ + offset += this->st_boards.deserialize(inbuffer + offset); + memcpy( &(this->boards[i]), &(this->st_boards), sizeof(fetch_driver_msgs::BoardState)); + } + uint32_t motors_lengthT = ((uint32_t) (*(inbuffer + offset))); + motors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + motors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + motors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->motors_length); + if(motors_lengthT > motors_length) + this->motors = (fetch_driver_msgs::MotorState*)realloc(this->motors, motors_lengthT * sizeof(fetch_driver_msgs::MotorState)); + motors_length = motors_lengthT; + for( uint32_t i = 0; i < motors_length; i++){ + offset += this->st_motors.deserialize(inbuffer + offset); + memcpy( &(this->motors[i]), &(this->st_motors), sizeof(fetch_driver_msgs::MotorState)); + } + uint32_t joints_lengthT = ((uint32_t) (*(inbuffer + offset))); + joints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joints_length); + if(joints_lengthT > joints_length) + this->joints = (fetch_driver_msgs::JointState*)realloc(this->joints, joints_lengthT * sizeof(fetch_driver_msgs::JointState)); + joints_length = joints_lengthT; + for( uint32_t i = 0; i < joints_length; i++){ + offset += this->st_joints.deserialize(inbuffer + offset); + memcpy( &(this->joints[i]), &(this->st_joints), sizeof(fetch_driver_msgs::JointState)); + } + uint32_t breakers_lengthT = ((uint32_t) (*(inbuffer + offset))); + breakers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + breakers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + breakers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->breakers_length); + if(breakers_lengthT > breakers_length) + this->breakers = (power_msgs::BreakerState*)realloc(this->breakers, breakers_lengthT * sizeof(power_msgs::BreakerState)); + breakers_length = breakers_lengthT; + for( uint32_t i = 0; i < breakers_length; i++){ + offset += this->st_breakers.deserialize(inbuffer + offset); + memcpy( &(this->breakers[i]), &(this->st_breakers), sizeof(power_msgs::BreakerState)); + } + offset += this->charger.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "fetch_driver_msgs/RobotState"; }; + virtual const char * getMD5() override { return "c35add7c3f24efcc8e75b26275c2cc63"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/SafetyLaserState.h b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/SafetyLaserState.h new file mode 100644 index 000000000..f5a2c3733 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fetch_driver_msgs/SafetyLaserState.h @@ -0,0 +1,117 @@ +#ifndef _ROS_fetch_driver_msgs_SafetyLaserState_h +#define _ROS_fetch_driver_msgs_SafetyLaserState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace fetch_driver_msgs +{ + + class SafetyLaserState : public ros::Msg + { + public: + typedef uint8_t _monitoring_case_type; + _monitoring_case_type monitoring_case; + typedef bool _protective_field_free_type; + _protective_field_free_type protective_field_free; + typedef bool _warning_field1_free_type; + _warning_field1_free_type warning_field1_free; + typedef bool _warning_field2_free_type; + _warning_field2_free_type warning_field2_free; + typedef bool _contaminated_type; + _contaminated_type contaminated; + + SafetyLaserState(): + monitoring_case(0), + protective_field_free(0), + warning_field1_free(0), + warning_field2_free(0), + contaminated(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->monitoring_case >> (8 * 0)) & 0xFF; + offset += sizeof(this->monitoring_case); + union { + bool real; + uint8_t base; + } u_protective_field_free; + u_protective_field_free.real = this->protective_field_free; + *(outbuffer + offset + 0) = (u_protective_field_free.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->protective_field_free); + union { + bool real; + uint8_t base; + } u_warning_field1_free; + u_warning_field1_free.real = this->warning_field1_free; + *(outbuffer + offset + 0) = (u_warning_field1_free.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->warning_field1_free); + union { + bool real; + uint8_t base; + } u_warning_field2_free; + u_warning_field2_free.real = this->warning_field2_free; + *(outbuffer + offset + 0) = (u_warning_field2_free.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->warning_field2_free); + union { + bool real; + uint8_t base; + } u_contaminated; + u_contaminated.real = this->contaminated; + *(outbuffer + offset + 0) = (u_contaminated.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->contaminated); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->monitoring_case = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->monitoring_case); + union { + bool real; + uint8_t base; + } u_protective_field_free; + u_protective_field_free.base = 0; + u_protective_field_free.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->protective_field_free = u_protective_field_free.real; + offset += sizeof(this->protective_field_free); + union { + bool real; + uint8_t base; + } u_warning_field1_free; + u_warning_field1_free.base = 0; + u_warning_field1_free.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->warning_field1_free = u_warning_field1_free.real; + offset += sizeof(this->warning_field1_free); + union { + bool real; + uint8_t base; + } u_warning_field2_free; + u_warning_field2_free.base = 0; + u_warning_field2_free.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->warning_field2_free = u_warning_field2_free.real; + offset += sizeof(this->warning_field2_free); + union { + bool real; + uint8_t base; + } u_contaminated; + u_contaminated.base = 0; + u_contaminated.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->contaminated = u_contaminated.real; + offset += sizeof(this->contaminated); + return offset; + } + + virtual const char * getType() override { return "fetch_driver_msgs/SafetyLaserState"; }; + virtual const char * getMD5() override { return "3ba0845be197d9f4b6e251e9c720cc5e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fingertip_pressure/PressureInfo.h b/smart_device_protocol/ros_lib/ros_lib/fingertip_pressure/PressureInfo.h new file mode 100644 index 000000000..6bf14dc91 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fingertip_pressure/PressureInfo.h @@ -0,0 +1,64 @@ +#ifndef _ROS_fingertip_pressure_PressureInfo_h +#define _ROS_fingertip_pressure_PressureInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "fingertip_pressure/PressureInfoElement.h" + +namespace fingertip_pressure +{ + + class PressureInfo : public ros::Msg + { + public: + uint32_t sensor_length; + typedef fingertip_pressure::PressureInfoElement _sensor_type; + _sensor_type st_sensor; + _sensor_type * sensor; + + PressureInfo(): + sensor_length(0), st_sensor(), sensor(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->sensor_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sensor_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sensor_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sensor_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->sensor_length); + for( uint32_t i = 0; i < sensor_length; i++){ + offset += this->sensor[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t sensor_lengthT = ((uint32_t) (*(inbuffer + offset))); + sensor_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + sensor_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + sensor_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sensor_length); + if(sensor_lengthT > sensor_length) + this->sensor = (fingertip_pressure::PressureInfoElement*)realloc(this->sensor, sensor_lengthT * sizeof(fingertip_pressure::PressureInfoElement)); + sensor_length = sensor_lengthT; + for( uint32_t i = 0; i < sensor_length; i++){ + offset += this->st_sensor.deserialize(inbuffer + offset); + memcpy( &(this->sensor[i]), &(this->st_sensor), sizeof(fingertip_pressure::PressureInfoElement)); + } + return offset; + } + + virtual const char * getType() override { return "fingertip_pressure/PressureInfo"; }; + virtual const char * getMD5() override { return "a11fc5bae3534aa023741e378743af5b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/fingertip_pressure/PressureInfoElement.h b/smart_device_protocol/ros_lib/ros_lib/fingertip_pressure/PressureInfoElement.h new file mode 100644 index 000000000..d83e06971 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/fingertip_pressure/PressureInfoElement.h @@ -0,0 +1,156 @@ +#ifndef _ROS_fingertip_pressure_PressureInfoElement_h +#define _ROS_fingertip_pressure_PressureInfoElement_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace fingertip_pressure +{ + + class PressureInfoElement : public ros::Msg + { + public: + typedef const char* _frame_id_type; + _frame_id_type frame_id; + uint32_t center_length; + typedef geometry_msgs::Vector3 _center_type; + _center_type st_center; + _center_type * center; + uint32_t halfside1_length; + typedef geometry_msgs::Vector3 _halfside1_type; + _halfside1_type st_halfside1; + _halfside1_type * halfside1; + uint32_t halfside2_length; + typedef geometry_msgs::Vector3 _halfside2_type; + _halfside2_type st_halfside2; + _halfside2_type * halfside2; + uint32_t force_per_unit_length; + typedef float _force_per_unit_type; + _force_per_unit_type st_force_per_unit; + _force_per_unit_type * force_per_unit; + + PressureInfoElement(): + frame_id(""), + center_length(0), st_center(), center(nullptr), + halfside1_length(0), st_halfside1(), halfside1(nullptr), + halfside2_length(0), st_halfside2(), halfside2(nullptr), + force_per_unit_length(0), st_force_per_unit(), force_per_unit(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; + *(outbuffer + offset + 0) = (this->center_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->center_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->center_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->center_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->center_length); + for( uint32_t i = 0; i < center_length; i++){ + offset += this->center[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->halfside1_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->halfside1_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->halfside1_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->halfside1_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->halfside1_length); + for( uint32_t i = 0; i < halfside1_length; i++){ + offset += this->halfside1[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->halfside2_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->halfside2_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->halfside2_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->halfside2_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->halfside2_length); + for( uint32_t i = 0; i < halfside2_length; i++){ + offset += this->halfside2[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->force_per_unit_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->force_per_unit_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->force_per_unit_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->force_per_unit_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->force_per_unit_length); + for( uint32_t i = 0; i < force_per_unit_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->force_per_unit[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; + uint32_t center_lengthT = ((uint32_t) (*(inbuffer + offset))); + center_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + center_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + center_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->center_length); + if(center_lengthT > center_length) + this->center = (geometry_msgs::Vector3*)realloc(this->center, center_lengthT * sizeof(geometry_msgs::Vector3)); + center_length = center_lengthT; + for( uint32_t i = 0; i < center_length; i++){ + offset += this->st_center.deserialize(inbuffer + offset); + memcpy( &(this->center[i]), &(this->st_center), sizeof(geometry_msgs::Vector3)); + } + uint32_t halfside1_lengthT = ((uint32_t) (*(inbuffer + offset))); + halfside1_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + halfside1_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + halfside1_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->halfside1_length); + if(halfside1_lengthT > halfside1_length) + this->halfside1 = (geometry_msgs::Vector3*)realloc(this->halfside1, halfside1_lengthT * sizeof(geometry_msgs::Vector3)); + halfside1_length = halfside1_lengthT; + for( uint32_t i = 0; i < halfside1_length; i++){ + offset += this->st_halfside1.deserialize(inbuffer + offset); + memcpy( &(this->halfside1[i]), &(this->st_halfside1), sizeof(geometry_msgs::Vector3)); + } + uint32_t halfside2_lengthT = ((uint32_t) (*(inbuffer + offset))); + halfside2_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + halfside2_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + halfside2_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->halfside2_length); + if(halfside2_lengthT > halfside2_length) + this->halfside2 = (geometry_msgs::Vector3*)realloc(this->halfside2, halfside2_lengthT * sizeof(geometry_msgs::Vector3)); + halfside2_length = halfside2_lengthT; + for( uint32_t i = 0; i < halfside2_length; i++){ + offset += this->st_halfside2.deserialize(inbuffer + offset); + memcpy( &(this->halfside2[i]), &(this->st_halfside2), sizeof(geometry_msgs::Vector3)); + } + uint32_t force_per_unit_lengthT = ((uint32_t) (*(inbuffer + offset))); + force_per_unit_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + force_per_unit_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + force_per_unit_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->force_per_unit_length); + if(force_per_unit_lengthT > force_per_unit_length) + this->force_per_unit = (float*)realloc(this->force_per_unit, force_per_unit_lengthT * sizeof(float)); + force_per_unit_length = force_per_unit_lengthT; + for( uint32_t i = 0; i < force_per_unit_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_force_per_unit)); + memcpy( &(this->force_per_unit[i]), &(this->st_force_per_unit), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "fingertip_pressure/PressureInfoElement"; }; + virtual const char * getMD5() override { return "1cb486bb542ab85e1ff8d84fe9cc899f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_example_controllers/JointTorqueComparison.h b/smart_device_protocol/ros_lib/ros_lib/franka_example_controllers/JointTorqueComparison.h new file mode 100644 index 000000000..e871adede --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_example_controllers/JointTorqueComparison.h @@ -0,0 +1,67 @@ +#ifndef _ROS_franka_example_controllers_JointTorqueComparison_h +#define _ROS_franka_example_controllers_JointTorqueComparison_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_example_controllers +{ + + class JointTorqueComparison : public ros::Msg + { + public: + float tau_error[7]; + float tau_commanded[7]; + float tau_measured[7]; + typedef float _root_mean_square_error_type; + _root_mean_square_error_type root_mean_square_error; + + JointTorqueComparison(): + tau_error(), + tau_commanded(), + tau_measured(), + root_mean_square_error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->tau_error[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->tau_commanded[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->tau_measured[i]); + } + offset += serializeAvrFloat64(outbuffer + offset, this->root_mean_square_error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->tau_error[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->tau_commanded[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->tau_measured[i])); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->root_mean_square_error)); + return offset; + } + + virtual const char * getType() override { return "franka_example_controllers/JointTorqueComparison"; }; + virtual const char * getMD5() override { return "6c09db90263c92a2e4e4d736f67bc033"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspAction.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspAction.h new file mode 100644 index 000000000..2ac77cee2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_GraspAction_h +#define _ROS_franka_gripper_GraspAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "franka_gripper/GraspActionGoal.h" +#include "franka_gripper/GraspActionResult.h" +#include "franka_gripper/GraspActionFeedback.h" + +namespace franka_gripper +{ + + class GraspAction : public ros::Msg + { + public: + typedef franka_gripper::GraspActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef franka_gripper::GraspActionResult _action_result_type; + _action_result_type action_result; + typedef franka_gripper::GraspActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + GraspAction(): + 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 "franka_gripper/GraspAction"; }; + virtual const char * getMD5() override { return "6f89449359949eaf1f0fef57b7e0db2a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionFeedback.h new file mode 100644 index 000000000..1770d83d5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_GraspActionFeedback_h +#define _ROS_franka_gripper_GraspActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "franka_gripper/GraspFeedback.h" + +namespace franka_gripper +{ + + class GraspActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef franka_gripper::GraspFeedback _feedback_type; + _feedback_type feedback; + + GraspActionFeedback(): + 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 "franka_gripper/GraspActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionGoal.h new file mode 100644 index 000000000..d69ef5fe2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_GraspActionGoal_h +#define _ROS_franka_gripper_GraspActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "franka_gripper/GraspGoal.h" + +namespace franka_gripper +{ + + class GraspActionGoal : 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 franka_gripper::GraspGoal _goal_type; + _goal_type goal; + + GraspActionGoal(): + 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 "franka_gripper/GraspActionGoal"; }; + virtual const char * getMD5() override { return "7bd1a6e7f94ef15bb6dd05cb170e7909"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionResult.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionResult.h new file mode 100644 index 000000000..562bf9542 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_GraspActionResult_h +#define _ROS_franka_gripper_GraspActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "franka_gripper/GraspResult.h" + +namespace franka_gripper +{ + + class GraspActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef franka_gripper::GraspResult _result_type; + _result_type result; + + GraspActionResult(): + 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 "franka_gripper/GraspActionResult"; }; + virtual const char * getMD5() override { return "89dbc4e75593b525bbbea3a150532ed6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspEpsilon.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspEpsilon.h new file mode 100644 index 000000000..a3b85ef14 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspEpsilon.h @@ -0,0 +1,48 @@ +#ifndef _ROS_franka_gripper_GraspEpsilon_h +#define _ROS_franka_gripper_GraspEpsilon_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class GraspEpsilon : public ros::Msg + { + public: + typedef float _inner_type; + _inner_type inner; + typedef float _outer_type; + _outer_type outer; + + GraspEpsilon(): + inner(0), + outer(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->inner); + offset += serializeAvrFloat64(outbuffer + offset, this->outer); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->inner)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->outer)); + return offset; + } + + virtual const char * getType() override { return "franka_gripper/GraspEpsilon"; }; + virtual const char * getMD5() override { return "95b2c5464a6f679bd1dacaf86414f095"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspFeedback.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspFeedback.h new file mode 100644 index 000000000..39e174d80 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_franka_gripper_GraspFeedback_h +#define _ROS_franka_gripper_GraspFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class GraspFeedback : public ros::Msg + { + public: + + GraspFeedback() + { + } + + 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 "franka_gripper/GraspFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspGoal.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspGoal.h new file mode 100644 index 000000000..92a23f32a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspGoal.h @@ -0,0 +1,59 @@ +#ifndef _ROS_franka_gripper_GraspGoal_h +#define _ROS_franka_gripper_GraspGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "franka_gripper/GraspEpsilon.h" + +namespace franka_gripper +{ + + class GraspGoal : public ros::Msg + { + public: + typedef float _width_type; + _width_type width; + typedef franka_gripper::GraspEpsilon _epsilon_type; + _epsilon_type epsilon; + typedef float _speed_type; + _speed_type speed; + typedef float _force_type; + _force_type force; + + GraspGoal(): + width(0), + epsilon(), + speed(0), + force(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->width); + offset += this->epsilon.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->speed); + offset += serializeAvrFloat64(outbuffer + offset, this->force); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->width)); + offset += this->epsilon.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->speed)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->force)); + return offset; + } + + virtual const char * getType() override { return "franka_gripper/GraspGoal"; }; + virtual const char * getMD5() override { return "627a0f0b10ad0c919fbd62b0b3427e63"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspResult.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspResult.h new file mode 100644 index 000000000..44f161e9d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/GraspResult.h @@ -0,0 +1,73 @@ +#ifndef _ROS_franka_gripper_GraspResult_h +#define _ROS_franka_gripper_GraspResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class GraspResult : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + GraspResult(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return "franka_gripper/GraspResult"; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingAction.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingAction.h new file mode 100644 index 000000000..9f3b4145f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_HomingAction_h +#define _ROS_franka_gripper_HomingAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "franka_gripper/HomingActionGoal.h" +#include "franka_gripper/HomingActionResult.h" +#include "franka_gripper/HomingActionFeedback.h" + +namespace franka_gripper +{ + + class HomingAction : public ros::Msg + { + public: + typedef franka_gripper::HomingActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef franka_gripper::HomingActionResult _action_result_type; + _action_result_type action_result; + typedef franka_gripper::HomingActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + HomingAction(): + 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 "franka_gripper/HomingAction"; }; + virtual const char * getMD5() override { return "f37964fcdec026d9507d088d32b65b38"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionFeedback.h new file mode 100644 index 000000000..cdb5ce6de --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_HomingActionFeedback_h +#define _ROS_franka_gripper_HomingActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "franka_gripper/HomingFeedback.h" + +namespace franka_gripper +{ + + class HomingActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef franka_gripper::HomingFeedback _feedback_type; + _feedback_type feedback; + + HomingActionFeedback(): + 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 "franka_gripper/HomingActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionGoal.h new file mode 100644 index 000000000..a4e551478 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_HomingActionGoal_h +#define _ROS_franka_gripper_HomingActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "franka_gripper/HomingGoal.h" + +namespace franka_gripper +{ + + class HomingActionGoal : 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 franka_gripper::HomingGoal _goal_type; + _goal_type goal; + + HomingActionGoal(): + 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 "franka_gripper/HomingActionGoal"; }; + virtual const char * getMD5() override { return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionResult.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionResult.h new file mode 100644 index 000000000..80335cbfd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_HomingActionResult_h +#define _ROS_franka_gripper_HomingActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "franka_gripper/HomingResult.h" + +namespace franka_gripper +{ + + class HomingActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef franka_gripper::HomingResult _result_type; + _result_type result; + + HomingActionResult(): + 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 "franka_gripper/HomingActionResult"; }; + virtual const char * getMD5() override { return "89dbc4e75593b525bbbea3a150532ed6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingFeedback.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingFeedback.h new file mode 100644 index 000000000..c0dbc2ffc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_franka_gripper_HomingFeedback_h +#define _ROS_franka_gripper_HomingFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class HomingFeedback : public ros::Msg + { + public: + + HomingFeedback() + { + } + + 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 "franka_gripper/HomingFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingGoal.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingGoal.h new file mode 100644 index 000000000..7cca34149 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_franka_gripper_HomingGoal_h +#define _ROS_franka_gripper_HomingGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class HomingGoal : public ros::Msg + { + public: + + HomingGoal() + { + } + + 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 "franka_gripper/HomingGoal"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingResult.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingResult.h new file mode 100644 index 000000000..c2a9f906b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/HomingResult.h @@ -0,0 +1,73 @@ +#ifndef _ROS_franka_gripper_HomingResult_h +#define _ROS_franka_gripper_HomingResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class HomingResult : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + HomingResult(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return "franka_gripper/HomingResult"; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveAction.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveAction.h new file mode 100644 index 000000000..90c937dde --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_MoveAction_h +#define _ROS_franka_gripper_MoveAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "franka_gripper/MoveActionGoal.h" +#include "franka_gripper/MoveActionResult.h" +#include "franka_gripper/MoveActionFeedback.h" + +namespace franka_gripper +{ + + class MoveAction : public ros::Msg + { + public: + typedef franka_gripper::MoveActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef franka_gripper::MoveActionResult _action_result_type; + _action_result_type action_result; + typedef franka_gripper::MoveActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + MoveAction(): + 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 "franka_gripper/MoveAction"; }; + virtual const char * getMD5() override { return "85e8e11f508e446b706022926779afee"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionFeedback.h new file mode 100644 index 000000000..f68a9dc61 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_MoveActionFeedback_h +#define _ROS_franka_gripper_MoveActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "franka_gripper/MoveFeedback.h" + +namespace franka_gripper +{ + + class MoveActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef franka_gripper::MoveFeedback _feedback_type; + _feedback_type feedback; + + MoveActionFeedback(): + 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 "franka_gripper/MoveActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionGoal.h new file mode 100644 index 000000000..831ec66c0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_MoveActionGoal_h +#define _ROS_franka_gripper_MoveActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "franka_gripper/MoveGoal.h" + +namespace franka_gripper +{ + + class MoveActionGoal : 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 franka_gripper::MoveGoal _goal_type; + _goal_type goal; + + MoveActionGoal(): + 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 "franka_gripper/MoveActionGoal"; }; + virtual const char * getMD5() override { return "f8907a1e7bb902f2e4c7db8e1cf3d24f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionResult.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionResult.h new file mode 100644 index 000000000..60e9134b0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_MoveActionResult_h +#define _ROS_franka_gripper_MoveActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "franka_gripper/MoveResult.h" + +namespace franka_gripper +{ + + class MoveActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef franka_gripper::MoveResult _result_type; + _result_type result; + + MoveActionResult(): + 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 "franka_gripper/MoveActionResult"; }; + virtual const char * getMD5() override { return "89dbc4e75593b525bbbea3a150532ed6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveFeedback.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveFeedback.h new file mode 100644 index 000000000..5f48551e0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_franka_gripper_MoveFeedback_h +#define _ROS_franka_gripper_MoveFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class MoveFeedback : public ros::Msg + { + public: + + MoveFeedback() + { + } + + 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 "franka_gripper/MoveFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveGoal.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveGoal.h new file mode 100644 index 000000000..d9c06d47c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveGoal.h @@ -0,0 +1,48 @@ +#ifndef _ROS_franka_gripper_MoveGoal_h +#define _ROS_franka_gripper_MoveGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class MoveGoal : public ros::Msg + { + public: + typedef float _width_type; + _width_type width; + typedef float _speed_type; + _speed_type speed; + + MoveGoal(): + width(0), + speed(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->width); + offset += serializeAvrFloat64(outbuffer + offset, this->speed); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->width)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->speed)); + return offset; + } + + virtual const char * getType() override { return "franka_gripper/MoveGoal"; }; + virtual const char * getMD5() override { return "d16050a0fe85f1c2cb8347c99678362e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveResult.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveResult.h new file mode 100644 index 000000000..16dcf1afb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/MoveResult.h @@ -0,0 +1,73 @@ +#ifndef _ROS_franka_gripper_MoveResult_h +#define _ROS_franka_gripper_MoveResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class MoveResult : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + MoveResult(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return "franka_gripper/MoveResult"; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopAction.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopAction.h new file mode 100644 index 000000000..9afba0f4b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_StopAction_h +#define _ROS_franka_gripper_StopAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "franka_gripper/StopActionGoal.h" +#include "franka_gripper/StopActionResult.h" +#include "franka_gripper/StopActionFeedback.h" + +namespace franka_gripper +{ + + class StopAction : public ros::Msg + { + public: + typedef franka_gripper::StopActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef franka_gripper::StopActionResult _action_result_type; + _action_result_type action_result; + typedef franka_gripper::StopActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + StopAction(): + 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 "franka_gripper/StopAction"; }; + virtual const char * getMD5() override { return "f37964fcdec026d9507d088d32b65b38"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionFeedback.h new file mode 100644 index 000000000..fb3937a13 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_StopActionFeedback_h +#define _ROS_franka_gripper_StopActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "franka_gripper/StopFeedback.h" + +namespace franka_gripper +{ + + class StopActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef franka_gripper::StopFeedback _feedback_type; + _feedback_type feedback; + + StopActionFeedback(): + 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 "franka_gripper/StopActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionGoal.h new file mode 100644 index 000000000..ac4b6747c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_StopActionGoal_h +#define _ROS_franka_gripper_StopActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "franka_gripper/StopGoal.h" + +namespace franka_gripper +{ + + class StopActionGoal : 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 franka_gripper::StopGoal _goal_type; + _goal_type goal; + + StopActionGoal(): + 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 "franka_gripper/StopActionGoal"; }; + virtual const char * getMD5() override { return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionResult.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionResult.h new file mode 100644 index 000000000..79f793d61 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_gripper_StopActionResult_h +#define _ROS_franka_gripper_StopActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "franka_gripper/StopResult.h" + +namespace franka_gripper +{ + + class StopActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef franka_gripper::StopResult _result_type; + _result_type result; + + StopActionResult(): + 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 "franka_gripper/StopActionResult"; }; + virtual const char * getMD5() override { return "89dbc4e75593b525bbbea3a150532ed6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopFeedback.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopFeedback.h new file mode 100644 index 000000000..821142b5f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_franka_gripper_StopFeedback_h +#define _ROS_franka_gripper_StopFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class StopFeedback : public ros::Msg + { + public: + + StopFeedback() + { + } + + 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 "franka_gripper/StopFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopGoal.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopGoal.h new file mode 100644 index 000000000..92d2f801f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_franka_gripper_StopGoal_h +#define _ROS_franka_gripper_StopGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class StopGoal : public ros::Msg + { + public: + + StopGoal() + { + } + + 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 "franka_gripper/StopGoal"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopResult.h b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopResult.h new file mode 100644 index 000000000..93593d358 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_gripper/StopResult.h @@ -0,0 +1,73 @@ +#ifndef _ROS_franka_gripper_StopResult_h +#define _ROS_franka_gripper_StopResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_gripper +{ + + class StopResult : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + StopResult(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return "franka_gripper/StopResult"; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryAction.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryAction.h new file mode 100644 index 000000000..c3c58d0cc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_msgs_ErrorRecoveryAction_h +#define _ROS_franka_msgs_ErrorRecoveryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "franka_msgs/ErrorRecoveryActionGoal.h" +#include "franka_msgs/ErrorRecoveryActionResult.h" +#include "franka_msgs/ErrorRecoveryActionFeedback.h" + +namespace franka_msgs +{ + + class ErrorRecoveryAction : public ros::Msg + { + public: + typedef franka_msgs::ErrorRecoveryActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef franka_msgs::ErrorRecoveryActionResult _action_result_type; + _action_result_type action_result; + typedef franka_msgs::ErrorRecoveryActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + ErrorRecoveryAction(): + 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 "franka_msgs/ErrorRecoveryAction"; }; + virtual const char * getMD5() override { return "d5a016b49f278075666fbc901debbd08"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionFeedback.h new file mode 100644 index 000000000..374aa0539 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_msgs_ErrorRecoveryActionFeedback_h +#define _ROS_franka_msgs_ErrorRecoveryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "franka_msgs/ErrorRecoveryFeedback.h" + +namespace franka_msgs +{ + + class ErrorRecoveryActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef franka_msgs::ErrorRecoveryFeedback _feedback_type; + _feedback_type feedback; + + ErrorRecoveryActionFeedback(): + 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 "franka_msgs/ErrorRecoveryActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionGoal.h new file mode 100644 index 000000000..b974b1463 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_msgs_ErrorRecoveryActionGoal_h +#define _ROS_franka_msgs_ErrorRecoveryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "franka_msgs/ErrorRecoveryGoal.h" + +namespace franka_msgs +{ + + class ErrorRecoveryActionGoal : 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 franka_msgs::ErrorRecoveryGoal _goal_type; + _goal_type goal; + + ErrorRecoveryActionGoal(): + 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 "franka_msgs/ErrorRecoveryActionGoal"; }; + virtual const char * getMD5() override { return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionResult.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionResult.h new file mode 100644 index 000000000..c188272c4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_franka_msgs_ErrorRecoveryActionResult_h +#define _ROS_franka_msgs_ErrorRecoveryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "franka_msgs/ErrorRecoveryResult.h" + +namespace franka_msgs +{ + + class ErrorRecoveryActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef franka_msgs::ErrorRecoveryResult _result_type; + _result_type result; + + ErrorRecoveryActionResult(): + 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 "franka_msgs/ErrorRecoveryActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryFeedback.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryFeedback.h new file mode 100644 index 000000000..a8ec76dae --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_franka_msgs_ErrorRecoveryFeedback_h +#define _ROS_franka_msgs_ErrorRecoveryFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + + class ErrorRecoveryFeedback : public ros::Msg + { + public: + + ErrorRecoveryFeedback() + { + } + + 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 "franka_msgs/ErrorRecoveryFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryGoal.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryGoal.h new file mode 100644 index 000000000..4d5616067 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_franka_msgs_ErrorRecoveryGoal_h +#define _ROS_franka_msgs_ErrorRecoveryGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + + class ErrorRecoveryGoal : public ros::Msg + { + public: + + ErrorRecoveryGoal() + { + } + + 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 "franka_msgs/ErrorRecoveryGoal"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryResult.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryResult.h new file mode 100644 index 000000000..5c6206b9f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/ErrorRecoveryResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_franka_msgs_ErrorRecoveryResult_h +#define _ROS_franka_msgs_ErrorRecoveryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + + class ErrorRecoveryResult : public ros::Msg + { + public: + + ErrorRecoveryResult() + { + } + + 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 "franka_msgs/ErrorRecoveryResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/Errors.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/Errors.h new file mode 100644 index 000000000..6a422d287 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/Errors.h @@ -0,0 +1,776 @@ +#ifndef _ROS_franka_msgs_Errors_h +#define _ROS_franka_msgs_Errors_h + +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + + class Errors : public ros::Msg + { + public: + typedef bool _joint_position_limits_violation_type; + _joint_position_limits_violation_type joint_position_limits_violation; + typedef bool _cartesian_position_limits_violation_type; + _cartesian_position_limits_violation_type cartesian_position_limits_violation; + typedef bool _self_collision_avoidance_violation_type; + _self_collision_avoidance_violation_type self_collision_avoidance_violation; + typedef bool _joint_velocity_violation_type; + _joint_velocity_violation_type joint_velocity_violation; + typedef bool _cartesian_velocity_violation_type; + _cartesian_velocity_violation_type cartesian_velocity_violation; + typedef bool _force_control_safety_violation_type; + _force_control_safety_violation_type force_control_safety_violation; + typedef bool _joint_reflex_type; + _joint_reflex_type joint_reflex; + typedef bool _cartesian_reflex_type; + _cartesian_reflex_type cartesian_reflex; + typedef bool _max_goal_pose_deviation_violation_type; + _max_goal_pose_deviation_violation_type max_goal_pose_deviation_violation; + typedef bool _max_path_pose_deviation_violation_type; + _max_path_pose_deviation_violation_type max_path_pose_deviation_violation; + typedef bool _cartesian_velocity_profile_safety_violation_type; + _cartesian_velocity_profile_safety_violation_type cartesian_velocity_profile_safety_violation; + typedef bool _joint_position_motion_generator_start_pose_invalid_type; + _joint_position_motion_generator_start_pose_invalid_type joint_position_motion_generator_start_pose_invalid; + typedef bool _joint_motion_generator_position_limits_violation_type; + _joint_motion_generator_position_limits_violation_type joint_motion_generator_position_limits_violation; + typedef bool _joint_motion_generator_velocity_limits_violation_type; + _joint_motion_generator_velocity_limits_violation_type joint_motion_generator_velocity_limits_violation; + typedef bool _joint_motion_generator_velocity_discontinuity_type; + _joint_motion_generator_velocity_discontinuity_type joint_motion_generator_velocity_discontinuity; + typedef bool _joint_motion_generator_acceleration_discontinuity_type; + _joint_motion_generator_acceleration_discontinuity_type joint_motion_generator_acceleration_discontinuity; + typedef bool _cartesian_position_motion_generator_start_pose_invalid_type; + _cartesian_position_motion_generator_start_pose_invalid_type cartesian_position_motion_generator_start_pose_invalid; + typedef bool _cartesian_motion_generator_elbow_limit_violation_type; + _cartesian_motion_generator_elbow_limit_violation_type cartesian_motion_generator_elbow_limit_violation; + typedef bool _cartesian_motion_generator_velocity_limits_violation_type; + _cartesian_motion_generator_velocity_limits_violation_type cartesian_motion_generator_velocity_limits_violation; + typedef bool _cartesian_motion_generator_velocity_discontinuity_type; + _cartesian_motion_generator_velocity_discontinuity_type cartesian_motion_generator_velocity_discontinuity; + typedef bool _cartesian_motion_generator_acceleration_discontinuity_type; + _cartesian_motion_generator_acceleration_discontinuity_type cartesian_motion_generator_acceleration_discontinuity; + typedef bool _cartesian_motion_generator_elbow_sign_inconsistent_type; + _cartesian_motion_generator_elbow_sign_inconsistent_type cartesian_motion_generator_elbow_sign_inconsistent; + typedef bool _cartesian_motion_generator_start_elbow_invalid_type; + _cartesian_motion_generator_start_elbow_invalid_type cartesian_motion_generator_start_elbow_invalid; + typedef bool _cartesian_motion_generator_joint_position_limits_violation_type; + _cartesian_motion_generator_joint_position_limits_violation_type cartesian_motion_generator_joint_position_limits_violation; + typedef bool _cartesian_motion_generator_joint_velocity_limits_violation_type; + _cartesian_motion_generator_joint_velocity_limits_violation_type cartesian_motion_generator_joint_velocity_limits_violation; + typedef bool _cartesian_motion_generator_joint_velocity_discontinuity_type; + _cartesian_motion_generator_joint_velocity_discontinuity_type cartesian_motion_generator_joint_velocity_discontinuity; + typedef bool _cartesian_motion_generator_joint_acceleration_discontinuity_type; + _cartesian_motion_generator_joint_acceleration_discontinuity_type cartesian_motion_generator_joint_acceleration_discontinuity; + typedef bool _cartesian_position_motion_generator_invalid_frame_type; + _cartesian_position_motion_generator_invalid_frame_type cartesian_position_motion_generator_invalid_frame; + typedef bool _force_controller_desired_force_tolerance_violation_type; + _force_controller_desired_force_tolerance_violation_type force_controller_desired_force_tolerance_violation; + typedef bool _controller_torque_discontinuity_type; + _controller_torque_discontinuity_type controller_torque_discontinuity; + typedef bool _start_elbow_sign_inconsistent_type; + _start_elbow_sign_inconsistent_type start_elbow_sign_inconsistent; + typedef bool _communication_constraints_violation_type; + _communication_constraints_violation_type communication_constraints_violation; + typedef bool _power_limit_violation_type; + _power_limit_violation_type power_limit_violation; + typedef bool _joint_p2p_insufficient_torque_for_planning_type; + _joint_p2p_insufficient_torque_for_planning_type joint_p2p_insufficient_torque_for_planning; + typedef bool _tau_j_range_violation_type; + _tau_j_range_violation_type tau_j_range_violation; + typedef bool _instability_detected_type; + _instability_detected_type instability_detected; + typedef bool _joint_move_in_wrong_direction_type; + _joint_move_in_wrong_direction_type joint_move_in_wrong_direction; + typedef bool _cartesian_spline_motion_generator_violation_type; + _cartesian_spline_motion_generator_violation_type cartesian_spline_motion_generator_violation; + typedef bool _joint_via_motion_generator_planning_joint_limit_violation_type; + _joint_via_motion_generator_planning_joint_limit_violation_type joint_via_motion_generator_planning_joint_limit_violation; + typedef bool _base_acceleration_initialization_timeout_type; + _base_acceleration_initialization_timeout_type base_acceleration_initialization_timeout; + typedef bool _base_acceleration_invalid_reading_type; + _base_acceleration_invalid_reading_type base_acceleration_invalid_reading; + + Errors(): + joint_position_limits_violation(0), + cartesian_position_limits_violation(0), + self_collision_avoidance_violation(0), + joint_velocity_violation(0), + cartesian_velocity_violation(0), + force_control_safety_violation(0), + joint_reflex(0), + cartesian_reflex(0), + max_goal_pose_deviation_violation(0), + max_path_pose_deviation_violation(0), + cartesian_velocity_profile_safety_violation(0), + joint_position_motion_generator_start_pose_invalid(0), + joint_motion_generator_position_limits_violation(0), + joint_motion_generator_velocity_limits_violation(0), + joint_motion_generator_velocity_discontinuity(0), + joint_motion_generator_acceleration_discontinuity(0), + cartesian_position_motion_generator_start_pose_invalid(0), + cartesian_motion_generator_elbow_limit_violation(0), + cartesian_motion_generator_velocity_limits_violation(0), + cartesian_motion_generator_velocity_discontinuity(0), + cartesian_motion_generator_acceleration_discontinuity(0), + cartesian_motion_generator_elbow_sign_inconsistent(0), + cartesian_motion_generator_start_elbow_invalid(0), + cartesian_motion_generator_joint_position_limits_violation(0), + cartesian_motion_generator_joint_velocity_limits_violation(0), + cartesian_motion_generator_joint_velocity_discontinuity(0), + cartesian_motion_generator_joint_acceleration_discontinuity(0), + cartesian_position_motion_generator_invalid_frame(0), + force_controller_desired_force_tolerance_violation(0), + controller_torque_discontinuity(0), + start_elbow_sign_inconsistent(0), + communication_constraints_violation(0), + power_limit_violation(0), + joint_p2p_insufficient_torque_for_planning(0), + tau_j_range_violation(0), + instability_detected(0), + joint_move_in_wrong_direction(0), + cartesian_spline_motion_generator_violation(0), + joint_via_motion_generator_planning_joint_limit_violation(0), + base_acceleration_initialization_timeout(0), + base_acceleration_invalid_reading(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_joint_position_limits_violation; + u_joint_position_limits_violation.real = this->joint_position_limits_violation; + *(outbuffer + offset + 0) = (u_joint_position_limits_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_position_limits_violation); + union { + bool real; + uint8_t base; + } u_cartesian_position_limits_violation; + u_cartesian_position_limits_violation.real = this->cartesian_position_limits_violation; + *(outbuffer + offset + 0) = (u_cartesian_position_limits_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_position_limits_violation); + union { + bool real; + uint8_t base; + } u_self_collision_avoidance_violation; + u_self_collision_avoidance_violation.real = this->self_collision_avoidance_violation; + *(outbuffer + offset + 0) = (u_self_collision_avoidance_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->self_collision_avoidance_violation); + union { + bool real; + uint8_t base; + } u_joint_velocity_violation; + u_joint_velocity_violation.real = this->joint_velocity_violation; + *(outbuffer + offset + 0) = (u_joint_velocity_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_velocity_violation); + union { + bool real; + uint8_t base; + } u_cartesian_velocity_violation; + u_cartesian_velocity_violation.real = this->cartesian_velocity_violation; + *(outbuffer + offset + 0) = (u_cartesian_velocity_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_velocity_violation); + union { + bool real; + uint8_t base; + } u_force_control_safety_violation; + u_force_control_safety_violation.real = this->force_control_safety_violation; + *(outbuffer + offset + 0) = (u_force_control_safety_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->force_control_safety_violation); + union { + bool real; + uint8_t base; + } u_joint_reflex; + u_joint_reflex.real = this->joint_reflex; + *(outbuffer + offset + 0) = (u_joint_reflex.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_reflex); + union { + bool real; + uint8_t base; + } u_cartesian_reflex; + u_cartesian_reflex.real = this->cartesian_reflex; + *(outbuffer + offset + 0) = (u_cartesian_reflex.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_reflex); + union { + bool real; + uint8_t base; + } u_max_goal_pose_deviation_violation; + u_max_goal_pose_deviation_violation.real = this->max_goal_pose_deviation_violation; + *(outbuffer + offset + 0) = (u_max_goal_pose_deviation_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->max_goal_pose_deviation_violation); + union { + bool real; + uint8_t base; + } u_max_path_pose_deviation_violation; + u_max_path_pose_deviation_violation.real = this->max_path_pose_deviation_violation; + *(outbuffer + offset + 0) = (u_max_path_pose_deviation_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->max_path_pose_deviation_violation); + union { + bool real; + uint8_t base; + } u_cartesian_velocity_profile_safety_violation; + u_cartesian_velocity_profile_safety_violation.real = this->cartesian_velocity_profile_safety_violation; + *(outbuffer + offset + 0) = (u_cartesian_velocity_profile_safety_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_velocity_profile_safety_violation); + union { + bool real; + uint8_t base; + } u_joint_position_motion_generator_start_pose_invalid; + u_joint_position_motion_generator_start_pose_invalid.real = this->joint_position_motion_generator_start_pose_invalid; + *(outbuffer + offset + 0) = (u_joint_position_motion_generator_start_pose_invalid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_position_motion_generator_start_pose_invalid); + union { + bool real; + uint8_t base; + } u_joint_motion_generator_position_limits_violation; + u_joint_motion_generator_position_limits_violation.real = this->joint_motion_generator_position_limits_violation; + *(outbuffer + offset + 0) = (u_joint_motion_generator_position_limits_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_motion_generator_position_limits_violation); + union { + bool real; + uint8_t base; + } u_joint_motion_generator_velocity_limits_violation; + u_joint_motion_generator_velocity_limits_violation.real = this->joint_motion_generator_velocity_limits_violation; + *(outbuffer + offset + 0) = (u_joint_motion_generator_velocity_limits_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_motion_generator_velocity_limits_violation); + union { + bool real; + uint8_t base; + } u_joint_motion_generator_velocity_discontinuity; + u_joint_motion_generator_velocity_discontinuity.real = this->joint_motion_generator_velocity_discontinuity; + *(outbuffer + offset + 0) = (u_joint_motion_generator_velocity_discontinuity.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_motion_generator_velocity_discontinuity); + union { + bool real; + uint8_t base; + } u_joint_motion_generator_acceleration_discontinuity; + u_joint_motion_generator_acceleration_discontinuity.real = this->joint_motion_generator_acceleration_discontinuity; + *(outbuffer + offset + 0) = (u_joint_motion_generator_acceleration_discontinuity.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_motion_generator_acceleration_discontinuity); + union { + bool real; + uint8_t base; + } u_cartesian_position_motion_generator_start_pose_invalid; + u_cartesian_position_motion_generator_start_pose_invalid.real = this->cartesian_position_motion_generator_start_pose_invalid; + *(outbuffer + offset + 0) = (u_cartesian_position_motion_generator_start_pose_invalid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_position_motion_generator_start_pose_invalid); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_elbow_limit_violation; + u_cartesian_motion_generator_elbow_limit_violation.real = this->cartesian_motion_generator_elbow_limit_violation; + *(outbuffer + offset + 0) = (u_cartesian_motion_generator_elbow_limit_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_motion_generator_elbow_limit_violation); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_velocity_limits_violation; + u_cartesian_motion_generator_velocity_limits_violation.real = this->cartesian_motion_generator_velocity_limits_violation; + *(outbuffer + offset + 0) = (u_cartesian_motion_generator_velocity_limits_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_motion_generator_velocity_limits_violation); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_velocity_discontinuity; + u_cartesian_motion_generator_velocity_discontinuity.real = this->cartesian_motion_generator_velocity_discontinuity; + *(outbuffer + offset + 0) = (u_cartesian_motion_generator_velocity_discontinuity.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_motion_generator_velocity_discontinuity); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_acceleration_discontinuity; + u_cartesian_motion_generator_acceleration_discontinuity.real = this->cartesian_motion_generator_acceleration_discontinuity; + *(outbuffer + offset + 0) = (u_cartesian_motion_generator_acceleration_discontinuity.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_motion_generator_acceleration_discontinuity); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_elbow_sign_inconsistent; + u_cartesian_motion_generator_elbow_sign_inconsistent.real = this->cartesian_motion_generator_elbow_sign_inconsistent; + *(outbuffer + offset + 0) = (u_cartesian_motion_generator_elbow_sign_inconsistent.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_motion_generator_elbow_sign_inconsistent); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_start_elbow_invalid; + u_cartesian_motion_generator_start_elbow_invalid.real = this->cartesian_motion_generator_start_elbow_invalid; + *(outbuffer + offset + 0) = (u_cartesian_motion_generator_start_elbow_invalid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_motion_generator_start_elbow_invalid); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_joint_position_limits_violation; + u_cartesian_motion_generator_joint_position_limits_violation.real = this->cartesian_motion_generator_joint_position_limits_violation; + *(outbuffer + offset + 0) = (u_cartesian_motion_generator_joint_position_limits_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_motion_generator_joint_position_limits_violation); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_joint_velocity_limits_violation; + u_cartesian_motion_generator_joint_velocity_limits_violation.real = this->cartesian_motion_generator_joint_velocity_limits_violation; + *(outbuffer + offset + 0) = (u_cartesian_motion_generator_joint_velocity_limits_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_motion_generator_joint_velocity_limits_violation); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_joint_velocity_discontinuity; + u_cartesian_motion_generator_joint_velocity_discontinuity.real = this->cartesian_motion_generator_joint_velocity_discontinuity; + *(outbuffer + offset + 0) = (u_cartesian_motion_generator_joint_velocity_discontinuity.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_motion_generator_joint_velocity_discontinuity); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_joint_acceleration_discontinuity; + u_cartesian_motion_generator_joint_acceleration_discontinuity.real = this->cartesian_motion_generator_joint_acceleration_discontinuity; + *(outbuffer + offset + 0) = (u_cartesian_motion_generator_joint_acceleration_discontinuity.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_motion_generator_joint_acceleration_discontinuity); + union { + bool real; + uint8_t base; + } u_cartesian_position_motion_generator_invalid_frame; + u_cartesian_position_motion_generator_invalid_frame.real = this->cartesian_position_motion_generator_invalid_frame; + *(outbuffer + offset + 0) = (u_cartesian_position_motion_generator_invalid_frame.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_position_motion_generator_invalid_frame); + union { + bool real; + uint8_t base; + } u_force_controller_desired_force_tolerance_violation; + u_force_controller_desired_force_tolerance_violation.real = this->force_controller_desired_force_tolerance_violation; + *(outbuffer + offset + 0) = (u_force_controller_desired_force_tolerance_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->force_controller_desired_force_tolerance_violation); + union { + bool real; + uint8_t base; + } u_controller_torque_discontinuity; + u_controller_torque_discontinuity.real = this->controller_torque_discontinuity; + *(outbuffer + offset + 0) = (u_controller_torque_discontinuity.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->controller_torque_discontinuity); + union { + bool real; + uint8_t base; + } u_start_elbow_sign_inconsistent; + u_start_elbow_sign_inconsistent.real = this->start_elbow_sign_inconsistent; + *(outbuffer + offset + 0) = (u_start_elbow_sign_inconsistent.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->start_elbow_sign_inconsistent); + union { + bool real; + uint8_t base; + } u_communication_constraints_violation; + u_communication_constraints_violation.real = this->communication_constraints_violation; + *(outbuffer + offset + 0) = (u_communication_constraints_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->communication_constraints_violation); + union { + bool real; + uint8_t base; + } u_power_limit_violation; + u_power_limit_violation.real = this->power_limit_violation; + *(outbuffer + offset + 0) = (u_power_limit_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_limit_violation); + union { + bool real; + uint8_t base; + } u_joint_p2p_insufficient_torque_for_planning; + u_joint_p2p_insufficient_torque_for_planning.real = this->joint_p2p_insufficient_torque_for_planning; + *(outbuffer + offset + 0) = (u_joint_p2p_insufficient_torque_for_planning.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_p2p_insufficient_torque_for_planning); + union { + bool real; + uint8_t base; + } u_tau_j_range_violation; + u_tau_j_range_violation.real = this->tau_j_range_violation; + *(outbuffer + offset + 0) = (u_tau_j_range_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->tau_j_range_violation); + union { + bool real; + uint8_t base; + } u_instability_detected; + u_instability_detected.real = this->instability_detected; + *(outbuffer + offset + 0) = (u_instability_detected.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->instability_detected); + union { + bool real; + uint8_t base; + } u_joint_move_in_wrong_direction; + u_joint_move_in_wrong_direction.real = this->joint_move_in_wrong_direction; + *(outbuffer + offset + 0) = (u_joint_move_in_wrong_direction.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_move_in_wrong_direction); + union { + bool real; + uint8_t base; + } u_cartesian_spline_motion_generator_violation; + u_cartesian_spline_motion_generator_violation.real = this->cartesian_spline_motion_generator_violation; + *(outbuffer + offset + 0) = (u_cartesian_spline_motion_generator_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cartesian_spline_motion_generator_violation); + union { + bool real; + uint8_t base; + } u_joint_via_motion_generator_planning_joint_limit_violation; + u_joint_via_motion_generator_planning_joint_limit_violation.real = this->joint_via_motion_generator_planning_joint_limit_violation; + *(outbuffer + offset + 0) = (u_joint_via_motion_generator_planning_joint_limit_violation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_via_motion_generator_planning_joint_limit_violation); + union { + bool real; + uint8_t base; + } u_base_acceleration_initialization_timeout; + u_base_acceleration_initialization_timeout.real = this->base_acceleration_initialization_timeout; + *(outbuffer + offset + 0) = (u_base_acceleration_initialization_timeout.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->base_acceleration_initialization_timeout); + union { + bool real; + uint8_t base; + } u_base_acceleration_invalid_reading; + u_base_acceleration_invalid_reading.real = this->base_acceleration_invalid_reading; + *(outbuffer + offset + 0) = (u_base_acceleration_invalid_reading.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->base_acceleration_invalid_reading); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_joint_position_limits_violation; + u_joint_position_limits_violation.base = 0; + u_joint_position_limits_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_position_limits_violation = u_joint_position_limits_violation.real; + offset += sizeof(this->joint_position_limits_violation); + union { + bool real; + uint8_t base; + } u_cartesian_position_limits_violation; + u_cartesian_position_limits_violation.base = 0; + u_cartesian_position_limits_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_position_limits_violation = u_cartesian_position_limits_violation.real; + offset += sizeof(this->cartesian_position_limits_violation); + union { + bool real; + uint8_t base; + } u_self_collision_avoidance_violation; + u_self_collision_avoidance_violation.base = 0; + u_self_collision_avoidance_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->self_collision_avoidance_violation = u_self_collision_avoidance_violation.real; + offset += sizeof(this->self_collision_avoidance_violation); + union { + bool real; + uint8_t base; + } u_joint_velocity_violation; + u_joint_velocity_violation.base = 0; + u_joint_velocity_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_velocity_violation = u_joint_velocity_violation.real; + offset += sizeof(this->joint_velocity_violation); + union { + bool real; + uint8_t base; + } u_cartesian_velocity_violation; + u_cartesian_velocity_violation.base = 0; + u_cartesian_velocity_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_velocity_violation = u_cartesian_velocity_violation.real; + offset += sizeof(this->cartesian_velocity_violation); + union { + bool real; + uint8_t base; + } u_force_control_safety_violation; + u_force_control_safety_violation.base = 0; + u_force_control_safety_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->force_control_safety_violation = u_force_control_safety_violation.real; + offset += sizeof(this->force_control_safety_violation); + union { + bool real; + uint8_t base; + } u_joint_reflex; + u_joint_reflex.base = 0; + u_joint_reflex.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_reflex = u_joint_reflex.real; + offset += sizeof(this->joint_reflex); + union { + bool real; + uint8_t base; + } u_cartesian_reflex; + u_cartesian_reflex.base = 0; + u_cartesian_reflex.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_reflex = u_cartesian_reflex.real; + offset += sizeof(this->cartesian_reflex); + union { + bool real; + uint8_t base; + } u_max_goal_pose_deviation_violation; + u_max_goal_pose_deviation_violation.base = 0; + u_max_goal_pose_deviation_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->max_goal_pose_deviation_violation = u_max_goal_pose_deviation_violation.real; + offset += sizeof(this->max_goal_pose_deviation_violation); + union { + bool real; + uint8_t base; + } u_max_path_pose_deviation_violation; + u_max_path_pose_deviation_violation.base = 0; + u_max_path_pose_deviation_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->max_path_pose_deviation_violation = u_max_path_pose_deviation_violation.real; + offset += sizeof(this->max_path_pose_deviation_violation); + union { + bool real; + uint8_t base; + } u_cartesian_velocity_profile_safety_violation; + u_cartesian_velocity_profile_safety_violation.base = 0; + u_cartesian_velocity_profile_safety_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_velocity_profile_safety_violation = u_cartesian_velocity_profile_safety_violation.real; + offset += sizeof(this->cartesian_velocity_profile_safety_violation); + union { + bool real; + uint8_t base; + } u_joint_position_motion_generator_start_pose_invalid; + u_joint_position_motion_generator_start_pose_invalid.base = 0; + u_joint_position_motion_generator_start_pose_invalid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_position_motion_generator_start_pose_invalid = u_joint_position_motion_generator_start_pose_invalid.real; + offset += sizeof(this->joint_position_motion_generator_start_pose_invalid); + union { + bool real; + uint8_t base; + } u_joint_motion_generator_position_limits_violation; + u_joint_motion_generator_position_limits_violation.base = 0; + u_joint_motion_generator_position_limits_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_motion_generator_position_limits_violation = u_joint_motion_generator_position_limits_violation.real; + offset += sizeof(this->joint_motion_generator_position_limits_violation); + union { + bool real; + uint8_t base; + } u_joint_motion_generator_velocity_limits_violation; + u_joint_motion_generator_velocity_limits_violation.base = 0; + u_joint_motion_generator_velocity_limits_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_motion_generator_velocity_limits_violation = u_joint_motion_generator_velocity_limits_violation.real; + offset += sizeof(this->joint_motion_generator_velocity_limits_violation); + union { + bool real; + uint8_t base; + } u_joint_motion_generator_velocity_discontinuity; + u_joint_motion_generator_velocity_discontinuity.base = 0; + u_joint_motion_generator_velocity_discontinuity.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_motion_generator_velocity_discontinuity = u_joint_motion_generator_velocity_discontinuity.real; + offset += sizeof(this->joint_motion_generator_velocity_discontinuity); + union { + bool real; + uint8_t base; + } u_joint_motion_generator_acceleration_discontinuity; + u_joint_motion_generator_acceleration_discontinuity.base = 0; + u_joint_motion_generator_acceleration_discontinuity.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_motion_generator_acceleration_discontinuity = u_joint_motion_generator_acceleration_discontinuity.real; + offset += sizeof(this->joint_motion_generator_acceleration_discontinuity); + union { + bool real; + uint8_t base; + } u_cartesian_position_motion_generator_start_pose_invalid; + u_cartesian_position_motion_generator_start_pose_invalid.base = 0; + u_cartesian_position_motion_generator_start_pose_invalid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_position_motion_generator_start_pose_invalid = u_cartesian_position_motion_generator_start_pose_invalid.real; + offset += sizeof(this->cartesian_position_motion_generator_start_pose_invalid); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_elbow_limit_violation; + u_cartesian_motion_generator_elbow_limit_violation.base = 0; + u_cartesian_motion_generator_elbow_limit_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_motion_generator_elbow_limit_violation = u_cartesian_motion_generator_elbow_limit_violation.real; + offset += sizeof(this->cartesian_motion_generator_elbow_limit_violation); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_velocity_limits_violation; + u_cartesian_motion_generator_velocity_limits_violation.base = 0; + u_cartesian_motion_generator_velocity_limits_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_motion_generator_velocity_limits_violation = u_cartesian_motion_generator_velocity_limits_violation.real; + offset += sizeof(this->cartesian_motion_generator_velocity_limits_violation); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_velocity_discontinuity; + u_cartesian_motion_generator_velocity_discontinuity.base = 0; + u_cartesian_motion_generator_velocity_discontinuity.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_motion_generator_velocity_discontinuity = u_cartesian_motion_generator_velocity_discontinuity.real; + offset += sizeof(this->cartesian_motion_generator_velocity_discontinuity); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_acceleration_discontinuity; + u_cartesian_motion_generator_acceleration_discontinuity.base = 0; + u_cartesian_motion_generator_acceleration_discontinuity.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_motion_generator_acceleration_discontinuity = u_cartesian_motion_generator_acceleration_discontinuity.real; + offset += sizeof(this->cartesian_motion_generator_acceleration_discontinuity); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_elbow_sign_inconsistent; + u_cartesian_motion_generator_elbow_sign_inconsistent.base = 0; + u_cartesian_motion_generator_elbow_sign_inconsistent.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_motion_generator_elbow_sign_inconsistent = u_cartesian_motion_generator_elbow_sign_inconsistent.real; + offset += sizeof(this->cartesian_motion_generator_elbow_sign_inconsistent); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_start_elbow_invalid; + u_cartesian_motion_generator_start_elbow_invalid.base = 0; + u_cartesian_motion_generator_start_elbow_invalid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_motion_generator_start_elbow_invalid = u_cartesian_motion_generator_start_elbow_invalid.real; + offset += sizeof(this->cartesian_motion_generator_start_elbow_invalid); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_joint_position_limits_violation; + u_cartesian_motion_generator_joint_position_limits_violation.base = 0; + u_cartesian_motion_generator_joint_position_limits_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_motion_generator_joint_position_limits_violation = u_cartesian_motion_generator_joint_position_limits_violation.real; + offset += sizeof(this->cartesian_motion_generator_joint_position_limits_violation); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_joint_velocity_limits_violation; + u_cartesian_motion_generator_joint_velocity_limits_violation.base = 0; + u_cartesian_motion_generator_joint_velocity_limits_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_motion_generator_joint_velocity_limits_violation = u_cartesian_motion_generator_joint_velocity_limits_violation.real; + offset += sizeof(this->cartesian_motion_generator_joint_velocity_limits_violation); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_joint_velocity_discontinuity; + u_cartesian_motion_generator_joint_velocity_discontinuity.base = 0; + u_cartesian_motion_generator_joint_velocity_discontinuity.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_motion_generator_joint_velocity_discontinuity = u_cartesian_motion_generator_joint_velocity_discontinuity.real; + offset += sizeof(this->cartesian_motion_generator_joint_velocity_discontinuity); + union { + bool real; + uint8_t base; + } u_cartesian_motion_generator_joint_acceleration_discontinuity; + u_cartesian_motion_generator_joint_acceleration_discontinuity.base = 0; + u_cartesian_motion_generator_joint_acceleration_discontinuity.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_motion_generator_joint_acceleration_discontinuity = u_cartesian_motion_generator_joint_acceleration_discontinuity.real; + offset += sizeof(this->cartesian_motion_generator_joint_acceleration_discontinuity); + union { + bool real; + uint8_t base; + } u_cartesian_position_motion_generator_invalid_frame; + u_cartesian_position_motion_generator_invalid_frame.base = 0; + u_cartesian_position_motion_generator_invalid_frame.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_position_motion_generator_invalid_frame = u_cartesian_position_motion_generator_invalid_frame.real; + offset += sizeof(this->cartesian_position_motion_generator_invalid_frame); + union { + bool real; + uint8_t base; + } u_force_controller_desired_force_tolerance_violation; + u_force_controller_desired_force_tolerance_violation.base = 0; + u_force_controller_desired_force_tolerance_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->force_controller_desired_force_tolerance_violation = u_force_controller_desired_force_tolerance_violation.real; + offset += sizeof(this->force_controller_desired_force_tolerance_violation); + union { + bool real; + uint8_t base; + } u_controller_torque_discontinuity; + u_controller_torque_discontinuity.base = 0; + u_controller_torque_discontinuity.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->controller_torque_discontinuity = u_controller_torque_discontinuity.real; + offset += sizeof(this->controller_torque_discontinuity); + union { + bool real; + uint8_t base; + } u_start_elbow_sign_inconsistent; + u_start_elbow_sign_inconsistent.base = 0; + u_start_elbow_sign_inconsistent.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->start_elbow_sign_inconsistent = u_start_elbow_sign_inconsistent.real; + offset += sizeof(this->start_elbow_sign_inconsistent); + union { + bool real; + uint8_t base; + } u_communication_constraints_violation; + u_communication_constraints_violation.base = 0; + u_communication_constraints_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->communication_constraints_violation = u_communication_constraints_violation.real; + offset += sizeof(this->communication_constraints_violation); + union { + bool real; + uint8_t base; + } u_power_limit_violation; + u_power_limit_violation.base = 0; + u_power_limit_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->power_limit_violation = u_power_limit_violation.real; + offset += sizeof(this->power_limit_violation); + union { + bool real; + uint8_t base; + } u_joint_p2p_insufficient_torque_for_planning; + u_joint_p2p_insufficient_torque_for_planning.base = 0; + u_joint_p2p_insufficient_torque_for_planning.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_p2p_insufficient_torque_for_planning = u_joint_p2p_insufficient_torque_for_planning.real; + offset += sizeof(this->joint_p2p_insufficient_torque_for_planning); + union { + bool real; + uint8_t base; + } u_tau_j_range_violation; + u_tau_j_range_violation.base = 0; + u_tau_j_range_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->tau_j_range_violation = u_tau_j_range_violation.real; + offset += sizeof(this->tau_j_range_violation); + union { + bool real; + uint8_t base; + } u_instability_detected; + u_instability_detected.base = 0; + u_instability_detected.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->instability_detected = u_instability_detected.real; + offset += sizeof(this->instability_detected); + union { + bool real; + uint8_t base; + } u_joint_move_in_wrong_direction; + u_joint_move_in_wrong_direction.base = 0; + u_joint_move_in_wrong_direction.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_move_in_wrong_direction = u_joint_move_in_wrong_direction.real; + offset += sizeof(this->joint_move_in_wrong_direction); + union { + bool real; + uint8_t base; + } u_cartesian_spline_motion_generator_violation; + u_cartesian_spline_motion_generator_violation.base = 0; + u_cartesian_spline_motion_generator_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cartesian_spline_motion_generator_violation = u_cartesian_spline_motion_generator_violation.real; + offset += sizeof(this->cartesian_spline_motion_generator_violation); + union { + bool real; + uint8_t base; + } u_joint_via_motion_generator_planning_joint_limit_violation; + u_joint_via_motion_generator_planning_joint_limit_violation.base = 0; + u_joint_via_motion_generator_planning_joint_limit_violation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->joint_via_motion_generator_planning_joint_limit_violation = u_joint_via_motion_generator_planning_joint_limit_violation.real; + offset += sizeof(this->joint_via_motion_generator_planning_joint_limit_violation); + union { + bool real; + uint8_t base; + } u_base_acceleration_initialization_timeout; + u_base_acceleration_initialization_timeout.base = 0; + u_base_acceleration_initialization_timeout.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->base_acceleration_initialization_timeout = u_base_acceleration_initialization_timeout.real; + offset += sizeof(this->base_acceleration_initialization_timeout); + union { + bool real; + uint8_t base; + } u_base_acceleration_invalid_reading; + u_base_acceleration_invalid_reading.base = 0; + u_base_acceleration_invalid_reading.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->base_acceleration_invalid_reading = u_base_acceleration_invalid_reading.real; + offset += sizeof(this->base_acceleration_invalid_reading); + return offset; + } + + virtual const char * getType() override { return "franka_msgs/Errors"; }; + virtual const char * getMD5() override { return "082e9a670c96d8bc64b53e32777458e7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/FrankaState.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/FrankaState.h new file mode 100644 index 000000000..08359061e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/FrankaState.h @@ -0,0 +1,406 @@ +#ifndef _ROS_franka_msgs_FrankaState_h +#define _ROS_franka_msgs_FrankaState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "franka_msgs/Errors.h" + +namespace franka_msgs +{ + + class FrankaState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + float cartesian_collision[6]; + float cartesian_contact[6]; + float q[7]; + float q_d[7]; + float dq[7]; + float dq_d[7]; + float ddq_d[7]; + float theta[7]; + float dtheta[7]; + float tau_J[7]; + float dtau_J[7]; + float tau_J_d[7]; + float K_F_ext_hat_K[6]; + float elbow[2]; + float elbow_d[2]; + float elbow_c[2]; + float delbow_c[2]; + float ddelbow_c[2]; + float joint_collision[7]; + float joint_contact[7]; + float O_F_ext_hat_K[6]; + float O_dP_EE_d[6]; + float O_ddP_O[3]; + float O_dP_EE_c[6]; + float O_ddP_EE_c[6]; + float tau_ext_hat_filtered[7]; + typedef float _m_ee_type; + _m_ee_type m_ee; + float F_x_Cee[3]; + float I_ee[9]; + typedef float _m_load_type; + _m_load_type m_load; + float F_x_Cload[3]; + float I_load[9]; + typedef float _m_total_type; + _m_total_type m_total; + float F_x_Ctotal[3]; + float I_total[9]; + float O_T_EE[16]; + float O_T_EE_d[16]; + float O_T_EE_c[16]; + float F_T_EE[16]; + float F_T_NE[16]; + float NE_T_EE[16]; + float EE_T_K[16]; + typedef float _time_type; + _time_type time; + typedef float _control_command_success_rate_type; + _control_command_success_rate_type control_command_success_rate; + typedef uint8_t _robot_mode_type; + _robot_mode_type robot_mode; + typedef franka_msgs::Errors _current_errors_type; + _current_errors_type current_errors; + typedef franka_msgs::Errors _last_motion_errors_type; + _last_motion_errors_type last_motion_errors; + enum { ROBOT_MODE_OTHER = 0 }; + enum { ROBOT_MODE_IDLE = 1 }; + enum { ROBOT_MODE_MOVE = 2 }; + enum { ROBOT_MODE_GUIDING = 3 }; + enum { ROBOT_MODE_REFLEX = 4 }; + enum { ROBOT_MODE_USER_STOPPED = 5 }; + enum { ROBOT_MODE_AUTOMATIC_ERROR_RECOVERY = 6 }; + + FrankaState(): + header(), + cartesian_collision(), + cartesian_contact(), + q(), + q_d(), + dq(), + dq_d(), + ddq_d(), + theta(), + dtheta(), + tau_J(), + dtau_J(), + tau_J_d(), + K_F_ext_hat_K(), + elbow(), + elbow_d(), + elbow_c(), + delbow_c(), + ddelbow_c(), + joint_collision(), + joint_contact(), + O_F_ext_hat_K(), + O_dP_EE_d(), + O_ddP_O(), + O_dP_EE_c(), + O_ddP_EE_c(), + tau_ext_hat_filtered(), + m_ee(0), + F_x_Cee(), + I_ee(), + m_load(0), + F_x_Cload(), + I_load(), + m_total(0), + F_x_Ctotal(), + I_total(), + O_T_EE(), + O_T_EE_d(), + O_T_EE_c(), + F_T_EE(), + F_T_NE(), + NE_T_EE(), + EE_T_K(), + time(0), + control_command_success_rate(0), + robot_mode(0), + current_errors(), + last_motion_errors() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->cartesian_collision[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->cartesian_contact[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->q[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->q_d[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->dq[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->dq_d[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->ddq_d[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->theta[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->dtheta[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->tau_J[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->dtau_J[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->tau_J_d[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->K_F_ext_hat_K[i]); + } + for( uint32_t i = 0; i < 2; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->elbow[i]); + } + for( uint32_t i = 0; i < 2; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->elbow_d[i]); + } + for( uint32_t i = 0; i < 2; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->elbow_c[i]); + } + for( uint32_t i = 0; i < 2; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->delbow_c[i]); + } + for( uint32_t i = 0; i < 2; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->ddelbow_c[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_collision[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_contact[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->O_F_ext_hat_K[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->O_dP_EE_d[i]); + } + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->O_ddP_O[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->O_dP_EE_c[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->O_ddP_EE_c[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->tau_ext_hat_filtered[i]); + } + offset += serializeAvrFloat64(outbuffer + offset, this->m_ee); + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->F_x_Cee[i]); + } + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->I_ee[i]); + } + offset += serializeAvrFloat64(outbuffer + offset, this->m_load); + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->F_x_Cload[i]); + } + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->I_load[i]); + } + offset += serializeAvrFloat64(outbuffer + offset, this->m_total); + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->F_x_Ctotal[i]); + } + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->I_total[i]); + } + for( uint32_t i = 0; i < 16; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->O_T_EE[i]); + } + for( uint32_t i = 0; i < 16; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->O_T_EE_d[i]); + } + for( uint32_t i = 0; i < 16; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->O_T_EE_c[i]); + } + for( uint32_t i = 0; i < 16; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->F_T_EE[i]); + } + for( uint32_t i = 0; i < 16; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->F_T_NE[i]); + } + for( uint32_t i = 0; i < 16; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->NE_T_EE[i]); + } + for( uint32_t i = 0; i < 16; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->EE_T_K[i]); + } + offset += serializeAvrFloat64(outbuffer + offset, this->time); + offset += serializeAvrFloat64(outbuffer + offset, this->control_command_success_rate); + *(outbuffer + offset + 0) = (this->robot_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->robot_mode); + offset += this->current_errors.serialize(outbuffer + offset); + offset += this->last_motion_errors.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->cartesian_collision[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->cartesian_contact[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->q[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->q_d[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->dq[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->dq_d[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ddq_d[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->theta[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->dtheta[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->tau_J[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->dtau_J[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->tau_J_d[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->K_F_ext_hat_K[i])); + } + for( uint32_t i = 0; i < 2; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->elbow[i])); + } + for( uint32_t i = 0; i < 2; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->elbow_d[i])); + } + for( uint32_t i = 0; i < 2; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->elbow_c[i])); + } + for( uint32_t i = 0; i < 2; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->delbow_c[i])); + } + for( uint32_t i = 0; i < 2; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ddelbow_c[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->joint_collision[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->joint_contact[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->O_F_ext_hat_K[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->O_dP_EE_d[i])); + } + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->O_ddP_O[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->O_dP_EE_c[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->O_ddP_EE_c[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->tau_ext_hat_filtered[i])); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m_ee)); + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->F_x_Cee[i])); + } + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->I_ee[i])); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m_load)); + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->F_x_Cload[i])); + } + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->I_load[i])); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m_total)); + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->F_x_Ctotal[i])); + } + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->I_total[i])); + } + for( uint32_t i = 0; i < 16; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->O_T_EE[i])); + } + for( uint32_t i = 0; i < 16; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->O_T_EE_d[i])); + } + for( uint32_t i = 0; i < 16; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->O_T_EE_c[i])); + } + for( uint32_t i = 0; i < 16; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->F_T_EE[i])); + } + for( uint32_t i = 0; i < 16; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->F_T_NE[i])); + } + for( uint32_t i = 0; i < 16; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->NE_T_EE[i])); + } + for( uint32_t i = 0; i < 16; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->EE_T_K[i])); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->control_command_success_rate)); + this->robot_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->robot_mode); + offset += this->current_errors.deserialize(inbuffer + offset); + offset += this->last_motion_errors.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "franka_msgs/FrankaState"; }; + virtual const char * getMD5() override { return "431567d5df6caf4e4dd7385f25cb71ee"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetCartesianImpedance.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetCartesianImpedance.h new file mode 100644 index 000000000..604dcbcb7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetCartesianImpedance.h @@ -0,0 +1,113 @@ +#ifndef _ROS_SERVICE_SetCartesianImpedance_h +#define _ROS_SERVICE_SetCartesianImpedance_h +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + +static const char SETCARTESIANIMPEDANCE[] = "franka_msgs/SetCartesianImpedance"; + + class SetCartesianImpedanceRequest : public ros::Msg + { + public: + float cartesian_stiffness[6]; + + SetCartesianImpedanceRequest(): + cartesian_stiffness() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->cartesian_stiffness[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->cartesian_stiffness[i])); + } + return offset; + } + + virtual const char * getType() override { return SETCARTESIANIMPEDANCE; }; + virtual const char * getMD5() override { return "591a43081c539ee56ec83a33587e68c4"; }; + + }; + + class SetCartesianImpedanceResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + SetCartesianImpedanceResponse(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return SETCARTESIANIMPEDANCE; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + + class SetCartesianImpedance { + public: + typedef SetCartesianImpedanceRequest Request; + typedef SetCartesianImpedanceResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetEEFrame.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetEEFrame.h new file mode 100644 index 000000000..45d8dd120 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetEEFrame.h @@ -0,0 +1,113 @@ +#ifndef _ROS_SERVICE_SetEEFrame_h +#define _ROS_SERVICE_SetEEFrame_h +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + +static const char SETEEFRAME[] = "franka_msgs/SetEEFrame"; + + class SetEEFrameRequest : public ros::Msg + { + public: + float NE_T_EE[16]; + + SetEEFrameRequest(): + NE_T_EE() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 16; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->NE_T_EE[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 16; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->NE_T_EE[i])); + } + return offset; + } + + virtual const char * getType() override { return SETEEFRAME; }; + virtual const char * getMD5() override { return "cddf0858e7d540f5bcee9d813a7550a2"; }; + + }; + + class SetEEFrameResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + SetEEFrameResponse(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return SETEEFRAME; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + + class SetEEFrame { + public: + typedef SetEEFrameRequest Request; + typedef SetEEFrameResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetForceTorqueCollisionBehavior.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetForceTorqueCollisionBehavior.h new file mode 100644 index 000000000..e84eed2a0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetForceTorqueCollisionBehavior.h @@ -0,0 +1,137 @@ +#ifndef _ROS_SERVICE_SetForceTorqueCollisionBehavior_h +#define _ROS_SERVICE_SetForceTorqueCollisionBehavior_h +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + +static const char SETFORCETORQUECOLLISIONBEHAVIOR[] = "franka_msgs/SetForceTorqueCollisionBehavior"; + + class SetForceTorqueCollisionBehaviorRequest : public ros::Msg + { + public: + float lower_torque_thresholds_nominal[7]; + float upper_torque_thresholds_nominal[7]; + float lower_force_thresholds_nominal[6]; + float upper_force_thresholds_nominal[6]; + + SetForceTorqueCollisionBehaviorRequest(): + lower_torque_thresholds_nominal(), + upper_torque_thresholds_nominal(), + lower_force_thresholds_nominal(), + upper_force_thresholds_nominal() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->lower_torque_thresholds_nominal[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->upper_torque_thresholds_nominal[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->lower_force_thresholds_nominal[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->upper_force_thresholds_nominal[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lower_torque_thresholds_nominal[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->upper_torque_thresholds_nominal[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lower_force_thresholds_nominal[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->upper_force_thresholds_nominal[i])); + } + return offset; + } + + virtual const char * getType() override { return SETFORCETORQUECOLLISIONBEHAVIOR; }; + virtual const char * getMD5() override { return "af37de8897f6124b6b82b8dad5d5a876"; }; + + }; + + class SetForceTorqueCollisionBehaviorResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + SetForceTorqueCollisionBehaviorResponse(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return SETFORCETORQUECOLLISIONBEHAVIOR; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + + class SetForceTorqueCollisionBehavior { + public: + typedef SetForceTorqueCollisionBehaviorRequest Request; + typedef SetForceTorqueCollisionBehaviorResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetFullCollisionBehavior.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetFullCollisionBehavior.h new file mode 100644 index 000000000..0ef0c23af --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetFullCollisionBehavior.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_SetFullCollisionBehavior_h +#define _ROS_SERVICE_SetFullCollisionBehavior_h +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + +static const char SETFULLCOLLISIONBEHAVIOR[] = "franka_msgs/SetFullCollisionBehavior"; + + class SetFullCollisionBehaviorRequest : public ros::Msg + { + public: + float lower_torque_thresholds_acceleration[7]; + float upper_torque_thresholds_acceleration[7]; + float lower_torque_thresholds_nominal[7]; + float upper_torque_thresholds_nominal[7]; + float lower_force_thresholds_acceleration[6]; + float upper_force_thresholds_acceleration[6]; + float lower_force_thresholds_nominal[6]; + float upper_force_thresholds_nominal[6]; + + SetFullCollisionBehaviorRequest(): + lower_torque_thresholds_acceleration(), + upper_torque_thresholds_acceleration(), + lower_torque_thresholds_nominal(), + upper_torque_thresholds_nominal(), + lower_force_thresholds_acceleration(), + upper_force_thresholds_acceleration(), + lower_force_thresholds_nominal(), + upper_force_thresholds_nominal() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->lower_torque_thresholds_acceleration[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->upper_torque_thresholds_acceleration[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->lower_torque_thresholds_nominal[i]); + } + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->upper_torque_thresholds_nominal[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->lower_force_thresholds_acceleration[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->upper_force_thresholds_acceleration[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->lower_force_thresholds_nominal[i]); + } + for( uint32_t i = 0; i < 6; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->upper_force_thresholds_nominal[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lower_torque_thresholds_acceleration[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->upper_torque_thresholds_acceleration[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lower_torque_thresholds_nominal[i])); + } + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->upper_torque_thresholds_nominal[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lower_force_thresholds_acceleration[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->upper_force_thresholds_acceleration[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lower_force_thresholds_nominal[i])); + } + for( uint32_t i = 0; i < 6; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->upper_force_thresholds_nominal[i])); + } + return offset; + } + + virtual const char * getType() override { return SETFULLCOLLISIONBEHAVIOR; }; + virtual const char * getMD5() override { return "bc875909c147220ba1720adcd48e47ea"; }; + + }; + + class SetFullCollisionBehaviorResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + SetFullCollisionBehaviorResponse(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return SETFULLCOLLISIONBEHAVIOR; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + + class SetFullCollisionBehavior { + public: + typedef SetFullCollisionBehaviorRequest Request; + typedef SetFullCollisionBehaviorResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetJointImpedance.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetJointImpedance.h new file mode 100644 index 000000000..70de8af19 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetJointImpedance.h @@ -0,0 +1,113 @@ +#ifndef _ROS_SERVICE_SetJointImpedance_h +#define _ROS_SERVICE_SetJointImpedance_h +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + +static const char SETJOINTIMPEDANCE[] = "franka_msgs/SetJointImpedance"; + + class SetJointImpedanceRequest : public ros::Msg + { + public: + float joint_stiffness[7]; + + SetJointImpedanceRequest(): + joint_stiffness() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 7; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_stiffness[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 7; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->joint_stiffness[i])); + } + return offset; + } + + virtual const char * getType() override { return SETJOINTIMPEDANCE; }; + virtual const char * getMD5() override { return "45e5482efb638f20554d876158c68e96"; }; + + }; + + class SetJointImpedanceResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + SetJointImpedanceResponse(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return SETJOINTIMPEDANCE; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + + class SetJointImpedance { + public: + typedef SetJointImpedanceRequest Request; + typedef SetJointImpedanceResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetKFrame.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetKFrame.h new file mode 100644 index 000000000..672002856 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetKFrame.h @@ -0,0 +1,113 @@ +#ifndef _ROS_SERVICE_SetKFrame_h +#define _ROS_SERVICE_SetKFrame_h +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + +static const char SETKFRAME[] = "franka_msgs/SetKFrame"; + + class SetKFrameRequest : public ros::Msg + { + public: + float EE_T_K[16]; + + SetKFrameRequest(): + EE_T_K() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 16; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->EE_T_K[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 16; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->EE_T_K[i])); + } + return offset; + } + + virtual const char * getType() override { return SETKFRAME; }; + virtual const char * getMD5() override { return "f8e38719bdb98c0e8ddafd6da2db480f"; }; + + }; + + class SetKFrameResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + SetKFrameResponse(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return SETKFRAME; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + + class SetKFrame { + public: + typedef SetKFrameRequest Request; + typedef SetKFrameResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetLoad.h b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetLoad.h new file mode 100644 index 000000000..6e1bce981 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/franka_msgs/SetLoad.h @@ -0,0 +1,126 @@ +#ifndef _ROS_SERVICE_SetLoad_h +#define _ROS_SERVICE_SetLoad_h +#include +#include +#include +#include "ros/msg.h" + +namespace franka_msgs +{ + +static const char SETLOAD[] = "franka_msgs/SetLoad"; + + class SetLoadRequest : public ros::Msg + { + public: + typedef float _mass_type; + _mass_type mass; + float F_x_center_load[3]; + float load_inertia[9]; + + SetLoadRequest(): + mass(0), + F_x_center_load(), + load_inertia() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->mass); + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->F_x_center_load[i]); + } + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->load_inertia[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mass)); + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->F_x_center_load[i])); + } + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->load_inertia[i])); + } + return offset; + } + + virtual const char * getType() override { return SETLOAD; }; + virtual const char * getMD5() override { return "0bcbb33b081d0f0b2611ae00474a91d6"; }; + + }; + + class SetLoadResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _error_type; + _error_type error; + + SetLoadResponse(): + success(0), + error("") + { + } + + 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_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return SETLOAD; }; + virtual const char * getMD5() override { return "45872d25d65c97743cc71afc6d4e884d"; }; + + }; + + class SetLoad { + public: + typedef SetLoadRequest Request; + typedef SetLoadResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h new file mode 100644 index 000000000..f08e641c4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h @@ -0,0 +1,199 @@ +#ifndef _ROS_SERVICE_ApplyBodyWrench_h +#define _ROS_SERVICE_ApplyBodyWrench_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "ros/time.h" +#include "geometry_msgs/Wrench.h" +#include "geometry_msgs/Point.h" + +namespace gazebo_msgs +{ + +static const char APPLYBODYWRENCH[] = "gazebo_msgs/ApplyBodyWrench"; + + class ApplyBodyWrenchRequest : public ros::Msg + { + public: + typedef const char* _body_name_type; + _body_name_type body_name; + typedef const char* _reference_frame_type; + _reference_frame_type reference_frame; + typedef geometry_msgs::Point _reference_point_type; + _reference_point_type reference_point; + typedef geometry_msgs::Wrench _wrench_type; + _wrench_type wrench; + typedef ros::Time _start_time_type; + _start_time_type start_time; + typedef ros::Duration _duration_type; + _duration_type duration; + + ApplyBodyWrenchRequest(): + body_name(""), + reference_frame(""), + reference_point(), + wrench(), + start_time(), + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_body_name = strlen(this->body_name); + varToArr(outbuffer + offset, length_body_name); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + uint32_t length_reference_frame = strlen(this->reference_frame); + varToArr(outbuffer + offset, length_reference_frame); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + offset += this->reference_point.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_body_name; + arrToVar(length_body_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_name-1]=0; + this->body_name = (char *)(inbuffer + offset-1); + offset += length_body_name; + uint32_t length_reference_frame; + arrToVar(length_reference_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + offset += this->reference_point.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual const char * getType() override { return APPLYBODYWRENCH; }; + virtual const char * getMD5() override { return "e37e6adf97eba5095baa77dffb71e5bd"; }; + + }; + + class ApplyBodyWrenchResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + ApplyBodyWrenchResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return APPLYBODYWRENCH; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyBodyWrench { + public: + typedef ApplyBodyWrenchRequest Request; + typedef ApplyBodyWrenchResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ApplyJointEffort.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ApplyJointEffort.h new file mode 100644 index 000000000..c33709d12 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ApplyJointEffort.h @@ -0,0 +1,175 @@ +#ifndef _ROS_SERVICE_ApplyJointEffort_h +#define _ROS_SERVICE_ApplyJointEffort_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "ros/time.h" + +namespace gazebo_msgs +{ + +static const char APPLYJOINTEFFORT[] = "gazebo_msgs/ApplyJointEffort"; + + class ApplyJointEffortRequest : public ros::Msg + { + public: + typedef const char* _joint_name_type; + _joint_name_type joint_name; + typedef float _effort_type; + _effort_type effort; + typedef ros::Time _start_time_type; + _start_time_type start_time; + typedef ros::Duration _duration_type; + _duration_type duration; + + ApplyJointEffortRequest(): + joint_name(""), + effort(0), + start_time(), + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + varToArr(outbuffer + offset, length_joint_name); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_joint_name; + arrToVar(length_joint_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual const char * getType() override { return APPLYJOINTEFFORT; }; + virtual const char * getMD5() override { return "2c3396ab9af67a509ecd2167a8fe41a2"; }; + + }; + + class ApplyJointEffortResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + ApplyJointEffortResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return APPLYJOINTEFFORT; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyJointEffort { + public: + typedef ApplyJointEffortRequest Request; + typedef ApplyJointEffortResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/BodyRequest.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/BodyRequest.h new file mode 100644 index 000000000..4475095f6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/BodyRequest.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_BodyRequest_h +#define _ROS_SERVICE_BodyRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char BODYREQUEST[] = "gazebo_msgs/BodyRequest"; + + class BodyRequestRequest : public ros::Msg + { + public: + typedef const char* _body_name_type; + _body_name_type body_name; + + BodyRequestRequest(): + body_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_body_name = strlen(this->body_name); + varToArr(outbuffer + offset, length_body_name); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_body_name; + arrToVar(length_body_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_name-1]=0; + this->body_name = (char *)(inbuffer + offset-1); + offset += length_body_name; + return offset; + } + + virtual const char * getType() override { return BODYREQUEST; }; + virtual const char * getMD5() override { return "5eade9afe7f232d78005bd0cafeab755"; }; + + }; + + class BodyRequestResponse : public ros::Msg + { + public: + + BodyRequestResponse() + { + } + + 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 BODYREQUEST; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class BodyRequest { + public: + typedef BodyRequestRequest Request; + typedef BodyRequestResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ContactState.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ContactState.h new file mode 100644 index 000000000..f6abf5416 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ContactState.h @@ -0,0 +1,196 @@ +#ifndef _ROS_gazebo_msgs_ContactState_h +#define _ROS_gazebo_msgs_ContactState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Wrench.h" +#include "geometry_msgs/Vector3.h" + +namespace gazebo_msgs +{ + + class ContactState : public ros::Msg + { + public: + typedef const char* _info_type; + _info_type info; + typedef const char* _collision1_name_type; + _collision1_name_type collision1_name; + typedef const char* _collision2_name_type; + _collision2_name_type collision2_name; + uint32_t wrenches_length; + typedef geometry_msgs::Wrench _wrenches_type; + _wrenches_type st_wrenches; + _wrenches_type * wrenches; + typedef geometry_msgs::Wrench _total_wrench_type; + _total_wrench_type total_wrench; + uint32_t contact_positions_length; + typedef geometry_msgs::Vector3 _contact_positions_type; + _contact_positions_type st_contact_positions; + _contact_positions_type * contact_positions; + uint32_t contact_normals_length; + typedef geometry_msgs::Vector3 _contact_normals_type; + _contact_normals_type st_contact_normals; + _contact_normals_type * contact_normals; + uint32_t depths_length; + typedef float _depths_type; + _depths_type st_depths; + _depths_type * depths; + + ContactState(): + info(""), + collision1_name(""), + collision2_name(""), + wrenches_length(0), st_wrenches(), wrenches(nullptr), + total_wrench(), + contact_positions_length(0), st_contact_positions(), contact_positions(nullptr), + contact_normals_length(0), st_contact_normals(), contact_normals(nullptr), + depths_length(0), st_depths(), depths(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_info = strlen(this->info); + varToArr(outbuffer + offset, length_info); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + uint32_t length_collision1_name = strlen(this->collision1_name); + varToArr(outbuffer + offset, length_collision1_name); + offset += 4; + memcpy(outbuffer + offset, this->collision1_name, length_collision1_name); + offset += length_collision1_name; + uint32_t length_collision2_name = strlen(this->collision2_name); + varToArr(outbuffer + offset, length_collision2_name); + offset += 4; + memcpy(outbuffer + offset, this->collision2_name, length_collision2_name); + offset += length_collision2_name; + *(outbuffer + offset + 0) = (this->wrenches_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wrenches_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wrenches_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wrenches_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->wrenches_length); + for( uint32_t i = 0; i < wrenches_length; i++){ + offset += this->wrenches[i].serialize(outbuffer + offset); + } + offset += this->total_wrench.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->contact_positions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->contact_positions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->contact_positions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->contact_positions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->contact_positions_length); + for( uint32_t i = 0; i < contact_positions_length; i++){ + offset += this->contact_positions[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->contact_normals_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->contact_normals_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->contact_normals_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->contact_normals_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->contact_normals_length); + for( uint32_t i = 0; i < contact_normals_length; i++){ + offset += this->contact_normals[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->depths_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->depths_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->depths_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->depths_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->depths_length); + for( uint32_t i = 0; i < depths_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->depths[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + uint32_t length_collision1_name; + arrToVar(length_collision1_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collision1_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collision1_name-1]=0; + this->collision1_name = (char *)(inbuffer + offset-1); + offset += length_collision1_name; + uint32_t length_collision2_name; + arrToVar(length_collision2_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collision2_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collision2_name-1]=0; + this->collision2_name = (char *)(inbuffer + offset-1); + offset += length_collision2_name; + uint32_t wrenches_lengthT = ((uint32_t) (*(inbuffer + offset))); + wrenches_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + wrenches_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + wrenches_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wrenches_length); + if(wrenches_lengthT > wrenches_length) + this->wrenches = (geometry_msgs::Wrench*)realloc(this->wrenches, wrenches_lengthT * sizeof(geometry_msgs::Wrench)); + wrenches_length = wrenches_lengthT; + for( uint32_t i = 0; i < wrenches_length; i++){ + offset += this->st_wrenches.deserialize(inbuffer + offset); + memcpy( &(this->wrenches[i]), &(this->st_wrenches), sizeof(geometry_msgs::Wrench)); + } + offset += this->total_wrench.deserialize(inbuffer + offset); + uint32_t contact_positions_lengthT = ((uint32_t) (*(inbuffer + offset))); + contact_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + contact_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + contact_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->contact_positions_length); + if(contact_positions_lengthT > contact_positions_length) + this->contact_positions = (geometry_msgs::Vector3*)realloc(this->contact_positions, contact_positions_lengthT * sizeof(geometry_msgs::Vector3)); + contact_positions_length = contact_positions_lengthT; + for( uint32_t i = 0; i < contact_positions_length; i++){ + offset += this->st_contact_positions.deserialize(inbuffer + offset); + memcpy( &(this->contact_positions[i]), &(this->st_contact_positions), sizeof(geometry_msgs::Vector3)); + } + uint32_t contact_normals_lengthT = ((uint32_t) (*(inbuffer + offset))); + contact_normals_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + contact_normals_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + contact_normals_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->contact_normals_length); + if(contact_normals_lengthT > contact_normals_length) + this->contact_normals = (geometry_msgs::Vector3*)realloc(this->contact_normals, contact_normals_lengthT * sizeof(geometry_msgs::Vector3)); + contact_normals_length = contact_normals_lengthT; + for( uint32_t i = 0; i < contact_normals_length; i++){ + offset += this->st_contact_normals.deserialize(inbuffer + offset); + memcpy( &(this->contact_normals[i]), &(this->st_contact_normals), sizeof(geometry_msgs::Vector3)); + } + uint32_t depths_lengthT = ((uint32_t) (*(inbuffer + offset))); + depths_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + depths_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + depths_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->depths_length); + if(depths_lengthT > depths_length) + this->depths = (float*)realloc(this->depths, depths_lengthT * sizeof(float)); + depths_length = depths_lengthT; + for( uint32_t i = 0; i < depths_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_depths)); + memcpy( &(this->depths[i]), &(this->st_depths), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/ContactState"; }; + virtual const char * getMD5() override { return "48c0ffb054b8c444f870cecea1ee50d9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ContactsState.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ContactsState.h new file mode 100644 index 000000000..5977fa505 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ContactsState.h @@ -0,0 +1,70 @@ +#ifndef _ROS_gazebo_msgs_ContactsState_h +#define _ROS_gazebo_msgs_ContactsState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "gazebo_msgs/ContactState.h" + +namespace gazebo_msgs +{ + + class ContactsState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t states_length; + typedef gazebo_msgs::ContactState _states_type; + _states_type st_states; + _states_type * states; + + ContactsState(): + header(), + states_length(0), st_states(), states(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->states_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->states_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->states_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->states_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->states_length); + for( uint32_t i = 0; i < states_length; i++){ + offset += this->states[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t states_lengthT = ((uint32_t) (*(inbuffer + offset))); + states_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + states_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + states_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->states_length); + if(states_lengthT > states_length) + this->states = (gazebo_msgs::ContactState*)realloc(this->states, states_lengthT * sizeof(gazebo_msgs::ContactState)); + states_length = states_lengthT; + for( uint32_t i = 0; i < states_length; i++){ + offset += this->st_states.deserialize(inbuffer + offset); + memcpy( &(this->states[i]), &(this->st_states), sizeof(gazebo_msgs::ContactState)); + } + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/ContactsState"; }; + virtual const char * getMD5() override { return "acbcb1601a8e525bf72509f18e6f668d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/DeleteLight.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/DeleteLight.h new file mode 100644 index 000000000..607e8e89e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/DeleteLight.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_DeleteLight_h +#define _ROS_SERVICE_DeleteLight_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char DELETELIGHT[] = "gazebo_msgs/DeleteLight"; + + class DeleteLightRequest : public ros::Msg + { + public: + typedef const char* _light_name_type; + _light_name_type light_name; + + DeleteLightRequest(): + light_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_light_name = strlen(this->light_name); + varToArr(outbuffer + offset, length_light_name); + offset += 4; + memcpy(outbuffer + offset, this->light_name, length_light_name); + offset += length_light_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_light_name; + arrToVar(length_light_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_light_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_light_name-1]=0; + this->light_name = (char *)(inbuffer + offset-1); + offset += length_light_name; + return offset; + } + + virtual const char * getType() override { return DELETELIGHT; }; + virtual const char * getMD5() override { return "4fb676dfb4741fc866365702a859441c"; }; + + }; + + class DeleteLightResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + DeleteLightResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return DELETELIGHT; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class DeleteLight { + public: + typedef DeleteLightRequest Request; + typedef DeleteLightResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/DeleteModel.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/DeleteModel.h new file mode 100644 index 000000000..66aa84d58 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/DeleteModel.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_DeleteModel_h +#define _ROS_SERVICE_DeleteModel_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char DELETEMODEL[] = "gazebo_msgs/DeleteModel"; + + class DeleteModelRequest : public ros::Msg + { + public: + typedef const char* _model_name_type; + _model_name_type model_name; + + DeleteModelRequest(): + model_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + varToArr(outbuffer + offset, length_model_name); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_model_name; + arrToVar(length_model_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + return offset; + } + + virtual const char * getType() override { return DELETEMODEL; }; + virtual const char * getMD5() override { return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class DeleteModelResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + DeleteModelResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return DELETEMODEL; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class DeleteModel { + public: + typedef DeleteModelRequest Request; + typedef DeleteModelResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetJointProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetJointProperties.h new file mode 100644 index 000000000..9c349b812 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetJointProperties.h @@ -0,0 +1,210 @@ +#ifndef _ROS_SERVICE_GetJointProperties_h +#define _ROS_SERVICE_GetJointProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETJOINTPROPERTIES[] = "gazebo_msgs/GetJointProperties"; + + class GetJointPropertiesRequest : public ros::Msg + { + public: + typedef const char* _joint_name_type; + _joint_name_type joint_name; + + GetJointPropertiesRequest(): + joint_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + varToArr(outbuffer + offset, length_joint_name); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_joint_name; + arrToVar(length_joint_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + return offset; + } + + virtual const char * getType() override { return GETJOINTPROPERTIES; }; + virtual const char * getMD5() override { return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class GetJointPropertiesResponse : public ros::Msg + { + public: + typedef uint8_t _type_type; + _type_type type; + uint32_t damping_length; + typedef float _damping_type; + _damping_type st_damping; + _damping_type * damping; + uint32_t position_length; + typedef float _position_type; + _position_type st_position; + _position_type * position; + uint32_t rate_length; + typedef float _rate_type; + _rate_type st_rate; + _rate_type * rate; + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + enum { REVOLUTE = 0 }; + enum { CONTINUOUS = 1 }; + enum { PRISMATIC = 2 }; + enum { FIXED = 3 }; + enum { BALL = 4 }; + enum { UNIVERSAL = 5 }; + + GetJointPropertiesResponse(): + type(0), + damping_length(0), st_damping(), damping(nullptr), + position_length(0), st_position(), position(nullptr), + rate_length(0), st_rate(), rate(nullptr), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->damping_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->damping_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->damping_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->damping_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->damping_length); + for( uint32_t i = 0; i < damping_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); + } + *(outbuffer + offset + 0) = (this->position_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->position_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->position_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->position_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->position_length); + for( uint32_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset + 0) = (this->rate_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rate_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rate_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rate_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rate_length); + for( uint32_t i = 0; i < rate_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->rate[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); + 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; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint32_t damping_lengthT = ((uint32_t) (*(inbuffer + offset))); + damping_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + damping_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + damping_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->damping_length); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + damping_length = damping_lengthT; + for( uint32_t i = 0; i < damping_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint32_t position_lengthT = ((uint32_t) (*(inbuffer + offset))); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->position_length); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + position_length = position_lengthT; + for( uint32_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint32_t rate_lengthT = ((uint32_t) (*(inbuffer + offset))); + rate_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rate_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rate_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rate_length); + if(rate_lengthT > rate_length) + this->rate = (float*)realloc(this->rate, rate_lengthT * sizeof(float)); + rate_length = rate_lengthT; + for( uint32_t i = 0; i < rate_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_rate)); + memcpy( &(this->rate[i]), &(this->st_rate), sizeof(float)); + } + 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; + return offset; + } + + virtual const char * getType() override { return GETJOINTPROPERTIES; }; + virtual const char * getMD5() override { return "cd7b30a39faa372283dc94c5f6457f82"; }; + + }; + + class GetJointProperties { + public: + typedef GetJointPropertiesRequest Request; + typedef GetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLightProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLightProperties.h new file mode 100644 index 000000000..41ba6f3ca --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLightProperties.h @@ -0,0 +1,143 @@ +#ifndef _ROS_SERVICE_GetLightProperties_h +#define _ROS_SERVICE_GetLightProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/ColorRGBA.h" + +namespace gazebo_msgs +{ + +static const char GETLIGHTPROPERTIES[] = "gazebo_msgs/GetLightProperties"; + + class GetLightPropertiesRequest : public ros::Msg + { + public: + typedef const char* _light_name_type; + _light_name_type light_name; + + GetLightPropertiesRequest(): + light_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_light_name = strlen(this->light_name); + varToArr(outbuffer + offset, length_light_name); + offset += 4; + memcpy(outbuffer + offset, this->light_name, length_light_name); + offset += length_light_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_light_name; + arrToVar(length_light_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_light_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_light_name-1]=0; + this->light_name = (char *)(inbuffer + offset-1); + offset += length_light_name; + return offset; + } + + virtual const char * getType() override { return GETLIGHTPROPERTIES; }; + virtual const char * getMD5() override { return "4fb676dfb4741fc866365702a859441c"; }; + + }; + + class GetLightPropertiesResponse : public ros::Msg + { + public: + typedef std_msgs::ColorRGBA _diffuse_type; + _diffuse_type diffuse; + typedef float _attenuation_constant_type; + _attenuation_constant_type attenuation_constant; + typedef float _attenuation_linear_type; + _attenuation_linear_type attenuation_linear; + typedef float _attenuation_quadratic_type; + _attenuation_quadratic_type attenuation_quadratic; + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + GetLightPropertiesResponse(): + diffuse(), + attenuation_constant(0), + attenuation_linear(0), + attenuation_quadratic(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->diffuse.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->attenuation_constant); + offset += serializeAvrFloat64(outbuffer + offset, this->attenuation_linear); + offset += serializeAvrFloat64(outbuffer + offset, this->attenuation_quadratic); + 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; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->diffuse.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->attenuation_constant)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->attenuation_linear)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->attenuation_quadratic)); + 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; + return offset; + } + + virtual const char * getType() override { return GETLIGHTPROPERTIES; }; + virtual const char * getMD5() override { return "9a19ddd5aab4c13b7643d1722c709f1f"; }; + + }; + + class GetLightProperties { + public: + typedef GetLightPropertiesRequest Request; + typedef GetLightPropertiesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLinkProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLinkProperties.h new file mode 100644 index 000000000..4acbcdecb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLinkProperties.h @@ -0,0 +1,181 @@ +#ifndef _ROS_SERVICE_GetLinkProperties_h +#define _ROS_SERVICE_GetLinkProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char GETLINKPROPERTIES[] = "gazebo_msgs/GetLinkProperties"; + + class GetLinkPropertiesRequest : public ros::Msg + { + public: + typedef const char* _link_name_type; + _link_name_type link_name; + + GetLinkPropertiesRequest(): + link_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + return offset; + } + + virtual const char * getType() override { return GETLINKPROPERTIES; }; + virtual const char * getMD5() override { return "7d82d60381f1b66a30f2157f60884345"; }; + + }; + + class GetLinkPropertiesResponse : public ros::Msg + { + public: + typedef geometry_msgs::Pose _com_type; + _com_type com; + typedef bool _gravity_mode_type; + _gravity_mode_type gravity_mode; + typedef float _mass_type; + _mass_type mass; + typedef float _ixx_type; + _ixx_type ixx; + typedef float _ixy_type; + _ixy_type ixy; + typedef float _ixz_type; + _ixz_type ixz; + typedef float _iyy_type; + _iyy_type iyy; + typedef float _iyz_type; + _iyz_type iyz; + typedef float _izz_type; + _izz_type izz; + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + GetLinkPropertiesResponse(): + com(), + gravity_mode(0), + mass(0), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->com.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.real = this->gravity_mode; + *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gravity_mode); + offset += serializeAvrFloat64(outbuffer + offset, this->mass); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + 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; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->com.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.base = 0; + u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gravity_mode = u_gravity_mode.real; + offset += sizeof(this->gravity_mode); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mass)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + 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; + return offset; + } + + virtual const char * getType() override { return GETLINKPROPERTIES; }; + virtual const char * getMD5() override { return "a8619f92d17cfcc3958c0fd13299443d"; }; + + }; + + class GetLinkProperties { + public: + typedef GetLinkPropertiesRequest Request; + typedef GetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLinkState.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLinkState.h new file mode 100644 index 000000000..5fc4a2c88 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetLinkState.h @@ -0,0 +1,145 @@ +#ifndef _ROS_SERVICE_GetLinkState_h +#define _ROS_SERVICE_GetLinkState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/LinkState.h" + +namespace gazebo_msgs +{ + +static const char GETLINKSTATE[] = "gazebo_msgs/GetLinkState"; + + class GetLinkStateRequest : public ros::Msg + { + public: + typedef const char* _link_name_type; + _link_name_type link_name; + typedef const char* _reference_frame_type; + _reference_frame_type reference_frame; + + GetLinkStateRequest(): + link_name(""), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + uint32_t length_reference_frame = strlen(this->reference_frame); + varToArr(outbuffer + offset, length_reference_frame); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + uint32_t length_reference_frame; + arrToVar(length_reference_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + virtual const char * getType() override { return GETLINKSTATE; }; + virtual const char * getMD5() override { return "7551675c30aaa71f7c288d4864552001"; }; + + }; + + class GetLinkStateResponse : public ros::Msg + { + public: + typedef gazebo_msgs::LinkState _link_state_type; + _link_state_type link_state; + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + GetLinkStateResponse(): + link_state(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->link_state.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); + 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; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + 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; + return offset; + } + + virtual const char * getType() override { return GETLINKSTATE; }; + virtual const char * getMD5() override { return "8ba55ad34f9c072e75c0de57b089753b"; }; + + }; + + class GetLinkState { + public: + typedef GetLinkStateRequest Request; + typedef GetLinkStateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetModelProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetModelProperties.h new file mode 100644 index 000000000..5ffc283bb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetModelProperties.h @@ -0,0 +1,322 @@ +#ifndef _ROS_SERVICE_GetModelProperties_h +#define _ROS_SERVICE_GetModelProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETMODELPROPERTIES[] = "gazebo_msgs/GetModelProperties"; + + class GetModelPropertiesRequest : public ros::Msg + { + public: + typedef const char* _model_name_type; + _model_name_type model_name; + + GetModelPropertiesRequest(): + model_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + varToArr(outbuffer + offset, length_model_name); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_model_name; + arrToVar(length_model_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + return offset; + } + + virtual const char * getType() override { return GETMODELPROPERTIES; }; + virtual const char * getMD5() override { return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class GetModelPropertiesResponse : public ros::Msg + { + public: + typedef const char* _parent_model_name_type; + _parent_model_name_type parent_model_name; + typedef const char* _canonical_body_name_type; + _canonical_body_name_type canonical_body_name; + uint32_t body_names_length; + typedef char* _body_names_type; + _body_names_type st_body_names; + _body_names_type * body_names; + uint32_t geom_names_length; + typedef char* _geom_names_type; + _geom_names_type st_geom_names; + _geom_names_type * geom_names; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t child_model_names_length; + typedef char* _child_model_names_type; + _child_model_names_type st_child_model_names; + _child_model_names_type * child_model_names; + typedef bool _is_static_type; + _is_static_type is_static; + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + GetModelPropertiesResponse(): + parent_model_name(""), + canonical_body_name(""), + body_names_length(0), st_body_names(), body_names(nullptr), + geom_names_length(0), st_geom_names(), geom_names(nullptr), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + child_model_names_length(0), st_child_model_names(), child_model_names(nullptr), + is_static(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_parent_model_name = strlen(this->parent_model_name); + varToArr(outbuffer + offset, length_parent_model_name); + offset += 4; + memcpy(outbuffer + offset, this->parent_model_name, length_parent_model_name); + offset += length_parent_model_name; + uint32_t length_canonical_body_name = strlen(this->canonical_body_name); + varToArr(outbuffer + offset, length_canonical_body_name); + offset += 4; + memcpy(outbuffer + offset, this->canonical_body_name, length_canonical_body_name); + offset += length_canonical_body_name; + *(outbuffer + offset + 0) = (this->body_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->body_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->body_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->body_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->body_names_length); + for( uint32_t i = 0; i < body_names_length; i++){ + uint32_t length_body_namesi = strlen(this->body_names[i]); + varToArr(outbuffer + offset, length_body_namesi); + offset += 4; + memcpy(outbuffer + offset, this->body_names[i], length_body_namesi); + offset += length_body_namesi; + } + *(outbuffer + offset + 0) = (this->geom_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->geom_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->geom_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->geom_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->geom_names_length); + for( uint32_t i = 0; i < geom_names_length; i++){ + uint32_t length_geom_namesi = strlen(this->geom_names[i]); + varToArr(outbuffer + offset, length_geom_namesi); + offset += 4; + memcpy(outbuffer + offset, this->geom_names[i], length_geom_namesi); + offset += length_geom_namesi; + } + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset + 0) = (this->child_model_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->child_model_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->child_model_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->child_model_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->child_model_names_length); + for( uint32_t i = 0; i < child_model_names_length; i++){ + uint32_t length_child_model_namesi = strlen(this->child_model_names[i]); + varToArr(outbuffer + offset, length_child_model_namesi); + offset += 4; + memcpy(outbuffer + offset, this->child_model_names[i], length_child_model_namesi); + offset += length_child_model_namesi; + } + union { + bool real; + uint8_t base; + } u_is_static; + u_is_static.real = this->is_static; + *(outbuffer + offset + 0) = (u_is_static.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_static); + 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; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_parent_model_name; + arrToVar(length_parent_model_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parent_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parent_model_name-1]=0; + this->parent_model_name = (char *)(inbuffer + offset-1); + offset += length_parent_model_name; + uint32_t length_canonical_body_name; + arrToVar(length_canonical_body_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_canonical_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_canonical_body_name-1]=0; + this->canonical_body_name = (char *)(inbuffer + offset-1); + offset += length_canonical_body_name; + uint32_t body_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + body_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + body_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + body_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->body_names_length); + if(body_names_lengthT > body_names_length) + this->body_names = (char**)realloc(this->body_names, body_names_lengthT * sizeof(char*)); + body_names_length = body_names_lengthT; + for( uint32_t i = 0; i < body_names_length; i++){ + uint32_t length_st_body_names; + arrToVar(length_st_body_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_body_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_body_names-1]=0; + this->st_body_names = (char *)(inbuffer + offset-1); + offset += length_st_body_names; + memcpy( &(this->body_names[i]), &(this->st_body_names), sizeof(char*)); + } + uint32_t geom_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + geom_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + geom_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + geom_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->geom_names_length); + if(geom_names_lengthT > geom_names_length) + this->geom_names = (char**)realloc(this->geom_names, geom_names_lengthT * sizeof(char*)); + geom_names_length = geom_names_lengthT; + for( uint32_t i = 0; i < geom_names_length; i++){ + uint32_t length_st_geom_names; + arrToVar(length_st_geom_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_geom_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_geom_names-1]=0; + this->st_geom_names = (char *)(inbuffer + offset-1); + offset += length_st_geom_names; + memcpy( &(this->geom_names[i]), &(this->st_geom_names), sizeof(char*)); + } + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint32_t child_model_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + child_model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + child_model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + child_model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->child_model_names_length); + if(child_model_names_lengthT > child_model_names_length) + this->child_model_names = (char**)realloc(this->child_model_names, child_model_names_lengthT * sizeof(char*)); + child_model_names_length = child_model_names_lengthT; + for( uint32_t i = 0; i < child_model_names_length; i++){ + uint32_t length_st_child_model_names; + arrToVar(length_st_child_model_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_child_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_child_model_names-1]=0; + this->st_child_model_names = (char *)(inbuffer + offset-1); + offset += length_st_child_model_names; + memcpy( &(this->child_model_names[i]), &(this->st_child_model_names), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_is_static; + u_is_static.base = 0; + u_is_static.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_static = u_is_static.real; + offset += sizeof(this->is_static); + 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; + return offset; + } + + virtual const char * getType() override { return GETMODELPROPERTIES; }; + virtual const char * getMD5() override { return "b7f370938ef77b464b95f1bab3ec5028"; }; + + }; + + class GetModelProperties { + public: + typedef GetModelPropertiesRequest Request; + typedef GetModelPropertiesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetModelState.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetModelState.h new file mode 100644 index 000000000..d572ad523 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetModelState.h @@ -0,0 +1,157 @@ +#ifndef _ROS_SERVICE_GetModelState_h +#define _ROS_SERVICE_GetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + +static const char GETMODELSTATE[] = "gazebo_msgs/GetModelState"; + + class GetModelStateRequest : public ros::Msg + { + public: + typedef const char* _model_name_type; + _model_name_type model_name; + typedef const char* _relative_entity_name_type; + _relative_entity_name_type relative_entity_name; + + GetModelStateRequest(): + model_name(""), + relative_entity_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + varToArr(outbuffer + offset, length_model_name); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_relative_entity_name = strlen(this->relative_entity_name); + varToArr(outbuffer + offset, length_relative_entity_name); + offset += 4; + memcpy(outbuffer + offset, this->relative_entity_name, length_relative_entity_name); + offset += length_relative_entity_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_model_name; + arrToVar(length_model_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_relative_entity_name; + arrToVar(length_relative_entity_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_relative_entity_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_relative_entity_name-1]=0; + this->relative_entity_name = (char *)(inbuffer + offset-1); + offset += length_relative_entity_name; + return offset; + } + + virtual const char * getType() override { return GETMODELSTATE; }; + virtual const char * getMD5() override { return "19d412713cefe4a67437e17a951e759e"; }; + + }; + + class GetModelStateResponse : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef geometry_msgs::Twist _twist_type; + _twist_type twist; + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + GetModelStateResponse(): + header(), + pose(), + twist(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.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); + 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; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + 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; + return offset; + } + + virtual const char * getType() override { return GETMODELSTATE; }; + virtual const char * getMD5() override { return "ccd51739bb00f0141629e87b792e92b9"; }; + + }; + + class GetModelState { + public: + typedef GetModelStateRequest Request; + typedef GetModelStateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h new file mode 100644 index 000000000..e3428aa8a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h @@ -0,0 +1,145 @@ +#ifndef _ROS_SERVICE_GetPhysicsProperties_h +#define _ROS_SERVICE_GetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ODEPhysics.h" +#include "geometry_msgs/Vector3.h" + +namespace gazebo_msgs +{ + +static const char GETPHYSICSPROPERTIES[] = "gazebo_msgs/GetPhysicsProperties"; + + class GetPhysicsPropertiesRequest : public ros::Msg + { + public: + + GetPhysicsPropertiesRequest() + { + } + + 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 GETPHYSICSPROPERTIES; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPhysicsPropertiesResponse : public ros::Msg + { + public: + typedef float _time_step_type; + _time_step_type time_step; + typedef bool _pause_type; + _pause_type pause; + typedef float _max_update_rate_type; + _max_update_rate_type max_update_rate; + typedef geometry_msgs::Vector3 _gravity_type; + _gravity_type gravity; + typedef gazebo_msgs::ODEPhysics _ode_config_type; + _ode_config_type ode_config; + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + GetPhysicsPropertiesResponse(): + time_step(0), + pause(0), + max_update_rate(0), + gravity(), + ode_config(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + union { + bool real; + uint8_t base; + } u_pause; + u_pause.real = this->pause; + *(outbuffer + offset + 0) = (u_pause.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pause); + offset += serializeAvrFloat64(outbuffer + offset, this->max_update_rate); + offset += this->gravity.serialize(outbuffer + offset); + offset += this->ode_config.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); + 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; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + union { + bool real; + uint8_t base; + } u_pause; + u_pause.base = 0; + u_pause.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pause = u_pause.real; + offset += sizeof(this->pause); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_update_rate)); + offset += this->gravity.deserialize(inbuffer + offset); + offset += this->ode_config.deserialize(inbuffer + offset); + 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; + return offset; + } + + virtual const char * getType() override { return GETPHYSICSPROPERTIES; }; + virtual const char * getMD5() override { return "575a5e74786981b7df2e3afc567693a6"; }; + + }; + + class GetPhysicsProperties { + public: + typedef GetPhysicsPropertiesRequest Request; + typedef GetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetWorldProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetWorldProperties.h new file mode 100644 index 000000000..9f153dee7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/GetWorldProperties.h @@ -0,0 +1,165 @@ +#ifndef _ROS_SERVICE_GetWorldProperties_h +#define _ROS_SERVICE_GetWorldProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETWORLDPROPERTIES[] = "gazebo_msgs/GetWorldProperties"; + + class GetWorldPropertiesRequest : public ros::Msg + { + public: + + GetWorldPropertiesRequest() + { + } + + 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 GETWORLDPROPERTIES; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetWorldPropertiesResponse : public ros::Msg + { + public: + typedef float _sim_time_type; + _sim_time_type sim_time; + uint32_t model_names_length; + typedef char* _model_names_type; + _model_names_type st_model_names; + _model_names_type * model_names; + typedef bool _rendering_enabled_type; + _rendering_enabled_type rendering_enabled; + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + GetWorldPropertiesResponse(): + sim_time(0), + model_names_length(0), st_model_names(), model_names(nullptr), + rendering_enabled(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->sim_time); + *(outbuffer + offset + 0) = (this->model_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->model_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->model_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->model_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->model_names_length); + for( uint32_t i = 0; i < model_names_length; i++){ + uint32_t length_model_namesi = strlen(this->model_names[i]); + varToArr(outbuffer + offset, length_model_namesi); + offset += 4; + memcpy(outbuffer + offset, this->model_names[i], length_model_namesi); + offset += length_model_namesi; + } + union { + bool real; + uint8_t base; + } u_rendering_enabled; + u_rendering_enabled.real = this->rendering_enabled; + *(outbuffer + offset + 0) = (u_rendering_enabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->rendering_enabled); + 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; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sim_time)); + uint32_t model_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->model_names_length); + if(model_names_lengthT > model_names_length) + this->model_names = (char**)realloc(this->model_names, model_names_lengthT * sizeof(char*)); + model_names_length = model_names_lengthT; + for( uint32_t i = 0; i < model_names_length; i++){ + uint32_t length_st_model_names; + arrToVar(length_st_model_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_model_names-1]=0; + this->st_model_names = (char *)(inbuffer + offset-1); + offset += length_st_model_names; + memcpy( &(this->model_names[i]), &(this->st_model_names), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_rendering_enabled; + u_rendering_enabled.base = 0; + u_rendering_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->rendering_enabled = u_rendering_enabled.real; + offset += sizeof(this->rendering_enabled); + 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; + return offset; + } + + virtual const char * getType() override { return GETWORLDPROPERTIES; }; + virtual const char * getMD5() override { return "36bb0f2eccf4d8be971410c22818ba3f"; }; + + }; + + class GetWorldProperties { + public: + typedef GetWorldPropertiesRequest Request; + typedef GetWorldPropertiesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/JointRequest.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/JointRequest.h new file mode 100644 index 000000000..41efe87a4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/JointRequest.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_JointRequest_h +#define _ROS_SERVICE_JointRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char JOINTREQUEST[] = "gazebo_msgs/JointRequest"; + + class JointRequestRequest : public ros::Msg + { + public: + typedef const char* _joint_name_type; + _joint_name_type joint_name; + + JointRequestRequest(): + joint_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + varToArr(outbuffer + offset, length_joint_name); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_joint_name; + arrToVar(length_joint_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + return offset; + } + + virtual const char * getType() override { return JOINTREQUEST; }; + virtual const char * getMD5() override { return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class JointRequestResponse : public ros::Msg + { + public: + + JointRequestResponse() + { + } + + 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 JOINTREQUEST; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class JointRequest { + public: + typedef JointRequestRequest Request; + typedef JointRequestResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/LinkState.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/LinkState.h new file mode 100644 index 000000000..92688027a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/LinkState.h @@ -0,0 +1,84 @@ +#ifndef _ROS_gazebo_msgs_LinkState_h +#define _ROS_gazebo_msgs_LinkState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class LinkState : public ros::Msg + { + public: + typedef const char* _link_name_type; + _link_name_type link_name; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef geometry_msgs::Twist _twist_type; + _twist_type twist; + typedef const char* _reference_frame_type; + _reference_frame_type reference_frame; + + LinkState(): + link_name(""), + pose(), + twist(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + varToArr(outbuffer + offset, length_reference_frame); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + arrToVar(length_reference_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/LinkState"; }; + virtual const char * getMD5() override { return "0818ebbf28ce3a08d48ab1eaa7309ebe"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/LinkStates.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/LinkStates.h new file mode 100644 index 000000000..5fe324737 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/LinkStates.h @@ -0,0 +1,127 @@ +#ifndef _ROS_gazebo_msgs_LinkStates_h +#define _ROS_gazebo_msgs_LinkStates_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class LinkStates : public ros::Msg + { + public: + uint32_t name_length; + typedef char* _name_type; + _name_type st_name; + _name_type * name; + uint32_t pose_length; + typedef geometry_msgs::Pose _pose_type; + _pose_type st_pose; + _pose_type * pose; + uint32_t twist_length; + typedef geometry_msgs::Twist _twist_type; + _twist_type st_twist; + _twist_type * twist; + + LinkStates(): + name_length(0), st_name(), name(nullptr), + pose_length(0), st_pose(), pose(nullptr), + twist_length(0), st_twist(), twist(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->name_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->name_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->name_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->name_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->name_length); + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + varToArr(outbuffer + offset, length_namei); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset + 0) = (this->pose_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pose_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pose_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pose_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->pose_length); + for( uint32_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->twist_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->twist_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->twist_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->twist_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->twist_length); + for( uint32_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t name_lengthT = ((uint32_t) (*(inbuffer + offset))); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->name_length); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + name_length = name_lengthT; + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + arrToVar(length_st_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint32_t pose_lengthT = ((uint32_t) (*(inbuffer + offset))); + pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pose_length); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + pose_length = pose_lengthT; + for( uint32_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint32_t twist_lengthT = ((uint32_t) (*(inbuffer + offset))); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->twist_length); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + twist_length = twist_lengthT; + for( uint32_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/LinkStates"; }; + virtual const char * getMD5() override { return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ModelState.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ModelState.h new file mode 100644 index 000000000..d193c00f9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ModelState.h @@ -0,0 +1,84 @@ +#ifndef _ROS_gazebo_msgs_ModelState_h +#define _ROS_gazebo_msgs_ModelState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class ModelState : public ros::Msg + { + public: + typedef const char* _model_name_type; + _model_name_type model_name; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef geometry_msgs::Twist _twist_type; + _twist_type twist; + typedef const char* _reference_frame_type; + _reference_frame_type reference_frame; + + ModelState(): + model_name(""), + pose(), + twist(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + varToArr(outbuffer + offset, length_model_name); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + varToArr(outbuffer + offset, length_reference_frame); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_model_name; + arrToVar(length_model_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + arrToVar(length_reference_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/ModelState"; }; + virtual const char * getMD5() override { return "9330fd35f2fcd82d457e54bd54e10593"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ModelStates.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ModelStates.h new file mode 100644 index 000000000..180aa89b1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ModelStates.h @@ -0,0 +1,127 @@ +#ifndef _ROS_gazebo_msgs_ModelStates_h +#define _ROS_gazebo_msgs_ModelStates_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class ModelStates : public ros::Msg + { + public: + uint32_t name_length; + typedef char* _name_type; + _name_type st_name; + _name_type * name; + uint32_t pose_length; + typedef geometry_msgs::Pose _pose_type; + _pose_type st_pose; + _pose_type * pose; + uint32_t twist_length; + typedef geometry_msgs::Twist _twist_type; + _twist_type st_twist; + _twist_type * twist; + + ModelStates(): + name_length(0), st_name(), name(nullptr), + pose_length(0), st_pose(), pose(nullptr), + twist_length(0), st_twist(), twist(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->name_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->name_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->name_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->name_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->name_length); + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + varToArr(outbuffer + offset, length_namei); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset + 0) = (this->pose_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pose_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pose_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pose_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->pose_length); + for( uint32_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->twist_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->twist_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->twist_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->twist_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->twist_length); + for( uint32_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t name_lengthT = ((uint32_t) (*(inbuffer + offset))); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->name_length); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + name_length = name_lengthT; + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + arrToVar(length_st_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint32_t pose_lengthT = ((uint32_t) (*(inbuffer + offset))); + pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pose_length); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + pose_length = pose_lengthT; + for( uint32_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint32_t twist_lengthT = ((uint32_t) (*(inbuffer + offset))); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->twist_length); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + twist_length = twist_lengthT; + for( uint32_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/ModelStates"; }; + virtual const char * getMD5() override { return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ODEJointProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ODEJointProperties.h new file mode 100644 index 000000000..8114b00f2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ODEJointProperties.h @@ -0,0 +1,288 @@ +#ifndef _ROS_gazebo_msgs_ODEJointProperties_h +#define _ROS_gazebo_msgs_ODEJointProperties_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class ODEJointProperties : public ros::Msg + { + public: + uint32_t damping_length; + typedef float _damping_type; + _damping_type st_damping; + _damping_type * damping; + uint32_t hiStop_length; + typedef float _hiStop_type; + _hiStop_type st_hiStop; + _hiStop_type * hiStop; + uint32_t loStop_length; + typedef float _loStop_type; + _loStop_type st_loStop; + _loStop_type * loStop; + uint32_t erp_length; + typedef float _erp_type; + _erp_type st_erp; + _erp_type * erp; + uint32_t cfm_length; + typedef float _cfm_type; + _cfm_type st_cfm; + _cfm_type * cfm; + uint32_t stop_erp_length; + typedef float _stop_erp_type; + _stop_erp_type st_stop_erp; + _stop_erp_type * stop_erp; + uint32_t stop_cfm_length; + typedef float _stop_cfm_type; + _stop_cfm_type st_stop_cfm; + _stop_cfm_type * stop_cfm; + uint32_t fudge_factor_length; + typedef float _fudge_factor_type; + _fudge_factor_type st_fudge_factor; + _fudge_factor_type * fudge_factor; + uint32_t fmax_length; + typedef float _fmax_type; + _fmax_type st_fmax; + _fmax_type * fmax; + uint32_t vel_length; + typedef float _vel_type; + _vel_type st_vel; + _vel_type * vel; + + ODEJointProperties(): + damping_length(0), st_damping(), damping(nullptr), + hiStop_length(0), st_hiStop(), hiStop(nullptr), + loStop_length(0), st_loStop(), loStop(nullptr), + erp_length(0), st_erp(), erp(nullptr), + cfm_length(0), st_cfm(), cfm(nullptr), + stop_erp_length(0), st_stop_erp(), stop_erp(nullptr), + stop_cfm_length(0), st_stop_cfm(), stop_cfm(nullptr), + fudge_factor_length(0), st_fudge_factor(), fudge_factor(nullptr), + fmax_length(0), st_fmax(), fmax(nullptr), + vel_length(0), st_vel(), vel(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->damping_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->damping_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->damping_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->damping_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->damping_length); + for( uint32_t i = 0; i < damping_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); + } + *(outbuffer + offset + 0) = (this->hiStop_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->hiStop_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->hiStop_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->hiStop_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->hiStop_length); + for( uint32_t i = 0; i < hiStop_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->hiStop[i]); + } + *(outbuffer + offset + 0) = (this->loStop_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->loStop_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->loStop_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->loStop_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->loStop_length); + for( uint32_t i = 0; i < loStop_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->loStop[i]); + } + *(outbuffer + offset + 0) = (this->erp_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->erp_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->erp_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->erp_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->erp_length); + for( uint32_t i = 0; i < erp_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->erp[i]); + } + *(outbuffer + offset + 0) = (this->cfm_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cfm_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cfm_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cfm_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cfm_length); + for( uint32_t i = 0; i < cfm_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->cfm[i]); + } + *(outbuffer + offset + 0) = (this->stop_erp_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stop_erp_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stop_erp_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stop_erp_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->stop_erp_length); + for( uint32_t i = 0; i < stop_erp_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->stop_erp[i]); + } + *(outbuffer + offset + 0) = (this->stop_cfm_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stop_cfm_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stop_cfm_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stop_cfm_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->stop_cfm_length); + for( uint32_t i = 0; i < stop_cfm_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->stop_cfm[i]); + } + *(outbuffer + offset + 0) = (this->fudge_factor_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fudge_factor_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fudge_factor_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fudge_factor_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->fudge_factor_length); + for( uint32_t i = 0; i < fudge_factor_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->fudge_factor[i]); + } + *(outbuffer + offset + 0) = (this->fmax_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fmax_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fmax_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fmax_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->fmax_length); + for( uint32_t i = 0; i < fmax_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->fmax[i]); + } + *(outbuffer + offset + 0) = (this->vel_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vel_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vel_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vel_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->vel_length); + for( uint32_t i = 0; i < vel_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->vel[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t damping_lengthT = ((uint32_t) (*(inbuffer + offset))); + damping_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + damping_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + damping_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->damping_length); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + damping_length = damping_lengthT; + for( uint32_t i = 0; i < damping_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint32_t hiStop_lengthT = ((uint32_t) (*(inbuffer + offset))); + hiStop_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + hiStop_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + hiStop_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->hiStop_length); + if(hiStop_lengthT > hiStop_length) + this->hiStop = (float*)realloc(this->hiStop, hiStop_lengthT * sizeof(float)); + hiStop_length = hiStop_lengthT; + for( uint32_t i = 0; i < hiStop_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_hiStop)); + memcpy( &(this->hiStop[i]), &(this->st_hiStop), sizeof(float)); + } + uint32_t loStop_lengthT = ((uint32_t) (*(inbuffer + offset))); + loStop_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + loStop_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + loStop_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->loStop_length); + if(loStop_lengthT > loStop_length) + this->loStop = (float*)realloc(this->loStop, loStop_lengthT * sizeof(float)); + loStop_length = loStop_lengthT; + for( uint32_t i = 0; i < loStop_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_loStop)); + memcpy( &(this->loStop[i]), &(this->st_loStop), sizeof(float)); + } + uint32_t erp_lengthT = ((uint32_t) (*(inbuffer + offset))); + erp_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + erp_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + erp_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->erp_length); + if(erp_lengthT > erp_length) + this->erp = (float*)realloc(this->erp, erp_lengthT * sizeof(float)); + erp_length = erp_lengthT; + for( uint32_t i = 0; i < erp_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_erp)); + memcpy( &(this->erp[i]), &(this->st_erp), sizeof(float)); + } + uint32_t cfm_lengthT = ((uint32_t) (*(inbuffer + offset))); + cfm_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cfm_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cfm_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cfm_length); + if(cfm_lengthT > cfm_length) + this->cfm = (float*)realloc(this->cfm, cfm_lengthT * sizeof(float)); + cfm_length = cfm_lengthT; + for( uint32_t i = 0; i < cfm_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_cfm)); + memcpy( &(this->cfm[i]), &(this->st_cfm), sizeof(float)); + } + uint32_t stop_erp_lengthT = ((uint32_t) (*(inbuffer + offset))); + stop_erp_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + stop_erp_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + stop_erp_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stop_erp_length); + if(stop_erp_lengthT > stop_erp_length) + this->stop_erp = (float*)realloc(this->stop_erp, stop_erp_lengthT * sizeof(float)); + stop_erp_length = stop_erp_lengthT; + for( uint32_t i = 0; i < stop_erp_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_stop_erp)); + memcpy( &(this->stop_erp[i]), &(this->st_stop_erp), sizeof(float)); + } + uint32_t stop_cfm_lengthT = ((uint32_t) (*(inbuffer + offset))); + stop_cfm_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + stop_cfm_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + stop_cfm_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stop_cfm_length); + if(stop_cfm_lengthT > stop_cfm_length) + this->stop_cfm = (float*)realloc(this->stop_cfm, stop_cfm_lengthT * sizeof(float)); + stop_cfm_length = stop_cfm_lengthT; + for( uint32_t i = 0; i < stop_cfm_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_stop_cfm)); + memcpy( &(this->stop_cfm[i]), &(this->st_stop_cfm), sizeof(float)); + } + uint32_t fudge_factor_lengthT = ((uint32_t) (*(inbuffer + offset))); + fudge_factor_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + fudge_factor_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + fudge_factor_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fudge_factor_length); + if(fudge_factor_lengthT > fudge_factor_length) + this->fudge_factor = (float*)realloc(this->fudge_factor, fudge_factor_lengthT * sizeof(float)); + fudge_factor_length = fudge_factor_lengthT; + for( uint32_t i = 0; i < fudge_factor_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fudge_factor)); + memcpy( &(this->fudge_factor[i]), &(this->st_fudge_factor), sizeof(float)); + } + uint32_t fmax_lengthT = ((uint32_t) (*(inbuffer + offset))); + fmax_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + fmax_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + fmax_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fmax_length); + if(fmax_lengthT > fmax_length) + this->fmax = (float*)realloc(this->fmax, fmax_lengthT * sizeof(float)); + fmax_length = fmax_lengthT; + for( uint32_t i = 0; i < fmax_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fmax)); + memcpy( &(this->fmax[i]), &(this->st_fmax), sizeof(float)); + } + uint32_t vel_lengthT = ((uint32_t) (*(inbuffer + offset))); + vel_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + vel_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + vel_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vel_length); + if(vel_lengthT > vel_length) + this->vel = (float*)realloc(this->vel, vel_lengthT * sizeof(float)); + vel_length = vel_lengthT; + for( uint32_t i = 0; i < vel_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_vel)); + memcpy( &(this->vel[i]), &(this->st_vel), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/ODEJointProperties"; }; + virtual const char * getMD5() override { return "1b744c32a920af979f53afe2f9c3511f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ODEPhysics.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ODEPhysics.h new file mode 100644 index 000000000..fe382cf72 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/ODEPhysics.h @@ -0,0 +1,125 @@ +#ifndef _ROS_gazebo_msgs_ODEPhysics_h +#define _ROS_gazebo_msgs_ODEPhysics_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class ODEPhysics : public ros::Msg + { + public: + typedef bool _auto_disable_bodies_type; + _auto_disable_bodies_type auto_disable_bodies; + typedef uint32_t _sor_pgs_precon_iters_type; + _sor_pgs_precon_iters_type sor_pgs_precon_iters; + typedef uint32_t _sor_pgs_iters_type; + _sor_pgs_iters_type sor_pgs_iters; + typedef float _sor_pgs_w_type; + _sor_pgs_w_type sor_pgs_w; + typedef float _sor_pgs_rms_error_tol_type; + _sor_pgs_rms_error_tol_type sor_pgs_rms_error_tol; + typedef float _contact_surface_layer_type; + _contact_surface_layer_type contact_surface_layer; + typedef float _contact_max_correcting_vel_type; + _contact_max_correcting_vel_type contact_max_correcting_vel; + typedef float _cfm_type; + _cfm_type cfm; + typedef float _erp_type; + _erp_type erp; + typedef uint32_t _max_contacts_type; + _max_contacts_type max_contacts; + + ODEPhysics(): + auto_disable_bodies(0), + sor_pgs_precon_iters(0), + sor_pgs_iters(0), + sor_pgs_w(0), + sor_pgs_rms_error_tol(0), + contact_surface_layer(0), + contact_max_correcting_vel(0), + cfm(0), + erp(0), + max_contacts(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_auto_disable_bodies; + u_auto_disable_bodies.real = this->auto_disable_bodies; + *(outbuffer + offset + 0) = (u_auto_disable_bodies.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->auto_disable_bodies); + *(outbuffer + offset + 0) = (this->sor_pgs_precon_iters >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sor_pgs_precon_iters >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sor_pgs_precon_iters >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sor_pgs_precon_iters >> (8 * 3)) & 0xFF; + offset += sizeof(this->sor_pgs_precon_iters); + *(outbuffer + offset + 0) = (this->sor_pgs_iters >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sor_pgs_iters >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sor_pgs_iters >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sor_pgs_iters >> (8 * 3)) & 0xFF; + offset += sizeof(this->sor_pgs_iters); + offset += serializeAvrFloat64(outbuffer + offset, this->sor_pgs_w); + offset += serializeAvrFloat64(outbuffer + offset, this->sor_pgs_rms_error_tol); + offset += serializeAvrFloat64(outbuffer + offset, this->contact_surface_layer); + offset += serializeAvrFloat64(outbuffer + offset, this->contact_max_correcting_vel); + offset += serializeAvrFloat64(outbuffer + offset, this->cfm); + offset += serializeAvrFloat64(outbuffer + offset, this->erp); + *(outbuffer + offset + 0) = (this->max_contacts >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->max_contacts >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->max_contacts >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->max_contacts >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_contacts); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_auto_disable_bodies; + u_auto_disable_bodies.base = 0; + u_auto_disable_bodies.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->auto_disable_bodies = u_auto_disable_bodies.real; + offset += sizeof(this->auto_disable_bodies); + this->sor_pgs_precon_iters = ((uint32_t) (*(inbuffer + offset))); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sor_pgs_precon_iters); + this->sor_pgs_iters = ((uint32_t) (*(inbuffer + offset))); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sor_pgs_iters); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sor_pgs_w)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sor_pgs_rms_error_tol)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->contact_surface_layer)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->contact_max_correcting_vel)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->cfm)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->erp)); + this->max_contacts = ((uint32_t) (*(inbuffer + offset))); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->max_contacts); + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/ODEPhysics"; }; + virtual const char * getMD5() override { return "667d56ddbd547918c32d1934503dc335"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/PerformanceMetrics.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/PerformanceMetrics.h new file mode 100644 index 000000000..d6835796e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/PerformanceMetrics.h @@ -0,0 +1,75 @@ +#ifndef _ROS_gazebo_msgs_PerformanceMetrics_h +#define _ROS_gazebo_msgs_PerformanceMetrics_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "gazebo_msgs/SensorPerformanceMetric.h" + +namespace gazebo_msgs +{ + + class PerformanceMetrics : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _real_time_factor_type; + _real_time_factor_type real_time_factor; + uint32_t sensors_length; + typedef gazebo_msgs::SensorPerformanceMetric _sensors_type; + _sensors_type st_sensors; + _sensors_type * sensors; + + PerformanceMetrics(): + header(), + real_time_factor(0), + sensors_length(0), st_sensors(), sensors(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->real_time_factor); + *(outbuffer + offset + 0) = (this->sensors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sensors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sensors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sensors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->sensors_length); + for( uint32_t i = 0; i < sensors_length; i++){ + offset += this->sensors[i].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->real_time_factor)); + uint32_t sensors_lengthT = ((uint32_t) (*(inbuffer + offset))); + sensors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + sensors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + sensors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sensors_length); + if(sensors_lengthT > sensors_length) + this->sensors = (gazebo_msgs::SensorPerformanceMetric*)realloc(this->sensors, sensors_lengthT * sizeof(gazebo_msgs::SensorPerformanceMetric)); + sensors_length = sensors_lengthT; + for( uint32_t i = 0; i < sensors_length; i++){ + offset += this->st_sensors.deserialize(inbuffer + offset); + memcpy( &(this->sensors[i]), &(this->st_sensors), sizeof(gazebo_msgs::SensorPerformanceMetric)); + } + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/PerformanceMetrics"; }; + virtual const char * getMD5() override { return "884f71fd5037b886ec5e126b83c4425a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SensorPerformanceMetric.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SensorPerformanceMetric.h new file mode 100644 index 000000000..817f2f6b9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SensorPerformanceMetric.h @@ -0,0 +1,70 @@ +#ifndef _ROS_gazebo_msgs_SensorPerformanceMetric_h +#define _ROS_gazebo_msgs_SensorPerformanceMetric_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class SensorPerformanceMetric : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef float _sim_update_rate_type; + _sim_update_rate_type sim_update_rate; + typedef float _real_update_rate_type; + _real_update_rate_type real_update_rate; + typedef float _fps_type; + _fps_type fps; + + SensorPerformanceMetric(): + name(""), + sim_update_rate(0), + real_update_rate(0), + fps(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; + offset += serializeAvrFloat64(outbuffer + offset, this->sim_update_rate); + offset += serializeAvrFloat64(outbuffer + offset, this->real_update_rate); + offset += serializeAvrFloat64(outbuffer + offset, this->fps); + 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; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sim_update_rate)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->real_update_rate)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->fps)); + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/SensorPerformanceMetric"; }; + virtual const char * getMD5() override { return "01762ded18cfe9ebc7c8222667c99547"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetJointProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetJointProperties.h new file mode 100644 index 000000000..87a79e867 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetJointProperties.h @@ -0,0 +1,128 @@ +#ifndef _ROS_SERVICE_SetJointProperties_h +#define _ROS_SERVICE_SetJointProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ODEJointProperties.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTPROPERTIES[] = "gazebo_msgs/SetJointProperties"; + + class SetJointPropertiesRequest : public ros::Msg + { + public: + typedef const char* _joint_name_type; + _joint_name_type joint_name; + typedef gazebo_msgs::ODEJointProperties _ode_joint_config_type; + _ode_joint_config_type ode_joint_config; + + SetJointPropertiesRequest(): + joint_name(""), + ode_joint_config() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + varToArr(outbuffer + offset, length_joint_name); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + offset += this->ode_joint_config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_joint_name; + arrToVar(length_joint_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + offset += this->ode_joint_config.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETJOINTPROPERTIES; }; + virtual const char * getMD5() override { return "331fd8f35fd27e3c1421175590258e26"; }; + + }; + + class SetJointPropertiesResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetJointPropertiesResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETJOINTPROPERTIES; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointProperties { + public: + typedef SetJointPropertiesRequest Request; + typedef SetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetJointTrajectory.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetJointTrajectory.h new file mode 100644 index 000000000..95ee7be4a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetJointTrajectory.h @@ -0,0 +1,170 @@ +#ifndef _ROS_SERVICE_SetJointTrajectory_h +#define _ROS_SERVICE_SetJointTrajectory_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "trajectory_msgs/JointTrajectory.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTTRAJECTORY[] = "gazebo_msgs/SetJointTrajectory"; + + class SetJointTrajectoryRequest : public ros::Msg + { + public: + typedef const char* _model_name_type; + _model_name_type model_name; + typedef trajectory_msgs::JointTrajectory _joint_trajectory_type; + _joint_trajectory_type joint_trajectory; + typedef geometry_msgs::Pose _model_pose_type; + _model_pose_type model_pose; + typedef bool _set_model_pose_type; + _set_model_pose_type set_model_pose; + typedef bool _disable_physics_updates_type; + _disable_physics_updates_type disable_physics_updates; + + SetJointTrajectoryRequest(): + model_name(""), + joint_trajectory(), + model_pose(), + set_model_pose(0), + disable_physics_updates(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + varToArr(outbuffer + offset, length_model_name); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + offset += this->joint_trajectory.serialize(outbuffer + offset); + offset += this->model_pose.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_set_model_pose; + u_set_model_pose.real = this->set_model_pose; + *(outbuffer + offset + 0) = (u_set_model_pose.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->set_model_pose); + union { + bool real; + uint8_t base; + } u_disable_physics_updates; + u_disable_physics_updates.real = this->disable_physics_updates; + *(outbuffer + offset + 0) = (u_disable_physics_updates.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->disable_physics_updates); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_model_name; + arrToVar(length_model_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + offset += this->joint_trajectory.deserialize(inbuffer + offset); + offset += this->model_pose.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_set_model_pose; + u_set_model_pose.base = 0; + u_set_model_pose.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->set_model_pose = u_set_model_pose.real; + offset += sizeof(this->set_model_pose); + union { + bool real; + uint8_t base; + } u_disable_physics_updates; + u_disable_physics_updates.base = 0; + u_disable_physics_updates.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->disable_physics_updates = u_disable_physics_updates.real; + offset += sizeof(this->disable_physics_updates); + return offset; + } + + virtual const char * getType() override { return SETJOINTTRAJECTORY; }; + virtual const char * getMD5() override { return "649dd2eba5ffd358069238825f9f85ab"; }; + + }; + + class SetJointTrajectoryResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetJointTrajectoryResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETJOINTTRAJECTORY; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointTrajectory { + public: + typedef SetJointTrajectoryRequest Request; + typedef SetJointTrajectoryResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLightProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLightProperties.h new file mode 100644 index 000000000..4a7ba9af6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLightProperties.h @@ -0,0 +1,178 @@ +#ifndef _ROS_SERVICE_SetLightProperties_h +#define _ROS_SERVICE_SetLightProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "std_msgs/ColorRGBA.h" +#include "geometry_msgs/Vector3.h" + +namespace gazebo_msgs +{ + +static const char SETLIGHTPROPERTIES[] = "gazebo_msgs/SetLightProperties"; + + class SetLightPropertiesRequest : public ros::Msg + { + public: + typedef const char* _light_name_type; + _light_name_type light_name; + typedef bool _cast_shadows_type; + _cast_shadows_type cast_shadows; + typedef std_msgs::ColorRGBA _diffuse_type; + _diffuse_type diffuse; + typedef std_msgs::ColorRGBA _specular_type; + _specular_type specular; + typedef float _attenuation_constant_type; + _attenuation_constant_type attenuation_constant; + typedef float _attenuation_linear_type; + _attenuation_linear_type attenuation_linear; + typedef float _attenuation_quadratic_type; + _attenuation_quadratic_type attenuation_quadratic; + typedef geometry_msgs::Vector3 _direction_type; + _direction_type direction; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + + SetLightPropertiesRequest(): + light_name(""), + cast_shadows(0), + diffuse(), + specular(), + attenuation_constant(0), + attenuation_linear(0), + attenuation_quadratic(0), + direction(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_light_name = strlen(this->light_name); + varToArr(outbuffer + offset, length_light_name); + offset += 4; + memcpy(outbuffer + offset, this->light_name, length_light_name); + offset += length_light_name; + union { + bool real; + uint8_t base; + } u_cast_shadows; + u_cast_shadows.real = this->cast_shadows; + *(outbuffer + offset + 0) = (u_cast_shadows.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->cast_shadows); + offset += this->diffuse.serialize(outbuffer + offset); + offset += this->specular.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->attenuation_constant); + offset += serializeAvrFloat64(outbuffer + offset, this->attenuation_linear); + offset += serializeAvrFloat64(outbuffer + offset, this->attenuation_quadratic); + offset += this->direction.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_light_name; + arrToVar(length_light_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_light_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_light_name-1]=0; + this->light_name = (char *)(inbuffer + offset-1); + offset += length_light_name; + union { + bool real; + uint8_t base; + } u_cast_shadows; + u_cast_shadows.base = 0; + u_cast_shadows.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->cast_shadows = u_cast_shadows.real; + offset += sizeof(this->cast_shadows); + offset += this->diffuse.deserialize(inbuffer + offset); + offset += this->specular.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->attenuation_constant)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->attenuation_linear)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->attenuation_quadratic)); + offset += this->direction.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETLIGHTPROPERTIES; }; + virtual const char * getMD5() override { return "10d953f2306aec18460eb80dd94fdd47"; }; + + }; + + class SetLightPropertiesResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetLightPropertiesResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETLIGHTPROPERTIES; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLightProperties { + public: + typedef SetLightPropertiesRequest Request; + typedef SetLightPropertiesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLinkProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLinkProperties.h new file mode 100644 index 000000000..02381aca0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLinkProperties.h @@ -0,0 +1,181 @@ +#ifndef _ROS_SERVICE_SetLinkProperties_h +#define _ROS_SERVICE_SetLinkProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SETLINKPROPERTIES[] = "gazebo_msgs/SetLinkProperties"; + + class SetLinkPropertiesRequest : public ros::Msg + { + public: + typedef const char* _link_name_type; + _link_name_type link_name; + typedef geometry_msgs::Pose _com_type; + _com_type com; + typedef bool _gravity_mode_type; + _gravity_mode_type gravity_mode; + typedef float _mass_type; + _mass_type mass; + typedef float _ixx_type; + _ixx_type ixx; + typedef float _ixy_type; + _ixy_type ixy; + typedef float _ixz_type; + _ixz_type ixz; + typedef float _iyy_type; + _iyy_type iyy; + typedef float _iyz_type; + _iyz_type iyz; + typedef float _izz_type; + _izz_type izz; + + SetLinkPropertiesRequest(): + link_name(""), + com(), + gravity_mode(0), + mass(0), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->com.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.real = this->gravity_mode; + *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gravity_mode); + offset += serializeAvrFloat64(outbuffer + offset, this->mass); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->com.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.base = 0; + u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gravity_mode = u_gravity_mode.real; + offset += sizeof(this->gravity_mode); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mass)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + return offset; + } + + virtual const char * getType() override { return SETLINKPROPERTIES; }; + virtual const char * getMD5() override { return "68ac74a4be01b165bc305b5ccdc45e91"; }; + + }; + + class SetLinkPropertiesResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetLinkPropertiesResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETLINKPROPERTIES; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkProperties { + public: + typedef SetLinkPropertiesRequest Request; + typedef SetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLinkState.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLinkState.h new file mode 100644 index 000000000..7162ec651 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetLinkState.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_SetLinkState_h +#define _ROS_SERVICE_SetLinkState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/LinkState.h" + +namespace gazebo_msgs +{ + +static const char SETLINKSTATE[] = "gazebo_msgs/SetLinkState"; + + class SetLinkStateRequest : public ros::Msg + { + public: + typedef gazebo_msgs::LinkState _link_state_type; + _link_state_type link_state; + + SetLinkStateRequest(): + link_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->link_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETLINKSTATE; }; + virtual const char * getMD5() override { return "22a2c757d56911b6f27868159e9a872d"; }; + + }; + + class SetLinkStateResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetLinkStateResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETLINKSTATE; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkState { + public: + typedef SetLinkStateRequest Request; + typedef SetLinkStateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetModelConfiguration.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetModelConfiguration.h new file mode 100644 index 000000000..89ef4578d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetModelConfiguration.h @@ -0,0 +1,201 @@ +#ifndef _ROS_SERVICE_SetModelConfiguration_h +#define _ROS_SERVICE_SetModelConfiguration_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char SETMODELCONFIGURATION[] = "gazebo_msgs/SetModelConfiguration"; + + class SetModelConfigurationRequest : public ros::Msg + { + public: + typedef const char* _model_name_type; + _model_name_type model_name; + typedef const char* _urdf_param_name_type; + _urdf_param_name_type urdf_param_name; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t joint_positions_length; + typedef float _joint_positions_type; + _joint_positions_type st_joint_positions; + _joint_positions_type * joint_positions; + + SetModelConfigurationRequest(): + model_name(""), + urdf_param_name(""), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + joint_positions_length(0), st_joint_positions(), joint_positions(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + varToArr(outbuffer + offset, length_model_name); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_urdf_param_name = strlen(this->urdf_param_name); + varToArr(outbuffer + offset, length_urdf_param_name); + offset += 4; + memcpy(outbuffer + offset, this->urdf_param_name, length_urdf_param_name); + offset += length_urdf_param_name; + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset + 0) = (this->joint_positions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_positions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_positions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_positions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_positions_length); + for( uint32_t i = 0; i < joint_positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_positions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_model_name; + arrToVar(length_model_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_urdf_param_name; + arrToVar(length_urdf_param_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_urdf_param_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_urdf_param_name-1]=0; + this->urdf_param_name = (char *)(inbuffer + offset-1); + offset += length_urdf_param_name; + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint32_t joint_positions_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_positions_length); + if(joint_positions_lengthT > joint_positions_length) + this->joint_positions = (float*)realloc(this->joint_positions, joint_positions_lengthT * sizeof(float)); + joint_positions_length = joint_positions_lengthT; + for( uint32_t i = 0; i < joint_positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_positions)); + memcpy( &(this->joint_positions[i]), &(this->st_joint_positions), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return SETMODELCONFIGURATION; }; + virtual const char * getMD5() override { return "160eae60f51fabff255480c70afa289f"; }; + + }; + + class SetModelConfigurationResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetModelConfigurationResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETMODELCONFIGURATION; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelConfiguration { + public: + typedef SetModelConfigurationRequest Request; + typedef SetModelConfigurationResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetModelState.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetModelState.h new file mode 100644 index 000000000..e14fc1cb2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetModelState.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_SetModelState_h +#define _ROS_SERVICE_SetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ModelState.h" + +namespace gazebo_msgs +{ + +static const char SETMODELSTATE[] = "gazebo_msgs/SetModelState"; + + class SetModelStateRequest : public ros::Msg + { + public: + typedef gazebo_msgs::ModelState _model_state_type; + _model_state_type model_state; + + SetModelStateRequest(): + model_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->model_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->model_state.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETMODELSTATE; }; + virtual const char * getMD5() override { return "cb042b0e91880f4661b29ea5b6234350"; }; + + }; + + class SetModelStateResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetModelStateResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETMODELSTATE; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelState { + public: + typedef SetModelStateRequest Request; + typedef SetModelStateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h new file mode 100644 index 000000000..bb25bf874 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h @@ -0,0 +1,127 @@ +#ifndef _ROS_SERVICE_SetPhysicsProperties_h +#define _ROS_SERVICE_SetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ODEPhysics.h" +#include "geometry_msgs/Vector3.h" + +namespace gazebo_msgs +{ + +static const char SETPHYSICSPROPERTIES[] = "gazebo_msgs/SetPhysicsProperties"; + + class SetPhysicsPropertiesRequest : public ros::Msg + { + public: + typedef float _time_step_type; + _time_step_type time_step; + typedef float _max_update_rate_type; + _max_update_rate_type max_update_rate; + typedef geometry_msgs::Vector3 _gravity_type; + _gravity_type gravity; + typedef gazebo_msgs::ODEPhysics _ode_config_type; + _ode_config_type ode_config; + + SetPhysicsPropertiesRequest(): + time_step(0), + max_update_rate(0), + gravity(), + ode_config() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + offset += serializeAvrFloat64(outbuffer + offset, this->max_update_rate); + offset += this->gravity.serialize(outbuffer + offset); + offset += this->ode_config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_update_rate)); + offset += this->gravity.deserialize(inbuffer + offset); + offset += this->ode_config.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETPHYSICSPROPERTIES; }; + virtual const char * getMD5() override { return "abd9f82732b52b92e9d6bb36e6a82452"; }; + + }; + + class SetPhysicsPropertiesResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetPhysicsPropertiesResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETPHYSICSPROPERTIES; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetPhysicsProperties { + public: + typedef SetPhysicsPropertiesRequest Request; + typedef SetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SpawnModel.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SpawnModel.h new file mode 100644 index 000000000..360058870 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/SpawnModel.h @@ -0,0 +1,179 @@ +#ifndef _ROS_SERVICE_SpawnModel_h +#define _ROS_SERVICE_SpawnModel_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SPAWNMODEL[] = "gazebo_msgs/SpawnModel"; + + class SpawnModelRequest : public ros::Msg + { + public: + typedef const char* _model_name_type; + _model_name_type model_name; + typedef const char* _model_xml_type; + _model_xml_type model_xml; + typedef const char* _robot_namespace_type; + _robot_namespace_type robot_namespace; + typedef geometry_msgs::Pose _initial_pose_type; + _initial_pose_type initial_pose; + typedef const char* _reference_frame_type; + _reference_frame_type reference_frame; + + SpawnModelRequest(): + model_name(""), + model_xml(""), + robot_namespace(""), + initial_pose(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + varToArr(outbuffer + offset, length_model_name); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_model_xml = strlen(this->model_xml); + varToArr(outbuffer + offset, length_model_xml); + offset += 4; + memcpy(outbuffer + offset, this->model_xml, length_model_xml); + offset += length_model_xml; + uint32_t length_robot_namespace = strlen(this->robot_namespace); + varToArr(outbuffer + offset, length_robot_namespace); + offset += 4; + memcpy(outbuffer + offset, this->robot_namespace, length_robot_namespace); + offset += length_robot_namespace; + offset += this->initial_pose.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + varToArr(outbuffer + offset, length_reference_frame); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_model_name; + arrToVar(length_model_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_model_xml; + arrToVar(length_model_xml, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_xml; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_xml-1]=0; + this->model_xml = (char *)(inbuffer + offset-1); + offset += length_model_xml; + uint32_t length_robot_namespace; + arrToVar(length_robot_namespace, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot_namespace-1]=0; + this->robot_namespace = (char *)(inbuffer + offset-1); + offset += length_robot_namespace; + offset += this->initial_pose.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + arrToVar(length_reference_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + virtual const char * getType() override { return SPAWNMODEL; }; + virtual const char * getMD5() override { return "6d0eba5753761cd57e6263a056b79930"; }; + + }; + + class SpawnModelResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SpawnModelResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SPAWNMODEL; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SpawnModel { + public: + typedef SpawnModelRequest Request; + typedef SpawnModelResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/WorldState.h b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/WorldState.h new file mode 100644 index 000000000..7f152dbfa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gazebo_msgs/WorldState.h @@ -0,0 +1,159 @@ +#ifndef _ROS_gazebo_msgs_WorldState_h +#define _ROS_gazebo_msgs_WorldState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" + +namespace gazebo_msgs +{ + + class WorldState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t name_length; + typedef char* _name_type; + _name_type st_name; + _name_type * name; + uint32_t pose_length; + typedef geometry_msgs::Pose _pose_type; + _pose_type st_pose; + _pose_type * pose; + uint32_t twist_length; + typedef geometry_msgs::Twist _twist_type; + _twist_type st_twist; + _twist_type * twist; + uint32_t wrench_length; + typedef geometry_msgs::Wrench _wrench_type; + _wrench_type st_wrench; + _wrench_type * wrench; + + WorldState(): + header(), + name_length(0), st_name(), name(nullptr), + pose_length(0), st_pose(), pose(nullptr), + twist_length(0), st_twist(), twist(nullptr), + wrench_length(0), st_wrench(), wrench(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->name_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->name_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->name_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->name_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->name_length); + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + varToArr(outbuffer + offset, length_namei); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset + 0) = (this->pose_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pose_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pose_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pose_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->pose_length); + for( uint32_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->twist_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->twist_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->twist_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->twist_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->twist_length); + for( uint32_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->wrench_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wrench_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wrench_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wrench_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->wrench_length); + for( uint32_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t name_lengthT = ((uint32_t) (*(inbuffer + offset))); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->name_length); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + name_length = name_lengthT; + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + arrToVar(length_st_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint32_t pose_lengthT = ((uint32_t) (*(inbuffer + offset))); + pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pose_length); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + pose_length = pose_lengthT; + for( uint32_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint32_t twist_lengthT = ((uint32_t) (*(inbuffer + offset))); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->twist_length); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + twist_length = twist_lengthT; + for( uint32_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + uint32_t wrench_lengthT = ((uint32_t) (*(inbuffer + offset))); + wrench_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + wrench_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + wrench_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wrench_length); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + wrench_length = wrench_lengthT; + for( uint32_t i = 0; i < wrench_length; i++){ + offset += this->st_wrench.deserialize(inbuffer + offset); + memcpy( &(this->wrench[i]), &(this->st_wrench), sizeof(geometry_msgs::Wrench)); + } + return offset; + } + + virtual const char * getType() override { return "gazebo_msgs/WorldState"; }; + virtual const char * getMD5() override { return "de1a9de3ab7ba97ac0e9ec01a4eb481e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gdrive_ros/MultipleUpload.h b/smart_device_protocol/ros_lib/ros_lib/gdrive_ros/MultipleUpload.h new file mode 100644 index 000000000..db11bcf26 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gdrive_ros/MultipleUpload.h @@ -0,0 +1,360 @@ +#ifndef _ROS_SERVICE_MultipleUpload_h +#define _ROS_SERVICE_MultipleUpload_h +#include +#include +#include +#include "ros/msg.h" + +namespace gdrive_ros +{ + +static const char MULTIPLEUPLOAD[] = "gdrive_ros/MultipleUpload"; + + class MultipleUploadRequest : public ros::Msg + { + public: + uint32_t file_paths_length; + typedef char* _file_paths_type; + _file_paths_type st_file_paths; + _file_paths_type * file_paths; + uint32_t file_titles_length; + typedef char* _file_titles_type; + _file_titles_type st_file_titles; + _file_titles_type * file_titles; + typedef const char* _parents_path_type; + _parents_path_type parents_path; + typedef const char* _parents_id_type; + _parents_id_type parents_id; + typedef bool _use_timestamp_folder_type; + _use_timestamp_folder_type use_timestamp_folder; + typedef bool _use_timestamp_file_title_type; + _use_timestamp_file_title_type use_timestamp_file_title; + + MultipleUploadRequest(): + file_paths_length(0), st_file_paths(), file_paths(nullptr), + file_titles_length(0), st_file_titles(), file_titles(nullptr), + parents_path(""), + parents_id(""), + use_timestamp_folder(0), + use_timestamp_file_title(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(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++){ + uint32_t length_file_pathsi = strlen(this->file_paths[i]); + varToArr(outbuffer + offset, length_file_pathsi); + offset += 4; + memcpy(outbuffer + offset, this->file_paths[i], length_file_pathsi); + offset += length_file_pathsi; + } + *(outbuffer + offset + 0) = (this->file_titles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->file_titles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->file_titles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->file_titles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->file_titles_length); + for( uint32_t i = 0; i < file_titles_length; i++){ + uint32_t length_file_titlesi = strlen(this->file_titles[i]); + varToArr(outbuffer + offset, length_file_titlesi); + offset += 4; + memcpy(outbuffer + offset, this->file_titles[i], length_file_titlesi); + offset += length_file_titlesi; + } + uint32_t length_parents_path = strlen(this->parents_path); + varToArr(outbuffer + offset, length_parents_path); + offset += 4; + memcpy(outbuffer + offset, this->parents_path, length_parents_path); + offset += length_parents_path; + uint32_t length_parents_id = strlen(this->parents_id); + varToArr(outbuffer + offset, length_parents_id); + offset += 4; + memcpy(outbuffer + offset, this->parents_id, length_parents_id); + offset += length_parents_id; + union { + bool real; + uint8_t base; + } u_use_timestamp_folder; + u_use_timestamp_folder.real = this->use_timestamp_folder; + *(outbuffer + offset + 0) = (u_use_timestamp_folder.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->use_timestamp_folder); + union { + bool real; + uint8_t base; + } u_use_timestamp_file_title; + u_use_timestamp_file_title.real = this->use_timestamp_file_title; + *(outbuffer + offset + 0) = (u_use_timestamp_file_title.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->use_timestamp_file_title); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 = (char**)realloc(this->file_paths, file_paths_lengthT * sizeof(char*)); + file_paths_length = file_paths_lengthT; + for( uint32_t i = 0; i < file_paths_length; i++){ + uint32_t length_st_file_paths; + arrToVar(length_st_file_paths, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_file_paths; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_file_paths-1]=0; + this->st_file_paths = (char *)(inbuffer + offset-1); + offset += length_st_file_paths; + memcpy( &(this->file_paths[i]), &(this->st_file_paths), sizeof(char*)); + } + uint32_t file_titles_lengthT = ((uint32_t) (*(inbuffer + offset))); + file_titles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + file_titles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + file_titles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->file_titles_length); + if(file_titles_lengthT > file_titles_length) + this->file_titles = (char**)realloc(this->file_titles, file_titles_lengthT * sizeof(char*)); + file_titles_length = file_titles_lengthT; + for( uint32_t i = 0; i < file_titles_length; i++){ + uint32_t length_st_file_titles; + arrToVar(length_st_file_titles, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_file_titles; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_file_titles-1]=0; + this->st_file_titles = (char *)(inbuffer + offset-1); + offset += length_st_file_titles; + memcpy( &(this->file_titles[i]), &(this->st_file_titles), sizeof(char*)); + } + uint32_t length_parents_path; + arrToVar(length_parents_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parents_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parents_path-1]=0; + this->parents_path = (char *)(inbuffer + offset-1); + offset += length_parents_path; + uint32_t length_parents_id; + arrToVar(length_parents_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parents_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parents_id-1]=0; + this->parents_id = (char *)(inbuffer + offset-1); + offset += length_parents_id; + union { + bool real; + uint8_t base; + } u_use_timestamp_folder; + u_use_timestamp_folder.base = 0; + u_use_timestamp_folder.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->use_timestamp_folder = u_use_timestamp_folder.real; + offset += sizeof(this->use_timestamp_folder); + union { + bool real; + uint8_t base; + } u_use_timestamp_file_title; + u_use_timestamp_file_title.base = 0; + u_use_timestamp_file_title.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->use_timestamp_file_title = u_use_timestamp_file_title.real; + offset += sizeof(this->use_timestamp_file_title); + return offset; + } + + virtual const char * getType() override { return MULTIPLEUPLOAD; }; + virtual const char * getMD5() override { return "122e5b4128de0fb81389f9b17153330d"; }; + + }; + + class MultipleUploadResponse : public ros::Msg + { + public: + uint32_t successes_length; + typedef bool _successes_type; + _successes_type st_successes; + _successes_type * successes; + uint32_t file_ids_length; + typedef char* _file_ids_type; + _file_ids_type st_file_ids; + _file_ids_type * file_ids; + uint32_t file_urls_length; + typedef char* _file_urls_type; + _file_urls_type st_file_urls; + _file_urls_type * file_urls; + typedef const char* _parents_id_type; + _parents_id_type parents_id; + typedef const char* _parents_url_type; + _parents_url_type parents_url; + + MultipleUploadResponse(): + successes_length(0), st_successes(), successes(nullptr), + file_ids_length(0), st_file_ids(), file_ids(nullptr), + file_urls_length(0), st_file_urls(), file_urls(nullptr), + parents_id(""), + parents_url("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->successes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->successes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->successes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->successes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->successes_length); + for( uint32_t i = 0; i < successes_length; i++){ + union { + bool real; + uint8_t base; + } u_successesi; + u_successesi.real = this->successes[i]; + *(outbuffer + offset + 0) = (u_successesi.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->successes[i]); + } + *(outbuffer + offset + 0) = (this->file_ids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->file_ids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->file_ids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->file_ids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->file_ids_length); + for( uint32_t i = 0; i < file_ids_length; i++){ + uint32_t length_file_idsi = strlen(this->file_ids[i]); + varToArr(outbuffer + offset, length_file_idsi); + offset += 4; + memcpy(outbuffer + offset, this->file_ids[i], length_file_idsi); + offset += length_file_idsi; + } + *(outbuffer + offset + 0) = (this->file_urls_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->file_urls_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->file_urls_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->file_urls_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->file_urls_length); + for( uint32_t i = 0; i < file_urls_length; i++){ + uint32_t length_file_urlsi = strlen(this->file_urls[i]); + varToArr(outbuffer + offset, length_file_urlsi); + offset += 4; + memcpy(outbuffer + offset, this->file_urls[i], length_file_urlsi); + offset += length_file_urlsi; + } + uint32_t length_parents_id = strlen(this->parents_id); + varToArr(outbuffer + offset, length_parents_id); + offset += 4; + memcpy(outbuffer + offset, this->parents_id, length_parents_id); + offset += length_parents_id; + uint32_t length_parents_url = strlen(this->parents_url); + varToArr(outbuffer + offset, length_parents_url); + offset += 4; + memcpy(outbuffer + offset, this->parents_url, length_parents_url); + offset += length_parents_url; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t successes_lengthT = ((uint32_t) (*(inbuffer + offset))); + successes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + successes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + successes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->successes_length); + if(successes_lengthT > successes_length) + this->successes = (bool*)realloc(this->successes, successes_lengthT * sizeof(bool)); + successes_length = successes_lengthT; + for( uint32_t i = 0; i < successes_length; i++){ + union { + bool real; + uint8_t base; + } u_st_successes; + u_st_successes.base = 0; + u_st_successes.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_successes = u_st_successes.real; + offset += sizeof(this->st_successes); + memcpy( &(this->successes[i]), &(this->st_successes), sizeof(bool)); + } + uint32_t file_ids_lengthT = ((uint32_t) (*(inbuffer + offset))); + file_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + file_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + file_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->file_ids_length); + if(file_ids_lengthT > file_ids_length) + this->file_ids = (char**)realloc(this->file_ids, file_ids_lengthT * sizeof(char*)); + file_ids_length = file_ids_lengthT; + for( uint32_t i = 0; i < file_ids_length; i++){ + uint32_t length_st_file_ids; + arrToVar(length_st_file_ids, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_file_ids; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_file_ids-1]=0; + this->st_file_ids = (char *)(inbuffer + offset-1); + offset += length_st_file_ids; + memcpy( &(this->file_ids[i]), &(this->st_file_ids), sizeof(char*)); + } + uint32_t file_urls_lengthT = ((uint32_t) (*(inbuffer + offset))); + file_urls_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + file_urls_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + file_urls_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->file_urls_length); + if(file_urls_lengthT > file_urls_length) + this->file_urls = (char**)realloc(this->file_urls, file_urls_lengthT * sizeof(char*)); + file_urls_length = file_urls_lengthT; + for( uint32_t i = 0; i < file_urls_length; i++){ + uint32_t length_st_file_urls; + arrToVar(length_st_file_urls, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_file_urls; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_file_urls-1]=0; + this->st_file_urls = (char *)(inbuffer + offset-1); + offset += length_st_file_urls; + memcpy( &(this->file_urls[i]), &(this->st_file_urls), sizeof(char*)); + } + uint32_t length_parents_id; + arrToVar(length_parents_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parents_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parents_id-1]=0; + this->parents_id = (char *)(inbuffer + offset-1); + offset += length_parents_id; + uint32_t length_parents_url; + arrToVar(length_parents_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parents_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parents_url-1]=0; + this->parents_url = (char *)(inbuffer + offset-1); + offset += length_parents_url; + return offset; + } + + virtual const char * getType() override { return MULTIPLEUPLOAD; }; + virtual const char * getMD5() override { return "060c3b54ca60104d86730aba3a3da16c"; }; + + }; + + class MultipleUpload { + public: + typedef MultipleUploadRequest Request; + typedef MultipleUploadResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/gdrive_ros/Upload.h b/smart_device_protocol/ros_lib/ros_lib/gdrive_ros/Upload.h new file mode 100644 index 000000000..91acb39c0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/gdrive_ros/Upload.h @@ -0,0 +1,260 @@ +#ifndef _ROS_SERVICE_Upload_h +#define _ROS_SERVICE_Upload_h +#include +#include +#include +#include "ros/msg.h" + +namespace gdrive_ros +{ + +static const char UPLOAD[] = "gdrive_ros/Upload"; + + class UploadRequest : public ros::Msg + { + public: + typedef const char* _file_path_type; + _file_path_type file_path; + typedef const char* _file_title_type; + _file_title_type file_title; + typedef const char* _parents_path_type; + _parents_path_type parents_path; + typedef const char* _parents_id_type; + _parents_id_type parents_id; + typedef bool _use_timestamp_folder_type; + _use_timestamp_folder_type use_timestamp_folder; + typedef bool _use_timestamp_file_title_type; + _use_timestamp_file_title_type use_timestamp_file_title; + + UploadRequest(): + file_path(""), + file_title(""), + parents_path(""), + parents_id(""), + use_timestamp_folder(0), + use_timestamp_file_title(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; + uint32_t length_file_title = strlen(this->file_title); + varToArr(outbuffer + offset, length_file_title); + offset += 4; + memcpy(outbuffer + offset, this->file_title, length_file_title); + offset += length_file_title; + uint32_t length_parents_path = strlen(this->parents_path); + varToArr(outbuffer + offset, length_parents_path); + offset += 4; + memcpy(outbuffer + offset, this->parents_path, length_parents_path); + offset += length_parents_path; + uint32_t length_parents_id = strlen(this->parents_id); + varToArr(outbuffer + offset, length_parents_id); + offset += 4; + memcpy(outbuffer + offset, this->parents_id, length_parents_id); + offset += length_parents_id; + union { + bool real; + uint8_t base; + } u_use_timestamp_folder; + u_use_timestamp_folder.real = this->use_timestamp_folder; + *(outbuffer + offset + 0) = (u_use_timestamp_folder.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->use_timestamp_folder); + union { + bool real; + uint8_t base; + } u_use_timestamp_file_title; + u_use_timestamp_file_title.real = this->use_timestamp_file_title; + *(outbuffer + offset + 0) = (u_use_timestamp_file_title.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->use_timestamp_file_title); + 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_file_title; + arrToVar(length_file_title, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_title; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_title-1]=0; + this->file_title = (char *)(inbuffer + offset-1); + offset += length_file_title; + uint32_t length_parents_path; + arrToVar(length_parents_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parents_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parents_path-1]=0; + this->parents_path = (char *)(inbuffer + offset-1); + offset += length_parents_path; + uint32_t length_parents_id; + arrToVar(length_parents_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parents_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parents_id-1]=0; + this->parents_id = (char *)(inbuffer + offset-1); + offset += length_parents_id; + union { + bool real; + uint8_t base; + } u_use_timestamp_folder; + u_use_timestamp_folder.base = 0; + u_use_timestamp_folder.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->use_timestamp_folder = u_use_timestamp_folder.real; + offset += sizeof(this->use_timestamp_folder); + union { + bool real; + uint8_t base; + } u_use_timestamp_file_title; + u_use_timestamp_file_title.base = 0; + u_use_timestamp_file_title.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->use_timestamp_file_title = u_use_timestamp_file_title.real; + offset += sizeof(this->use_timestamp_file_title); + return offset; + } + + virtual const char * getType() override { return UPLOAD; }; + virtual const char * getMD5() override { return "a09a0dc73a941d3514dca63d7fc3cf3b"; }; + + }; + + class UploadResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _file_id_type; + _file_id_type file_id; + typedef const char* _file_url_type; + _file_url_type file_url; + typedef const char* _parents_id_type; + _parents_id_type parents_id; + typedef const char* _parents_url_type; + _parents_url_type parents_url; + + UploadResponse(): + success(0), + file_id(""), + file_url(""), + parents_id(""), + parents_url("") + { + } + + 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_file_id = strlen(this->file_id); + varToArr(outbuffer + offset, length_file_id); + offset += 4; + memcpy(outbuffer + offset, this->file_id, length_file_id); + offset += length_file_id; + 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; + uint32_t length_parents_id = strlen(this->parents_id); + varToArr(outbuffer + offset, length_parents_id); + offset += 4; + memcpy(outbuffer + offset, this->parents_id, length_parents_id); + offset += length_parents_id; + uint32_t length_parents_url = strlen(this->parents_url); + varToArr(outbuffer + offset, length_parents_url); + offset += 4; + memcpy(outbuffer + offset, this->parents_url, length_parents_url); + offset += length_parents_url; + 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_file_id; + arrToVar(length_file_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_id-1]=0; + this->file_id = (char *)(inbuffer + offset-1); + offset += length_file_id; + 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; + uint32_t length_parents_id; + arrToVar(length_parents_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parents_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parents_id-1]=0; + this->parents_id = (char *)(inbuffer + offset-1); + offset += length_parents_id; + uint32_t length_parents_url; + arrToVar(length_parents_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parents_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parents_url-1]=0; + this->parents_url = (char *)(inbuffer + offset-1); + offset += length_parents_url; + return offset; + } + + virtual const char * getType() override { return UPLOAD; }; + virtual const char * getMD5() override { return "8f896e15fe386deb4d613a31c64e0cf6"; }; + + }; + + class Upload { + public: + typedef UploadRequest Request; + typedef UploadResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/BoundingBox.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/BoundingBox.h new file mode 100644 index 000000000..cacf42a0a --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPath.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPath.h new file mode 100644 index 000000000..d9216f2d8 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPoint.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPoint.h new file mode 100644 index 000000000..eaf05afe2 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPointStamped.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPointStamped.h new file mode 100644 index 000000000..0d7f40bc9 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPose.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPose.h new file mode 100644 index 000000000..a87ef842d --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPoseStamped.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeoPoseStamped.h new file mode 100644 index 000000000..2d5e6e8b2 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeographicMap.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeographicMap.h new file mode 100644 index 000000000..cfbf7a689 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeographicMapChanges.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GeographicMapChanges.h new file mode 100644 index 000000000..a0368db93 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GetGeoPath.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GetGeoPath.h new file mode 100644 index 000000000..272a2ea9e --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GetGeographicMap.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GetGeographicMap.h new file mode 100644 index 000000000..600ee5cd0 --- /dev/null +++ b/smart_device_protocol/ros_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/GeographicMap.h" +#include "geographic_msgs/BoundingBox.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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GetRoutePlan.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/GetRoutePlan.h new file mode 100644 index 000000000..bd9b6b7d2 --- /dev/null +++ b/smart_device_protocol/ros_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 "uuid_msgs/UniqueID.h" +#include "geographic_msgs/RoutePath.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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/KeyValue.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/KeyValue.h new file mode 100644 index 000000000..8ef9190f2 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/MapFeature.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/MapFeature.h new file mode 100644 index 000000000..bfd10c481 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/RouteNetwork.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/RouteNetwork.h new file mode 100644 index 000000000..5390dac3b --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/RoutePath.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/RoutePath.h new file mode 100644 index 000000000..8a9371cba --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/RouteSegment.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/RouteSegment.h new file mode 100644 index 000000000..83b1e8765 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/UpdateGeographicMap.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/UpdateGeographicMap.h new file mode 100644 index 000000000..b0122ed37 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/WayPoint.h b/smart_device_protocol/ros_lib/ros_lib/geographic_msgs/WayPoint.h new file mode 100644 index 000000000..9c71b3d0c --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Accel.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Accel.h new file mode 100644 index 000000000..efd9bcbaf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Accel.h @@ -0,0 +1,49 @@ +#ifndef _ROS_geometry_msgs_Accel_h +#define _ROS_geometry_msgs_Accel_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Accel : public ros::Msg + { + public: + typedef geometry_msgs::Vector3 _linear_type; + _linear_type linear; + typedef geometry_msgs::Vector3 _angular_type; + _angular_type angular; + + Accel(): + linear(), + angular() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Accel"; }; + virtual const char * getMD5() override { return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelStamped.h new file mode 100644 index 000000000..0923e3ec3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_AccelStamped_h +#define _ROS_geometry_msgs_AccelStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Accel.h" + +namespace geometry_msgs +{ + + class AccelStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Accel _accel_type; + _accel_type accel; + + AccelStamped(): + header(), + accel() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/AccelStamped"; }; + virtual const char * getMD5() override { return "d8a98a5d81351b6eb0578c78557e7659"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelWithCovariance.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelWithCovariance.h new file mode 100644 index 000000000..c4420e82a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelWithCovariance.h @@ -0,0 +1,52 @@ +#ifndef _ROS_geometry_msgs_AccelWithCovariance_h +#define _ROS_geometry_msgs_AccelWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Accel.h" + +namespace geometry_msgs +{ + + class AccelWithCovariance : public ros::Msg + { + public: + typedef geometry_msgs::Accel _accel_type; + _accel_type accel; + float covariance[36]; + + AccelWithCovariance(): + accel(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->accel.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->accel.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/AccelWithCovariance"; }; + virtual const char * getMD5() override { return "ad5a718d699c6be72a02b8d6a139f334"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h new file mode 100644 index 000000000..dbc01a4ca --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_AccelWithCovarianceStamped_h +#define _ROS_geometry_msgs_AccelWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/AccelWithCovariance.h" + +namespace geometry_msgs +{ + + class AccelWithCovarianceStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::AccelWithCovariance _accel_type; + _accel_type accel; + + AccelWithCovarianceStamped(): + header(), + accel() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/AccelWithCovarianceStamped"; }; + virtual const char * getMD5() override { return "96adb295225031ec8d57fb4251b0a886"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Inertia.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Inertia.h new file mode 100644 index 000000000..1351c03e8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Inertia.h @@ -0,0 +1,79 @@ +#ifndef _ROS_geometry_msgs_Inertia_h +#define _ROS_geometry_msgs_Inertia_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Inertia : public ros::Msg + { + public: + typedef float _m_type; + _m_type m; + typedef geometry_msgs::Vector3 _com_type; + _com_type com; + typedef float _ixx_type; + _ixx_type ixx; + typedef float _ixy_type; + _ixy_type ixy; + typedef float _ixz_type; + _ixz_type ixz; + typedef float _iyy_type; + _iyy_type iyy; + typedef float _iyz_type; + _iyz_type iyz; + typedef float _izz_type; + _izz_type izz; + + Inertia(): + m(0), + com(), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->m); + offset += this->com.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m)); + offset += this->com.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Inertia"; }; + virtual const char * getMD5() override { return "1d26e4bb6c83ff141c5cf0d883c2b0fe"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/InertiaStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/InertiaStamped.h new file mode 100644 index 000000000..5f287cc2d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/InertiaStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_InertiaStamped_h +#define _ROS_geometry_msgs_InertiaStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Inertia.h" + +namespace geometry_msgs +{ + + class InertiaStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Inertia _inertia_type; + _inertia_type inertia; + + InertiaStamped(): + header(), + inertia() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->inertia.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->inertia.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/InertiaStamped"; }; + virtual const char * getMD5() override { return "ddee48caeab5a966c5e8d166654a9ac7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Point.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Point.h new file mode 100644 index 000000000..6f0cbcb14 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Point.h @@ -0,0 +1,53 @@ +#ifndef _ROS_geometry_msgs_Point_h +#define _ROS_geometry_msgs_Point_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Point : 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; + + Point(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Point"; }; + virtual const char * getMD5() override { return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Point32.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Point32.h new file mode 100644 index 000000000..6f8565bbf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Point32.h @@ -0,0 +1,110 @@ +#ifndef _ROS_geometry_msgs_Point32_h +#define _ROS_geometry_msgs_Point32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Point32 : 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; + + Point32(): + x(0), + y(0), + z(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); + 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); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Point32"; }; + virtual const char * getMD5() override { return "cc153912f1453b708d221682bc23d9ac"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PointStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PointStamped.h new file mode 100644 index 000000000..e9efeda4a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PointStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_PointStamped_h +#define _ROS_geometry_msgs_PointStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace geometry_msgs +{ + + class PointStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Point _point_type; + _point_type point; + + PointStamped(): + header(), + point() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->point.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/PointStamped"; }; + virtual const char * getMD5() override { return "c63aecb41bfdfd6b7e1fac37c7cbe7bf"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Polygon.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Polygon.h new file mode 100644 index 000000000..80329af41 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Polygon.h @@ -0,0 +1,64 @@ +#ifndef _ROS_geometry_msgs_Polygon_h +#define _ROS_geometry_msgs_Polygon_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point32.h" + +namespace geometry_msgs +{ + + class Polygon : public ros::Msg + { + public: + uint32_t points_length; + typedef geometry_msgs::Point32 _points_type; + _points_type st_points; + _points_type * points; + + Polygon(): + points_length(0), st_points(), points(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + 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(geometry_msgs::Point32)); + } + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Polygon"; }; + virtual const char * getMD5() override { return "cd60a26494a087f577976f0329fa120e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PolygonStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PolygonStamped.h new file mode 100644 index 000000000..c3971bb32 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PolygonStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_PolygonStamped_h +#define _ROS_geometry_msgs_PolygonStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Polygon.h" + +namespace geometry_msgs +{ + + class PolygonStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Polygon _polygon_type; + _polygon_type polygon; + + PolygonStamped(): + header(), + polygon() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->polygon.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->polygon.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/PolygonStamped"; }; + virtual const char * getMD5() override { return "c6be8f7dc3bee7fe9e8d296070f53340"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Pose.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Pose.h new file mode 100644 index 000000000..f2e3429df --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Pose.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Pose_h +#define _ROS_geometry_msgs_Pose_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class Pose : public ros::Msg + { + public: + typedef geometry_msgs::Point _position_type; + _position_type position; + typedef geometry_msgs::Quaternion _orientation_type; + _orientation_type orientation; + + Pose(): + 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 "geometry_msgs/Pose"; }; + virtual const char * getMD5() override { return "e45d45a5a1ce597b249e23fb30fc871f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Pose2D.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Pose2D.h new file mode 100644 index 000000000..16a316df9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Pose2D.h @@ -0,0 +1,53 @@ +#ifndef _ROS_geometry_msgs_Pose2D_h +#define _ROS_geometry_msgs_Pose2D_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Pose2D : 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; + + Pose2D(): + x(0), + y(0), + theta(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->theta); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->theta)); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Pose2D"; }; + virtual const char * getMD5() override { return "938fa65709584ad8e77d238529be13b8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseArray.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseArray.h new file mode 100644 index 000000000..b2a56623c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_geometry_msgs_PoseArray_h +#define _ROS_geometry_msgs_PoseArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t poses_length; + typedef geometry_msgs::Pose _poses_type; + _poses_type st_poses; + _poses_type * poses; + + PoseArray(): + 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 = (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 "geometry_msgs/PoseArray"; }; + virtual const char * getMD5() override { return "916c28c5764443f268b296bb671b9d97"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseStamped.h new file mode 100644 index 000000000..5cbf005a6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_PoseStamped_h +#define _ROS_geometry_msgs_PoseStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + + PoseStamped(): + 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 "geometry_msgs/PoseStamped"; }; + virtual const char * getMD5() override { return "d3812c3cbc69362b77dc0b19b345f8f5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseWithCovariance.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseWithCovariance.h new file mode 100644 index 000000000..97c08d382 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseWithCovariance.h @@ -0,0 +1,52 @@ +#ifndef _ROS_geometry_msgs_PoseWithCovariance_h +#define _ROS_geometry_msgs_PoseWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseWithCovariance : public ros::Msg + { + public: + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + float covariance[36]; + + PoseWithCovariance(): + pose(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/PoseWithCovariance"; }; + virtual const char * getMD5() override { return "c23e848cf1b7533a8d7c259073a97e6f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h new file mode 100644 index 000000000..9a040e3d1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_PoseWithCovarianceStamped_h +#define _ROS_geometry_msgs_PoseWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" + +namespace geometry_msgs +{ + + class PoseWithCovarianceStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::PoseWithCovariance _pose_type; + _pose_type pose; + + PoseWithCovarianceStamped(): + 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 "geometry_msgs/PoseWithCovarianceStamped"; }; + virtual const char * getMD5() override { return "953b798c0f514ff060a53a3498ce6246"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Quaternion.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Quaternion.h new file mode 100644 index 000000000..2241de371 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Quaternion.h @@ -0,0 +1,58 @@ +#ifndef _ROS_geometry_msgs_Quaternion_h +#define _ROS_geometry_msgs_Quaternion_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Quaternion : 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 _w_type; + _w_type w; + + Quaternion(): + x(0), + y(0), + z(0), + w(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + offset += serializeAvrFloat64(outbuffer + offset, this->w); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->w)); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Quaternion"; }; + virtual const char * getMD5() override { return "a779879fadf0160734f906b8c19c7004"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/QuaternionStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/QuaternionStamped.h new file mode 100644 index 000000000..14bfe0b4d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/QuaternionStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_QuaternionStamped_h +#define _ROS_geometry_msgs_QuaternionStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class QuaternionStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Quaternion _quaternion_type; + _quaternion_type quaternion; + + QuaternionStamped(): + header(), + quaternion() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->quaternion.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->quaternion.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/QuaternionStamped"; }; + virtual const char * getMD5() override { return "e57f1e547e0e1fd13504588ffc8334e2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Transform.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Transform.h new file mode 100644 index 000000000..c1c7575f4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Transform.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Transform_h +#define _ROS_geometry_msgs_Transform_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class Transform : public ros::Msg + { + public: + typedef geometry_msgs::Vector3 _translation_type; + _translation_type translation; + typedef geometry_msgs::Quaternion _rotation_type; + _rotation_type rotation; + + Transform(): + translation(), + rotation() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->translation.serialize(outbuffer + offset); + offset += this->rotation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->translation.deserialize(inbuffer + offset); + offset += this->rotation.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Transform"; }; + virtual const char * getMD5() override { return "ac9eff44abf714214112b05d54a3cf9b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TransformStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TransformStamped.h new file mode 100644 index 000000000..2cb1e9d83 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TransformStamped.h @@ -0,0 +1,67 @@ +#ifndef _ROS_geometry_msgs_TransformStamped_h +#define _ROS_geometry_msgs_TransformStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" + +namespace geometry_msgs +{ + + class TransformStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _child_frame_id_type; + _child_frame_id_type child_frame_id; + typedef geometry_msgs::Transform _transform_type; + _transform_type transform; + + TransformStamped(): + header(), + child_frame_id(""), + transform() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen(this->child_frame_id); + varToArr(outbuffer + offset, length_child_frame_id); + offset += 4; + memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id); + offset += length_child_frame_id; + offset += this->transform.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + arrToVar(length_child_frame_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame_id-1]=0; + this->child_frame_id = (char *)(inbuffer + offset-1); + offset += length_child_frame_id; + offset += this->transform.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/TransformStamped"; }; + virtual const char * getMD5() override { return "b5764a33bfeb3588febc2682852579b0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Twist.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Twist.h new file mode 100644 index 000000000..4861a595c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Twist.h @@ -0,0 +1,49 @@ +#ifndef _ROS_geometry_msgs_Twist_h +#define _ROS_geometry_msgs_Twist_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Twist : public ros::Msg + { + public: + typedef geometry_msgs::Vector3 _linear_type; + _linear_type linear; + typedef geometry_msgs::Vector3 _angular_type; + _angular_type angular; + + Twist(): + linear(), + angular() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Twist"; }; + virtual const char * getMD5() override { return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistStamped.h new file mode 100644 index 000000000..b8a873fa3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_TwistStamped_h +#define _ROS_geometry_msgs_TwistStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Twist.h" + +namespace geometry_msgs +{ + + class TwistStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Twist _twist_type; + _twist_type twist; + + TwistStamped(): + header(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/TwistStamped"; }; + virtual const char * getMD5() override { return "98d34b0043a2093cf9d9345ab6eef12e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistWithCovariance.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistWithCovariance.h new file mode 100644 index 000000000..b22a41371 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistWithCovariance.h @@ -0,0 +1,52 @@ +#ifndef _ROS_geometry_msgs_TwistWithCovariance_h +#define _ROS_geometry_msgs_TwistWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Twist.h" + +namespace geometry_msgs +{ + + class TwistWithCovariance : public ros::Msg + { + public: + typedef geometry_msgs::Twist _twist_type; + _twist_type twist; + float covariance[36]; + + TwistWithCovariance(): + twist(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->twist.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->twist.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/TwistWithCovariance"; }; + virtual const char * getMD5() override { return "1fe8a28e6890a4cc3ae4c3ca5c7d82e6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h new file mode 100644 index 000000000..dfa7ef583 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_TwistWithCovarianceStamped_h +#define _ROS_geometry_msgs_TwistWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace geometry_msgs +{ + + class TwistWithCovarianceStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::TwistWithCovariance _twist_type; + _twist_type twist; + + TwistWithCovarianceStamped(): + header(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/TwistWithCovarianceStamped"; }; + virtual const char * getMD5() override { return "8927a1a12fb2607ceea095b2dc440a96"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Vector3.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Vector3.h new file mode 100644 index 000000000..670a19f3b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Vector3.h @@ -0,0 +1,53 @@ +#ifndef _ROS_geometry_msgs_Vector3_h +#define _ROS_geometry_msgs_Vector3_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Vector3 : 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; + + Vector3(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Vector3"; }; + virtual const char * getMD5() override { return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Vector3Stamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Vector3Stamped.h new file mode 100644 index 000000000..120503272 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Vector3Stamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Vector3Stamped_h +#define _ROS_geometry_msgs_Vector3Stamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Vector3Stamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Vector3 _vector_type; + _vector_type vector; + + Vector3Stamped(): + header(), + vector() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->vector.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->vector.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Vector3Stamped"; }; + virtual const char * getMD5() override { return "7b324c7325e683bf02a9b14b01090ec7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Wrench.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Wrench.h new file mode 100644 index 000000000..d0a9c26f1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/Wrench.h @@ -0,0 +1,49 @@ +#ifndef _ROS_geometry_msgs_Wrench_h +#define _ROS_geometry_msgs_Wrench_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Wrench : public ros::Msg + { + public: + typedef geometry_msgs::Vector3 _force_type; + _force_type force; + typedef geometry_msgs::Vector3 _torque_type; + _torque_type torque; + + Wrench(): + force(), + torque() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->force.serialize(outbuffer + offset); + offset += this->torque.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->force.deserialize(inbuffer + offset); + offset += this->torque.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/Wrench"; }; + virtual const char * getMD5() override { return "4f539cf138b23283b520fd271b567936"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/WrenchStamped.h b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/WrenchStamped.h new file mode 100644 index 000000000..d13c0d775 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/geometry_msgs/WrenchStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_WrenchStamped_h +#define _ROS_geometry_msgs_WrenchStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Wrench.h" + +namespace geometry_msgs +{ + + class WrenchStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Wrench _wrench_type; + _wrench_type wrench; + + WrenchStamped(): + header(), + wrench() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "geometry_msgs/WrenchStamped"; }; + virtual const char * getMD5() override { return "d78d3cb249ce23087ade7e7d0c40cfa7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/ActionParameter.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/ActionParameter.h new file mode 100644 index 000000000..0131ca213 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/ActionParameter.h @@ -0,0 +1,72 @@ +#ifndef _ROS_google_chat_ros_ActionParameter_h +#define _ROS_google_chat_ros_ActionParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace google_chat_ros +{ + + class ActionParameter : public ros::Msg + { + public: + typedef const char* _key_type; + _key_type key; + typedef const char* _value_type; + _value_type value; + + ActionParameter(): + 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 "google_chat_ros/ActionParameter"; }; + virtual const char * getMD5() override { return "cf57fdc6617a881a88c16e768132149c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Annotation.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Annotation.h new file mode 100644 index 000000000..68cc7a387 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Annotation.h @@ -0,0 +1,134 @@ +#ifndef _ROS_google_chat_ros_Annotation_h +#define _ROS_google_chat_ros_Annotation_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/User.h" +#include "google_chat_ros/SlashCommand.h" + +namespace google_chat_ros +{ + + class Annotation : public ros::Msg + { + public: + typedef int32_t _length_type; + _length_type length; + typedef int32_t _start_index_type; + _start_index_type start_index; + typedef google_chat_ros::User _user_type; + _user_type user; + typedef bool _mention_type; + _mention_type mention; + typedef bool _slash_command_type; + _slash_command_type slash_command; + typedef google_chat_ros::SlashCommand _command_type; + _command_type command; + + Annotation(): + length(0), + start_index(0), + user(), + mention(0), + slash_command(0), + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_length; + u_length.real = this->length; + *(outbuffer + offset + 0) = (u_length.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_length.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_length.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_length.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->length); + union { + int32_t real; + uint32_t base; + } u_start_index; + u_start_index.real = this->start_index; + *(outbuffer + offset + 0) = (u_start_index.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_start_index.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_start_index.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_start_index.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_index); + offset += this->user.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_mention; + u_mention.real = this->mention; + *(outbuffer + offset + 0) = (u_mention.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mention); + union { + bool real; + uint8_t base; + } u_slash_command; + u_slash_command.real = this->slash_command; + *(outbuffer + offset + 0) = (u_slash_command.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->slash_command); + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_length; + u_length.base = 0; + u_length.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_length.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_length.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_length.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->length = u_length.real; + offset += sizeof(this->length); + union { + int32_t real; + uint32_t base; + } u_start_index; + u_start_index.base = 0; + u_start_index.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_start_index.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_start_index.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_start_index.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->start_index = u_start_index.real; + offset += sizeof(this->start_index); + offset += this->user.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_mention; + u_mention.base = 0; + u_mention.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mention = u_mention.real; + offset += sizeof(this->mention); + union { + bool real; + uint8_t base; + } u_slash_command; + u_slash_command.base = 0; + u_slash_command.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->slash_command = u_slash_command.real; + offset += sizeof(this->slash_command); + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/Annotation"; }; + virtual const char * getMD5() override { return "802d9766a400b0c3a17014460dadcf6a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Attachment.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Attachment.h new file mode 100644 index 000000000..f9e0a1ef1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Attachment.h @@ -0,0 +1,210 @@ +#ifndef _ROS_google_chat_ros_Attachment_h +#define _ROS_google_chat_ros_Attachment_h + +#include +#include +#include +#include "ros/msg.h" + +namespace google_chat_ros +{ + + class Attachment : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _content_name_type; + _content_name_type content_name; + typedef const char* _content_type_type; + _content_type_type content_type; + typedef const char* _thumnail_uri_type; + _thumnail_uri_type thumnail_uri; + typedef const char* _download_uri_type; + _download_uri_type download_uri; + typedef const char* _localpath_type; + _localpath_type localpath; + typedef bool _drive_file_type; + _drive_file_type drive_file; + typedef bool _uploaded_content_type; + _uploaded_content_type uploaded_content; + typedef const char* _attachment_resource_name_type; + _attachment_resource_name_type attachment_resource_name; + typedef const char* _drive_field_id_type; + _drive_field_id_type drive_field_id; + + Attachment(): + name(""), + content_name(""), + content_type(""), + thumnail_uri(""), + download_uri(""), + localpath(""), + drive_file(0), + uploaded_content(0), + attachment_resource_name(""), + drive_field_id("") + { + } + + 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_content_name = strlen(this->content_name); + varToArr(outbuffer + offset, length_content_name); + offset += 4; + memcpy(outbuffer + offset, this->content_name, length_content_name); + offset += length_content_name; + uint32_t length_content_type = strlen(this->content_type); + varToArr(outbuffer + offset, length_content_type); + offset += 4; + memcpy(outbuffer + offset, this->content_type, length_content_type); + offset += length_content_type; + uint32_t length_thumnail_uri = strlen(this->thumnail_uri); + varToArr(outbuffer + offset, length_thumnail_uri); + offset += 4; + memcpy(outbuffer + offset, this->thumnail_uri, length_thumnail_uri); + offset += length_thumnail_uri; + uint32_t length_download_uri = strlen(this->download_uri); + varToArr(outbuffer + offset, length_download_uri); + offset += 4; + memcpy(outbuffer + offset, this->download_uri, length_download_uri); + offset += length_download_uri; + uint32_t length_localpath = strlen(this->localpath); + varToArr(outbuffer + offset, length_localpath); + offset += 4; + memcpy(outbuffer + offset, this->localpath, length_localpath); + offset += length_localpath; + union { + bool real; + uint8_t base; + } u_drive_file; + u_drive_file.real = this->drive_file; + *(outbuffer + offset + 0) = (u_drive_file.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->drive_file); + union { + bool real; + uint8_t base; + } u_uploaded_content; + u_uploaded_content.real = this->uploaded_content; + *(outbuffer + offset + 0) = (u_uploaded_content.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->uploaded_content); + uint32_t length_attachment_resource_name = strlen(this->attachment_resource_name); + varToArr(outbuffer + offset, length_attachment_resource_name); + offset += 4; + memcpy(outbuffer + offset, this->attachment_resource_name, length_attachment_resource_name); + offset += length_attachment_resource_name; + uint32_t length_drive_field_id = strlen(this->drive_field_id); + varToArr(outbuffer + offset, length_drive_field_id); + offset += 4; + memcpy(outbuffer + offset, this->drive_field_id, length_drive_field_id); + offset += length_drive_field_id; + 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_content_name; + arrToVar(length_content_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_content_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_content_name-1]=0; + this->content_name = (char *)(inbuffer + offset-1); + offset += length_content_name; + uint32_t length_content_type; + arrToVar(length_content_type, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_content_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_content_type-1]=0; + this->content_type = (char *)(inbuffer + offset-1); + offset += length_content_type; + uint32_t length_thumnail_uri; + arrToVar(length_thumnail_uri, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_thumnail_uri; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_thumnail_uri-1]=0; + this->thumnail_uri = (char *)(inbuffer + offset-1); + offset += length_thumnail_uri; + uint32_t length_download_uri; + arrToVar(length_download_uri, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_download_uri; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_download_uri-1]=0; + this->download_uri = (char *)(inbuffer + offset-1); + offset += length_download_uri; + uint32_t length_localpath; + arrToVar(length_localpath, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_localpath; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_localpath-1]=0; + this->localpath = (char *)(inbuffer + offset-1); + offset += length_localpath; + union { + bool real; + uint8_t base; + } u_drive_file; + u_drive_file.base = 0; + u_drive_file.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->drive_file = u_drive_file.real; + offset += sizeof(this->drive_file); + union { + bool real; + uint8_t base; + } u_uploaded_content; + u_uploaded_content.base = 0; + u_uploaded_content.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->uploaded_content = u_uploaded_content.real; + offset += sizeof(this->uploaded_content); + uint32_t length_attachment_resource_name; + arrToVar(length_attachment_resource_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_attachment_resource_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_attachment_resource_name-1]=0; + this->attachment_resource_name = (char *)(inbuffer + offset-1); + offset += length_attachment_resource_name; + uint32_t length_drive_field_id; + arrToVar(length_drive_field_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_drive_field_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_drive_field_id-1]=0; + this->drive_field_id = (char *)(inbuffer + offset-1); + offset += length_drive_field_id; + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/Attachment"; }; + virtual const char * getMD5() override { return "4c5e6ebea127240726d3a3e9429557a1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Button.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Button.h new file mode 100644 index 000000000..9dc785ddd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Button.h @@ -0,0 +1,134 @@ +#ifndef _ROS_google_chat_ros_Button_h +#define _ROS_google_chat_ros_Button_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/OnClick.h" + +namespace google_chat_ros +{ + + class Button : public ros::Msg + { + public: + typedef const char* _text_button_name_type; + _text_button_name_type text_button_name; + typedef google_chat_ros::OnClick _text_button_on_click_type; + _text_button_on_click_type text_button_on_click; + typedef const char* _image_button_name_type; + _image_button_name_type image_button_name; + typedef google_chat_ros::OnClick _image_button_on_click_type; + _image_button_on_click_type image_button_on_click; + typedef const char* _icon_type; + _icon_type icon; + typedef const char* _original_icon_url_type; + _original_icon_url_type original_icon_url; + typedef const char* _original_icon_filepath_type; + _original_icon_filepath_type original_icon_filepath; + + Button(): + text_button_name(""), + text_button_on_click(), + image_button_name(""), + image_button_on_click(), + icon(""), + original_icon_url(""), + original_icon_filepath("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_text_button_name = strlen(this->text_button_name); + varToArr(outbuffer + offset, length_text_button_name); + offset += 4; + memcpy(outbuffer + offset, this->text_button_name, length_text_button_name); + offset += length_text_button_name; + offset += this->text_button_on_click.serialize(outbuffer + offset); + uint32_t length_image_button_name = strlen(this->image_button_name); + varToArr(outbuffer + offset, length_image_button_name); + offset += 4; + memcpy(outbuffer + offset, this->image_button_name, length_image_button_name); + offset += length_image_button_name; + offset += this->image_button_on_click.serialize(outbuffer + offset); + uint32_t length_icon = strlen(this->icon); + varToArr(outbuffer + offset, length_icon); + offset += 4; + memcpy(outbuffer + offset, this->icon, length_icon); + offset += length_icon; + uint32_t length_original_icon_url = strlen(this->original_icon_url); + varToArr(outbuffer + offset, length_original_icon_url); + offset += 4; + memcpy(outbuffer + offset, this->original_icon_url, length_original_icon_url); + offset += length_original_icon_url; + uint32_t length_original_icon_filepath = strlen(this->original_icon_filepath); + varToArr(outbuffer + offset, length_original_icon_filepath); + offset += 4; + memcpy(outbuffer + offset, this->original_icon_filepath, length_original_icon_filepath); + offset += length_original_icon_filepath; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_text_button_name; + arrToVar(length_text_button_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text_button_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text_button_name-1]=0; + this->text_button_name = (char *)(inbuffer + offset-1); + offset += length_text_button_name; + offset += this->text_button_on_click.deserialize(inbuffer + offset); + uint32_t length_image_button_name; + arrToVar(length_image_button_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_image_button_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_image_button_name-1]=0; + this->image_button_name = (char *)(inbuffer + offset-1); + offset += length_image_button_name; + offset += this->image_button_on_click.deserialize(inbuffer + offset); + uint32_t length_icon; + arrToVar(length_icon, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_icon; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_icon-1]=0; + this->icon = (char *)(inbuffer + offset-1); + offset += length_icon; + uint32_t length_original_icon_url; + arrToVar(length_original_icon_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_original_icon_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_original_icon_url-1]=0; + this->original_icon_url = (char *)(inbuffer + offset-1); + offset += length_original_icon_url; + uint32_t length_original_icon_filepath; + arrToVar(length_original_icon_filepath, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_original_icon_filepath; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_original_icon_filepath-1]=0; + this->original_icon_filepath = (char *)(inbuffer + offset-1); + offset += length_original_icon_filepath; + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/Button"; }; + virtual const char * getMD5() override { return "d1068b3005f469e72c9f1e45775e9406"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Card.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Card.h new file mode 100644 index 000000000..0f21515f5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Card.h @@ -0,0 +1,113 @@ +#ifndef _ROS_google_chat_ros_Card_h +#define _ROS_google_chat_ros_Card_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/CardHeader.h" +#include "google_chat_ros/Section.h" +#include "google_chat_ros/CardAction.h" + +namespace google_chat_ros +{ + + class Card : public ros::Msg + { + public: + typedef google_chat_ros::CardHeader _header_type; + _header_type header; + uint32_t sections_length; + typedef google_chat_ros::Section _sections_type; + _sections_type st_sections; + _sections_type * sections; + uint32_t card_actions_length; + typedef google_chat_ros::CardAction _card_actions_type; + _card_actions_type st_card_actions; + _card_actions_type * card_actions; + typedef const char* _name_type; + _name_type name; + + Card(): + header(), + sections_length(0), st_sections(), sections(nullptr), + card_actions_length(0), st_card_actions(), card_actions(nullptr), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->sections_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sections_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sections_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sections_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->sections_length); + for( uint32_t i = 0; i < sections_length; i++){ + offset += this->sections[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->card_actions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->card_actions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->card_actions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->card_actions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->card_actions_length); + for( uint32_t i = 0; i < card_actions_length; i++){ + offset += this->card_actions[i].serialize(outbuffer + offset); + } + 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; + offset += this->header.deserialize(inbuffer + offset); + uint32_t sections_lengthT = ((uint32_t) (*(inbuffer + offset))); + sections_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + sections_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + sections_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sections_length); + if(sections_lengthT > sections_length) + this->sections = (google_chat_ros::Section*)realloc(this->sections, sections_lengthT * sizeof(google_chat_ros::Section)); + sections_length = sections_lengthT; + for( uint32_t i = 0; i < sections_length; i++){ + offset += this->st_sections.deserialize(inbuffer + offset); + memcpy( &(this->sections[i]), &(this->st_sections), sizeof(google_chat_ros::Section)); + } + uint32_t card_actions_lengthT = ((uint32_t) (*(inbuffer + offset))); + card_actions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + card_actions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + card_actions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->card_actions_length); + if(card_actions_lengthT > card_actions_length) + this->card_actions = (google_chat_ros::CardAction*)realloc(this->card_actions, card_actions_lengthT * sizeof(google_chat_ros::CardAction)); + card_actions_length = card_actions_lengthT; + for( uint32_t i = 0; i < card_actions_length; i++){ + offset += this->st_card_actions.deserialize(inbuffer + offset); + memcpy( &(this->card_actions[i]), &(this->st_card_actions), sizeof(google_chat_ros::CardAction)); + } + 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 "google_chat_ros/Card"; }; + virtual const char * getMD5() override { return "bb2b7c6880601ea58b79855bc615f5d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardAction.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardAction.h new file mode 100644 index 000000000..104bca971 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardAction.h @@ -0,0 +1,61 @@ +#ifndef _ROS_google_chat_ros_CardAction_h +#define _ROS_google_chat_ros_CardAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/OnClick.h" + +namespace google_chat_ros +{ + + class CardAction : public ros::Msg + { + public: + typedef const char* _action_label_type; + _action_label_type action_label; + typedef google_chat_ros::OnClick _on_click_type; + _on_click_type on_click; + + CardAction(): + action_label(""), + on_click() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_action_label = strlen(this->action_label); + varToArr(outbuffer + offset, length_action_label); + offset += 4; + memcpy(outbuffer + offset, this->action_label, length_action_label); + offset += length_action_label; + offset += this->on_click.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_action_label; + arrToVar(length_action_label, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_action_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_action_label-1]=0; + this->action_label = (char *)(inbuffer + offset-1); + offset += length_action_label; + offset += this->on_click.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/CardAction"; }; + virtual const char * getMD5() override { return "c02c03a84bb896279f275f3e8c1bc1fe"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardEvent.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardEvent.h new file mode 100644 index 000000000..1a1ee180f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardEvent.h @@ -0,0 +1,79 @@ +#ifndef _ROS_google_chat_ros_CardEvent_h +#define _ROS_google_chat_ros_CardEvent_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/Space.h" +#include "google_chat_ros/Message.h" +#include "google_chat_ros/User.h" +#include "google_chat_ros/FormAction.h" + +namespace google_chat_ros +{ + + class CardEvent : public ros::Msg + { + public: + typedef const char* _event_time_type; + _event_time_type event_time; + typedef google_chat_ros::Space _space_type; + _space_type space; + typedef google_chat_ros::Message _message_type; + _message_type message; + typedef google_chat_ros::User _user_type; + _user_type user; + typedef google_chat_ros::FormAction _action_type; + _action_type action; + + CardEvent(): + event_time(""), + space(), + message(), + user(), + action() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_event_time = strlen(this->event_time); + varToArr(outbuffer + offset, length_event_time); + offset += 4; + memcpy(outbuffer + offset, this->event_time, length_event_time); + offset += length_event_time; + offset += this->space.serialize(outbuffer + offset); + offset += this->message.serialize(outbuffer + offset); + offset += this->user.serialize(outbuffer + offset); + offset += this->action.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_event_time; + arrToVar(length_event_time, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_event_time; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_event_time-1]=0; + this->event_time = (char *)(inbuffer + offset-1); + offset += length_event_time; + offset += this->space.deserialize(inbuffer + offset); + offset += this->message.deserialize(inbuffer + offset); + offset += this->user.deserialize(inbuffer + offset); + offset += this->action.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/CardEvent"; }; + virtual const char * getMD5() override { return "cf8d6a04ed99a4664e48a179c2768325"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardHeader.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardHeader.h new file mode 100644 index 000000000..c5aea13e9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/CardHeader.h @@ -0,0 +1,124 @@ +#ifndef _ROS_google_chat_ros_CardHeader_h +#define _ROS_google_chat_ros_CardHeader_h + +#include +#include +#include +#include "ros/msg.h" + +namespace google_chat_ros +{ + + class CardHeader : public ros::Msg + { + public: + typedef const char* _title_type; + _title_type title; + typedef const char* _subtitle_type; + _subtitle_type subtitle; + typedef bool _image_style_circular_type; + _image_style_circular_type image_style_circular; + typedef const char* _image_url_type; + _image_url_type image_url; + typedef const char* _image_filepath_type; + _image_filepath_type image_filepath; + + CardHeader(): + title(""), + subtitle(""), + image_style_circular(0), + image_url(""), + image_filepath("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_title = strlen(this->title); + varToArr(outbuffer + offset, length_title); + offset += 4; + memcpy(outbuffer + offset, this->title, length_title); + offset += length_title; + uint32_t length_subtitle = strlen(this->subtitle); + varToArr(outbuffer + offset, length_subtitle); + offset += 4; + memcpy(outbuffer + offset, this->subtitle, length_subtitle); + offset += length_subtitle; + union { + bool real; + uint8_t base; + } u_image_style_circular; + u_image_style_circular.real = this->image_style_circular; + *(outbuffer + offset + 0) = (u_image_style_circular.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->image_style_circular); + uint32_t length_image_url = strlen(this->image_url); + varToArr(outbuffer + offset, length_image_url); + offset += 4; + memcpy(outbuffer + offset, this->image_url, length_image_url); + offset += length_image_url; + uint32_t length_image_filepath = strlen(this->image_filepath); + varToArr(outbuffer + offset, length_image_filepath); + offset += 4; + memcpy(outbuffer + offset, this->image_filepath, length_image_filepath); + offset += length_image_filepath; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_title; + arrToVar(length_title, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_title; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_title-1]=0; + this->title = (char *)(inbuffer + offset-1); + offset += length_title; + uint32_t length_subtitle; + arrToVar(length_subtitle, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_subtitle; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_subtitle-1]=0; + this->subtitle = (char *)(inbuffer + offset-1); + offset += length_subtitle; + union { + bool real; + uint8_t base; + } u_image_style_circular; + u_image_style_circular.base = 0; + u_image_style_circular.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->image_style_circular = u_image_style_circular.real; + offset += sizeof(this->image_style_circular); + uint32_t length_image_url; + arrToVar(length_image_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_image_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_image_url-1]=0; + this->image_url = (char *)(inbuffer + offset-1); + offset += length_image_url; + uint32_t length_image_filepath; + arrToVar(length_image_filepath, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_image_filepath; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_image_filepath-1]=0; + this->image_filepath = (char *)(inbuffer + offset-1); + offset += length_image_filepath; + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/CardHeader"; }; + virtual const char * getMD5() override { return "0736280013717df387c39c7113faf889"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/FormAction.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/FormAction.h new file mode 100644 index 000000000..f3233a832 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/FormAction.h @@ -0,0 +1,81 @@ +#ifndef _ROS_google_chat_ros_FormAction_h +#define _ROS_google_chat_ros_FormAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/ActionParameter.h" + +namespace google_chat_ros +{ + + class FormAction : public ros::Msg + { + public: + typedef const char* _action_method_name_type; + _action_method_name_type action_method_name; + uint32_t parameters_length; + typedef google_chat_ros::ActionParameter _parameters_type; + _parameters_type st_parameters; + _parameters_type * parameters; + + FormAction(): + action_method_name(""), + parameters_length(0), st_parameters(), parameters(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_action_method_name = strlen(this->action_method_name); + varToArr(outbuffer + offset, length_action_method_name); + offset += 4; + memcpy(outbuffer + offset, this->action_method_name, length_action_method_name); + offset += length_action_method_name; + *(outbuffer + offset + 0) = (this->parameters_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->parameters_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->parameters_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->parameters_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->parameters_length); + for( uint32_t i = 0; i < parameters_length; i++){ + offset += this->parameters[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_action_method_name; + arrToVar(length_action_method_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_action_method_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_action_method_name-1]=0; + this->action_method_name = (char *)(inbuffer + offset-1); + offset += length_action_method_name; + uint32_t parameters_lengthT = ((uint32_t) (*(inbuffer + offset))); + parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->parameters_length); + if(parameters_lengthT > parameters_length) + this->parameters = (google_chat_ros::ActionParameter*)realloc(this->parameters, parameters_lengthT * sizeof(google_chat_ros::ActionParameter)); + parameters_length = parameters_lengthT; + for( uint32_t i = 0; i < parameters_length; i++){ + offset += this->st_parameters.deserialize(inbuffer + offset); + memcpy( &(this->parameters[i]), &(this->st_parameters), sizeof(google_chat_ros::ActionParameter)); + } + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/FormAction"; }; + virtual const char * getMD5() override { return "1b529563550f4567d19b052af042c195"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Image.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Image.h new file mode 100644 index 000000000..94bd74ae7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Image.h @@ -0,0 +1,83 @@ +#ifndef _ROS_google_chat_ros_Image_h +#define _ROS_google_chat_ros_Image_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/OnClick.h" + +namespace google_chat_ros +{ + + class Image : public ros::Msg + { + public: + typedef const char* _image_url_type; + _image_url_type image_url; + typedef const char* _localpath_type; + _localpath_type localpath; + typedef google_chat_ros::OnClick _on_click_type; + _on_click_type on_click; + typedef float _aspect_ratio_type; + _aspect_ratio_type aspect_ratio; + + Image(): + image_url(""), + localpath(""), + on_click(), + aspect_ratio(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_image_url = strlen(this->image_url); + varToArr(outbuffer + offset, length_image_url); + offset += 4; + memcpy(outbuffer + offset, this->image_url, length_image_url); + offset += length_image_url; + uint32_t length_localpath = strlen(this->localpath); + varToArr(outbuffer + offset, length_localpath); + offset += 4; + memcpy(outbuffer + offset, this->localpath, length_localpath); + offset += length_localpath; + offset += this->on_click.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->aspect_ratio); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_image_url; + arrToVar(length_image_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_image_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_image_url-1]=0; + this->image_url = (char *)(inbuffer + offset-1); + offset += length_image_url; + uint32_t length_localpath; + arrToVar(length_localpath, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_localpath; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_localpath-1]=0; + this->localpath = (char *)(inbuffer + offset-1); + offset += length_localpath; + offset += this->on_click.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->aspect_ratio)); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/Image"; }; + virtual const char * getMD5() override { return "4ca7f9f879afc606650793149935a08e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/KeyValue.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/KeyValue.h new file mode 100644 index 000000000..3baf07dda --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/KeyValue.h @@ -0,0 +1,170 @@ +#ifndef _ROS_google_chat_ros_KeyValue_h +#define _ROS_google_chat_ros_KeyValue_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/OnClick.h" +#include "google_chat_ros/Button.h" + +namespace google_chat_ros +{ + + class KeyValue : public ros::Msg + { + public: + typedef const char* _top_label_type; + _top_label_type top_label; + typedef const char* _content_type; + _content_type content; + typedef bool _content_multiline_type; + _content_multiline_type content_multiline; + typedef const char* _bottom_label_type; + _bottom_label_type bottom_label; + typedef google_chat_ros::OnClick _on_click_type; + _on_click_type on_click; + typedef const char* _icon_type; + _icon_type icon; + typedef const char* _original_icon_url_type; + _original_icon_url_type original_icon_url; + typedef const char* _original_icon_localpath_type; + _original_icon_localpath_type original_icon_localpath; + typedef google_chat_ros::Button _button_type; + _button_type button; + + KeyValue(): + top_label(""), + content(""), + content_multiline(0), + bottom_label(""), + on_click(), + icon(""), + original_icon_url(""), + original_icon_localpath(""), + button() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_top_label = strlen(this->top_label); + varToArr(outbuffer + offset, length_top_label); + offset += 4; + memcpy(outbuffer + offset, this->top_label, length_top_label); + offset += length_top_label; + uint32_t length_content = strlen(this->content); + varToArr(outbuffer + offset, length_content); + offset += 4; + memcpy(outbuffer + offset, this->content, length_content); + offset += length_content; + union { + bool real; + uint8_t base; + } u_content_multiline; + u_content_multiline.real = this->content_multiline; + *(outbuffer + offset + 0) = (u_content_multiline.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->content_multiline); + uint32_t length_bottom_label = strlen(this->bottom_label); + varToArr(outbuffer + offset, length_bottom_label); + offset += 4; + memcpy(outbuffer + offset, this->bottom_label, length_bottom_label); + offset += length_bottom_label; + offset += this->on_click.serialize(outbuffer + offset); + uint32_t length_icon = strlen(this->icon); + varToArr(outbuffer + offset, length_icon); + offset += 4; + memcpy(outbuffer + offset, this->icon, length_icon); + offset += length_icon; + uint32_t length_original_icon_url = strlen(this->original_icon_url); + varToArr(outbuffer + offset, length_original_icon_url); + offset += 4; + memcpy(outbuffer + offset, this->original_icon_url, length_original_icon_url); + offset += length_original_icon_url; + uint32_t length_original_icon_localpath = strlen(this->original_icon_localpath); + varToArr(outbuffer + offset, length_original_icon_localpath); + offset += 4; + memcpy(outbuffer + offset, this->original_icon_localpath, length_original_icon_localpath); + offset += length_original_icon_localpath; + offset += this->button.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_top_label; + arrToVar(length_top_label, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_top_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_top_label-1]=0; + this->top_label = (char *)(inbuffer + offset-1); + offset += length_top_label; + uint32_t length_content; + arrToVar(length_content, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_content; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_content-1]=0; + this->content = (char *)(inbuffer + offset-1); + offset += length_content; + union { + bool real; + uint8_t base; + } u_content_multiline; + u_content_multiline.base = 0; + u_content_multiline.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->content_multiline = u_content_multiline.real; + offset += sizeof(this->content_multiline); + uint32_t length_bottom_label; + arrToVar(length_bottom_label, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_bottom_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_bottom_label-1]=0; + this->bottom_label = (char *)(inbuffer + offset-1); + offset += length_bottom_label; + offset += this->on_click.deserialize(inbuffer + offset); + uint32_t length_icon; + arrToVar(length_icon, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_icon; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_icon-1]=0; + this->icon = (char *)(inbuffer + offset-1); + offset += length_icon; + uint32_t length_original_icon_url; + arrToVar(length_original_icon_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_original_icon_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_original_icon_url-1]=0; + this->original_icon_url = (char *)(inbuffer + offset-1); + offset += length_original_icon_url; + uint32_t length_original_icon_localpath; + arrToVar(length_original_icon_localpath, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_original_icon_localpath; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_original_icon_localpath-1]=0; + this->original_icon_localpath = (char *)(inbuffer + offset-1); + offset += length_original_icon_localpath; + offset += this->button.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/KeyValue"; }; + virtual const char * getMD5() override { return "b6a881cbd28397b27cef176bc48d6879"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Message.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Message.h new file mode 100644 index 000000000..a405df37a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Message.h @@ -0,0 +1,181 @@ +#ifndef _ROS_google_chat_ros_Message_h +#define _ROS_google_chat_ros_Message_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/User.h" +#include "google_chat_ros/Annotation.h" +#include "google_chat_ros/Attachment.h" + +namespace google_chat_ros +{ + + class Message : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef google_chat_ros::User _sender_type; + _sender_type sender; + typedef const char* _create_time_type; + _create_time_type create_time; + typedef const char* _text_type; + _text_type text; + typedef const char* _thread_name_type; + _thread_name_type thread_name; + uint32_t annotations_length; + typedef google_chat_ros::Annotation _annotations_type; + _annotations_type st_annotations; + _annotations_type * annotations; + typedef const char* _argument_text_type; + _argument_text_type argument_text; + uint32_t attachments_length; + typedef google_chat_ros::Attachment _attachments_type; + _attachments_type st_attachments; + _attachments_type * attachments; + + Message(): + name(""), + sender(), + create_time(""), + text(""), + thread_name(""), + annotations_length(0), st_annotations(), annotations(nullptr), + argument_text(""), + attachments_length(0), st_attachments(), attachments(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; + offset += this->sender.serialize(outbuffer + offset); + uint32_t length_create_time = strlen(this->create_time); + varToArr(outbuffer + offset, length_create_time); + offset += 4; + memcpy(outbuffer + offset, this->create_time, length_create_time); + offset += length_create_time; + uint32_t length_text = strlen(this->text); + varToArr(outbuffer + offset, length_text); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + uint32_t length_thread_name = strlen(this->thread_name); + varToArr(outbuffer + offset, length_thread_name); + offset += 4; + memcpy(outbuffer + offset, this->thread_name, length_thread_name); + offset += length_thread_name; + *(outbuffer + offset + 0) = (this->annotations_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->annotations_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->annotations_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->annotations_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->annotations_length); + for( uint32_t i = 0; i < annotations_length; i++){ + offset += this->annotations[i].serialize(outbuffer + offset); + } + uint32_t length_argument_text = strlen(this->argument_text); + varToArr(outbuffer + offset, length_argument_text); + offset += 4; + memcpy(outbuffer + offset, this->argument_text, length_argument_text); + offset += length_argument_text; + *(outbuffer + offset + 0) = (this->attachments_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->attachments_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->attachments_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->attachments_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->attachments_length); + for( uint32_t i = 0; i < attachments_length; i++){ + offset += this->attachments[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; + offset += this->sender.deserialize(inbuffer + offset); + uint32_t length_create_time; + arrToVar(length_create_time, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_create_time; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_create_time-1]=0; + this->create_time = (char *)(inbuffer + offset-1); + offset += length_create_time; + 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; + uint32_t length_thread_name; + arrToVar(length_thread_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_thread_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_thread_name-1]=0; + this->thread_name = (char *)(inbuffer + offset-1); + offset += length_thread_name; + uint32_t annotations_lengthT = ((uint32_t) (*(inbuffer + offset))); + annotations_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + annotations_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + annotations_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->annotations_length); + if(annotations_lengthT > annotations_length) + this->annotations = (google_chat_ros::Annotation*)realloc(this->annotations, annotations_lengthT * sizeof(google_chat_ros::Annotation)); + annotations_length = annotations_lengthT; + for( uint32_t i = 0; i < annotations_length; i++){ + offset += this->st_annotations.deserialize(inbuffer + offset); + memcpy( &(this->annotations[i]), &(this->st_annotations), sizeof(google_chat_ros::Annotation)); + } + uint32_t length_argument_text; + arrToVar(length_argument_text, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_argument_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_argument_text-1]=0; + this->argument_text = (char *)(inbuffer + offset-1); + offset += length_argument_text; + uint32_t attachments_lengthT = ((uint32_t) (*(inbuffer + offset))); + attachments_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + attachments_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + attachments_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->attachments_length); + if(attachments_lengthT > attachments_length) + this->attachments = (google_chat_ros::Attachment*)realloc(this->attachments, attachments_lengthT * sizeof(google_chat_ros::Attachment)); + attachments_length = attachments_lengthT; + for( uint32_t i = 0; i < attachments_length; i++){ + offset += this->st_attachments.deserialize(inbuffer + offset); + memcpy( &(this->attachments[i]), &(this->st_attachments), sizeof(google_chat_ros::Attachment)); + } + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/Message"; }; + virtual const char * getMD5() override { return "74482e9e8af0e668f3b70e9af9ccd33f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/MessageEvent.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/MessageEvent.h new file mode 100644 index 000000000..b4f4530c4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/MessageEvent.h @@ -0,0 +1,73 @@ +#ifndef _ROS_google_chat_ros_MessageEvent_h +#define _ROS_google_chat_ros_MessageEvent_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/Space.h" +#include "google_chat_ros/Message.h" +#include "google_chat_ros/User.h" + +namespace google_chat_ros +{ + + class MessageEvent : public ros::Msg + { + public: + typedef const char* _event_time_type; + _event_time_type event_time; + typedef google_chat_ros::Space _space_type; + _space_type space; + typedef google_chat_ros::Message _message_type; + _message_type message; + typedef google_chat_ros::User _user_type; + _user_type user; + + MessageEvent(): + event_time(""), + space(), + message(), + user() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_event_time = strlen(this->event_time); + varToArr(outbuffer + offset, length_event_time); + offset += 4; + memcpy(outbuffer + offset, this->event_time, length_event_time); + offset += length_event_time; + offset += this->space.serialize(outbuffer + offset); + offset += this->message.serialize(outbuffer + offset); + offset += this->user.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_event_time; + arrToVar(length_event_time, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_event_time; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_event_time-1]=0; + this->event_time = (char *)(inbuffer + offset-1); + offset += length_event_time; + offset += this->space.deserialize(inbuffer + offset); + offset += this->message.deserialize(inbuffer + offset); + offset += this->user.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/MessageEvent"; }; + virtual const char * getMD5() override { return "e98b007d5ecc221778f8416b69f7f901"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/OnClick.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/OnClick.h new file mode 100644 index 000000000..2c65d19d6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/OnClick.h @@ -0,0 +1,61 @@ +#ifndef _ROS_google_chat_ros_OnClick_h +#define _ROS_google_chat_ros_OnClick_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/FormAction.h" + +namespace google_chat_ros +{ + + class OnClick : public ros::Msg + { + public: + typedef google_chat_ros::FormAction _action_type; + _action_type action; + typedef const char* _open_link_url_type; + _open_link_url_type open_link_url; + + OnClick(): + action(), + open_link_url("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->action.serialize(outbuffer + offset); + uint32_t length_open_link_url = strlen(this->open_link_url); + varToArr(outbuffer + offset, length_open_link_url); + offset += 4; + memcpy(outbuffer + offset, this->open_link_url, length_open_link_url); + offset += length_open_link_url; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->action.deserialize(inbuffer + offset); + uint32_t length_open_link_url; + arrToVar(length_open_link_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_open_link_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_open_link_url-1]=0; + this->open_link_url = (char *)(inbuffer + offset-1); + offset += length_open_link_url; + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/OnClick"; }; + virtual const char * getMD5() override { return "fa8b3a77f7093cce31488d398e534227"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Section.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Section.h new file mode 100644 index 000000000..ff5df321f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Section.h @@ -0,0 +1,81 @@ +#ifndef _ROS_google_chat_ros_Section_h +#define _ROS_google_chat_ros_Section_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/WidgetMarkup.h" + +namespace google_chat_ros +{ + + class Section : public ros::Msg + { + public: + typedef const char* _header_type; + _header_type header; + uint32_t widgets_length; + typedef google_chat_ros::WidgetMarkup _widgets_type; + _widgets_type st_widgets; + _widgets_type * widgets; + + Section(): + header(""), + widgets_length(0), st_widgets(), widgets(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_header = strlen(this->header); + varToArr(outbuffer + offset, length_header); + offset += 4; + memcpy(outbuffer + offset, this->header, length_header); + offset += length_header; + *(outbuffer + offset + 0) = (this->widgets_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->widgets_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->widgets_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->widgets_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->widgets_length); + for( uint32_t i = 0; i < widgets_length; i++){ + offset += this->widgets[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_header; + arrToVar(length_header, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_header; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_header-1]=0; + this->header = (char *)(inbuffer + offset-1); + offset += length_header; + uint32_t widgets_lengthT = ((uint32_t) (*(inbuffer + offset))); + widgets_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + widgets_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + widgets_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->widgets_length); + if(widgets_lengthT > widgets_length) + this->widgets = (google_chat_ros::WidgetMarkup*)realloc(this->widgets, widgets_lengthT * sizeof(google_chat_ros::WidgetMarkup)); + widgets_length = widgets_lengthT; + for( uint32_t i = 0; i < widgets_length; i++){ + offset += this->st_widgets.deserialize(inbuffer + offset); + memcpy( &(this->widgets[i]), &(this->st_widgets), sizeof(google_chat_ros::WidgetMarkup)); + } + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/Section"; }; + virtual const char * getMD5() override { return "90eb3f68d10d183e560f956adae61989"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageAction.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageAction.h new file mode 100644 index 000000000..ad9b0e8b1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_google_chat_ros_SendMessageAction_h +#define _ROS_google_chat_ros_SendMessageAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/SendMessageActionGoal.h" +#include "google_chat_ros/SendMessageActionResult.h" +#include "google_chat_ros/SendMessageActionFeedback.h" + +namespace google_chat_ros +{ + + class SendMessageAction : public ros::Msg + { + public: + typedef google_chat_ros::SendMessageActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef google_chat_ros::SendMessageActionResult _action_result_type; + _action_result_type action_result; + typedef google_chat_ros::SendMessageActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + SendMessageAction(): + 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 "google_chat_ros/SendMessageAction"; }; + virtual const char * getMD5() override { return "206fe2fbaf1767bb5cb3d3e00067dacb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionFeedback.h new file mode 100644 index 000000000..ee0933383 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_google_chat_ros_SendMessageActionFeedback_h +#define _ROS_google_chat_ros_SendMessageActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "google_chat_ros/SendMessageFeedback.h" + +namespace google_chat_ros +{ + + class SendMessageActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef google_chat_ros::SendMessageFeedback _feedback_type; + _feedback_type feedback; + + SendMessageActionFeedback(): + 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 "google_chat_ros/SendMessageActionFeedback"; }; + virtual const char * getMD5() override { return "82e97615735594b25e2cee3da22d3eb7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionGoal.h new file mode 100644 index 000000000..146027969 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_google_chat_ros_SendMessageActionGoal_h +#define _ROS_google_chat_ros_SendMessageActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "google_chat_ros/SendMessageGoal.h" + +namespace google_chat_ros +{ + + class SendMessageActionGoal : 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 google_chat_ros::SendMessageGoal _goal_type; + _goal_type goal; + + SendMessageActionGoal(): + 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 "google_chat_ros/SendMessageActionGoal"; }; + virtual const char * getMD5() override { return "19eb7986d1278553a938571e4467e0c2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionResult.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionResult.h new file mode 100644 index 000000000..995f4f92b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_google_chat_ros_SendMessageActionResult_h +#define _ROS_google_chat_ros_SendMessageActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "google_chat_ros/SendMessageResult.h" + +namespace google_chat_ros +{ + + class SendMessageActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef google_chat_ros::SendMessageResult _result_type; + _result_type result; + + SendMessageActionResult(): + 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 "google_chat_ros/SendMessageActionResult"; }; + virtual const char * getMD5() override { return "e6ea81f96b7558d651e042ed81283a6e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageFeedback.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageFeedback.h new file mode 100644 index 000000000..aa07e9980 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageFeedback.h @@ -0,0 +1,55 @@ +#ifndef _ROS_google_chat_ros_SendMessageFeedback_h +#define _ROS_google_chat_ros_SendMessageFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace google_chat_ros +{ + + class SendMessageFeedback : public ros::Msg + { + public: + typedef const char* _status_type; + _status_type status; + + SendMessageFeedback(): + status("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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; + 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 "google_chat_ros/SendMessageFeedback"; }; + virtual const char * getMD5() override { return "4fe5af303955c287688e7347e9b00278"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageGoal.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageGoal.h new file mode 100644 index 000000000..3ca115607 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageGoal.h @@ -0,0 +1,133 @@ +#ifndef _ROS_google_chat_ros_SendMessageGoal_h +#define _ROS_google_chat_ros_SendMessageGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/Card.h" + +namespace google_chat_ros +{ + + class SendMessageGoal : public ros::Msg + { + public: + typedef const char* _text_type; + _text_type text; + uint32_t cards_length; + typedef google_chat_ros::Card _cards_type; + _cards_type st_cards; + _cards_type * cards; + typedef bool _update_message_type; + _update_message_type update_message; + typedef const char* _thread_name_type; + _thread_name_type thread_name; + typedef const char* _space_type; + _space_type space; + + SendMessageGoal(): + text(""), + cards_length(0), st_cards(), cards(nullptr), + update_message(0), + thread_name(""), + space("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_text = strlen(this->text); + varToArr(outbuffer + offset, length_text); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + *(outbuffer + offset + 0) = (this->cards_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cards_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cards_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cards_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cards_length); + for( uint32_t i = 0; i < cards_length; i++){ + offset += this->cards[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_update_message; + u_update_message.real = this->update_message; + *(outbuffer + offset + 0) = (u_update_message.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->update_message); + uint32_t length_thread_name = strlen(this->thread_name); + varToArr(outbuffer + offset, length_thread_name); + offset += 4; + memcpy(outbuffer + offset, this->thread_name, length_thread_name); + offset += length_thread_name; + uint32_t length_space = strlen(this->space); + varToArr(outbuffer + offset, length_space); + offset += 4; + memcpy(outbuffer + offset, this->space, length_space); + offset += length_space; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + uint32_t cards_lengthT = ((uint32_t) (*(inbuffer + offset))); + cards_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cards_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cards_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cards_length); + if(cards_lengthT > cards_length) + this->cards = (google_chat_ros::Card*)realloc(this->cards, cards_lengthT * sizeof(google_chat_ros::Card)); + cards_length = cards_lengthT; + for( uint32_t i = 0; i < cards_length; i++){ + offset += this->st_cards.deserialize(inbuffer + offset); + memcpy( &(this->cards[i]), &(this->st_cards), sizeof(google_chat_ros::Card)); + } + union { + bool real; + uint8_t base; + } u_update_message; + u_update_message.base = 0; + u_update_message.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->update_message = u_update_message.real; + offset += sizeof(this->update_message); + uint32_t length_thread_name; + arrToVar(length_thread_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_thread_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_thread_name-1]=0; + this->thread_name = (char *)(inbuffer + offset-1); + offset += length_thread_name; + uint32_t length_space; + arrToVar(length_space, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_space; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_space-1]=0; + this->space = (char *)(inbuffer + offset-1); + offset += length_space; + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/SendMessageGoal"; }; + virtual const char * getMD5() override { return "228383d98cf45717fe53712a5be9ee06"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageResult.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageResult.h new file mode 100644 index 000000000..283526017 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SendMessageResult.h @@ -0,0 +1,88 @@ +#ifndef _ROS_google_chat_ros_SendMessageResult_h +#define _ROS_google_chat_ros_SendMessageResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/Message.h" +#include "google_chat_ros/Card.h" + +namespace google_chat_ros +{ + + class SendMessageResult : public ros::Msg + { + public: + typedef google_chat_ros::Message _message_result_type; + _message_result_type message_result; + uint32_t cards_result_length; + typedef google_chat_ros::Card _cards_result_type; + _cards_result_type st_cards_result; + _cards_result_type * cards_result; + typedef bool _done_type; + _done_type done; + + SendMessageResult(): + message_result(), + cards_result_length(0), st_cards_result(), cards_result(nullptr), + done(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->message_result.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->cards_result_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cards_result_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cards_result_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cards_result_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cards_result_length); + for( uint32_t i = 0; i < cards_result_length; i++){ + offset += this->cards_result[i].serialize(outbuffer + offset); + } + 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; + offset += this->message_result.deserialize(inbuffer + offset); + uint32_t cards_result_lengthT = ((uint32_t) (*(inbuffer + offset))); + cards_result_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cards_result_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cards_result_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cards_result_length); + if(cards_result_lengthT > cards_result_length) + this->cards_result = (google_chat_ros::Card*)realloc(this->cards_result, cards_result_lengthT * sizeof(google_chat_ros::Card)); + cards_result_length = cards_result_lengthT; + for( uint32_t i = 0; i < cards_result_length; i++){ + offset += this->st_cards_result.deserialize(inbuffer + offset); + memcpy( &(this->cards_result[i]), &(this->st_cards_result), sizeof(google_chat_ros::Card)); + } + 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 "google_chat_ros/SendMessageResult"; }; + virtual const char * getMD5() override { return "2debf2fb1ec68366c318ee077fe23b31"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SlashCommand.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SlashCommand.h new file mode 100644 index 000000000..b3e2b698f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SlashCommand.h @@ -0,0 +1,132 @@ +#ifndef _ROS_google_chat_ros_SlashCommand_h +#define _ROS_google_chat_ros_SlashCommand_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/User.h" + +namespace google_chat_ros +{ + + class SlashCommand : public ros::Msg + { + public: + typedef google_chat_ros::User _user_type; + _user_type user; + typedef bool _added_type; + _added_type added; + typedef bool _invoke_type; + _invoke_type invoke; + typedef const char* _command_name_type; + _command_name_type command_name; + typedef const char* _command_id_type; + _command_id_type command_id; + typedef bool _triggers_dialog_type; + _triggers_dialog_type triggers_dialog; + + SlashCommand(): + user(), + added(0), + invoke(0), + command_name(""), + command_id(""), + triggers_dialog(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->user.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_added; + u_added.real = this->added; + *(outbuffer + offset + 0) = (u_added.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->added); + union { + bool real; + uint8_t base; + } u_invoke; + u_invoke.real = this->invoke; + *(outbuffer + offset + 0) = (u_invoke.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->invoke); + uint32_t length_command_name = strlen(this->command_name); + varToArr(outbuffer + offset, length_command_name); + offset += 4; + memcpy(outbuffer + offset, this->command_name, length_command_name); + offset += length_command_name; + uint32_t length_command_id = strlen(this->command_id); + varToArr(outbuffer + offset, length_command_id); + offset += 4; + memcpy(outbuffer + offset, this->command_id, length_command_id); + offset += length_command_id; + union { + bool real; + uint8_t base; + } u_triggers_dialog; + u_triggers_dialog.real = this->triggers_dialog; + *(outbuffer + offset + 0) = (u_triggers_dialog.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->triggers_dialog); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->user.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_added; + u_added.base = 0; + u_added.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->added = u_added.real; + offset += sizeof(this->added); + union { + bool real; + uint8_t base; + } u_invoke; + u_invoke.base = 0; + u_invoke.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->invoke = u_invoke.real; + offset += sizeof(this->invoke); + uint32_t length_command_name; + arrToVar(length_command_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command_name-1]=0; + this->command_name = (char *)(inbuffer + offset-1); + offset += length_command_name; + uint32_t length_command_id; + arrToVar(length_command_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command_id-1]=0; + this->command_id = (char *)(inbuffer + offset-1); + offset += length_command_id; + union { + bool real; + uint8_t base; + } u_triggers_dialog; + u_triggers_dialog.base = 0; + u_triggers_dialog.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->triggers_dialog = u_triggers_dialog.real; + offset += sizeof(this->triggers_dialog); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/SlashCommand"; }; + virtual const char * getMD5() override { return "528efb48a0c7a11bda8f24aa72b809fb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Space.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Space.h new file mode 100644 index 000000000..b0456189f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/Space.h @@ -0,0 +1,108 @@ +#ifndef _ROS_google_chat_ros_Space_h +#define _ROS_google_chat_ros_Space_h + +#include +#include +#include +#include "ros/msg.h" + +namespace google_chat_ros +{ + + class Space : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _display_name_type; + _display_name_type display_name; + typedef bool _room_type; + _room_type room; + typedef bool _dm_type; + _dm_type dm; + + Space(): + name(""), + display_name(""), + room(0), + dm(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; + uint32_t length_display_name = strlen(this->display_name); + varToArr(outbuffer + offset, length_display_name); + offset += 4; + memcpy(outbuffer + offset, this->display_name, length_display_name); + offset += length_display_name; + union { + bool real; + uint8_t base; + } u_room; + u_room.real = this->room; + *(outbuffer + offset + 0) = (u_room.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->room); + union { + bool real; + uint8_t base; + } u_dm; + u_dm.real = this->dm; + *(outbuffer + offset + 0) = (u_dm.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->dm); + 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_display_name; + arrToVar(length_display_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_display_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_display_name-1]=0; + this->display_name = (char *)(inbuffer + offset-1); + offset += length_display_name; + union { + bool real; + uint8_t base; + } u_room; + u_room.base = 0; + u_room.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->room = u_room.real; + offset += sizeof(this->room); + union { + bool real; + uint8_t base; + } u_dm; + u_dm.base = 0; + u_dm.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->dm = u_dm.real; + offset += sizeof(this->dm); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/Space"; }; + virtual const char * getMD5() override { return "8f448d7cd982f2c3d68173cc206e522d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SpaceEvent.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SpaceEvent.h new file mode 100644 index 000000000..5a6f8d364 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/SpaceEvent.h @@ -0,0 +1,103 @@ +#ifndef _ROS_google_chat_ros_SpaceEvent_h +#define _ROS_google_chat_ros_SpaceEvent_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/Space.h" +#include "google_chat_ros/User.h" + +namespace google_chat_ros +{ + + class SpaceEvent : public ros::Msg + { + public: + typedef bool _added_type; + _added_type added; + typedef bool _removed_type; + _removed_type removed; + typedef const char* _event_time_type; + _event_time_type event_time; + typedef google_chat_ros::Space _space_type; + _space_type space; + typedef google_chat_ros::User _user_type; + _user_type user; + + SpaceEvent(): + added(0), + removed(0), + event_time(""), + space(), + user() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_added; + u_added.real = this->added; + *(outbuffer + offset + 0) = (u_added.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->added); + union { + bool real; + uint8_t base; + } u_removed; + u_removed.real = this->removed; + *(outbuffer + offset + 0) = (u_removed.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->removed); + uint32_t length_event_time = strlen(this->event_time); + varToArr(outbuffer + offset, length_event_time); + offset += 4; + memcpy(outbuffer + offset, this->event_time, length_event_time); + offset += length_event_time; + offset += this->space.serialize(outbuffer + offset); + offset += this->user.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_added; + u_added.base = 0; + u_added.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->added = u_added.real; + offset += sizeof(this->added); + union { + bool real; + uint8_t base; + } u_removed; + u_removed.base = 0; + u_removed.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->removed = u_removed.real; + offset += sizeof(this->removed); + uint32_t length_event_time; + arrToVar(length_event_time, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_event_time; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_event_time-1]=0; + this->event_time = (char *)(inbuffer + offset-1); + offset += length_event_time; + offset += this->space.deserialize(inbuffer + offset); + offset += this->user.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/SpaceEvent"; }; + virtual const char * getMD5() override { return "3987589bfc8301d7f07c0b4a98b57eab"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/User.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/User.h new file mode 100644 index 000000000..de99c8306 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/User.h @@ -0,0 +1,169 @@ +#ifndef _ROS_google_chat_ros_User_h +#define _ROS_google_chat_ros_User_h + +#include +#include +#include +#include "ros/msg.h" + +namespace google_chat_ros +{ + + class User : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _display_name_type; + _display_name_type display_name; + typedef const char* _avatar_url_type; + _avatar_url_type avatar_url; + uint32_t avatar_length; + typedef uint8_t _avatar_type; + _avatar_type st_avatar; + _avatar_type * avatar; + typedef const char* _email_type; + _email_type email; + typedef bool _bot_type; + _bot_type bot; + typedef bool _human_type; + _human_type human; + + User(): + name(""), + display_name(""), + avatar_url(""), + avatar_length(0), st_avatar(), avatar(nullptr), + email(""), + bot(0), + human(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; + uint32_t length_display_name = strlen(this->display_name); + varToArr(outbuffer + offset, length_display_name); + offset += 4; + memcpy(outbuffer + offset, this->display_name, length_display_name); + offset += length_display_name; + uint32_t length_avatar_url = strlen(this->avatar_url); + varToArr(outbuffer + offset, length_avatar_url); + offset += 4; + memcpy(outbuffer + offset, this->avatar_url, length_avatar_url); + offset += length_avatar_url; + *(outbuffer + offset + 0) = (this->avatar_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->avatar_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->avatar_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->avatar_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->avatar_length); + for( uint32_t i = 0; i < avatar_length; i++){ + *(outbuffer + offset + 0) = (this->avatar[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->avatar[i]); + } + uint32_t length_email = strlen(this->email); + varToArr(outbuffer + offset, length_email); + offset += 4; + memcpy(outbuffer + offset, this->email, length_email); + offset += length_email; + union { + bool real; + uint8_t base; + } u_bot; + u_bot.real = this->bot; + *(outbuffer + offset + 0) = (u_bot.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->bot); + union { + bool real; + uint8_t base; + } u_human; + u_human.real = this->human; + *(outbuffer + offset + 0) = (u_human.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->human); + 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_display_name; + arrToVar(length_display_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_display_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_display_name-1]=0; + this->display_name = (char *)(inbuffer + offset-1); + offset += length_display_name; + uint32_t length_avatar_url; + arrToVar(length_avatar_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_avatar_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_avatar_url-1]=0; + this->avatar_url = (char *)(inbuffer + offset-1); + offset += length_avatar_url; + uint32_t avatar_lengthT = ((uint32_t) (*(inbuffer + offset))); + avatar_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + avatar_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + avatar_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->avatar_length); + if(avatar_lengthT > avatar_length) + this->avatar = (uint8_t*)realloc(this->avatar, avatar_lengthT * sizeof(uint8_t)); + avatar_length = avatar_lengthT; + for( uint32_t i = 0; i < avatar_length; i++){ + this->st_avatar = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_avatar); + memcpy( &(this->avatar[i]), &(this->st_avatar), sizeof(uint8_t)); + } + uint32_t length_email; + arrToVar(length_email, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_email; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_email-1]=0; + this->email = (char *)(inbuffer + offset-1); + offset += length_email; + union { + bool real; + uint8_t base; + } u_bot; + u_bot.base = 0; + u_bot.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->bot = u_bot.real; + offset += sizeof(this->bot); + union { + bool real; + uint8_t base; + } u_human; + u_human.base = 0; + u_human.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->human = u_human.real; + offset += sizeof(this->human); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/User"; }; + virtual const char * getMD5() override { return "8f7f8da1e0e6ba94d6bd196cb5950d15"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/WidgetMarkup.h b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/WidgetMarkup.h new file mode 100644 index 000000000..ccfc7a9d5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/google_chat_ros/WidgetMarkup.h @@ -0,0 +1,93 @@ +#ifndef _ROS_google_chat_ros_WidgetMarkup_h +#define _ROS_google_chat_ros_WidgetMarkup_h + +#include +#include +#include +#include "ros/msg.h" +#include "google_chat_ros/Button.h" +#include "google_chat_ros/Image.h" +#include "google_chat_ros/KeyValue.h" + +namespace google_chat_ros +{ + + class WidgetMarkup : public ros::Msg + { + public: + uint32_t buttons_length; + typedef google_chat_ros::Button _buttons_type; + _buttons_type st_buttons; + _buttons_type * buttons; + typedef const char* _text_paragraph_type; + _text_paragraph_type text_paragraph; + typedef google_chat_ros::Image _image_type; + _image_type image; + typedef google_chat_ros::KeyValue _key_value_type; + _key_value_type key_value; + + WidgetMarkup(): + buttons_length(0), st_buttons(), buttons(nullptr), + text_paragraph(""), + image(), + key_value() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->buttons_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->buttons_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->buttons_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->buttons_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->buttons_length); + for( uint32_t i = 0; i < buttons_length; i++){ + offset += this->buttons[i].serialize(outbuffer + offset); + } + uint32_t length_text_paragraph = strlen(this->text_paragraph); + varToArr(outbuffer + offset, length_text_paragraph); + offset += 4; + memcpy(outbuffer + offset, this->text_paragraph, length_text_paragraph); + offset += length_text_paragraph; + offset += this->image.serialize(outbuffer + offset); + offset += this->key_value.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t buttons_lengthT = ((uint32_t) (*(inbuffer + offset))); + buttons_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + buttons_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + buttons_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->buttons_length); + if(buttons_lengthT > buttons_length) + this->buttons = (google_chat_ros::Button*)realloc(this->buttons, buttons_lengthT * sizeof(google_chat_ros::Button)); + buttons_length = buttons_lengthT; + for( uint32_t i = 0; i < buttons_length; i++){ + offset += this->st_buttons.deserialize(inbuffer + offset); + memcpy( &(this->buttons[i]), &(this->st_buttons), sizeof(google_chat_ros::Button)); + } + uint32_t length_text_paragraph; + arrToVar(length_text_paragraph, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text_paragraph; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text_paragraph-1]=0; + this->text_paragraph = (char *)(inbuffer + offset-1); + offset += length_text_paragraph; + offset += this->image.deserialize(inbuffer + offset); + offset += this->key_value.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "google_chat_ros/WidgetMarkup"; }; + virtual const char * getMD5() override { return "df2ae4247b1cbe16ca432a0ead1ba903"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/graft/GraftControl.h b/smart_device_protocol/ros_lib/ros_lib/graft/GraftControl.h new file mode 100644 index 000000000..88a3d18ce --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/graft/GraftControl.h @@ -0,0 +1,67 @@ +#ifndef _ROS_graft_GraftControl_h +#define _ROS_graft_GraftControl_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/Vector3.h" +#include "geometry_msgs/Twist.h" + +namespace graft +{ + + class GraftControl : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Point _position_type; + _position_type position; + typedef geometry_msgs::Vector3 _rotation_type; + _rotation_type rotation; + typedef geometry_msgs::Twist _twist_type; + _twist_type twist; + typedef geometry_msgs::Vector3 _acceleration_type; + _acceleration_type acceleration; + + GraftControl(): + header(), + position(), + rotation(), + twist(), + acceleration() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->position.serialize(outbuffer + offset); + offset += this->rotation.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + offset += this->acceleration.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); + offset += this->rotation.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + offset += this->acceleration.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "graft/GraftControl"; }; + virtual const char * getMD5() override { return "f41b0858f042a487e729d7efdbffed39"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/graft/GraftSensorResidual.h b/smart_device_protocol/ros_lib/ros_lib/graft/GraftSensorResidual.h new file mode 100644 index 000000000..a2e8a86ae --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/graft/GraftSensorResidual.h @@ -0,0 +1,103 @@ +#ifndef _ROS_graft_GraftSensorResidual_h +#define _ROS_graft_GraftSensorResidual_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Vector3.h" + +namespace graft +{ + + class GraftSensorResidual : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _name_type; + _name_type name; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef geometry_msgs::Twist _twist_type; + _twist_type twist; + typedef geometry_msgs::Vector3 _accel_type; + _accel_type accel; + float pose_covariance[36]; + float twist_covariance[36]; + float accel_covariance[9]; + + GraftSensorResidual(): + header(), + name(""), + pose(), + twist(), + accel(), + pose_covariance(), + twist_covariance(), + accel_covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_name = strlen(this->name); + varToArr(outbuffer + offset, length_name); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->pose_covariance[i]); + } + for( uint32_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->twist_covariance[i]); + } + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->accel_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + 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; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pose_covariance[i])); + } + for( uint32_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->twist_covariance[i])); + } + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->accel_covariance[i])); + } + return offset; + } + + virtual const char * getType() override { return "graft/GraftSensorResidual"; }; + virtual const char * getMD5() override { return "f75937e1c71e90285875737addd2c780"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/graft/GraftState.h b/smart_device_protocol/ros_lib/ros_lib/graft/GraftState.h new file mode 100644 index 000000000..1beab6005 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/graft/GraftState.h @@ -0,0 +1,80 @@ +#ifndef _ROS_graft_GraftState_h +#define _ROS_graft_GraftState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Vector3.h" + +namespace graft +{ + + class GraftState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef geometry_msgs::Twist _twist_type; + _twist_type twist; + typedef geometry_msgs::Vector3 _acceleration_type; + _acceleration_type acceleration; + typedef geometry_msgs::Vector3 _gyro_bias_type; + _gyro_bias_type gyro_bias; + typedef geometry_msgs::Vector3 _accel_bias_type; + _accel_bias_type accel_bias; + float covariance[324]; + + GraftState(): + header(), + pose(), + twist(), + acceleration(), + gyro_bias(), + accel_bias(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + offset += this->acceleration.serialize(outbuffer + offset); + offset += this->gyro_bias.serialize(outbuffer + offset); + offset += this->accel_bias.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 324; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + offset += this->acceleration.deserialize(inbuffer + offset); + offset += this->gyro_bias.deserialize(inbuffer + offset); + offset += this->accel_bias.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 324; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + virtual const char * getType() override { return "graft/GraftState"; }; + virtual const char * getMD5() override { return "4744aac037427813b68053f3a09da177"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsAction.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsAction.h new file mode 100644 index 000000000..afd9284a2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_grasping_msgs_FindGraspableObjectsAction_h +#define _ROS_grasping_msgs_FindGraspableObjectsAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "grasping_msgs/FindGraspableObjectsActionGoal.h" +#include "grasping_msgs/FindGraspableObjectsActionResult.h" +#include "grasping_msgs/FindGraspableObjectsActionFeedback.h" + +namespace grasping_msgs +{ + + class FindGraspableObjectsAction : public ros::Msg + { + public: + typedef grasping_msgs::FindGraspableObjectsActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef grasping_msgs::FindGraspableObjectsActionResult _action_result_type; + _action_result_type action_result; + typedef grasping_msgs::FindGraspableObjectsActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + FindGraspableObjectsAction(): + 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 "grasping_msgs/FindGraspableObjectsAction"; }; + virtual const char * getMD5() override { return "ee328bdfce4619bf201b406a666b5877"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionFeedback.h new file mode 100644 index 000000000..020e4f1fe --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_grasping_msgs_FindGraspableObjectsActionFeedback_h +#define _ROS_grasping_msgs_FindGraspableObjectsActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "grasping_msgs/FindGraspableObjectsFeedback.h" + +namespace grasping_msgs +{ + + class FindGraspableObjectsActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef grasping_msgs::FindGraspableObjectsFeedback _feedback_type; + _feedback_type feedback; + + FindGraspableObjectsActionFeedback(): + 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 "grasping_msgs/FindGraspableObjectsActionFeedback"; }; + virtual const char * getMD5() override { return "76520896515effab7bb58019ad8185f0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionGoal.h new file mode 100644 index 000000000..fc24e6928 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_grasping_msgs_FindGraspableObjectsActionGoal_h +#define _ROS_grasping_msgs_FindGraspableObjectsActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "grasping_msgs/FindGraspableObjectsGoal.h" + +namespace grasping_msgs +{ + + class FindGraspableObjectsActionGoal : 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 grasping_msgs::FindGraspableObjectsGoal _goal_type; + _goal_type goal; + + FindGraspableObjectsActionGoal(): + 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 "grasping_msgs/FindGraspableObjectsActionGoal"; }; + virtual const char * getMD5() override { return "8308965ee8ae423cd6ede0a494bc6f1e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionResult.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionResult.h new file mode 100644 index 000000000..2eb3ddc99 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_grasping_msgs_FindGraspableObjectsActionResult_h +#define _ROS_grasping_msgs_FindGraspableObjectsActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "grasping_msgs/FindGraspableObjectsResult.h" + +namespace grasping_msgs +{ + + class FindGraspableObjectsActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef grasping_msgs::FindGraspableObjectsResult _result_type; + _result_type result; + + FindGraspableObjectsActionResult(): + 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 "grasping_msgs/FindGraspableObjectsActionResult"; }; + virtual const char * getMD5() override { return "815c3872a35e011e303fdc6f38a6dc62"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsFeedback.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsFeedback.h new file mode 100644 index 000000000..ea87a2da6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsFeedback.h @@ -0,0 +1,44 @@ +#ifndef _ROS_grasping_msgs_FindGraspableObjectsFeedback_h +#define _ROS_grasping_msgs_FindGraspableObjectsFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "grasping_msgs/GraspableObject.h" + +namespace grasping_msgs +{ + + class FindGraspableObjectsFeedback : public ros::Msg + { + public: + typedef grasping_msgs::GraspableObject _object_type; + _object_type object; + + FindGraspableObjectsFeedback(): + object() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->object.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->object.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "grasping_msgs/FindGraspableObjectsFeedback"; }; + virtual const char * getMD5() override { return "64c6bfc02f7e1c6e2d2473d1c1329ec7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsGoal.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsGoal.h new file mode 100644 index 000000000..10509b091 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_grasping_msgs_FindGraspableObjectsGoal_h +#define _ROS_grasping_msgs_FindGraspableObjectsGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace grasping_msgs +{ + + class FindGraspableObjectsGoal : public ros::Msg + { + public: + typedef bool _plan_grasps_type; + _plan_grasps_type plan_grasps; + + FindGraspableObjectsGoal(): + plan_grasps(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_plan_grasps; + u_plan_grasps.real = this->plan_grasps; + *(outbuffer + offset + 0) = (u_plan_grasps.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->plan_grasps); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_plan_grasps; + u_plan_grasps.base = 0; + u_plan_grasps.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->plan_grasps = u_plan_grasps.real; + offset += sizeof(this->plan_grasps); + return offset; + } + + virtual const char * getType() override { return "grasping_msgs/FindGraspableObjectsGoal"; }; + virtual const char * getMD5() override { return "4aadd364d1b04bf1e9e9fdbdce5637d4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsResult.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsResult.h new file mode 100644 index 000000000..cdf5de3a9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/FindGraspableObjectsResult.h @@ -0,0 +1,90 @@ +#ifndef _ROS_grasping_msgs_FindGraspableObjectsResult_h +#define _ROS_grasping_msgs_FindGraspableObjectsResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "grasping_msgs/GraspableObject.h" +#include "grasping_msgs/Object.h" + +namespace grasping_msgs +{ + + class FindGraspableObjectsResult : public ros::Msg + { + public: + uint32_t objects_length; + typedef grasping_msgs::GraspableObject _objects_type; + _objects_type st_objects; + _objects_type * objects; + uint32_t support_surfaces_length; + typedef grasping_msgs::Object _support_surfaces_type; + _support_surfaces_type st_support_surfaces; + _support_surfaces_type * support_surfaces; + + FindGraspableObjectsResult(): + objects_length(0), st_objects(), objects(nullptr), + support_surfaces_length(0), st_support_surfaces(), support_surfaces(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(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); + } + *(outbuffer + offset + 0) = (this->support_surfaces_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->support_surfaces_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->support_surfaces_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->support_surfaces_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->support_surfaces_length); + for( uint32_t i = 0; i < support_surfaces_length; i++){ + offset += this->support_surfaces[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 = (grasping_msgs::GraspableObject*)realloc(this->objects, objects_lengthT * sizeof(grasping_msgs::GraspableObject)); + 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(grasping_msgs::GraspableObject)); + } + uint32_t support_surfaces_lengthT = ((uint32_t) (*(inbuffer + offset))); + support_surfaces_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + support_surfaces_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + support_surfaces_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->support_surfaces_length); + if(support_surfaces_lengthT > support_surfaces_length) + this->support_surfaces = (grasping_msgs::Object*)realloc(this->support_surfaces, support_surfaces_lengthT * sizeof(grasping_msgs::Object)); + support_surfaces_length = support_surfaces_lengthT; + for( uint32_t i = 0; i < support_surfaces_length; i++){ + offset += this->st_support_surfaces.deserialize(inbuffer + offset); + memcpy( &(this->support_surfaces[i]), &(this->st_support_surfaces), sizeof(grasping_msgs::Object)); + } + return offset; + } + + virtual const char * getType() override { return "grasping_msgs/FindGraspableObjectsResult"; }; + virtual const char * getMD5() override { return "b0e2a5b10c524db813b26378dd6d8559"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningAction.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningAction.h new file mode 100644 index 000000000..7c711646e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_grasping_msgs_GraspPlanningAction_h +#define _ROS_grasping_msgs_GraspPlanningAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "grasping_msgs/GraspPlanningActionGoal.h" +#include "grasping_msgs/GraspPlanningActionResult.h" +#include "grasping_msgs/GraspPlanningActionFeedback.h" + +namespace grasping_msgs +{ + + class GraspPlanningAction : public ros::Msg + { + public: + typedef grasping_msgs::GraspPlanningActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef grasping_msgs::GraspPlanningActionResult _action_result_type; + _action_result_type action_result; + typedef grasping_msgs::GraspPlanningActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + GraspPlanningAction(): + 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 "grasping_msgs/GraspPlanningAction"; }; + virtual const char * getMD5() override { return "7133eaf5c7bbf3f1f2b109ce543a58b0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionFeedback.h new file mode 100644 index 000000000..a07e1fa65 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_grasping_msgs_GraspPlanningActionFeedback_h +#define _ROS_grasping_msgs_GraspPlanningActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "grasping_msgs/GraspPlanningFeedback.h" + +namespace grasping_msgs +{ + + class GraspPlanningActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef grasping_msgs::GraspPlanningFeedback _feedback_type; + _feedback_type feedback; + + GraspPlanningActionFeedback(): + 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 "grasping_msgs/GraspPlanningActionFeedback"; }; + virtual const char * getMD5() override { return "947765100fcb339c2c35349f12eee057"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionGoal.h new file mode 100644 index 000000000..0f1b8ef2c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_grasping_msgs_GraspPlanningActionGoal_h +#define _ROS_grasping_msgs_GraspPlanningActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "grasping_msgs/GraspPlanningGoal.h" + +namespace grasping_msgs +{ + + class GraspPlanningActionGoal : 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 grasping_msgs::GraspPlanningGoal _goal_type; + _goal_type goal; + + GraspPlanningActionGoal(): + 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 "grasping_msgs/GraspPlanningActionGoal"; }; + virtual const char * getMD5() override { return "caad3d76fe6a67352a76302e837cccbe"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionResult.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionResult.h new file mode 100644 index 000000000..3e8f58363 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_grasping_msgs_GraspPlanningActionResult_h +#define _ROS_grasping_msgs_GraspPlanningActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "grasping_msgs/GraspPlanningResult.h" + +namespace grasping_msgs +{ + + class GraspPlanningActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef grasping_msgs::GraspPlanningResult _result_type; + _result_type result; + + GraspPlanningActionResult(): + 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 "grasping_msgs/GraspPlanningActionResult"; }; + virtual const char * getMD5() override { return "3e5cdae81cffa49b72e6fc3e16366194"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningFeedback.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningFeedback.h new file mode 100644 index 000000000..ebaaad4c3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningFeedback.h @@ -0,0 +1,64 @@ +#ifndef _ROS_grasping_msgs_GraspPlanningFeedback_h +#define _ROS_grasping_msgs_GraspPlanningFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/Grasp.h" + +namespace grasping_msgs +{ + + class GraspPlanningFeedback : public ros::Msg + { + public: + uint32_t grasps_length; + typedef moveit_msgs::Grasp _grasps_type; + _grasps_type st_grasps; + _grasps_type * grasps; + + GraspPlanningFeedback(): + grasps_length(0), st_grasps(), grasps(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->grasps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->grasps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->grasps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->grasps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->grasps_length); + for( uint32_t i = 0; i < grasps_length; i++){ + offset += this->grasps[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t grasps_lengthT = ((uint32_t) (*(inbuffer + offset))); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->grasps_length); + if(grasps_lengthT > grasps_length) + this->grasps = (moveit_msgs::Grasp*)realloc(this->grasps, grasps_lengthT * sizeof(moveit_msgs::Grasp)); + grasps_length = grasps_lengthT; + for( uint32_t i = 0; i < grasps_length; i++){ + offset += this->st_grasps.deserialize(inbuffer + offset); + memcpy( &(this->grasps[i]), &(this->st_grasps), sizeof(moveit_msgs::Grasp)); + } + return offset; + } + + virtual const char * getType() override { return "grasping_msgs/GraspPlanningFeedback"; }; + virtual const char * getMD5() override { return "8c4083a4efa926cd066c287f905843a3"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningGoal.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningGoal.h new file mode 100644 index 000000000..e691a0191 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningGoal.h @@ -0,0 +1,61 @@ +#ifndef _ROS_grasping_msgs_GraspPlanningGoal_h +#define _ROS_grasping_msgs_GraspPlanningGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "grasping_msgs/Object.h" + +namespace grasping_msgs +{ + + class GraspPlanningGoal : public ros::Msg + { + public: + typedef grasping_msgs::Object _object_type; + _object_type object; + typedef const char* _group_name_type; + _group_name_type group_name; + + GraspPlanningGoal(): + object(), + group_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->object.serialize(outbuffer + offset); + uint32_t length_group_name = strlen(this->group_name); + varToArr(outbuffer + offset, length_group_name); + offset += 4; + memcpy(outbuffer + offset, this->group_name, length_group_name); + offset += length_group_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->object.deserialize(inbuffer + offset); + uint32_t length_group_name; + arrToVar(length_group_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group_name-1]=0; + this->group_name = (char *)(inbuffer + offset-1); + offset += length_group_name; + return offset; + } + + virtual const char * getType() override { return "grasping_msgs/GraspPlanningGoal"; }; + virtual const char * getMD5() override { return "1c3f3ed2a31c4c865c3032a4789c0df9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningResult.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningResult.h new file mode 100644 index 000000000..3d79487f1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspPlanningResult.h @@ -0,0 +1,64 @@ +#ifndef _ROS_grasping_msgs_GraspPlanningResult_h +#define _ROS_grasping_msgs_GraspPlanningResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/Grasp.h" + +namespace grasping_msgs +{ + + class GraspPlanningResult : public ros::Msg + { + public: + uint32_t grasps_length; + typedef moveit_msgs::Grasp _grasps_type; + _grasps_type st_grasps; + _grasps_type * grasps; + + GraspPlanningResult(): + grasps_length(0), st_grasps(), grasps(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->grasps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->grasps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->grasps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->grasps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->grasps_length); + for( uint32_t i = 0; i < grasps_length; i++){ + offset += this->grasps[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t grasps_lengthT = ((uint32_t) (*(inbuffer + offset))); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->grasps_length); + if(grasps_lengthT > grasps_length) + this->grasps = (moveit_msgs::Grasp*)realloc(this->grasps, grasps_lengthT * sizeof(moveit_msgs::Grasp)); + grasps_length = grasps_lengthT; + for( uint32_t i = 0; i < grasps_length; i++){ + offset += this->st_grasps.deserialize(inbuffer + offset); + memcpy( &(this->grasps[i]), &(this->st_grasps), sizeof(moveit_msgs::Grasp)); + } + return offset; + } + + virtual const char * getType() override { return "grasping_msgs/GraspPlanningResult"; }; + virtual const char * getMD5() override { return "8c4083a4efa926cd066c287f905843a3"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspableObject.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspableObject.h new file mode 100644 index 000000000..bc1951fcc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/GraspableObject.h @@ -0,0 +1,70 @@ +#ifndef _ROS_grasping_msgs_GraspableObject_h +#define _ROS_grasping_msgs_GraspableObject_h + +#include +#include +#include +#include "ros/msg.h" +#include "grasping_msgs/Object.h" +#include "moveit_msgs/Grasp.h" + +namespace grasping_msgs +{ + + class GraspableObject : public ros::Msg + { + public: + typedef grasping_msgs::Object _object_type; + _object_type object; + uint32_t grasps_length; + typedef moveit_msgs::Grasp _grasps_type; + _grasps_type st_grasps; + _grasps_type * grasps; + + GraspableObject(): + object(), + grasps_length(0), st_grasps(), grasps(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->object.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->grasps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->grasps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->grasps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->grasps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->grasps_length); + for( uint32_t i = 0; i < grasps_length; i++){ + offset += this->grasps[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->object.deserialize(inbuffer + offset); + uint32_t grasps_lengthT = ((uint32_t) (*(inbuffer + offset))); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->grasps_length); + if(grasps_lengthT > grasps_length) + this->grasps = (moveit_msgs::Grasp*)realloc(this->grasps, grasps_lengthT * sizeof(moveit_msgs::Grasp)); + grasps_length = grasps_lengthT; + for( uint32_t i = 0; i < grasps_length; i++){ + offset += this->st_grasps.deserialize(inbuffer + offset); + memcpy( &(this->grasps[i]), &(this->st_grasps), sizeof(moveit_msgs::Grasp)); + } + return offset; + } + + virtual const char * getType() override { return "grasping_msgs/GraspableObject"; }; + virtual const char * getMD5() override { return "ec31ebe9db31c8d3ccab1b66aedd1293"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/Object.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/Object.h new file mode 100644 index 000000000..db4a7ef75 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/Object.h @@ -0,0 +1,219 @@ +#ifndef _ROS_grasping_msgs_Object_h +#define _ROS_grasping_msgs_Object_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "grasping_msgs/ObjectProperty.h" +#include "sensor_msgs/PointCloud2.h" +#include "shape_msgs/SolidPrimitive.h" +#include "geometry_msgs/Pose.h" +#include "shape_msgs/Mesh.h" +#include "shape_msgs/Plane.h" + +namespace grasping_msgs +{ + + class Object : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _name_type; + _name_type name; + typedef const char* _support_surface_type; + _support_surface_type support_surface; + uint32_t properties_length; + typedef grasping_msgs::ObjectProperty _properties_type; + _properties_type st_properties; + _properties_type * properties; + typedef sensor_msgs::PointCloud2 _point_cluster_type; + _point_cluster_type point_cluster; + uint32_t primitives_length; + typedef shape_msgs::SolidPrimitive _primitives_type; + _primitives_type st_primitives; + _primitives_type * primitives; + uint32_t primitive_poses_length; + typedef geometry_msgs::Pose _primitive_poses_type; + _primitive_poses_type st_primitive_poses; + _primitive_poses_type * primitive_poses; + uint32_t meshes_length; + typedef shape_msgs::Mesh _meshes_type; + _meshes_type st_meshes; + _meshes_type * meshes; + uint32_t mesh_poses_length; + typedef geometry_msgs::Pose _mesh_poses_type; + _mesh_poses_type st_mesh_poses; + _mesh_poses_type * mesh_poses; + typedef shape_msgs::Plane _surface_type; + _surface_type surface; + + Object(): + header(), + name(""), + support_surface(""), + properties_length(0), st_properties(), properties(nullptr), + point_cluster(), + primitives_length(0), st_primitives(), primitives(nullptr), + primitive_poses_length(0), st_primitive_poses(), primitive_poses(nullptr), + meshes_length(0), st_meshes(), meshes(nullptr), + mesh_poses_length(0), st_mesh_poses(), mesh_poses(nullptr), + surface() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + 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_support_surface = strlen(this->support_surface); + varToArr(outbuffer + offset, length_support_surface); + offset += 4; + memcpy(outbuffer + offset, this->support_surface, length_support_surface); + offset += length_support_surface; + *(outbuffer + offset + 0) = (this->properties_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->properties_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->properties_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->properties_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->properties_length); + for( uint32_t i = 0; i < properties_length; i++){ + offset += this->properties[i].serialize(outbuffer + offset); + } + offset += this->point_cluster.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->primitives_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->primitives_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->primitives_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->primitives_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->primitives_length); + for( uint32_t i = 0; i < primitives_length; i++){ + offset += this->primitives[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->primitive_poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->primitive_poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->primitive_poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->primitive_poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->primitive_poses_length); + for( uint32_t i = 0; i < primitive_poses_length; i++){ + offset += this->primitive_poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->meshes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->meshes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->meshes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->meshes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->meshes_length); + for( uint32_t i = 0; i < meshes_length; i++){ + offset += this->meshes[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->mesh_poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->mesh_poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->mesh_poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->mesh_poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->mesh_poses_length); + for( uint32_t i = 0; i < mesh_poses_length; i++){ + offset += this->mesh_poses[i].serialize(outbuffer + offset); + } + offset += this->surface.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + 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_support_surface; + arrToVar(length_support_surface, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_support_surface; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_support_surface-1]=0; + this->support_surface = (char *)(inbuffer + offset-1); + offset += length_support_surface; + uint32_t properties_lengthT = ((uint32_t) (*(inbuffer + offset))); + properties_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + properties_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + properties_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->properties_length); + if(properties_lengthT > properties_length) + this->properties = (grasping_msgs::ObjectProperty*)realloc(this->properties, properties_lengthT * sizeof(grasping_msgs::ObjectProperty)); + properties_length = properties_lengthT; + for( uint32_t i = 0; i < properties_length; i++){ + offset += this->st_properties.deserialize(inbuffer + offset); + memcpy( &(this->properties[i]), &(this->st_properties), sizeof(grasping_msgs::ObjectProperty)); + } + offset += this->point_cluster.deserialize(inbuffer + offset); + uint32_t primitives_lengthT = ((uint32_t) (*(inbuffer + offset))); + primitives_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + primitives_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + primitives_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->primitives_length); + if(primitives_lengthT > primitives_length) + this->primitives = (shape_msgs::SolidPrimitive*)realloc(this->primitives, primitives_lengthT * sizeof(shape_msgs::SolidPrimitive)); + primitives_length = primitives_lengthT; + for( uint32_t i = 0; i < primitives_length; i++){ + offset += this->st_primitives.deserialize(inbuffer + offset); + memcpy( &(this->primitives[i]), &(this->st_primitives), sizeof(shape_msgs::SolidPrimitive)); + } + uint32_t primitive_poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + primitive_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + primitive_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + primitive_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->primitive_poses_length); + if(primitive_poses_lengthT > primitive_poses_length) + this->primitive_poses = (geometry_msgs::Pose*)realloc(this->primitive_poses, primitive_poses_lengthT * sizeof(geometry_msgs::Pose)); + primitive_poses_length = primitive_poses_lengthT; + for( uint32_t i = 0; i < primitive_poses_length; i++){ + offset += this->st_primitive_poses.deserialize(inbuffer + offset); + memcpy( &(this->primitive_poses[i]), &(this->st_primitive_poses), sizeof(geometry_msgs::Pose)); + } + uint32_t meshes_lengthT = ((uint32_t) (*(inbuffer + offset))); + meshes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + meshes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + meshes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->meshes_length); + if(meshes_lengthT > meshes_length) + this->meshes = (shape_msgs::Mesh*)realloc(this->meshes, meshes_lengthT * sizeof(shape_msgs::Mesh)); + meshes_length = meshes_lengthT; + for( uint32_t i = 0; i < meshes_length; i++){ + offset += this->st_meshes.deserialize(inbuffer + offset); + memcpy( &(this->meshes[i]), &(this->st_meshes), sizeof(shape_msgs::Mesh)); + } + uint32_t mesh_poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + mesh_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + mesh_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + mesh_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->mesh_poses_length); + if(mesh_poses_lengthT > mesh_poses_length) + this->mesh_poses = (geometry_msgs::Pose*)realloc(this->mesh_poses, mesh_poses_lengthT * sizeof(geometry_msgs::Pose)); + mesh_poses_length = mesh_poses_lengthT; + for( uint32_t i = 0; i < mesh_poses_length; i++){ + offset += this->st_mesh_poses.deserialize(inbuffer + offset); + memcpy( &(this->mesh_poses[i]), &(this->st_mesh_poses), sizeof(geometry_msgs::Pose)); + } + offset += this->surface.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "grasping_msgs/Object"; }; + virtual const char * getMD5() override { return "0770e300363d18954f6fd25963e4d536"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/ObjectProperty.h b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/ObjectProperty.h new file mode 100644 index 000000000..67976032a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/grasping_msgs/ObjectProperty.h @@ -0,0 +1,72 @@ +#ifndef _ROS_grasping_msgs_ObjectProperty_h +#define _ROS_grasping_msgs_ObjectProperty_h + +#include +#include +#include +#include "ros/msg.h" + +namespace grasping_msgs +{ + + class ObjectProperty : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _value_type; + _value_type value; + + ObjectProperty(): + name(""), + value("") + { + } + + 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_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_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_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 "grasping_msgs/ObjectProperty"; }; + virtual const char * getMD5() override { return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/image_view2/ChangeMode.h b/smart_device_protocol/ros_lib/ros_lib/image_view2/ChangeMode.h new file mode 100644 index 000000000..d545000fa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/image_view2/ChangeMode.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_ChangeMode_h +#define _ROS_SERVICE_ChangeMode_h +#include +#include +#include +#include "ros/msg.h" + +namespace image_view2 +{ + +static const char CHANGEMODE[] = "image_view2/ChangeMode"; + + class ChangeModeRequest : public ros::Msg + { + public: + typedef const char* _mode_type; + _mode_type mode; + + ChangeModeRequest(): + mode("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_mode = strlen(this->mode); + varToArr(outbuffer + offset, length_mode); + offset += 4; + memcpy(outbuffer + offset, this->mode, length_mode); + offset += length_mode; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return CHANGEMODE; }; + virtual const char * getMD5() override { return "e84dc3ad5dc323bb64f0aca01c2d1eef"; }; + + }; + + class ChangeModeResponse : public ros::Msg + { + public: + + ChangeModeResponse() + { + } + + 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 CHANGEMODE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ChangeMode { + public: + typedef ChangeModeRequest Request; + typedef ChangeModeResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/image_view2/ImageMarker2.h b/smart_device_protocol/ros_lib/ros_lib/image_view2/ImageMarker2.h new file mode 100644 index 000000000..bb6be8bc8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/image_view2/ImageMarker2.h @@ -0,0 +1,455 @@ +#ifndef _ROS_image_view2_ImageMarker2_h +#define _ROS_image_view2_ImageMarker2_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/PointStamped.h" +#include "geometry_msgs/PoseStamped.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" +#include "image_view2/PointArrayStamped.h" + +namespace image_view2 +{ + + class ImageMarker2 : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _ns_type; + _ns_type ns; + typedef int32_t _id_type; + _id_type id; + typedef int32_t _type_type; + _type_type type; + typedef int32_t _action_type; + _action_type action; + typedef geometry_msgs::Point _position_type; + _position_type position; + typedef geometry_msgs::PointStamped _position3D_type; + _position3D_type position3D; + typedef geometry_msgs::PoseStamped _pose_type; + _pose_type pose; + typedef float _scale_type; + _scale_type scale; + typedef float _width_type; + _width_type width; + typedef std_msgs::ColorRGBA _outline_color_type; + _outline_color_type outline_color; + typedef int8_t _filled_type; + _filled_type filled; + typedef std_msgs::ColorRGBA _fill_color_type; + _fill_color_type fill_color; + typedef ros::Duration _lifetime_type; + _lifetime_type lifetime; + typedef int8_t _arc_type; + _arc_type arc; + typedef float _angle_type; + _angle_type angle; + uint32_t points_length; + typedef geometry_msgs::Point _points_type; + _points_type st_points; + _points_type * points; + typedef image_view2::PointArrayStamped _points3D_type; + _points3D_type points3D; + uint32_t outline_colors_length; + typedef std_msgs::ColorRGBA _outline_colors_type; + _outline_colors_type st_outline_colors; + _outline_colors_type * outline_colors; + uint32_t frames_length; + typedef char* _frames_type; + _frames_type st_frames; + _frames_type * frames; + typedef const char* _text_type; + _text_type text; + typedef bool _left_up_origin_type; + _left_up_origin_type left_up_origin; + typedef bool _ratio_scale_type; + _ratio_scale_type ratio_scale; + enum { CIRCLE = 0 }; + enum { LINE_STRIP = 1 }; + enum { LINE_LIST = 2 }; + enum { POLYGON = 3 }; + enum { POINTS = 4 }; + enum { FRAMES = 5 }; + enum { TEXT = 6 }; + enum { LINE_STRIP3D = 7 }; + enum { LINE_LIST3D = 8 }; + enum { POLYGON3D = 9 }; + enum { POINTS3D = 10 }; + enum { TEXT3D = 11 }; + enum { CIRCLE3D = 12 }; + enum { ADD = 0 }; + enum { REMOVE = 1 }; + + ImageMarker2(): + header(), + ns(""), + id(0), + type(0), + action(0), + position(), + position3D(), + pose(), + scale(0), + width(0), + outline_color(), + filled(0), + fill_color(), + lifetime(), + arc(0), + angle(0), + points_length(0), st_points(), points(nullptr), + points3D(), + outline_colors_length(0), st_outline_colors(), outline_colors(nullptr), + frames_length(0), st_frames(), frames(nullptr), + text(""), + left_up_origin(0), + ratio_scale(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + varToArr(outbuffer + offset, length_ns); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + 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_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_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->position.serialize(outbuffer + offset); + offset += this->position3D.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + union { + float real; + uint32_t base; + } u_width; + u_width.real = this->width; + *(outbuffer + offset + 0) = (u_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + offset += this->outline_color.serialize(outbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_filled; + u_filled.real = this->filled; + *(outbuffer + offset + 0) = (u_filled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->filled); + offset += this->fill_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + union { + int8_t real; + uint8_t base; + } u_arc; + u_arc.real = this->arc; + *(outbuffer + offset + 0) = (u_arc.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->arc); + 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); + *(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); + } + offset += this->points3D.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->outline_colors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outline_colors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outline_colors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outline_colors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->outline_colors_length); + for( uint32_t i = 0; i < outline_colors_length; i++){ + offset += this->outline_colors[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->frames_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->frames_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->frames_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->frames_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->frames_length); + for( uint32_t i = 0; i < frames_length; i++){ + uint32_t length_framesi = strlen(this->frames[i]); + varToArr(outbuffer + offset, length_framesi); + offset += 4; + memcpy(outbuffer + offset, this->frames[i], length_framesi); + offset += length_framesi; + } + uint32_t length_text = strlen(this->text); + varToArr(outbuffer + offset, length_text); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + union { + bool real; + uint8_t base; + } u_left_up_origin; + u_left_up_origin.real = this->left_up_origin; + *(outbuffer + offset + 0) = (u_left_up_origin.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->left_up_origin); + union { + bool real; + uint8_t base; + } u_ratio_scale; + u_ratio_scale.real = this->ratio_scale; + *(outbuffer + offset + 0) = (u_ratio_scale.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->ratio_scale); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + arrToVar(length_ns, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + 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_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_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->position.deserialize(inbuffer + offset); + offset += this->position3D.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + union { + float real; + uint32_t base; + } u_width; + u_width.base = 0; + u_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->width = u_width.real; + offset += sizeof(this->width); + offset += this->outline_color.deserialize(inbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_filled; + u_filled.base = 0; + u_filled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->filled = u_filled.real; + offset += sizeof(this->filled); + offset += this->fill_color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + union { + int8_t real; + uint8_t base; + } u_arc; + u_arc.base = 0; + u_arc.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->arc = u_arc.real; + offset += sizeof(this->arc); + 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); + 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 = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + 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(geometry_msgs::Point)); + } + offset += this->points3D.deserialize(inbuffer + offset); + uint32_t outline_colors_lengthT = ((uint32_t) (*(inbuffer + offset))); + outline_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + outline_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + outline_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outline_colors_length); + if(outline_colors_lengthT > outline_colors_length) + this->outline_colors = (std_msgs::ColorRGBA*)realloc(this->outline_colors, outline_colors_lengthT * sizeof(std_msgs::ColorRGBA)); + outline_colors_length = outline_colors_lengthT; + for( uint32_t i = 0; i < outline_colors_length; i++){ + offset += this->st_outline_colors.deserialize(inbuffer + offset); + memcpy( &(this->outline_colors[i]), &(this->st_outline_colors), sizeof(std_msgs::ColorRGBA)); + } + uint32_t frames_lengthT = ((uint32_t) (*(inbuffer + offset))); + frames_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + frames_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + frames_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->frames_length); + if(frames_lengthT > frames_length) + this->frames = (char**)realloc(this->frames, frames_lengthT * sizeof(char*)); + frames_length = frames_lengthT; + for( uint32_t i = 0; i < frames_length; i++){ + uint32_t length_st_frames; + arrToVar(length_st_frames, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_frames; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_frames-1]=0; + this->st_frames = (char *)(inbuffer + offset-1); + offset += length_st_frames; + memcpy( &(this->frames[i]), &(this->st_frames), sizeof(char*)); + } + 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; + union { + bool real; + uint8_t base; + } u_left_up_origin; + u_left_up_origin.base = 0; + u_left_up_origin.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->left_up_origin = u_left_up_origin.real; + offset += sizeof(this->left_up_origin); + union { + bool real; + uint8_t base; + } u_ratio_scale; + u_ratio_scale.base = 0; + u_ratio_scale.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->ratio_scale = u_ratio_scale.real; + offset += sizeof(this->ratio_scale); + return offset; + } + + virtual const char * getType() override { return "image_view2/ImageMarker2"; }; + virtual const char * getMD5() override { return "8efc23e411f94f2c04288719c078c291"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/image_view2/MouseEvent.h b/smart_device_protocol/ros_lib/ros_lib/image_view2/MouseEvent.h new file mode 100644 index 000000000..40faff09a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/image_view2/MouseEvent.h @@ -0,0 +1,193 @@ +#ifndef _ROS_image_view2_MouseEvent_h +#define _ROS_image_view2_MouseEvent_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace image_view2 +{ + + class MouseEvent : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _type_type; + _type_type type; + typedef int32_t _key_type; + _key_type key; + typedef int32_t _x_type; + _x_type x; + typedef int32_t _y_type; + _y_type y; + typedef int32_t _width_type; + _width_type width; + typedef int32_t _height_type; + _height_type height; + enum { KEY_PRESSED = 1 }; + enum { MOUSE_LEFT_UP = 2 }; + enum { MOUSE_LEFT_DOWN = 3 }; + enum { MOUSE_MOVE = 4 }; + enum { MOUSE_RIGHT_DOWN = 5 }; + + MouseEvent(): + header(), + type(0), + key(0), + x(0), + y(0), + width(0), + height(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); + union { + int32_t real; + uint32_t base; + } u_key; + u_key.real = this->key; + *(outbuffer + offset + 0) = (u_key.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_key.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_key.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_key.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->key); + 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 { + int32_t real; + uint32_t base; + } u_width; + u_width.real = this->width; + *(outbuffer + offset + 0) = (u_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + union { + int32_t real; + uint32_t base; + } u_height; + u_height.real = this->height; + *(outbuffer + offset + 0) = (u_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + 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); + union { + int32_t real; + uint32_t base; + } u_key; + u_key.base = 0; + u_key.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_key.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_key.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_key.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->key = u_key.real; + offset += sizeof(this->key); + 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 { + int32_t real; + uint32_t base; + } u_width; + u_width.base = 0; + u_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->width = u_width.real; + offset += sizeof(this->width); + union { + int32_t real; + uint32_t base; + } u_height; + u_height.base = 0; + u_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->height = u_height.real; + offset += sizeof(this->height); + return offset; + } + + virtual const char * getType() override { return "image_view2/MouseEvent"; }; + virtual const char * getMD5() override { return "7ffa73624c1be385169a9e6e23460224"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/image_view2/PointArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/image_view2/PointArrayStamped.h new file mode 100644 index 000000000..c9b686ccb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/image_view2/PointArrayStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_image_view2_PointArrayStamped_h +#define _ROS_image_view2_PointArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace image_view2 +{ + + class PointArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t points_length; + typedef geometry_msgs::Point _points_type; + _points_type st_points; + _points_type * points; + + PointArrayStamped(): + header(), + points_length(0), st_points(), points(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.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 = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + 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(geometry_msgs::Point)); + } + return offset; + } + + virtual const char * getType() override { return "image_view2/PointArrayStamped"; }; + virtual const char * getMD5() override { return "2199cac4695ce1fc0f346db535dda30d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/FootCoordsLowLevelInfo.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/FootCoordsLowLevelInfo.h new file mode 100644 index 000000000..05c99b66a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/FootCoordsLowLevelInfo.h @@ -0,0 +1,69 @@ +#ifndef _ROS_jsk_footstep_controller_FootCoordsLowLevelInfo_h +#define _ROS_jsk_footstep_controller_FootCoordsLowLevelInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_footstep_controller +{ + + class FootCoordsLowLevelInfo : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _raw_lleg_force_type; + _raw_lleg_force_type raw_lleg_force; + typedef float _raw_rleg_force_type; + _raw_rleg_force_type raw_rleg_force; + typedef float _filtered_lleg_force_type; + _filtered_lleg_force_type filtered_lleg_force; + typedef float _filtered_rleg_force_type; + _filtered_rleg_force_type filtered_rleg_force; + typedef float _threshold_type; + _threshold_type threshold; + + FootCoordsLowLevelInfo(): + header(), + raw_lleg_force(0), + raw_rleg_force(0), + filtered_lleg_force(0), + filtered_rleg_force(0), + threshold(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->raw_lleg_force); + offset += serializeAvrFloat64(outbuffer + offset, this->raw_rleg_force); + offset += serializeAvrFloat64(outbuffer + offset, this->filtered_lleg_force); + offset += serializeAvrFloat64(outbuffer + offset, this->filtered_rleg_force); + offset += serializeAvrFloat64(outbuffer + offset, this->threshold); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->raw_lleg_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->raw_rleg_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->filtered_lleg_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->filtered_rleg_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->threshold)); + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_controller/FootCoordsLowLevelInfo"; }; + virtual const char * getMD5() override { return "f03f7aaafde613e7d2247f1ee6314403"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosAction.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosAction.h new file mode 100644 index 000000000..045cea1e7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_controller_GoPosAction_h +#define _ROS_jsk_footstep_controller_GoPosAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "jsk_footstep_controller/GoPosActionGoal.h" +#include "jsk_footstep_controller/GoPosActionResult.h" +#include "jsk_footstep_controller/GoPosActionFeedback.h" + +namespace jsk_footstep_controller +{ + + class GoPosAction : public ros::Msg + { + public: + typedef jsk_footstep_controller::GoPosActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef jsk_footstep_controller::GoPosActionResult _action_result_type; + _action_result_type action_result; + typedef jsk_footstep_controller::GoPosActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + GoPosAction(): + 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 "jsk_footstep_controller/GoPosAction"; }; + virtual const char * getMD5() override { return "950fe2e36bc3f398cac7bf97f2a7fcb8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionFeedback.h new file mode 100644 index 000000000..c74b13757 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_controller_GoPosActionFeedback_h +#define _ROS_jsk_footstep_controller_GoPosActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "jsk_footstep_controller/GoPosFeedback.h" + +namespace jsk_footstep_controller +{ + + class GoPosActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef jsk_footstep_controller::GoPosFeedback _feedback_type; + _feedback_type feedback; + + GoPosActionFeedback(): + 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 "jsk_footstep_controller/GoPosActionFeedback"; }; + virtual const char * getMD5() override { return "f94482fa4ac6ec4eba7904ad5f096d59"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionGoal.h new file mode 100644 index 000000000..a68894766 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_controller_GoPosActionGoal_h +#define _ROS_jsk_footstep_controller_GoPosActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "jsk_footstep_controller/GoPosGoal.h" + +namespace jsk_footstep_controller +{ + + class GoPosActionGoal : 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 jsk_footstep_controller::GoPosGoal _goal_type; + _goal_type goal; + + GoPosActionGoal(): + 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 "jsk_footstep_controller/GoPosActionGoal"; }; + virtual const char * getMD5() override { return "1e10617102395e85ccbe04b2666246b4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionResult.h new file mode 100644 index 000000000..8fb905800 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_controller_GoPosActionResult_h +#define _ROS_jsk_footstep_controller_GoPosActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "jsk_footstep_controller/GoPosResult.h" + +namespace jsk_footstep_controller +{ + + class GoPosActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef jsk_footstep_controller::GoPosResult _result_type; + _result_type result; + + GoPosActionResult(): + 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 "jsk_footstep_controller/GoPosActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosFeedback.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosFeedback.h new file mode 100644 index 000000000..e9e1ce8d6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosFeedback.h @@ -0,0 +1,74 @@ +#ifndef _ROS_jsk_footstep_controller_GoPosFeedback_h +#define _ROS_jsk_footstep_controller_GoPosFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_footstep_controller +{ + + class GoPosFeedback : public ros::Msg + { + public: + typedef uint8_t _status_type; + _status_type status; + typedef int32_t _remaining_steps_type; + _remaining_steps_type remaining_steps; + enum { PRE_PLANNING = 0 }; + enum { PLANNING = 1 }; + enum { WALKING = 2 }; + enum { WAITING = 3 }; + enum { FINISH = 4 }; + + GoPosFeedback(): + status(0), + remaining_steps(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->status >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + union { + int32_t real; + uint32_t base; + } u_remaining_steps; + u_remaining_steps.real = this->remaining_steps; + *(outbuffer + offset + 0) = (u_remaining_steps.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_remaining_steps.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_remaining_steps.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_remaining_steps.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->remaining_steps); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->status); + union { + int32_t real; + uint32_t base; + } u_remaining_steps; + u_remaining_steps.base = 0; + u_remaining_steps.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_remaining_steps.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_remaining_steps.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_remaining_steps.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->remaining_steps = u_remaining_steps.real; + offset += sizeof(this->remaining_steps); + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_controller/GoPosFeedback"; }; + virtual const char * getMD5() override { return "4b0fee2db6d7d95642702999456a0721"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosGoal.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosGoal.h new file mode 100644 index 000000000..4b725a395 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosGoal.h @@ -0,0 +1,121 @@ +#ifndef _ROS_jsk_footstep_controller_GoPosGoal_h +#define _ROS_jsk_footstep_controller_GoPosGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_footstep_controller +{ + + class GoPosGoal : 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 uint8_t _action_type; + _action_type action; + enum { NEW_TARGET = 0 }; + enum { OVER_WRITE = 1 }; + enum { ABSOLUTE_NEW_TARGET = 2 }; + enum { ABSOLUTE_OVER_WRITE = 3 }; + + GoPosGoal(): + x(0), + y(0), + theta(0), + action(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); + *(outbuffer + offset + 0) = (this->action >> (8 * 0)) & 0xFF; + offset += sizeof(this->action); + 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); + this->action = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->action); + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_controller/GoPosGoal"; }; + virtual const char * getMD5() override { return "69d55867d9a94dddd5bc8dc8910558cf"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosResult.h new file mode 100644 index 000000000..97e987f67 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GoPosResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_jsk_footstep_controller_GoPosResult_h +#define _ROS_jsk_footstep_controller_GoPosResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_footstep_controller +{ + + class GoPosResult : public ros::Msg + { + public: + + GoPosResult() + { + } + + 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 "jsk_footstep_controller/GoPosResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GroundContactState.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GroundContactState.h new file mode 100644 index 000000000..969b88c31 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/GroundContactState.h @@ -0,0 +1,76 @@ +#ifndef _ROS_jsk_footstep_controller_GroundContactState_h +#define _ROS_jsk_footstep_controller_GroundContactState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_footstep_controller +{ + + class GroundContactState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _contact_state_type; + _contact_state_type contact_state; + typedef float _error_pitch_angle_type; + _error_pitch_angle_type error_pitch_angle; + typedef float _error_roll_angle_type; + _error_roll_angle_type error_roll_angle; + typedef float _error_yaw_angle_type; + _error_yaw_angle_type error_yaw_angle; + typedef float _error_z_type; + _error_z_type error_z; + enum { CONTACT_BOTH_GROUND = 1 }; + enum { CONTACT_AIR = 2 }; + enum { CONTACT_LLEG_GROUND = 3 }; + enum { CONTACT_RLEG_GROUND = 4 }; + enum { CONTACT_UNSTABLE = 5 }; + + GroundContactState(): + header(), + contact_state(0), + error_pitch_angle(0), + error_roll_angle(0), + error_yaw_angle(0), + error_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->contact_state >> (8 * 0)) & 0xFF; + offset += sizeof(this->contact_state); + offset += serializeAvrFloat64(outbuffer + offset, this->error_pitch_angle); + offset += serializeAvrFloat64(outbuffer + offset, this->error_roll_angle); + offset += serializeAvrFloat64(outbuffer + offset, this->error_yaw_angle); + offset += serializeAvrFloat64(outbuffer + offset, this->error_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->contact_state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->contact_state); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error_pitch_angle)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error_roll_angle)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error_yaw_angle)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error_z)); + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_controller/GroundContactState"; }; + virtual const char * getMD5() override { return "da0f3906e0a6eafe324ba582440493ea"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundAction.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundAction.h new file mode 100644 index 000000000..08e98464b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_controller_LookAroundGroundAction_h +#define _ROS_jsk_footstep_controller_LookAroundGroundAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "jsk_footstep_controller/LookAroundGroundActionGoal.h" +#include "jsk_footstep_controller/LookAroundGroundActionResult.h" +#include "jsk_footstep_controller/LookAroundGroundActionFeedback.h" + +namespace jsk_footstep_controller +{ + + class LookAroundGroundAction : public ros::Msg + { + public: + typedef jsk_footstep_controller::LookAroundGroundActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef jsk_footstep_controller::LookAroundGroundActionResult _action_result_type; + _action_result_type action_result; + typedef jsk_footstep_controller::LookAroundGroundActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + LookAroundGroundAction(): + 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 "jsk_footstep_controller/LookAroundGroundAction"; }; + virtual const char * getMD5() override { return "d5a016b49f278075666fbc901debbd08"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionFeedback.h new file mode 100644 index 000000000..2b89f1ac5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_controller_LookAroundGroundActionFeedback_h +#define _ROS_jsk_footstep_controller_LookAroundGroundActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "jsk_footstep_controller/LookAroundGroundFeedback.h" + +namespace jsk_footstep_controller +{ + + class LookAroundGroundActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef jsk_footstep_controller::LookAroundGroundFeedback _feedback_type; + _feedback_type feedback; + + LookAroundGroundActionFeedback(): + 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 "jsk_footstep_controller/LookAroundGroundActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionGoal.h new file mode 100644 index 000000000..a8df3d61c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_controller_LookAroundGroundActionGoal_h +#define _ROS_jsk_footstep_controller_LookAroundGroundActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "jsk_footstep_controller/LookAroundGroundGoal.h" + +namespace jsk_footstep_controller +{ + + class LookAroundGroundActionGoal : 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 jsk_footstep_controller::LookAroundGroundGoal _goal_type; + _goal_type goal; + + LookAroundGroundActionGoal(): + 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 "jsk_footstep_controller/LookAroundGroundActionGoal"; }; + virtual const char * getMD5() override { return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionResult.h new file mode 100644 index 000000000..090903136 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_controller_LookAroundGroundActionResult_h +#define _ROS_jsk_footstep_controller_LookAroundGroundActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "jsk_footstep_controller/LookAroundGroundResult.h" + +namespace jsk_footstep_controller +{ + + class LookAroundGroundActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef jsk_footstep_controller::LookAroundGroundResult _result_type; + _result_type result; + + LookAroundGroundActionResult(): + 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 "jsk_footstep_controller/LookAroundGroundActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundFeedback.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundFeedback.h new file mode 100644 index 000000000..44dc01327 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_jsk_footstep_controller_LookAroundGroundFeedback_h +#define _ROS_jsk_footstep_controller_LookAroundGroundFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_footstep_controller +{ + + class LookAroundGroundFeedback : public ros::Msg + { + public: + + LookAroundGroundFeedback() + { + } + + 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 "jsk_footstep_controller/LookAroundGroundFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundGoal.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundGoal.h new file mode 100644 index 000000000..83a0a8371 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_jsk_footstep_controller_LookAroundGroundGoal_h +#define _ROS_jsk_footstep_controller_LookAroundGroundGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_footstep_controller +{ + + class LookAroundGroundGoal : public ros::Msg + { + public: + + LookAroundGroundGoal() + { + } + + 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 "jsk_footstep_controller/LookAroundGroundGoal"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundResult.h new file mode 100644 index 000000000..376af084f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/LookAroundGroundResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_jsk_footstep_controller_LookAroundGroundResult_h +#define _ROS_jsk_footstep_controller_LookAroundGroundResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_footstep_controller +{ + + class LookAroundGroundResult : public ros::Msg + { + public: + + LookAroundGroundResult() + { + } + + 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 "jsk_footstep_controller/LookAroundGroundResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/RequireLog.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/RequireLog.h new file mode 100644 index 000000000..2399e5c00 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/RequireLog.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_RequireLog_h +#define _ROS_SERVICE_RequireLog_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_footstep_controller +{ + +static const char REQUIRELOG[] = "jsk_footstep_controller/RequireLog"; + + class RequireLogRequest : public ros::Msg + { + public: + + RequireLogRequest() + { + } + + 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 REQUIRELOG; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class RequireLogResponse : public ros::Msg + { + public: + typedef const char* _sexp_type; + _sexp_type sexp; + + RequireLogResponse(): + sexp("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_sexp = strlen(this->sexp); + varToArr(outbuffer + offset, length_sexp); + offset += 4; + memcpy(outbuffer + offset, this->sexp, length_sexp); + offset += length_sexp; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_sexp; + arrToVar(length_sexp, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_sexp; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_sexp-1]=0; + this->sexp = (char *)(inbuffer + offset-1); + offset += length_sexp; + return offset; + } + + virtual const char * getType() override { return REQUIRELOG; }; + virtual const char * getMD5() override { return "29db591ef5f8291f316c2b168fcbe017"; }; + + }; + + class RequireLog { + public: + typedef RequireLogRequest Request; + typedef RequireLogResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/RequireMonitorStatus.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/RequireMonitorStatus.h new file mode 100644 index 000000000..e896c5bb9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/RequireMonitorStatus.h @@ -0,0 +1,118 @@ +#ifndef _ROS_SERVICE_RequireMonitorStatus_h +#define _ROS_SERVICE_RequireMonitorStatus_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_footstep_controller +{ + +static const char REQUIREMONITORSTATUS[] = "jsk_footstep_controller/RequireMonitorStatus"; + + class RequireMonitorStatusRequest : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _threshold_type; + _threshold_type threshold; + + RequireMonitorStatusRequest(): + header(), + threshold(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_threshold; + u_threshold.real = this->threshold; + *(outbuffer + offset + 0) = (u_threshold.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_threshold.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_threshold.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_threshold.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->threshold); + 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_threshold; + u_threshold.base = 0; + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->threshold = u_threshold.real; + offset += sizeof(this->threshold); + return offset; + } + + virtual const char * getType() override { return REQUIREMONITORSTATUS; }; + virtual const char * getMD5() override { return "3dc898e59e7081935abe13d2f48debb8"; }; + + }; + + class RequireMonitorStatusResponse : public ros::Msg + { + public: + typedef bool _go_type; + _go_type go; + + RequireMonitorStatusResponse(): + go(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_go; + u_go.real = this->go; + *(outbuffer + offset + 0) = (u_go.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->go); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_go; + u_go.base = 0; + u_go.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->go = u_go.real; + offset += sizeof(this->go); + return offset; + } + + virtual const char * getType() override { return REQUIREMONITORSTATUS; }; + virtual const char * getMD5() override { return "50769ce61ea599387c084cd1aa050412"; }; + + }; + + class RequireMonitorStatus { + public: + typedef RequireMonitorStatusRequest Request; + typedef RequireMonitorStatusResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/SynchronizedForces.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/SynchronizedForces.h new file mode 100644 index 000000000..d58a49f38 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_controller/SynchronizedForces.h @@ -0,0 +1,67 @@ +#ifndef _ROS_jsk_footstep_controller_SynchronizedForces_h +#define _ROS_jsk_footstep_controller_SynchronizedForces_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/WrenchStamped.h" +#include "sensor_msgs/JointState.h" +#include "geometry_msgs/PointStamped.h" + +namespace jsk_footstep_controller +{ + + class SynchronizedForces : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::WrenchStamped _lleg_force_type; + _lleg_force_type lleg_force; + typedef geometry_msgs::WrenchStamped _rleg_force_type; + _rleg_force_type rleg_force; + typedef sensor_msgs::JointState _joint_angles_type; + _joint_angles_type joint_angles; + typedef geometry_msgs::PointStamped _zmp_type; + _zmp_type zmp; + + SynchronizedForces(): + header(), + lleg_force(), + rleg_force(), + joint_angles(), + zmp() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->lleg_force.serialize(outbuffer + offset); + offset += this->rleg_force.serialize(outbuffer + offset); + offset += this->joint_angles.serialize(outbuffer + offset); + offset += this->zmp.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->lleg_force.deserialize(inbuffer + offset); + offset += this->rleg_force.deserialize(inbuffer + offset); + offset += this->joint_angles.deserialize(inbuffer + offset); + offset += this->zmp.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_controller/SynchronizedForces"; }; + virtual const char * getMD5() override { return "9f34791d0775ccd699ccdfdb8b823128"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsAction.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsAction.h new file mode 100644 index 000000000..23b82dc1d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_msgs_ExecFootstepsAction_h +#define _ROS_jsk_footstep_msgs_ExecFootstepsAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "jsk_footstep_msgs/ExecFootstepsActionGoal.h" +#include "jsk_footstep_msgs/ExecFootstepsActionResult.h" +#include "jsk_footstep_msgs/ExecFootstepsActionFeedback.h" + +namespace jsk_footstep_msgs +{ + + class ExecFootstepsAction : public ros::Msg + { + public: + typedef jsk_footstep_msgs::ExecFootstepsActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef jsk_footstep_msgs::ExecFootstepsActionResult _action_result_type; + _action_result_type action_result; + typedef jsk_footstep_msgs::ExecFootstepsActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + ExecFootstepsAction(): + 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 "jsk_footstep_msgs/ExecFootstepsAction"; }; + virtual const char * getMD5() override { return "c92f25369ce56498a9f7b060b84a87e6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionFeedback.h new file mode 100644 index 000000000..7f3443de0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_msgs_ExecFootstepsActionFeedback_h +#define _ROS_jsk_footstep_msgs_ExecFootstepsActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "jsk_footstep_msgs/ExecFootstepsFeedback.h" + +namespace jsk_footstep_msgs +{ + + class ExecFootstepsActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef jsk_footstep_msgs::ExecFootstepsFeedback _feedback_type; + _feedback_type feedback; + + ExecFootstepsActionFeedback(): + 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 "jsk_footstep_msgs/ExecFootstepsActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionGoal.h new file mode 100644 index 000000000..149464106 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_msgs_ExecFootstepsActionGoal_h +#define _ROS_jsk_footstep_msgs_ExecFootstepsActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "jsk_footstep_msgs/ExecFootstepsGoal.h" + +namespace jsk_footstep_msgs +{ + + class ExecFootstepsActionGoal : 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 jsk_footstep_msgs::ExecFootstepsGoal _goal_type; + _goal_type goal; + + ExecFootstepsActionGoal(): + 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 "jsk_footstep_msgs/ExecFootstepsActionGoal"; }; + virtual const char * getMD5() override { return "38576fea93f66a22a5349190d02ffd87"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionResult.h new file mode 100644 index 000000000..d54ca9a62 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_msgs_ExecFootstepsActionResult_h +#define _ROS_jsk_footstep_msgs_ExecFootstepsActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "jsk_footstep_msgs/ExecFootstepsResult.h" + +namespace jsk_footstep_msgs +{ + + class ExecFootstepsActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef jsk_footstep_msgs::ExecFootstepsResult _result_type; + _result_type result; + + ExecFootstepsActionResult(): + 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 "jsk_footstep_msgs/ExecFootstepsActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsFeedback.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsFeedback.h new file mode 100644 index 000000000..455900e94 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_jsk_footstep_msgs_ExecFootstepsFeedback_h +#define _ROS_jsk_footstep_msgs_ExecFootstepsFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_footstep_msgs +{ + + class ExecFootstepsFeedback : public ros::Msg + { + public: + + ExecFootstepsFeedback() + { + } + + 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 "jsk_footstep_msgs/ExecFootstepsFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsGoal.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsGoal.h new file mode 100644 index 000000000..7d41623de --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_jsk_footstep_msgs_ExecFootstepsGoal_h +#define _ROS_jsk_footstep_msgs_ExecFootstepsGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "jsk_footstep_msgs/FootstepArray.h" + +namespace jsk_footstep_msgs +{ + + class ExecFootstepsGoal : public ros::Msg + { + public: + typedef jsk_footstep_msgs::FootstepArray _footstep_type; + _footstep_type footstep; + typedef uint8_t _strategy_type; + _strategy_type strategy; + enum { NEW_TARGET = 0 }; + enum { RESUME = 1 }; + + ExecFootstepsGoal(): + footstep(), + strategy(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->footstep.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->strategy >> (8 * 0)) & 0xFF; + offset += sizeof(this->strategy); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->footstep.deserialize(inbuffer + offset); + this->strategy = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->strategy); + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_msgs/ExecFootstepsGoal"; }; + virtual const char * getMD5() override { return "bb8b96be7f0085372e05a467f65017bb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsResult.h new file mode 100644 index 000000000..65555cadb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/ExecFootstepsResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_jsk_footstep_msgs_ExecFootstepsResult_h +#define _ROS_jsk_footstep_msgs_ExecFootstepsResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_footstep_msgs +{ + + class ExecFootstepsResult : public ros::Msg + { + public: + + ExecFootstepsResult() + { + } + + 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 "jsk_footstep_msgs/ExecFootstepsResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/Footstep.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/Footstep.h new file mode 100644 index 000000000..533257fd1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/Footstep.h @@ -0,0 +1,155 @@ +#ifndef _ROS_jsk_footstep_msgs_Footstep_h +#define _ROS_jsk_footstep_msgs_Footstep_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "ros/duration.h" +#include "geometry_msgs/Vector3.h" + +namespace jsk_footstep_msgs +{ + + class Footstep : public ros::Msg + { + public: + typedef uint8_t _leg_type; + _leg_type leg; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef ros::Duration _duration_type; + _duration_type duration; + typedef uint32_t _footstep_group_type; + _footstep_group_type footstep_group; + typedef geometry_msgs::Vector3 _dimensions_type; + _dimensions_type dimensions; + typedef geometry_msgs::Vector3 _offset_type; + _offset_type offset; + typedef float _swing_height_type; + _swing_height_type swing_height; + typedef float _cost_type; + _cost_type cost; + enum { RIGHT = 2 }; + enum { LEFT = 1 }; + enum { REJECTED = 3 }; + enum { APPROVED = 4 }; + enum { LLEG = 1 }; + enum { RLEG = 2 }; + enum { LARM = 5 }; + enum { RARM = 6 }; + + Footstep(): + leg(0), + pose(), + duration(), + footstep_group(0), + dimensions(), + offset(), + swing_height(0), + cost(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->leg >> (8 * 0)) & 0xFF; + offset += sizeof(this->leg); + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + *(outbuffer + offset + 0) = (this->footstep_group >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->footstep_group >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->footstep_group >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->footstep_group >> (8 * 3)) & 0xFF; + offset += sizeof(this->footstep_group); + offset += this->dimensions.serialize(outbuffer + offset); + offset += this->offset.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_swing_height; + u_swing_height.real = this->swing_height; + *(outbuffer + offset + 0) = (u_swing_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_swing_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_swing_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_swing_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->swing_height); + union { + float real; + uint32_t base; + } u_cost; + u_cost.real = this->cost; + *(outbuffer + offset + 0) = (u_cost.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cost.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cost.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cost.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cost); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->leg = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->leg); + offset += this->pose.deserialize(inbuffer + offset); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + this->footstep_group = ((uint32_t) (*(inbuffer + offset))); + this->footstep_group |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->footstep_group |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->footstep_group |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->footstep_group); + offset += this->dimensions.deserialize(inbuffer + offset); + offset += this->offset.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_swing_height; + u_swing_height.base = 0; + u_swing_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_swing_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_swing_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_swing_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->swing_height = u_swing_height.real; + offset += sizeof(this->swing_height); + union { + float real; + uint32_t base; + } u_cost; + u_cost.base = 0; + u_cost.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cost.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cost.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cost.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cost = u_cost.real; + offset += sizeof(this->cost); + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_msgs/Footstep"; }; + virtual const char * getMD5() override { return "d890b275b63a90fe5f22a21e9a879971"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/FootstepArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/FootstepArray.h new file mode 100644 index 000000000..2c8ada124 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/FootstepArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_footstep_msgs_FootstepArray_h +#define _ROS_jsk_footstep_msgs_FootstepArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_footstep_msgs/Footstep.h" + +namespace jsk_footstep_msgs +{ + + class FootstepArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t footsteps_length; + typedef jsk_footstep_msgs::Footstep _footsteps_type; + _footsteps_type st_footsteps; + _footsteps_type * footsteps; + + FootstepArray(): + header(), + footsteps_length(0), st_footsteps(), footsteps(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->footsteps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->footsteps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->footsteps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->footsteps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->footsteps_length); + for( uint32_t i = 0; i < footsteps_length; i++){ + offset += this->footsteps[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t footsteps_lengthT = ((uint32_t) (*(inbuffer + offset))); + footsteps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + footsteps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + footsteps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->footsteps_length); + if(footsteps_lengthT > footsteps_length) + this->footsteps = (jsk_footstep_msgs::Footstep*)realloc(this->footsteps, footsteps_lengthT * sizeof(jsk_footstep_msgs::Footstep)); + footsteps_length = footsteps_lengthT; + for( uint32_t i = 0; i < footsteps_length; i++){ + offset += this->st_footsteps.deserialize(inbuffer + offset); + memcpy( &(this->footsteps[i]), &(this->st_footsteps), sizeof(jsk_footstep_msgs::Footstep)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_msgs/FootstepArray"; }; + virtual const char * getMD5() override { return "385bc396845a4680214262a4679d83b3"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsAction.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsAction.h new file mode 100644 index 000000000..8d897c2ff --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_msgs_PlanFootstepsAction_h +#define _ROS_jsk_footstep_msgs_PlanFootstepsAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "jsk_footstep_msgs/PlanFootstepsActionGoal.h" +#include "jsk_footstep_msgs/PlanFootstepsActionResult.h" +#include "jsk_footstep_msgs/PlanFootstepsActionFeedback.h" + +namespace jsk_footstep_msgs +{ + + class PlanFootstepsAction : public ros::Msg + { + public: + typedef jsk_footstep_msgs::PlanFootstepsActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef jsk_footstep_msgs::PlanFootstepsActionResult _action_result_type; + _action_result_type action_result; + typedef jsk_footstep_msgs::PlanFootstepsActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PlanFootstepsAction(): + 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 "jsk_footstep_msgs/PlanFootstepsAction"; }; + virtual const char * getMD5() override { return "d801380a2d476b66f9efad45f18ff807"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionFeedback.h new file mode 100644 index 000000000..0ebfdd486 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_msgs_PlanFootstepsActionFeedback_h +#define _ROS_jsk_footstep_msgs_PlanFootstepsActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "jsk_footstep_msgs/PlanFootstepsFeedback.h" + +namespace jsk_footstep_msgs +{ + + class PlanFootstepsActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef jsk_footstep_msgs::PlanFootstepsFeedback _feedback_type; + _feedback_type feedback; + + PlanFootstepsActionFeedback(): + 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 "jsk_footstep_msgs/PlanFootstepsActionFeedback"; }; + virtual const char * getMD5() override { return "c827ac0ba59dca5c1bf7b9bb97d2a1ae"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionGoal.h new file mode 100644 index 000000000..74db165a2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_msgs_PlanFootstepsActionGoal_h +#define _ROS_jsk_footstep_msgs_PlanFootstepsActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "jsk_footstep_msgs/PlanFootstepsGoal.h" + +namespace jsk_footstep_msgs +{ + + class PlanFootstepsActionGoal : 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 jsk_footstep_msgs::PlanFootstepsGoal _goal_type; + _goal_type goal; + + PlanFootstepsActionGoal(): + 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 "jsk_footstep_msgs/PlanFootstepsActionGoal"; }; + virtual const char * getMD5() override { return "4f600ecca20b1d57f2e38560d26042c4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionResult.h new file mode 100644 index 000000000..210d99b35 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_footstep_msgs_PlanFootstepsActionResult_h +#define _ROS_jsk_footstep_msgs_PlanFootstepsActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "jsk_footstep_msgs/PlanFootstepsResult.h" + +namespace jsk_footstep_msgs +{ + + class PlanFootstepsActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef jsk_footstep_msgs::PlanFootstepsResult _result_type; + _result_type result; + + PlanFootstepsActionResult(): + 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 "jsk_footstep_msgs/PlanFootstepsActionResult"; }; + virtual const char * getMD5() override { return "12a9334ae88f7e7881a5ffdea1dd3de1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsFeedback.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsFeedback.h new file mode 100644 index 000000000..ae4018358 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsFeedback.h @@ -0,0 +1,44 @@ +#ifndef _ROS_jsk_footstep_msgs_PlanFootstepsFeedback_h +#define _ROS_jsk_footstep_msgs_PlanFootstepsFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "jsk_footstep_msgs/FootstepArray.h" + +namespace jsk_footstep_msgs +{ + + class PlanFootstepsFeedback : public ros::Msg + { + public: + typedef jsk_footstep_msgs::FootstepArray _feedback_type; + _feedback_type feedback; + + PlanFootstepsFeedback(): + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_msgs/PlanFootstepsFeedback"; }; + virtual const char * getMD5() override { return "5f4757afbf7a130712f963e49c7f5f00"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsGoal.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsGoal.h new file mode 100644 index 000000000..3fa54460f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsGoal.h @@ -0,0 +1,73 @@ +#ifndef _ROS_jsk_footstep_msgs_PlanFootstepsGoal_h +#define _ROS_jsk_footstep_msgs_PlanFootstepsGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "jsk_footstep_msgs/FootstepArray.h" +#include "ros/duration.h" + +namespace jsk_footstep_msgs +{ + + class PlanFootstepsGoal : public ros::Msg + { + public: + typedef jsk_footstep_msgs::FootstepArray _goal_footstep_type; + _goal_footstep_type goal_footstep; + typedef jsk_footstep_msgs::FootstepArray _initial_footstep_type; + _initial_footstep_type initial_footstep; + typedef ros::Duration _timeout_type; + _timeout_type timeout; + + PlanFootstepsGoal(): + goal_footstep(), + initial_footstep(), + timeout() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->goal_footstep.serialize(outbuffer + offset); + offset += this->initial_footstep.serialize(outbuffer + offset); + *(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); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->goal_footstep.deserialize(inbuffer + offset); + offset += this->initial_footstep.deserialize(inbuffer + offset); + 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); + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_msgs/PlanFootstepsGoal"; }; + virtual const char * getMD5() override { return "68011023a311776030c53b8ca437fae1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsResult.h new file mode 100644 index 000000000..dbf880faf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_msgs/PlanFootstepsResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_jsk_footstep_msgs_PlanFootstepsResult_h +#define _ROS_jsk_footstep_msgs_PlanFootstepsResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "jsk_footstep_msgs/FootstepArray.h" + +namespace jsk_footstep_msgs +{ + + class PlanFootstepsResult : public ros::Msg + { + public: + typedef jsk_footstep_msgs::FootstepArray _result_type; + _result_type result; + + PlanFootstepsResult(): + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_footstep_msgs/PlanFootstepsResult"; }; + virtual const char * getMD5() override { return "951c674749b5b8b08d5eba2e3e62aedd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/ChangeSuccessor.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/ChangeSuccessor.h new file mode 100644 index 000000000..8cc48ddec --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/ChangeSuccessor.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_ChangeSuccessor_h +#define _ROS_SERVICE_ChangeSuccessor_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_footstep_planner +{ + +static const char CHANGESUCCESSOR[] = "jsk_footstep_planner/ChangeSuccessor"; + + class ChangeSuccessorRequest : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + + ChangeSuccessorRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return CHANGESUCCESSOR; }; + virtual const char * getMD5() override { return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class ChangeSuccessorResponse : public ros::Msg + { + public: + + ChangeSuccessorResponse() + { + } + + 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 CHANGESUCCESSOR; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ChangeSuccessor { + public: + typedef ChangeSuccessorRequest Request; + typedef ChangeSuccessorResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/CollisionBoundingBoxInfo.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/CollisionBoundingBoxInfo.h new file mode 100644 index 000000000..9f971b4a4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/CollisionBoundingBoxInfo.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_CollisionBoundingBoxInfo_h +#define _ROS_SERVICE_CollisionBoundingBoxInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Vector3.h" + +namespace jsk_footstep_planner +{ + +static const char COLLISIONBOUNDINGBOXINFO[] = "jsk_footstep_planner/CollisionBoundingBoxInfo"; + + class CollisionBoundingBoxInfoRequest : public ros::Msg + { + public: + + CollisionBoundingBoxInfoRequest() + { + } + + 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 COLLISIONBOUNDINGBOXINFO; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class CollisionBoundingBoxInfoResponse : public ros::Msg + { + public: + typedef geometry_msgs::Vector3 _box_dimensions_type; + _box_dimensions_type box_dimensions; + typedef geometry_msgs::Pose _box_offset_type; + _box_offset_type box_offset; + + CollisionBoundingBoxInfoResponse(): + box_dimensions(), + box_offset() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->box_dimensions.serialize(outbuffer + offset); + offset += this->box_offset.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->box_dimensions.deserialize(inbuffer + offset); + offset += this->box_offset.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return COLLISIONBOUNDINGBOXINFO; }; + virtual const char * getMD5() override { return "2ea386819a2c4e5466f51a04205f588b"; }; + + }; + + class CollisionBoundingBoxInfo { + public: + typedef CollisionBoundingBoxInfoRequest Request; + typedef CollisionBoundingBoxInfoResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/ProjectFootstep.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/ProjectFootstep.h new file mode 100644 index 000000000..a2a26427f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/ProjectFootstep.h @@ -0,0 +1,126 @@ +#ifndef _ROS_SERVICE_ProjectFootstep_h +#define _ROS_SERVICE_ProjectFootstep_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_footstep_msgs/FootstepArray.h" + +namespace jsk_footstep_planner +{ + +static const char PROJECTFOOTSTEP[] = "jsk_footstep_planner/ProjectFootstep"; + + class ProjectFootstepRequest : public ros::Msg + { + public: + typedef uint8_t _project_type_type; + _project_type_type project_type; + typedef jsk_footstep_msgs::FootstepArray _input_type; + _input_type input; + + ProjectFootstepRequest(): + project_type(0), + input() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->project_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->project_type); + offset += this->input.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->project_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->project_type); + offset += this->input.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return PROJECTFOOTSTEP; }; + virtual const char * getMD5() override { return "aa8e4e9b4dd5cb69940dd879b6fecb96"; }; + + }; + + class ProjectFootstepResponse : public ros::Msg + { + public: + uint32_t success_length; + typedef bool _success_type; + _success_type st_success; + _success_type * success; + typedef jsk_footstep_msgs::FootstepArray _result_type; + _result_type result; + + ProjectFootstepResponse(): + success_length(0), st_success(), success(nullptr), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->success_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->success_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->success_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->success_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->success_length); + for( uint32_t i = 0; i < success_length; i++){ + union { + bool real; + uint8_t base; + } u_successi; + u_successi.real = this->success[i]; + *(outbuffer + offset + 0) = (u_successi.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success[i]); + } + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t success_lengthT = ((uint32_t) (*(inbuffer + offset))); + success_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + success_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + success_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->success_length); + if(success_lengthT > success_length) + this->success = (bool*)realloc(this->success, success_lengthT * sizeof(bool)); + success_length = success_lengthT; + for( uint32_t i = 0; i < success_length; i++){ + union { + bool real; + uint8_t base; + } u_st_success; + u_st_success.base = 0; + u_st_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_success = u_st_success.real; + offset += sizeof(this->st_success); + memcpy( &(this->success[i]), &(this->st_success), sizeof(bool)); + } + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return PROJECTFOOTSTEP; }; + virtual const char * getMD5() override { return "0e35d9b6cc53f98167d0eeaf015660dc"; }; + + }; + + class ProjectFootstep { + public: + typedef ProjectFootstepRequest Request; + typedef ProjectFootstepResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/SetHeuristicPath.h b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/SetHeuristicPath.h new file mode 100644 index 000000000..0549f98f0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_footstep_planner/SetHeuristicPath.h @@ -0,0 +1,96 @@ +#ifndef _ROS_SERVICE_SetHeuristicPath_h +#define _ROS_SERVICE_SetHeuristicPath_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" + +namespace jsk_footstep_planner +{ + +static const char SETHEURISTICPATH[] = "jsk_footstep_planner/SetHeuristicPath"; + + class SetHeuristicPathRequest : public ros::Msg + { + public: + uint32_t segments_length; + typedef geometry_msgs::Point _segments_type; + _segments_type st_segments; + _segments_type * segments; + + SetHeuristicPathRequest(): + segments_length(0), st_segments(), segments(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 = (geometry_msgs::Point*)realloc(this->segments, segments_lengthT * sizeof(geometry_msgs::Point)); + 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(geometry_msgs::Point)); + } + return offset; + } + + virtual const char * getType() override { return SETHEURISTICPATH; }; + virtual const char * getMD5() override { return "622321b353cfaa79892ba07be3ea7d2e"; }; + + }; + + class SetHeuristicPathResponse : public ros::Msg + { + public: + + SetHeuristicPathResponse() + { + } + + 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 SETHEURISTICPATH; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetHeuristicPath { + public: + typedef SetHeuristicPathRequest Request; + typedef SetHeuristicPathResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Action.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Action.h new file mode 100644 index 000000000..666eaf91c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Action.h @@ -0,0 +1,197 @@ +#ifndef _ROS_jsk_gui_msgs_Action_h +#define _ROS_jsk_gui_msgs_Action_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_gui_msgs +{ + + class Action : public ros::Msg + { + public: + typedef const char* _task_name_type; + _task_name_type task_name; + typedef int64_t _arm_id_type; + _arm_id_type arm_id; + typedef const char* _state_type; + _state_type state; + typedef float _state_value_type; + _state_value_type state_value; + typedef const char* _direction_type; + _direction_type direction; + typedef float _direction_value_type; + _direction_value_type direction_value; + typedef int64_t _touch_x_type; + _touch_x_type touch_x; + typedef int64_t _touch_y_type; + _touch_y_type touch_y; + enum { RARMID = 0 }; + enum { LARMID = 1 }; + + Action(): + task_name(""), + arm_id(0), + state(""), + state_value(0), + direction(""), + direction_value(0), + touch_x(0), + touch_y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_task_name = strlen(this->task_name); + varToArr(outbuffer + offset, length_task_name); + offset += 4; + memcpy(outbuffer + offset, this->task_name, length_task_name); + offset += length_task_name; + union { + int64_t real; + uint64_t base; + } u_arm_id; + u_arm_id.real = this->arm_id; + *(outbuffer + offset + 0) = (u_arm_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_arm_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_arm_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_arm_id.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_arm_id.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_arm_id.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_arm_id.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_arm_id.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->arm_id); + uint32_t length_state = strlen(this->state); + varToArr(outbuffer + offset, length_state); + offset += 4; + memcpy(outbuffer + offset, this->state, length_state); + offset += length_state; + offset += serializeAvrFloat64(outbuffer + offset, this->state_value); + uint32_t length_direction = strlen(this->direction); + varToArr(outbuffer + offset, length_direction); + offset += 4; + memcpy(outbuffer + offset, this->direction, length_direction); + offset += length_direction; + offset += serializeAvrFloat64(outbuffer + offset, this->direction_value); + union { + int64_t real; + uint64_t base; + } u_touch_x; + u_touch_x.real = this->touch_x; + *(outbuffer + offset + 0) = (u_touch_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_touch_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_touch_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_touch_x.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_touch_x.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_touch_x.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_touch_x.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_touch_x.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->touch_x); + union { + int64_t real; + uint64_t base; + } u_touch_y; + u_touch_y.real = this->touch_y; + *(outbuffer + offset + 0) = (u_touch_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_touch_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_touch_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_touch_y.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_touch_y.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_touch_y.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_touch_y.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_touch_y.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->touch_y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_task_name; + arrToVar(length_task_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_task_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_task_name-1]=0; + this->task_name = (char *)(inbuffer + offset-1); + offset += length_task_name; + union { + int64_t real; + uint64_t base; + } u_arm_id; + u_arm_id.base = 0; + u_arm_id.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_arm_id.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_arm_id.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_arm_id.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_arm_id.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_arm_id.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_arm_id.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_arm_id.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->arm_id = u_arm_id.real; + offset += sizeof(this->arm_id); + 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; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->state_value)); + uint32_t length_direction; + arrToVar(length_direction, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_direction; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_direction-1]=0; + this->direction = (char *)(inbuffer + offset-1); + offset += length_direction; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->direction_value)); + union { + int64_t real; + uint64_t base; + } u_touch_x; + u_touch_x.base = 0; + u_touch_x.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_touch_x.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_touch_x.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_touch_x.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_touch_x.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_touch_x.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_touch_x.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_touch_x.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->touch_x = u_touch_x.real; + offset += sizeof(this->touch_x); + union { + int64_t real; + uint64_t base; + } u_touch_y; + u_touch_y.base = 0; + u_touch_y.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_touch_y.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_touch_y.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_touch_y.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_touch_y.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_touch_y.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_touch_y.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_touch_y.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->touch_y = u_touch_y.real; + offset += sizeof(this->touch_y); + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/Action"; }; + virtual const char * getMD5() override { return "d81dc8475ff89ce7097d2e73ebfc2591"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/AndroidSensor.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/AndroidSensor.h new file mode 100644 index 000000000..dcbb1184e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/AndroidSensor.h @@ -0,0 +1,68 @@ +#ifndef _ROS_jsk_gui_msgs_AndroidSensor_h +#define _ROS_jsk_gui_msgs_AndroidSensor_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_gui_msgs +{ + + class AndroidSensor : public ros::Msg + { + public: + typedef float _accel_x_type; + _accel_x_type accel_x; + typedef float _accel_y_type; + _accel_y_type accel_y; + typedef float _accel_z_type; + _accel_z_type accel_z; + typedef float _orientation_x_type; + _orientation_x_type orientation_x; + typedef float _orientation_y_type; + _orientation_y_type orientation_y; + typedef float _orientation_z_type; + _orientation_z_type orientation_z; + + AndroidSensor(): + accel_x(0), + accel_y(0), + accel_z(0), + orientation_x(0), + orientation_y(0), + orientation_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->accel_x); + offset += serializeAvrFloat64(outbuffer + offset, this->accel_y); + offset += serializeAvrFloat64(outbuffer + offset, this->accel_z); + offset += serializeAvrFloat64(outbuffer + offset, this->orientation_x); + offset += serializeAvrFloat64(outbuffer + offset, this->orientation_y); + offset += serializeAvrFloat64(outbuffer + offset, this->orientation_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->accel_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->accel_y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->accel_z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->orientation_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->orientation_y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->orientation_z)); + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/AndroidSensor"; }; + virtual const char * getMD5() override { return "d832dbe3be7e7f061d963f2188f1a407"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/DeviceSensor.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/DeviceSensor.h new file mode 100644 index 000000000..2907d8149 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/DeviceSensor.h @@ -0,0 +1,63 @@ +#ifndef _ROS_jsk_gui_msgs_DeviceSensor_h +#define _ROS_jsk_gui_msgs_DeviceSensor_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_gui_msgs +{ + + class DeviceSensor : public ros::Msg + { + public: + typedef float _temperature_type; + _temperature_type temperature; + typedef float _relative_humidity_type; + _relative_humidity_type relative_humidity; + typedef float _light_type; + _light_type light; + typedef float _pressure_type; + _pressure_type pressure; + typedef float _proximity_type; + _proximity_type proximity; + + DeviceSensor(): + temperature(0), + relative_humidity(0), + light(0), + pressure(0), + proximity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->temperature); + offset += serializeAvrFloat64(outbuffer + offset, this->relative_humidity); + offset += serializeAvrFloat64(outbuffer + offset, this->light); + offset += serializeAvrFloat64(outbuffer + offset, this->pressure); + offset += serializeAvrFloat64(outbuffer + offset, this->proximity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->temperature)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->relative_humidity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->light)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pressure)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->proximity)); + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/DeviceSensor"; }; + virtual const char * getMD5() override { return "d3861ba768b988b4c249337d4dc6552d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Gravity.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Gravity.h new file mode 100644 index 000000000..057fe5b36 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Gravity.h @@ -0,0 +1,44 @@ +#ifndef _ROS_jsk_gui_msgs_Gravity_h +#define _ROS_jsk_gui_msgs_Gravity_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace jsk_gui_msgs +{ + + class Gravity : public ros::Msg + { + public: + typedef geometry_msgs::Vector3 _gravity_type; + _gravity_type gravity; + + Gravity(): + gravity() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->gravity.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->gravity.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/Gravity"; }; + virtual const char * getMD5() override { return "86facaf836997cbbc4faee170616f59e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/MagneticField.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/MagneticField.h new file mode 100644 index 000000000..63c0bcaf2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/MagneticField.h @@ -0,0 +1,44 @@ +#ifndef _ROS_jsk_gui_msgs_MagneticField_h +#define _ROS_jsk_gui_msgs_MagneticField_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace jsk_gui_msgs +{ + + class MagneticField : public ros::Msg + { + public: + typedef geometry_msgs::Vector3 _magneticfield_type; + _magneticfield_type magneticfield; + + MagneticField(): + magneticfield() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->magneticfield.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->magneticfield.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/MagneticField"; }; + virtual const char * getMD5() override { return "a924df7c82a527d1b76508ed8354604b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/MultiTouch.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/MultiTouch.h new file mode 100644 index 000000000..0fef2ef7f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/MultiTouch.h @@ -0,0 +1,64 @@ +#ifndef _ROS_jsk_gui_msgs_MultiTouch_h +#define _ROS_jsk_gui_msgs_MultiTouch_h + +#include +#include +#include +#include "ros/msg.h" +#include "jsk_gui_msgs/Touch.h" + +namespace jsk_gui_msgs +{ + + class MultiTouch : public ros::Msg + { + public: + uint32_t touches_length; + typedef jsk_gui_msgs::Touch _touches_type; + _touches_type st_touches; + _touches_type * touches; + + MultiTouch(): + touches_length(0), st_touches(), touches(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->touches_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->touches_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->touches_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->touches_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->touches_length); + for( uint32_t i = 0; i < touches_length; i++){ + offset += this->touches[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t touches_lengthT = ((uint32_t) (*(inbuffer + offset))); + touches_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + touches_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + touches_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->touches_length); + if(touches_lengthT > touches_length) + this->touches = (jsk_gui_msgs::Touch*)realloc(this->touches, touches_lengthT * sizeof(jsk_gui_msgs::Touch)); + touches_length = touches_lengthT; + for( uint32_t i = 0; i < touches_length; i++){ + offset += this->st_touches.deserialize(inbuffer + offset); + memcpy( &(this->touches[i]), &(this->st_touches), sizeof(jsk_gui_msgs::Touch)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/MultiTouch"; }; + virtual const char * getMD5() override { return "9f4a309588ef669e69a71aa5601ea65e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Query.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Query.h new file mode 100644 index 000000000..15a5cb1c8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Query.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_Query_h +#define _ROS_SERVICE_Query_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_gui_msgs +{ + +static const char QUERY[] = "jsk_gui_msgs/Query"; + + class QueryRequest : public ros::Msg + { + public: + typedef int32_t _id_type; + _id_type id; + + QueryRequest(): + id(0) + { + } + + 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); + 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); + return offset; + } + + virtual const char * getType() override { return QUERY; }; + virtual const char * getMD5() override { return "c5e4a7d59c68f74eabcec876a00216aa"; }; + + }; + + class QueryResponse : public ros::Msg + { + public: + typedef const char* _res_type; + _res_type res; + + QueryResponse(): + res("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_res = strlen(this->res); + varToArr(outbuffer + offset, length_res); + offset += 4; + memcpy(outbuffer + offset, this->res, length_res); + offset += length_res; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_res; + arrToVar(length_res, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_res; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_res-1]=0; + this->res = (char *)(inbuffer + offset-1); + offset += length_res; + return offset; + } + + virtual const char * getType() override { return QUERY; }; + virtual const char * getMD5() override { return "53af918a2a4a2a182c184142fff49b0c"; }; + + }; + + class Query { + public: + typedef QueryRequest Request; + typedef QueryResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/SlackMessage.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/SlackMessage.h new file mode 100644 index 000000000..766b848ce --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/SlackMessage.h @@ -0,0 +1,78 @@ +#ifndef _ROS_jsk_gui_msgs_SlackMessage_h +#define _ROS_jsk_gui_msgs_SlackMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/Image.h" + +namespace jsk_gui_msgs +{ + + class SlackMessage : public ros::Msg + { + public: + typedef const char* _channel_type; + _channel_type channel; + typedef const char* _text_type; + _text_type text; + typedef sensor_msgs::Image _image_type; + _image_type image; + + SlackMessage(): + channel(""), + text(""), + image() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_channel = strlen(this->channel); + varToArr(outbuffer + offset, length_channel); + offset += 4; + memcpy(outbuffer + offset, this->channel, length_channel); + offset += length_channel; + uint32_t length_text = strlen(this->text); + varToArr(outbuffer + offset, length_text); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + offset += this->image.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_channel; + arrToVar(length_channel, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_channel; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_channel-1]=0; + this->channel = (char *)(inbuffer + offset-1); + offset += length_channel; + 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; + offset += this->image.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/SlackMessage"; }; + virtual const char * getMD5() override { return "b68991d3b722980bd0f3eeeeee52635b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Tablet.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Tablet.h new file mode 100644 index 000000000..711e35d0b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Tablet.h @@ -0,0 +1,116 @@ +#ifndef _ROS_jsk_gui_msgs_Tablet_h +#define _ROS_jsk_gui_msgs_Tablet_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_gui_msgs/Action.h" +#include "jsk_gui_msgs/DeviceSensor.h" +#include "jsk_gui_msgs/Touch.h" + +namespace jsk_gui_msgs +{ + + class Tablet : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _hardware_name_type; + _hardware_name_type hardware_name; + typedef const char* _hardware_id_type; + _hardware_id_type hardware_id; + typedef jsk_gui_msgs::Action _action_type; + _action_type action; + typedef jsk_gui_msgs::DeviceSensor _sensor_type; + _sensor_type sensor; + uint32_t touches_length; + typedef jsk_gui_msgs::Touch _touches_type; + _touches_type st_touches; + _touches_type * touches; + + Tablet(): + header(), + hardware_name(""), + hardware_id(""), + action(), + sensor(), + touches_length(0), st_touches(), touches(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_hardware_name = strlen(this->hardware_name); + varToArr(outbuffer + offset, length_hardware_name); + offset += 4; + memcpy(outbuffer + offset, this->hardware_name, length_hardware_name); + offset += length_hardware_name; + uint32_t length_hardware_id = strlen(this->hardware_id); + varToArr(outbuffer + offset, length_hardware_id); + offset += 4; + memcpy(outbuffer + offset, this->hardware_id, length_hardware_id); + offset += length_hardware_id; + offset += this->action.serialize(outbuffer + offset); + offset += this->sensor.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->touches_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->touches_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->touches_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->touches_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->touches_length); + for( uint32_t i = 0; i < touches_length; i++){ + offset += this->touches[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_hardware_name; + arrToVar(length_hardware_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_hardware_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_hardware_name-1]=0; + this->hardware_name = (char *)(inbuffer + offset-1); + offset += length_hardware_name; + uint32_t length_hardware_id; + arrToVar(length_hardware_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_hardware_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_hardware_id-1]=0; + this->hardware_id = (char *)(inbuffer + offset-1); + offset += length_hardware_id; + offset += this->action.deserialize(inbuffer + offset); + offset += this->sensor.deserialize(inbuffer + offset); + uint32_t touches_lengthT = ((uint32_t) (*(inbuffer + offset))); + touches_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + touches_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + touches_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->touches_length); + if(touches_lengthT > touches_length) + this->touches = (jsk_gui_msgs::Touch*)realloc(this->touches, touches_lengthT * sizeof(jsk_gui_msgs::Touch)); + touches_length = touches_lengthT; + for( uint32_t i = 0; i < touches_length; i++){ + offset += this->st_touches.deserialize(inbuffer + offset); + memcpy( &(this->touches[i]), &(this->st_touches), sizeof(jsk_gui_msgs::Touch)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/Tablet"; }; + virtual const char * getMD5() override { return "0bab196c7b214826d8c27d7bd5f924f6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Touch.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Touch.h new file mode 100644 index 000000000..95f7baac8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/Touch.h @@ -0,0 +1,144 @@ +#ifndef _ROS_jsk_gui_msgs_Touch_h +#define _ROS_jsk_gui_msgs_Touch_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_gui_msgs +{ + + class Touch : public ros::Msg + { + public: + typedef int64_t _finger_id_type; + _finger_id_type finger_id; + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef int64_t _image_width_type; + _image_width_type image_width; + typedef int64_t _image_height_type; + _image_height_type image_height; + + Touch(): + finger_id(0), + x(0), + y(0), + image_width(0), + image_height(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_finger_id; + u_finger_id.real = this->finger_id; + *(outbuffer + offset + 0) = (u_finger_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_finger_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_finger_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_finger_id.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_finger_id.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_finger_id.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_finger_id.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_finger_id.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->finger_id); + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + union { + int64_t real; + uint64_t base; + } u_image_width; + u_image_width.real = this->image_width; + *(outbuffer + offset + 0) = (u_image_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_image_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_image_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_image_width.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_image_width.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_image_width.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_image_width.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_image_width.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->image_width); + union { + int64_t real; + uint64_t base; + } u_image_height; + u_image_height.real = this->image_height; + *(outbuffer + offset + 0) = (u_image_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_image_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_image_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_image_height.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_image_height.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_image_height.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_image_height.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_image_height.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->image_height); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_finger_id; + u_finger_id.base = 0; + u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_finger_id.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->finger_id = u_finger_id.real; + offset += sizeof(this->finger_id); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + union { + int64_t real; + uint64_t base; + } u_image_width; + u_image_width.base = 0; + u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_image_width.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->image_width = u_image_width.real; + offset += sizeof(this->image_width); + union { + int64_t real; + uint64_t base; + } u_image_height; + u_image_height.base = 0; + u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_image_height.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->image_height = u_image_height.real; + offset += sizeof(this->image_height); + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/Touch"; }; + virtual const char * getMD5() override { return "d96a284d39fcc410f375ac68fd380177"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/TouchEvent.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/TouchEvent.h new file mode 100644 index 000000000..59bec84e7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/TouchEvent.h @@ -0,0 +1,155 @@ +#ifndef _ROS_jsk_gui_msgs_TouchEvent_h +#define _ROS_jsk_gui_msgs_TouchEvent_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_gui_msgs +{ + + class TouchEvent : public ros::Msg + { + public: + typedef int8_t _state_type; + _state_type state; + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef float _w_type; + _w_type w; + typedef float _h_type; + _h_type h; + enum { DOWN = 0 }; + enum { UP = 1 }; + enum { MOVE = 2 }; + + TouchEvent(): + state(0), + x(0), + y(0), + w(0), + h(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_state; + u_state.real = this->state; + *(outbuffer + offset + 0) = (u_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + 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_w; + u_w.real = this->w; + *(outbuffer + offset + 0) = (u_w.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_w.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_w.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_w.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->w); + union { + float real; + uint32_t base; + } u_h; + u_h.real = this->h; + *(outbuffer + offset + 0) = (u_h.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_h.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_h.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_h.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->h); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_state; + u_state.base = 0; + u_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->state = u_state.real; + offset += sizeof(this->state); + 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_w; + u_w.base = 0; + u_w.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_w.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_w.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_w.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->w = u_w.real; + offset += sizeof(this->w); + union { + float real; + uint32_t base; + } u_h; + u_h.base = 0; + u_h.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_h.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_h.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_h.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->h = u_h.real; + offset += sizeof(this->h); + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/TouchEvent"; }; + virtual const char * getMD5() override { return "f074642ed1ad51ea5afc186cab8aaca1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/VoiceMessage.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/VoiceMessage.h new file mode 100644 index 000000000..c0f59dfc9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/VoiceMessage.h @@ -0,0 +1,75 @@ +#ifndef _ROS_jsk_gui_msgs_VoiceMessage_h +#define _ROS_jsk_gui_msgs_VoiceMessage_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_gui_msgs +{ + + class VoiceMessage : public ros::Msg + { + public: + uint32_t texts_length; + typedef char* _texts_type; + _texts_type st_texts; + _texts_type * texts; + + VoiceMessage(): + texts_length(0), st_texts(), texts(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->texts_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->texts_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->texts_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->texts_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->texts_length); + for( uint32_t i = 0; i < texts_length; i++){ + uint32_t length_textsi = strlen(this->texts[i]); + varToArr(outbuffer + offset, length_textsi); + offset += 4; + memcpy(outbuffer + offset, this->texts[i], length_textsi); + offset += length_textsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t texts_lengthT = ((uint32_t) (*(inbuffer + offset))); + texts_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + texts_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + texts_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->texts_length); + if(texts_lengthT > texts_length) + this->texts = (char**)realloc(this->texts, texts_lengthT * sizeof(char*)); + texts_length = texts_lengthT; + for( uint32_t i = 0; i < texts_length; i++){ + uint32_t length_st_texts; + arrToVar(length_st_texts, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_texts; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_texts-1]=0; + this->st_texts = (char *)(inbuffer + offset-1); + offset += length_st_texts; + memcpy( &(this->texts[i]), &(this->st_texts), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_gui_msgs/VoiceMessage"; }; + virtual const char * getMD5() override { return "8d7dcfb3b46640ccf02177a3f0cf9530"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/YesNo.h b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/YesNo.h new file mode 100644 index 000000000..a3da36cd3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_gui_msgs/YesNo.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_YesNo_h +#define _ROS_SERVICE_YesNo_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_gui_msgs +{ + +static const char YESNO[] = "jsk_gui_msgs/YesNo"; + + class YesNoRequest : public ros::Msg + { + public: + typedef const char* _message_type; + _message_type message; + + YesNoRequest(): + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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; + 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 YESNO; }; + virtual const char * getMD5() override { return "5f003d6bcc824cbd51361d66d8e4f76c"; }; + + }; + + class YesNoResponse : public ros::Msg + { + public: + typedef bool _yes_type; + _yes_type yes; + + YesNoResponse(): + yes(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_yes; + u_yes.real = this->yes; + *(outbuffer + offset + 0) = (u_yes.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->yes); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_yes; + u_yes.base = 0; + u_yes.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->yes = u_yes.real; + offset += sizeof(this->yes); + return offset; + } + + virtual const char * getType() override { return YESNO; }; + virtual const char * getMD5() override { return "aa7d186fb6268a501cd4c0c274f480ff"; }; + + }; + + class YesNo { + public: + typedef YesNoRequest Request; + typedef YesNoResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_hark_msgs/HarkPower.h b/smart_device_protocol/ros_lib/ros_lib/jsk_hark_msgs/HarkPower.h new file mode 100644 index 000000000..635474a86 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_hark_msgs/HarkPower.h @@ -0,0 +1,160 @@ +#ifndef _ROS_jsk_hark_msgs_HarkPower_h +#define _ROS_jsk_hark_msgs_HarkPower_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_hark_msgs +{ + + class HarkPower : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _count_type; + _count_type count; + typedef int32_t _directions_type; + _directions_type directions; + typedef int32_t _data_bytes_type; + _data_bytes_type data_bytes; + uint32_t powers_length; + typedef float _powers_type; + _powers_type st_powers; + _powers_type * powers; + + HarkPower(): + header(), + count(0), + directions(0), + data_bytes(0), + powers_length(0), st_powers(), powers(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_count; + u_count.real = this->count; + *(outbuffer + offset + 0) = (u_count.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_count.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_count.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_count.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->count); + union { + int32_t real; + uint32_t base; + } u_directions; + u_directions.real = this->directions; + *(outbuffer + offset + 0) = (u_directions.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_directions.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_directions.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_directions.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->directions); + union { + int32_t real; + uint32_t base; + } u_data_bytes; + u_data_bytes.real = this->data_bytes; + *(outbuffer + offset + 0) = (u_data_bytes.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data_bytes.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data_bytes.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data_bytes.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_bytes); + *(outbuffer + offset + 0) = (this->powers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->powers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->powers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->powers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->powers_length); + for( uint32_t i = 0; i < powers_length; i++){ + union { + float real; + uint32_t base; + } u_powersi; + u_powersi.real = this->powers[i]; + *(outbuffer + offset + 0) = (u_powersi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_powersi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_powersi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_powersi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->powers[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_count; + u_count.base = 0; + u_count.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_count.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_count.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_count.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->count = u_count.real; + offset += sizeof(this->count); + union { + int32_t real; + uint32_t base; + } u_directions; + u_directions.base = 0; + u_directions.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_directions.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_directions.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_directions.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->directions = u_directions.real; + offset += sizeof(this->directions); + union { + int32_t real; + uint32_t base; + } u_data_bytes; + u_data_bytes.base = 0; + u_data_bytes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data_bytes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data_bytes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data_bytes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data_bytes = u_data_bytes.real; + offset += sizeof(this->data_bytes); + uint32_t powers_lengthT = ((uint32_t) (*(inbuffer + offset))); + powers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + powers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + powers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->powers_length); + if(powers_lengthT > powers_length) + this->powers = (float*)realloc(this->powers, powers_lengthT * sizeof(float)); + powers_length = powers_lengthT; + for( uint32_t i = 0; i < powers_length; i++){ + union { + float real; + uint32_t base; + } u_st_powers; + u_st_powers.base = 0; + u_st_powers.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_powers.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_powers.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_powers.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_powers = u_st_powers.real; + offset += sizeof(this->st_powers); + memcpy( &(this->powers[i]), &(this->st_powers), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_hark_msgs/HarkPower"; }; + virtual const char * getMD5() override { return "251c13d7a8be27144a2b24c6f53df705"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetJointState.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetJointState.h new file mode 100644 index 000000000..28bdbe0e2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetJointState.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_GetJointState_h +#define _ROS_SERVICE_GetJointState_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JointState.h" + +namespace jsk_interactive_marker +{ + +static const char GETJOINTSTATE[] = "jsk_interactive_marker/GetJointState"; + + class GetJointStateRequest : public ros::Msg + { + public: + + GetJointStateRequest() + { + } + + 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 GETJOINTSTATE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetJointStateResponse : public ros::Msg + { + public: + typedef sensor_msgs::JointState _joint_state_type; + _joint_state_type joint_state; + + GetJointStateResponse(): + joint_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->joint_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->joint_state.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETJOINTSTATE; }; + virtual const char * getMD5() override { return "9ca061465ef0ed08771ed240c43789f5"; }; + + }; + + class GetJointState { + public: + typedef GetJointStateRequest Request; + typedef GetJointStateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetMarkerDimensions.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetMarkerDimensions.h new file mode 100644 index 000000000..e9ba33661 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetMarkerDimensions.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_GetMarkerDimensions_h +#define _ROS_SERVICE_GetMarkerDimensions_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_interactive_marker/MarkerDimensions.h" + +namespace jsk_interactive_marker +{ + +static const char GETMARKERDIMENSIONS[] = "jsk_interactive_marker/GetMarkerDimensions"; + + class GetMarkerDimensionsRequest : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + + GetMarkerDimensionsRequest(): + target_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + return offset; + } + + virtual const char * getType() override { return GETMARKERDIMENSIONS; }; + virtual const char * getMD5() override { return "2008933b3c7227647cbe00c74682331a"; }; + + }; + + class GetMarkerDimensionsResponse : public ros::Msg + { + public: + typedef jsk_interactive_marker::MarkerDimensions _dimensions_type; + _dimensions_type dimensions; + + GetMarkerDimensionsResponse(): + dimensions() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->dimensions.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->dimensions.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETMARKERDIMENSIONS; }; + virtual const char * getMD5() override { return "742fb7645b415cf6f633f4bd78cac455"; }; + + }; + + class GetMarkerDimensions { + public: + typedef GetMarkerDimensionsRequest Request; + typedef GetMarkerDimensionsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerColor.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerColor.h new file mode 100644 index 000000000..255a45b9e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerColor.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_GetTransformableMarkerColor_h +#define _ROS_SERVICE_GetTransformableMarkerColor_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/ColorRGBA.h" + +namespace jsk_interactive_marker +{ + +static const char GETTRANSFORMABLEMARKERCOLOR[] = "jsk_interactive_marker/GetTransformableMarkerColor"; + + class GetTransformableMarkerColorRequest : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + + GetTransformableMarkerColorRequest(): + target_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + return offset; + } + + virtual const char * getType() override { return GETTRANSFORMABLEMARKERCOLOR; }; + virtual const char * getMD5() override { return "2008933b3c7227647cbe00c74682331a"; }; + + }; + + class GetTransformableMarkerColorResponse : public ros::Msg + { + public: + typedef std_msgs::ColorRGBA _color_type; + _color_type color; + + GetTransformableMarkerColorResponse(): + color() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->color.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->color.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETTRANSFORMABLEMARKERCOLOR; }; + virtual const char * getMD5() override { return "3e04b62b1b39cd97e873789f0bb130e7"; }; + + }; + + class GetTransformableMarkerColor { + public: + typedef GetTransformableMarkerColorRequest Request; + typedef GetTransformableMarkerColorResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerExistence.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerExistence.h new file mode 100644 index 000000000..a2a6ebf98 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerExistence.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_GetTransformableMarkerExistence_h +#define _ROS_SERVICE_GetTransformableMarkerExistence_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_interactive_marker +{ + +static const char GETTRANSFORMABLEMARKEREXISTENCE[] = "jsk_interactive_marker/GetTransformableMarkerExistence"; + + class GetTransformableMarkerExistenceRequest : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + + GetTransformableMarkerExistenceRequest(): + target_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + return offset; + } + + virtual const char * getType() override { return GETTRANSFORMABLEMARKEREXISTENCE; }; + virtual const char * getMD5() override { return "2008933b3c7227647cbe00c74682331a"; }; + + }; + + class GetTransformableMarkerExistenceResponse : public ros::Msg + { + public: + typedef bool _existence_type; + _existence_type existence; + + GetTransformableMarkerExistenceResponse(): + existence(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_existence; + u_existence.real = this->existence; + *(outbuffer + offset + 0) = (u_existence.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->existence); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_existence; + u_existence.base = 0; + u_existence.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->existence = u_existence.real; + offset += sizeof(this->existence); + return offset; + } + + virtual const char * getType() override { return GETTRANSFORMABLEMARKEREXISTENCE; }; + virtual const char * getMD5() override { return "09ae207b2bf8af13a88dd5fd7b14cb66"; }; + + }; + + class GetTransformableMarkerExistence { + public: + typedef GetTransformableMarkerExistenceRequest Request; + typedef GetTransformableMarkerExistenceResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerFocus.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerFocus.h new file mode 100644 index 000000000..9e8702eab --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerFocus.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_GetTransformableMarkerFocus_h +#define _ROS_SERVICE_GetTransformableMarkerFocus_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_interactive_marker +{ + +static const char GETTRANSFORMABLEMARKERFOCUS[] = "jsk_interactive_marker/GetTransformableMarkerFocus"; + + class GetTransformableMarkerFocusRequest : public ros::Msg + { + public: + + GetTransformableMarkerFocusRequest() + { + } + + 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 GETTRANSFORMABLEMARKERFOCUS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetTransformableMarkerFocusResponse : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + + GetTransformableMarkerFocusResponse(): + target_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + return offset; + } + + virtual const char * getType() override { return GETTRANSFORMABLEMARKERFOCUS; }; + virtual const char * getMD5() override { return "2008933b3c7227647cbe00c74682331a"; }; + + }; + + class GetTransformableMarkerFocus { + public: + typedef GetTransformableMarkerFocusRequest Request; + typedef GetTransformableMarkerFocusResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerPose.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerPose.h new file mode 100644 index 000000000..ee31419d2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetTransformableMarkerPose.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_GetTransformableMarkerPose_h +#define _ROS_SERVICE_GetTransformableMarkerPose_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace jsk_interactive_marker +{ + +static const char GETTRANSFORMABLEMARKERPOSE[] = "jsk_interactive_marker/GetTransformableMarkerPose"; + + class GetTransformableMarkerPoseRequest : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + + GetTransformableMarkerPoseRequest(): + target_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + return offset; + } + + virtual const char * getType() override { return GETTRANSFORMABLEMARKERPOSE; }; + virtual const char * getMD5() override { return "2008933b3c7227647cbe00c74682331a"; }; + + }; + + class GetTransformableMarkerPoseResponse : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _pose_stamped_type; + _pose_stamped_type pose_stamped; + + GetTransformableMarkerPoseResponse(): + pose_stamped() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose_stamped.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose_stamped.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETTRANSFORMABLEMARKERPOSE; }; + virtual const char * getMD5() override { return "a6cf8bca3220fd47abb2c1783444110d"; }; + + }; + + class GetTransformableMarkerPose { + public: + typedef GetTransformableMarkerPoseRequest Request; + typedef GetTransformableMarkerPoseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetType.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetType.h new file mode 100644 index 000000000..138515a06 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/GetType.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_GetType_h +#define _ROS_SERVICE_GetType_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_interactive_marker +{ + +static const char GETTYPE[] = "jsk_interactive_marker/GetType"; + + class GetTypeRequest : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + + GetTypeRequest(): + target_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + return offset; + } + + virtual const char * getType() override { return GETTYPE; }; + virtual const char * getMD5() override { return "2008933b3c7227647cbe00c74682331a"; }; + + }; + + class GetTypeResponse : public ros::Msg + { + public: + typedef int32_t _type_type; + _type_type type; + + GetTypeResponse(): + type(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); + 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); + return offset; + } + + virtual const char * getType() override { return GETTYPE; }; + virtual const char * getMD5() override { return "bda37decd5e3814bcc042f341d2e60a1"; }; + + }; + + class GetType { + public: + typedef GetTypeRequest Request; + typedef GetTypeResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/IndexRequest.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/IndexRequest.h new file mode 100644 index 000000000..ef595b124 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/IndexRequest.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_IndexRequest_h +#define _ROS_SERVICE_IndexRequest_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_recognition_msgs/Int32Stamped.h" + +namespace jsk_interactive_marker +{ + +static const char INDEXREQUEST[] = "jsk_interactive_marker/IndexRequest"; + + class IndexRequestRequest : public ros::Msg + { + public: + typedef jsk_recognition_msgs::Int32Stamped _index_type; + _index_type index; + + IndexRequestRequest(): + index() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->index.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->index.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return INDEXREQUEST; }; + virtual const char * getMD5() override { return "e7767d85a4611e638acb5e4f67adbc5a"; }; + + }; + + class IndexRequestResponse : public ros::Msg + { + public: + + IndexRequestResponse() + { + } + + 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 INDEXREQUEST; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class IndexRequest { + public: + typedef IndexRequestRequest Request; + typedef IndexRequestResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/JointTrajectoryPointWithType.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/JointTrajectoryPointWithType.h new file mode 100644 index 000000000..eec1c2a14 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/JointTrajectoryPointWithType.h @@ -0,0 +1,220 @@ +#ifndef _ROS_jsk_interactive_marker_JointTrajectoryPointWithType_h +#define _ROS_jsk_interactive_marker_JointTrajectoryPointWithType_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace jsk_interactive_marker +{ + + class JointTrajectoryPointWithType : public ros::Msg + { + public: + typedef int8_t _type_type; + _type_type type; + typedef const char* _args_type; + _args_type args; + typedef bool _wait_type; + _wait_type wait; + uint32_t positions_length; + typedef float _positions_type; + _positions_type st_positions; + _positions_type * positions; + uint32_t velocities_length; + typedef float _velocities_type; + _velocities_type st_velocities; + _velocities_type * velocities; + uint32_t accelerations_length; + typedef float _accelerations_type; + _accelerations_type st_accelerations; + _accelerations_type * accelerations; + uint32_t effort_length; + typedef float _effort_type; + _effort_type st_effort; + _effort_type * effort; + typedef ros::Duration _time_from_start_type; + _time_from_start_type time_from_start; + enum { JOINT_INTERPOLATION = 0 }; + enum { LINEAR_INTERPOLATION = 1 }; + enum { COLLISION_AVOIDANCE = 2 }; + enum { CLOSE_HAND = 10 }; + enum { OPEN_HAND = 11 }; + + JointTrajectoryPointWithType(): + type(0), + args(""), + wait(0), + positions_length(0), st_positions(), positions(nullptr), + velocities_length(0), st_velocities(), velocities(nullptr), + accelerations_length(0), st_accelerations(), accelerations(nullptr), + effort_length(0), st_effort(), effort(nullptr), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + uint32_t length_args = strlen(this->args); + varToArr(outbuffer + offset, length_args); + offset += 4; + memcpy(outbuffer + offset, this->args, length_args); + offset += length_args; + union { + bool real; + uint8_t base; + } u_wait; + u_wait.real = this->wait; + *(outbuffer + offset + 0) = (u_wait.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->wait); + *(outbuffer + offset + 0) = (this->positions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->positions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->positions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->positions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->positions_length); + for( uint32_t i = 0; i < positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->positions[i]); + } + *(outbuffer + offset + 0) = (this->velocities_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->velocities_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->velocities_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->velocities_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->velocities_length); + for( uint32_t i = 0; i < velocities_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocities[i]); + } + *(outbuffer + offset + 0) = (this->accelerations_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->accelerations_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->accelerations_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->accelerations_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->accelerations_length); + for( uint32_t i = 0; i < accelerations_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->accelerations[i]); + } + *(outbuffer + offset + 0) = (this->effort_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->effort_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->effort_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->effort_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->effort_length); + for( uint32_t i = 0; i < effort_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->effort[i]); + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->type = u_type.real; + offset += sizeof(this->type); + uint32_t length_args; + arrToVar(length_args, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_args-1]=0; + this->args = (char *)(inbuffer + offset-1); + offset += length_args; + union { + bool real; + uint8_t base; + } u_wait; + u_wait.base = 0; + u_wait.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->wait = u_wait.real; + offset += sizeof(this->wait); + uint32_t positions_lengthT = ((uint32_t) (*(inbuffer + offset))); + positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->positions_length); + if(positions_lengthT > positions_length) + this->positions = (float*)realloc(this->positions, positions_lengthT * sizeof(float)); + positions_length = positions_lengthT; + for( uint32_t i = 0; i < positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_positions)); + memcpy( &(this->positions[i]), &(this->st_positions), sizeof(float)); + } + uint32_t velocities_lengthT = ((uint32_t) (*(inbuffer + offset))); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->velocities_length); + if(velocities_lengthT > velocities_length) + this->velocities = (float*)realloc(this->velocities, velocities_lengthT * sizeof(float)); + velocities_length = velocities_lengthT; + for( uint32_t i = 0; i < velocities_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocities)); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(float)); + } + uint32_t accelerations_lengthT = ((uint32_t) (*(inbuffer + offset))); + accelerations_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + accelerations_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + accelerations_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->accelerations_length); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (float*)realloc(this->accelerations, accelerations_lengthT * sizeof(float)); + accelerations_length = accelerations_lengthT; + for( uint32_t i = 0; i < accelerations_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_accelerations)); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(float)); + } + uint32_t effort_lengthT = ((uint32_t) (*(inbuffer + offset))); + effort_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + effort_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + effort_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->effort_length); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + effort_length = effort_lengthT; + for( uint32_t i = 0; i < effort_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_effort)); + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual const char * getType() override { return "jsk_interactive_marker/JointTrajectoryPointWithType"; }; + virtual const char * getMD5() override { return "990bd6a1d9e03cc634e576f569783816"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/JointTrajectoryWithType.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/JointTrajectoryWithType.h new file mode 100644 index 000000000..6289108ca --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/JointTrajectoryWithType.h @@ -0,0 +1,107 @@ +#ifndef _ROS_jsk_interactive_marker_JointTrajectoryWithType_h +#define _ROS_jsk_interactive_marker_JointTrajectoryWithType_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_interactive_marker/JointTrajectoryPointWithType.h" + +namespace jsk_interactive_marker +{ + + class JointTrajectoryWithType : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t points_length; + typedef jsk_interactive_marker::JointTrajectoryPointWithType _points_type; + _points_type st_points; + _points_type * points; + + JointTrajectoryWithType(): + header(), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + points_length(0), st_points(), points(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + 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 = (jsk_interactive_marker::JointTrajectoryPointWithType*)realloc(this->points, points_lengthT * sizeof(jsk_interactive_marker::JointTrajectoryPointWithType)); + 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(jsk_interactive_marker::JointTrajectoryPointWithType)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_interactive_marker/JointTrajectoryWithType"; }; + virtual const char * getMD5() override { return "60e366ad2005e5bee332903472737b12"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerDimensions.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerDimensions.h new file mode 100644 index 000000000..cdfe385ea --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerDimensions.h @@ -0,0 +1,182 @@ +#ifndef _ROS_jsk_interactive_marker_MarkerDimensions_h +#define _ROS_jsk_interactive_marker_MarkerDimensions_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_interactive_marker +{ + + class MarkerDimensions : 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 _radius_type; + _radius_type radius; + typedef float _small_radius_type; + _small_radius_type small_radius; + typedef int32_t _type_type; + _type_type type; + + MarkerDimensions(): + x(0), + y(0), + z(0), + radius(0), + small_radius(0), + type(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_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 { + float real; + uint32_t base; + } u_small_radius; + u_small_radius.real = this->small_radius; + *(outbuffer + offset + 0) = (u_small_radius.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_small_radius.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_small_radius.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_small_radius.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->small_radius); + 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); + 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_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 { + float real; + uint32_t base; + } u_small_radius; + u_small_radius.base = 0; + u_small_radius.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_small_radius.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_small_radius.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_small_radius.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->small_radius = u_small_radius.real; + offset += sizeof(this->small_radius); + 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); + return offset; + } + + virtual const char * getType() override { return "jsk_interactive_marker/MarkerDimensions"; }; + virtual const char * getMD5() override { return "78d79a51113d58c1ab04c7bc03c8facc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerMenu.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerMenu.h new file mode 100644 index 000000000..bbe668c8a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerMenu.h @@ -0,0 +1,136 @@ +#ifndef _ROS_jsk_interactive_marker_MarkerMenu_h +#define _ROS_jsk_interactive_marker_MarkerMenu_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_interactive_marker +{ + + class MarkerMenu : public ros::Msg + { + public: + typedef int8_t _menu_type; + _menu_type menu; + typedef int8_t _type_type; + _type_type type; + typedef const char* _marker_name_type; + _marker_name_type marker_name; + enum { MOVE = 0 }; + enum { FORCE_MOVE = 1 }; + enum { SET_ORIGIN = 2 }; + enum { SET_ORIGIN_RHAND = 3 }; + enum { SET_ORIGIN_LHAND = 4 }; + enum { RESET_COORDS = 5 }; + enum { DELETE_FORCE = 6 }; + enum { PUBLISH_MARKER = 7 }; + enum { JOINT_MOVE = 8 }; + enum { RESET_JOINT = 9 }; + enum { SET_MOVE_RARM = 10 }; + enum { SET_MOVE_LARM = 11 }; + enum { SET_MOVE_ARMS = 12 }; + enum { MOVE_CONSTRAINT_T = 13 }; + enum { MOVE_CONSTRAINT_NIL = 14 }; + enum { IK_ROTATION_AXIS_T = 15 }; + enum { IK_ROTATION_AXIS_NIL = 16 }; + enum { USE_TORSO_T = 17 }; + enum { USE_TORSO_NIL = 18 }; + enum { USE_FULLBODY = 19 }; + enum { START_GRASP = 20 }; + enum { HARF_GRASP = 21 }; + enum { STOP_GRASP = 22 }; + enum { HEAD_TARGET_POINT = 30 }; + enum { LOOK_AUTO = 31 }; + enum { MANIP_MODE = 40 }; + enum { PICK = 41 }; + enum { TOUCHIT_EXEC = 42 }; + enum { TOUCHIT_PREV = 43 }; + enum { TOUCHIT_CANCEL = 44 }; + enum { LOOK_RARM = 45 }; + enum { LOOK_LARM = 46 }; + enum { PLAN = 50 }; + enum { EXECUTE = 51 }; + enum { PLAN_EXECUTE = 52 }; + enum { CANCEL_PLAN = 53 }; + enum { GENERAL = 0 }; + enum { HEAD_MARKER = 1 }; + enum { RHAND_MARKER = 2 }; + enum { LHAND_MARKER = 3 }; + enum { RLEG_MARKER = 4 }; + enum { LLEG_MARKER = 5 }; + enum { BASE_MARKER = 6 }; + enum { RFINGER_MARKER = 7 }; + enum { LFINGER_MARKER = 8 }; + + MarkerMenu(): + menu(0), + type(0), + marker_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_menu; + u_menu.real = this->menu; + *(outbuffer + offset + 0) = (u_menu.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->menu); + union { + int8_t real; + uint8_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + uint32_t length_marker_name = strlen(this->marker_name); + varToArr(outbuffer + offset, length_marker_name); + offset += 4; + memcpy(outbuffer + offset, this->marker_name, length_marker_name); + offset += length_marker_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_menu; + u_menu.base = 0; + u_menu.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->menu = u_menu.real; + offset += sizeof(this->menu); + union { + int8_t real; + uint8_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->type = u_type.real; + offset += sizeof(this->type); + uint32_t length_marker_name; + arrToVar(length_marker_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_marker_name-1]=0; + this->marker_name = (char *)(inbuffer + offset-1); + offset += length_marker_name; + return offset; + } + + virtual const char * getType() override { return "jsk_interactive_marker/MarkerMenu"; }; + virtual const char * getMD5() override { return "192d3b78eda584051c0d487463f7de74"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerPose.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerPose.h new file mode 100644 index 000000000..c65b0f1a9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerPose.h @@ -0,0 +1,89 @@ +#ifndef _ROS_jsk_interactive_marker_MarkerPose_h +#define _ROS_jsk_interactive_marker_MarkerPose_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace jsk_interactive_marker +{ + + class MarkerPose : public ros::Msg + { + public: + typedef int8_t _type_type; + _type_type type; + typedef geometry_msgs::PoseStamped _pose_type; + _pose_type pose; + typedef const char* _marker_name_type; + _marker_name_type marker_name; + enum { GENERAL = 0 }; + enum { HEAD_MARKER = 1 }; + enum { RHAND_MARKER = 2 }; + enum { LHAND_MARKER = 3 }; + enum { RLEG_MARKER = 4 }; + enum { LLEG_MARKER = 5 }; + enum { BASE_MARKER = 6 }; + enum { RFINGER_MARKER = 7 }; + enum { LFINGER_MARKER = 8 }; + enum { SPHERE_MARKER = 9 }; + + MarkerPose(): + type(0), + pose(), + marker_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_marker_name = strlen(this->marker_name); + varToArr(outbuffer + offset, length_marker_name); + offset += 4; + memcpy(outbuffer + offset, this->marker_name, length_marker_name); + offset += length_marker_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->type = u_type.real; + offset += sizeof(this->type); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_marker_name; + arrToVar(length_marker_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_marker_name-1]=0; + this->marker_name = (char *)(inbuffer + offset-1); + offset += length_marker_name; + return offset; + } + + virtual const char * getType() override { return "jsk_interactive_marker/MarkerPose"; }; + virtual const char * getMD5() override { return "cbb82805055f8f87cec211c5459c476c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerSetPose.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerSetPose.h new file mode 100644 index 000000000..8e5f50640 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MarkerSetPose.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_MarkerSetPose_h +#define _ROS_SERVICE_MarkerSetPose_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "visualization_msgs/Marker.h" + +namespace jsk_interactive_marker +{ + +static const char MARKERSETPOSE[] = "jsk_interactive_marker/MarkerSetPose"; + + class MarkerSetPoseRequest : public ros::Msg + { + public: + typedef const char* _marker_name_type; + _marker_name_type marker_name; + typedef geometry_msgs::PoseStamped _pose_type; + _pose_type pose; + uint32_t markers_length; + typedef visualization_msgs::Marker _markers_type; + _markers_type st_markers; + _markers_type * markers; + + MarkerSetPoseRequest(): + marker_name(""), + pose(), + markers_length(0), st_markers(), markers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_marker_name = strlen(this->marker_name); + varToArr(outbuffer + offset, length_marker_name); + offset += 4; + memcpy(outbuffer + offset, this->marker_name, length_marker_name); + offset += length_marker_name; + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->markers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->markers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->markers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->markers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->markers_length); + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_marker_name; + arrToVar(length_marker_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_marker_name-1]=0; + this->marker_name = (char *)(inbuffer + offset-1); + offset += length_marker_name; + offset += this->pose.deserialize(inbuffer + offset); + uint32_t markers_lengthT = ((uint32_t) (*(inbuffer + offset))); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->markers_length); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + markers_length = markers_lengthT; + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + return offset; + } + + virtual const char * getType() override { return MARKERSETPOSE; }; + virtual const char * getMD5() override { return "ad9cd9afd2203415fba0c5648ca2decb"; }; + + }; + + class MarkerSetPoseResponse : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _pose_type; + _pose_type pose; + + MarkerSetPoseResponse(): + 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 MARKERSETPOSE; }; + virtual const char * getMD5() override { return "3f8930d968a3e84d471dff917bb1cdae"; }; + + }; + + class MarkerSetPose { + public: + typedef MarkerSetPoseRequest Request; + typedef MarkerSetPoseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MoveModel.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MoveModel.h new file mode 100644 index 000000000..cd5df86ef --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MoveModel.h @@ -0,0 +1,100 @@ +#ifndef _ROS_jsk_interactive_marker_MoveModel_h +#define _ROS_jsk_interactive_marker_MoveModel_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/JointState.h" +#include "geometry_msgs/PoseStamped.h" + +namespace jsk_interactive_marker +{ + + class MoveModel : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _name_type; + _name_type name; + typedef const char* _description_type; + _description_type description; + typedef sensor_msgs::JointState _joint_state_origin_type; + _joint_state_origin_type joint_state_origin; + typedef sensor_msgs::JointState _joint_state_goal_type; + _joint_state_goal_type joint_state_goal; + typedef geometry_msgs::PoseStamped _pose_origin_type; + _pose_origin_type pose_origin; + typedef geometry_msgs::PoseStamped _pose_goal_type; + _pose_goal_type pose_goal; + + MoveModel(): + header(), + name(""), + description(""), + joint_state_origin(), + joint_state_goal(), + pose_origin(), + pose_goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + 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_description = strlen(this->description); + varToArr(outbuffer + offset, length_description); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + offset += this->joint_state_origin.serialize(outbuffer + offset); + offset += this->joint_state_goal.serialize(outbuffer + offset); + offset += this->pose_origin.serialize(outbuffer + offset); + offset += this->pose_goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + 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_description; + arrToVar(length_description, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + offset += this->joint_state_origin.deserialize(inbuffer + offset); + offset += this->joint_state_goal.deserialize(inbuffer + offset); + offset += this->pose_origin.deserialize(inbuffer + offset); + offset += this->pose_goal.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_interactive_marker/MoveModel"; }; + virtual const char * getMD5() override { return "61edcddd6ca50e876e68d4fcf06c90f6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MoveObject.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MoveObject.h new file mode 100644 index 000000000..ed1768f65 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/MoveObject.h @@ -0,0 +1,55 @@ +#ifndef _ROS_jsk_interactive_marker_MoveObject_h +#define _ROS_jsk_interactive_marker_MoveObject_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "geometry_msgs/Pose.h" + +namespace jsk_interactive_marker +{ + + class MoveObject : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _origin_type; + _origin_type origin; + typedef geometry_msgs::PoseStamped _goal_type; + _goal_type goal; + typedef geometry_msgs::Pose _graspPose_type; + _graspPose_type graspPose; + + MoveObject(): + origin(), + goal(), + graspPose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->origin.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + offset += this->graspPose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->origin.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + offset += this->graspPose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_interactive_marker/MoveObject"; }; + virtual const char * getMD5() override { return "398be7a942bfa9cfc119a5f96e3dc37a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/PoseStampedWithName.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/PoseStampedWithName.h new file mode 100644 index 000000000..5ca4dd5aa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/PoseStampedWithName.h @@ -0,0 +1,61 @@ +#ifndef _ROS_jsk_interactive_marker_PoseStampedWithName_h +#define _ROS_jsk_interactive_marker_PoseStampedWithName_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace jsk_interactive_marker +{ + + class PoseStampedWithName : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef geometry_msgs::PoseStamped _pose_type; + _pose_type pose; + + PoseStampedWithName(): + name(""), + pose() + { + } + + 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; + offset += this->pose.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; + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_interactive_marker/PoseStampedWithName"; }; + virtual const char * getMD5() override { return "8377dd3ee630b796499a6be053df1d41"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/RemoveParentMarker.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/RemoveParentMarker.h new file mode 100644 index 000000000..f29e8661c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/RemoveParentMarker.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_RemoveParentMarker_h +#define _ROS_SERVICE_RemoveParentMarker_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_interactive_marker +{ + +static const char REMOVEPARENTMARKER[] = "jsk_interactive_marker/RemoveParentMarker"; + + class RemoveParentMarkerRequest : public ros::Msg + { + public: + typedef const char* _child_marker_name_type; + _child_marker_name_type child_marker_name; + + RemoveParentMarkerRequest(): + child_marker_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_child_marker_name = strlen(this->child_marker_name); + varToArr(outbuffer + offset, length_child_marker_name); + offset += 4; + memcpy(outbuffer + offset, this->child_marker_name, length_child_marker_name); + offset += length_child_marker_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_child_marker_name; + arrToVar(length_child_marker_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_marker_name-1]=0; + this->child_marker_name = (char *)(inbuffer + offset-1); + offset += length_child_marker_name; + return offset; + } + + virtual const char * getType() override { return REMOVEPARENTMARKER; }; + virtual const char * getMD5() override { return "97181b161a4bd485fbd404baffdcfbf4"; }; + + }; + + class RemoveParentMarkerResponse : public ros::Msg + { + public: + + RemoveParentMarkerResponse() + { + } + + 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 REMOVEPARENTMARKER; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class RemoveParentMarker { + public: + typedef RemoveParentMarkerRequest Request; + typedef RemoveParentMarkerResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetHeuristic.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetHeuristic.h new file mode 100644 index 000000000..0a95fa6d7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetHeuristic.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_SetHeuristic_h +#define _ROS_SERVICE_SetHeuristic_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_interactive_marker +{ + +static const char SETHEURISTIC[] = "jsk_interactive_marker/SetHeuristic"; + + class SetHeuristicRequest : public ros::Msg + { + public: + typedef const char* _heuristic_type; + _heuristic_type heuristic; + + SetHeuristicRequest(): + heuristic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_heuristic = strlen(this->heuristic); + varToArr(outbuffer + offset, length_heuristic); + offset += 4; + memcpy(outbuffer + offset, this->heuristic, length_heuristic); + offset += length_heuristic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_heuristic; + arrToVar(length_heuristic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_heuristic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_heuristic-1]=0; + this->heuristic = (char *)(inbuffer + offset-1); + offset += length_heuristic; + return offset; + } + + virtual const char * getType() override { return SETHEURISTIC; }; + virtual const char * getMD5() override { return "96bf1327fac533122d937324246cbde4"; }; + + }; + + class SetHeuristicResponse : public ros::Msg + { + public: + + SetHeuristicResponse() + { + } + + 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 SETHEURISTIC; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetHeuristic { + public: + typedef SetHeuristicRequest Request; + typedef SetHeuristicResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetMarkerDimensions.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetMarkerDimensions.h new file mode 100644 index 000000000..aa58e9d93 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetMarkerDimensions.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_SetMarkerDimensions_h +#define _ROS_SERVICE_SetMarkerDimensions_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_interactive_marker/MarkerDimensions.h" + +namespace jsk_interactive_marker +{ + +static const char SETMARKERDIMENSIONS[] = "jsk_interactive_marker/SetMarkerDimensions"; + + class SetMarkerDimensionsRequest : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + typedef jsk_interactive_marker::MarkerDimensions _dimensions_type; + _dimensions_type dimensions; + + SetMarkerDimensionsRequest(): + target_name(""), + dimensions() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + offset += this->dimensions.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + offset += this->dimensions.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETMARKERDIMENSIONS; }; + virtual const char * getMD5() override { return "68f212be16364271f11f516c3f033749"; }; + + }; + + class SetMarkerDimensionsResponse : public ros::Msg + { + public: + + SetMarkerDimensionsResponse() + { + } + + 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 SETMARKERDIMENSIONS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetMarkerDimensions { + public: + typedef SetMarkerDimensionsRequest Request; + typedef SetMarkerDimensionsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetParentMarker.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetParentMarker.h new file mode 100644 index 000000000..68aa8b9b8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetParentMarker.h @@ -0,0 +1,121 @@ +#ifndef _ROS_SERVICE_SetParentMarker_h +#define _ROS_SERVICE_SetParentMarker_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_interactive_marker +{ + +static const char SETPARENTMARKER[] = "jsk_interactive_marker/SetParentMarker"; + + class SetParentMarkerRequest : public ros::Msg + { + public: + typedef const char* _parent_topic_name_type; + _parent_topic_name_type parent_topic_name; + typedef const char* _parent_marker_name_type; + _parent_marker_name_type parent_marker_name; + typedef const char* _child_marker_name_type; + _child_marker_name_type child_marker_name; + + SetParentMarkerRequest(): + parent_topic_name(""), + parent_marker_name(""), + child_marker_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_parent_topic_name = strlen(this->parent_topic_name); + varToArr(outbuffer + offset, length_parent_topic_name); + offset += 4; + memcpy(outbuffer + offset, this->parent_topic_name, length_parent_topic_name); + offset += length_parent_topic_name; + uint32_t length_parent_marker_name = strlen(this->parent_marker_name); + varToArr(outbuffer + offset, length_parent_marker_name); + offset += 4; + memcpy(outbuffer + offset, this->parent_marker_name, length_parent_marker_name); + offset += length_parent_marker_name; + uint32_t length_child_marker_name = strlen(this->child_marker_name); + varToArr(outbuffer + offset, length_child_marker_name); + offset += 4; + memcpy(outbuffer + offset, this->child_marker_name, length_child_marker_name); + offset += length_child_marker_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_parent_topic_name; + arrToVar(length_parent_topic_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parent_topic_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parent_topic_name-1]=0; + this->parent_topic_name = (char *)(inbuffer + offset-1); + offset += length_parent_topic_name; + uint32_t length_parent_marker_name; + arrToVar(length_parent_marker_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parent_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parent_marker_name-1]=0; + this->parent_marker_name = (char *)(inbuffer + offset-1); + offset += length_parent_marker_name; + uint32_t length_child_marker_name; + arrToVar(length_child_marker_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_marker_name-1]=0; + this->child_marker_name = (char *)(inbuffer + offset-1); + offset += length_child_marker_name; + return offset; + } + + virtual const char * getType() override { return SETPARENTMARKER; }; + virtual const char * getMD5() override { return "0fbeb5790154b3ebc3c1cc4917de6fcc"; }; + + }; + + class SetParentMarkerResponse : public ros::Msg + { + public: + + SetParentMarkerResponse() + { + } + + 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 SETPARENTMARKER; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetParentMarker { + public: + typedef SetParentMarkerRequest Request; + typedef SetParentMarkerResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetPose.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetPose.h new file mode 100644 index 000000000..93328c868 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetPose.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_SetPose_h +#define _ROS_SERVICE_SetPose_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "visualization_msgs/Marker.h" + +namespace jsk_interactive_marker +{ + +static const char SETPOSE[] = "jsk_interactive_marker/SetPose"; + + class SetPoseRequest : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _pose_type; + _pose_type pose; + uint32_t markers_length; + typedef visualization_msgs::Marker _markers_type; + _markers_type st_markers; + _markers_type * markers; + + SetPoseRequest(): + pose(), + markers_length(0), st_markers(), markers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->markers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->markers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->markers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->markers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->markers_length); + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + uint32_t markers_lengthT = ((uint32_t) (*(inbuffer + offset))); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->markers_length); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + markers_length = markers_lengthT; + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + return offset; + } + + virtual const char * getType() override { return SETPOSE; }; + virtual const char * getMD5() override { return "21980095fd7bf6047ed57a495f657428"; }; + + }; + + class SetPoseResponse : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _pose_type; + _pose_type pose; + + SetPoseResponse(): + 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 "3f8930d968a3e84d471dff917bb1cdae"; }; + + }; + + class SetPose { + public: + typedef SetPoseRequest Request; + typedef SetPoseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerColor.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerColor.h new file mode 100644 index 000000000..c085751d7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerColor.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_SetTransformableMarkerColor_h +#define _ROS_SERVICE_SetTransformableMarkerColor_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/ColorRGBA.h" + +namespace jsk_interactive_marker +{ + +static const char SETTRANSFORMABLEMARKERCOLOR[] = "jsk_interactive_marker/SetTransformableMarkerColor"; + + class SetTransformableMarkerColorRequest : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + typedef std_msgs::ColorRGBA _color_type; + _color_type color; + + SetTransformableMarkerColorRequest(): + target_name(""), + color() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + offset += this->color.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + offset += this->color.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETTRANSFORMABLEMARKERCOLOR; }; + virtual const char * getMD5() override { return "6da9e77546dd19426d1dc251fb18d20e"; }; + + }; + + class SetTransformableMarkerColorResponse : public ros::Msg + { + public: + + SetTransformableMarkerColorResponse() + { + } + + 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 SETTRANSFORMABLEMARKERCOLOR; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetTransformableMarkerColor { + public: + typedef SetTransformableMarkerColorRequest Request; + typedef SetTransformableMarkerColorResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerFocus.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerFocus.h new file mode 100644 index 000000000..5f7846e5b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerFocus.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_SetTransformableMarkerFocus_h +#define _ROS_SERVICE_SetTransformableMarkerFocus_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_interactive_marker +{ + +static const char SETTRANSFORMABLEMARKERFOCUS[] = "jsk_interactive_marker/SetTransformableMarkerFocus"; + + class SetTransformableMarkerFocusRequest : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + + SetTransformableMarkerFocusRequest(): + target_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + return offset; + } + + virtual const char * getType() override { return SETTRANSFORMABLEMARKERFOCUS; }; + virtual const char * getMD5() override { return "2008933b3c7227647cbe00c74682331a"; }; + + }; + + class SetTransformableMarkerFocusResponse : public ros::Msg + { + public: + + SetTransformableMarkerFocusResponse() + { + } + + 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 SETTRANSFORMABLEMARKERFOCUS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetTransformableMarkerFocus { + public: + typedef SetTransformableMarkerFocusRequest Request; + typedef SetTransformableMarkerFocusResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerPose.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerPose.h new file mode 100644 index 000000000..7ee15edd8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SetTransformableMarkerPose.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_SetTransformableMarkerPose_h +#define _ROS_SERVICE_SetTransformableMarkerPose_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace jsk_interactive_marker +{ + +static const char SETTRANSFORMABLEMARKERPOSE[] = "jsk_interactive_marker/SetTransformableMarkerPose"; + + class SetTransformableMarkerPoseRequest : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + typedef geometry_msgs::PoseStamped _pose_stamped_type; + _pose_stamped_type pose_stamped; + + SetTransformableMarkerPoseRequest(): + target_name(""), + pose_stamped() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + offset += this->pose_stamped.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + offset += this->pose_stamped.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETTRANSFORMABLEMARKERPOSE; }; + virtual const char * getMD5() override { return "e19607b29b4528e87feff290fe261191"; }; + + }; + + class SetTransformableMarkerPoseResponse : public ros::Msg + { + public: + + SetTransformableMarkerPoseResponse() + { + } + + 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 SETTRANSFORMABLEMARKERPOSE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetTransformableMarkerPose { + public: + typedef SetTransformableMarkerPoseRequest Request; + typedef SetTransformableMarkerPoseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SnapFootPrint.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SnapFootPrint.h new file mode 100644 index 000000000..0eb95dfc9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SnapFootPrint.h @@ -0,0 +1,110 @@ +#ifndef _ROS_SERVICE_SnapFootPrint_h +#define _ROS_SERVICE_SnapFootPrint_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "geometry_msgs/Pose.h" + +namespace jsk_interactive_marker +{ + +static const char SNAPFOOTPRINT[] = "jsk_interactive_marker/SnapFootPrint"; + + class SnapFootPrintRequest : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _input_pose_type; + _input_pose_type input_pose; + typedef geometry_msgs::Pose _lleg_pose_type; + _lleg_pose_type lleg_pose; + typedef geometry_msgs::Pose _rleg_pose_type; + _rleg_pose_type rleg_pose; + + SnapFootPrintRequest(): + input_pose(), + lleg_pose(), + rleg_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->input_pose.serialize(outbuffer + offset); + offset += this->lleg_pose.serialize(outbuffer + offset); + offset += this->rleg_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->input_pose.deserialize(inbuffer + offset); + offset += this->lleg_pose.deserialize(inbuffer + offset); + offset += this->rleg_pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SNAPFOOTPRINT; }; + virtual const char * getMD5() override { return "07fc9b79352f12bc13742f589662de86"; }; + + }; + + class SnapFootPrintResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef geometry_msgs::PoseStamped _snapped_pose_type; + _snapped_pose_type snapped_pose; + + SnapFootPrintResponse(): + success(0), + snapped_pose() + { + } + + 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->snapped_pose.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->snapped_pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SNAPFOOTPRINT; }; + virtual const char * getMD5() override { return "a900428084c91b5e6bdb3a3c62cb401d"; }; + + }; + + class SnapFootPrint { + public: + typedef SnapFootPrintRequest Request; + typedef SnapFootPrintResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SnapFootPrintInput.h b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SnapFootPrintInput.h new file mode 100644 index 000000000..b40a6f64b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_interactive_marker/SnapFootPrintInput.h @@ -0,0 +1,55 @@ +#ifndef _ROS_jsk_interactive_marker_SnapFootPrintInput_h +#define _ROS_jsk_interactive_marker_SnapFootPrintInput_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "geometry_msgs/Pose.h" + +namespace jsk_interactive_marker +{ + + class SnapFootPrintInput : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _input_pose_type; + _input_pose_type input_pose; + typedef geometry_msgs::Pose _lleg_pose_type; + _lleg_pose_type lleg_pose; + typedef geometry_msgs::Pose _rleg_pose_type; + _rleg_pose_type rleg_pose; + + SnapFootPrintInput(): + input_pose(), + lleg_pose(), + rleg_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->input_pose.serialize(outbuffer + offset); + offset += this->lleg_pose.serialize(outbuffer + offset); + offset += this->rleg_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->input_pose.deserialize(inbuffer + offset); + offset += this->lleg_pose.deserialize(inbuffer + offset); + offset += this->rleg_pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_interactive_marker/SnapFootPrintInput"; }; + virtual const char * getMD5() override { return "07fc9b79352f12bc13742f589662de86"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/AllTypeTest.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/AllTypeTest.h new file mode 100644 index 000000000..7cc490fa3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/AllTypeTest.h @@ -0,0 +1,410 @@ +#ifndef _ROS_jsk_network_tools_AllTypeTest_h +#define _ROS_jsk_network_tools_AllTypeTest_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_network_tools +{ + + class AllTypeTest : public ros::Msg + { + public: + typedef bool _bool_atom_type; + _bool_atom_type bool_atom; + bool bool_array[4]; + typedef uint8_t _uint8_atom_type; + _uint8_atom_type uint8_atom; + uint8_t uint8_array[4]; + typedef int8_t _int8_atom_type; + _int8_atom_type int8_atom; + int8_t int8_array[4]; + typedef uint16_t _uint16_atom_type; + _uint16_atom_type uint16_atom; + uint16_t uint16_array[4]; + typedef int32_t _int32_atom_type; + _int32_atom_type int32_atom; + int32_t int32_array[4]; + typedef uint32_t _uint32_atom_type; + _uint32_atom_type uint32_atom; + uint32_t uint32_array[4]; + typedef int64_t _int64_atom_type; + _int64_atom_type int64_atom; + int64_t int64_array[4]; + typedef uint64_t _uint64_atom_type; + _uint64_atom_type uint64_atom; + uint64_t uint64_array[4]; + typedef float _float32_atom_type; + _float32_atom_type float32_atom; + float float32_array[4]; + typedef float _float64_atom_type; + _float64_atom_type float64_atom; + float float64_array[4]; + + AllTypeTest(): + bool_atom(0), + bool_array(), + uint8_atom(0), + uint8_array(), + int8_atom(0), + int8_array(), + uint16_atom(0), + uint16_array(), + int32_atom(0), + int32_array(), + uint32_atom(0), + uint32_array(), + int64_atom(0), + int64_array(), + uint64_atom(0), + uint64_array(), + float32_atom(0), + float32_array(), + float64_atom(0), + float64_array() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_bool_atom; + u_bool_atom.real = this->bool_atom; + *(outbuffer + offset + 0) = (u_bool_atom.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->bool_atom); + for( uint32_t i = 0; i < 4; i++){ + union { + bool real; + uint8_t base; + } u_bool_arrayi; + u_bool_arrayi.real = this->bool_array[i]; + *(outbuffer + offset + 0) = (u_bool_arrayi.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->bool_array[i]); + } + *(outbuffer + offset + 0) = (this->uint8_atom >> (8 * 0)) & 0xFF; + offset += sizeof(this->uint8_atom); + for( uint32_t i = 0; i < 4; i++){ + *(outbuffer + offset + 0) = (this->uint8_array[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->uint8_array[i]); + } + union { + int8_t real; + uint8_t base; + } u_int8_atom; + u_int8_atom.real = this->int8_atom; + *(outbuffer + offset + 0) = (u_int8_atom.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->int8_atom); + for( uint32_t i = 0; i < 4; i++){ + union { + int8_t real; + uint8_t base; + } u_int8_arrayi; + u_int8_arrayi.real = this->int8_array[i]; + *(outbuffer + offset + 0) = (u_int8_arrayi.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->int8_array[i]); + } + *(outbuffer + offset + 0) = (this->uint16_atom >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint16_atom >> (8 * 1)) & 0xFF; + offset += sizeof(this->uint16_atom); + for( uint32_t i = 0; i < 4; i++){ + *(outbuffer + offset + 0) = (this->uint16_array[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint16_array[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->uint16_array[i]); + } + union { + int32_t real; + uint32_t base; + } u_int32_atom; + u_int32_atom.real = this->int32_atom; + *(outbuffer + offset + 0) = (u_int32_atom.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_int32_atom.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_int32_atom.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_int32_atom.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->int32_atom); + for( uint32_t i = 0; i < 4; i++){ + union { + int32_t real; + uint32_t base; + } u_int32_arrayi; + u_int32_arrayi.real = this->int32_array[i]; + *(outbuffer + offset + 0) = (u_int32_arrayi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_int32_arrayi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_int32_arrayi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_int32_arrayi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->int32_array[i]); + } + *(outbuffer + offset + 0) = (this->uint32_atom >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint32_atom >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint32_atom >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint32_atom >> (8 * 3)) & 0xFF; + offset += sizeof(this->uint32_atom); + for( uint32_t i = 0; i < 4; i++){ + *(outbuffer + offset + 0) = (this->uint32_array[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint32_array[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint32_array[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint32_array[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->uint32_array[i]); + } + union { + int64_t real; + uint64_t base; + } u_int64_atom; + u_int64_atom.real = this->int64_atom; + *(outbuffer + offset + 0) = (u_int64_atom.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_int64_atom.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_int64_atom.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_int64_atom.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_int64_atom.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_int64_atom.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_int64_atom.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_int64_atom.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->int64_atom); + for( uint32_t i = 0; i < 4; i++){ + union { + int64_t real; + uint64_t base; + } u_int64_arrayi; + u_int64_arrayi.real = this->int64_array[i]; + *(outbuffer + offset + 0) = (u_int64_arrayi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_int64_arrayi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_int64_arrayi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_int64_arrayi.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_int64_arrayi.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_int64_arrayi.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_int64_arrayi.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_int64_arrayi.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->int64_array[i]); + } + *(outbuffer + offset + 0) = (this->uint64_atom >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint64_atom >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint64_atom >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint64_atom >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->uint64_atom >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->uint64_atom >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->uint64_atom >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->uint64_atom >> (8 * 7)) & 0xFF; + offset += sizeof(this->uint64_atom); + for( uint32_t i = 0; i < 4; i++){ + *(outbuffer + offset + 0) = (this->uint64_array[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint64_array[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint64_array[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint64_array[i] >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->uint64_array[i] >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->uint64_array[i] >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->uint64_array[i] >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->uint64_array[i] >> (8 * 7)) & 0xFF; + offset += sizeof(this->uint64_array[i]); + } + union { + float real; + uint32_t base; + } u_float32_atom; + u_float32_atom.real = this->float32_atom; + *(outbuffer + offset + 0) = (u_float32_atom.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_float32_atom.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_float32_atom.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_float32_atom.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->float32_atom); + for( uint32_t i = 0; i < 4; i++){ + union { + float real; + uint32_t base; + } u_float32_arrayi; + u_float32_arrayi.real = this->float32_array[i]; + *(outbuffer + offset + 0) = (u_float32_arrayi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_float32_arrayi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_float32_arrayi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_float32_arrayi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->float32_array[i]); + } + offset += serializeAvrFloat64(outbuffer + offset, this->float64_atom); + for( uint32_t i = 0; i < 4; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->float64_array[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_bool_atom; + u_bool_atom.base = 0; + u_bool_atom.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->bool_atom = u_bool_atom.real; + offset += sizeof(this->bool_atom); + for( uint32_t i = 0; i < 4; i++){ + union { + bool real; + uint8_t base; + } u_bool_arrayi; + u_bool_arrayi.base = 0; + u_bool_arrayi.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->bool_array[i] = u_bool_arrayi.real; + offset += sizeof(this->bool_array[i]); + } + this->uint8_atom = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->uint8_atom); + for( uint32_t i = 0; i < 4; i++){ + this->uint8_array[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->uint8_array[i]); + } + union { + int8_t real; + uint8_t base; + } u_int8_atom; + u_int8_atom.base = 0; + u_int8_atom.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->int8_atom = u_int8_atom.real; + offset += sizeof(this->int8_atom); + for( uint32_t i = 0; i < 4; i++){ + union { + int8_t real; + uint8_t base; + } u_int8_arrayi; + u_int8_arrayi.base = 0; + u_int8_arrayi.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->int8_array[i] = u_int8_arrayi.real; + offset += sizeof(this->int8_array[i]); + } + this->uint16_atom = ((uint16_t) (*(inbuffer + offset))); + this->uint16_atom |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->uint16_atom); + for( uint32_t i = 0; i < 4; i++){ + this->uint16_array[i] = ((uint16_t) (*(inbuffer + offset))); + this->uint16_array[i] |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->uint16_array[i]); + } + union { + int32_t real; + uint32_t base; + } u_int32_atom; + u_int32_atom.base = 0; + u_int32_atom.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_int32_atom.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_int32_atom.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_int32_atom.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->int32_atom = u_int32_atom.real; + offset += sizeof(this->int32_atom); + for( uint32_t i = 0; i < 4; i++){ + union { + int32_t real; + uint32_t base; + } u_int32_arrayi; + u_int32_arrayi.base = 0; + u_int32_arrayi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_int32_arrayi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_int32_arrayi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_int32_arrayi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->int32_array[i] = u_int32_arrayi.real; + offset += sizeof(this->int32_array[i]); + } + this->uint32_atom = ((uint32_t) (*(inbuffer + offset))); + this->uint32_atom |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->uint32_atom |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->uint32_atom |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->uint32_atom); + for( uint32_t i = 0; i < 4; i++){ + this->uint32_array[i] = ((uint32_t) (*(inbuffer + offset))); + this->uint32_array[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->uint32_array[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->uint32_array[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->uint32_array[i]); + } + union { + int64_t real; + uint64_t base; + } u_int64_atom; + u_int64_atom.base = 0; + u_int64_atom.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_int64_atom.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_int64_atom.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_int64_atom.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_int64_atom.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_int64_atom.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_int64_atom.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_int64_atom.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->int64_atom = u_int64_atom.real; + offset += sizeof(this->int64_atom); + for( uint32_t i = 0; i < 4; i++){ + union { + int64_t real; + uint64_t base; + } u_int64_arrayi; + u_int64_arrayi.base = 0; + u_int64_arrayi.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_int64_arrayi.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_int64_arrayi.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_int64_arrayi.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_int64_arrayi.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_int64_arrayi.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_int64_arrayi.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_int64_arrayi.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->int64_array[i] = u_int64_arrayi.real; + offset += sizeof(this->int64_array[i]); + } + this->uint64_atom = ((uint64_t) (*(inbuffer + offset))); + this->uint64_atom |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->uint64_atom |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->uint64_atom |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->uint64_atom |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->uint64_atom |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->uint64_atom |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->uint64_atom |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->uint64_atom); + for( uint32_t i = 0; i < 4; i++){ + this->uint64_array[i] = ((uint64_t) (*(inbuffer + offset))); + this->uint64_array[i] |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->uint64_array[i] |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->uint64_array[i] |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->uint64_array[i] |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->uint64_array[i] |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->uint64_array[i] |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->uint64_array[i] |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->uint64_array[i]); + } + union { + float real; + uint32_t base; + } u_float32_atom; + u_float32_atom.base = 0; + u_float32_atom.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_float32_atom.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_float32_atom.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_float32_atom.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->float32_atom = u_float32_atom.real; + offset += sizeof(this->float32_atom); + for( uint32_t i = 0; i < 4; i++){ + union { + float real; + uint32_t base; + } u_float32_arrayi; + u_float32_arrayi.base = 0; + u_float32_arrayi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_float32_arrayi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_float32_arrayi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_float32_arrayi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->float32_array[i] = u_float32_arrayi.real; + offset += sizeof(this->float32_array[i]); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->float64_atom)); + for( uint32_t i = 0; i < 4; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->float64_array[i])); + } + return offset; + } + + virtual const char * getType() override { return "jsk_network_tools/AllTypeTest"; }; + virtual const char * getMD5() override { return "e38fde731d43d6674bf0d48497971fd6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/CompressedAngleVectorPR2.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/CompressedAngleVectorPR2.h new file mode 100644 index 000000000..147c7fa4d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/CompressedAngleVectorPR2.h @@ -0,0 +1,48 @@ +#ifndef _ROS_jsk_network_tools_CompressedAngleVectorPR2_h +#define _ROS_jsk_network_tools_CompressedAngleVectorPR2_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_network_tools +{ + + class CompressedAngleVectorPR2 : public ros::Msg + { + public: + uint8_t angles[17]; + + CompressedAngleVectorPR2(): + angles() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 17; i++){ + *(outbuffer + offset + 0) = (this->angles[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->angles[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 17; i++){ + this->angles[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->angles[i]); + } + return offset; + } + + virtual const char * getType() override { return "jsk_network_tools/CompressedAngleVectorPR2"; }; + virtual const char * getMD5() override { return "41a167b428fc98b1c378a7ba1bae8d54"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/FC2OCS.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/FC2OCS.h new file mode 100644 index 000000000..d6f44d31a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/FC2OCS.h @@ -0,0 +1,106 @@ +#ifndef _ROS_jsk_network_tools_FC2OCS_h +#define _ROS_jsk_network_tools_FC2OCS_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_network_tools +{ + + class FC2OCS : public ros::Msg + { + public: + uint8_t joint_angles[32]; + uint8_t lhand_force[6]; + uint8_t rhand_force[6]; + uint8_t lfoot_force[6]; + uint8_t rfoot_force[6]; + typedef bool _servo_state_type; + _servo_state_type servo_state; + + FC2OCS(): + joint_angles(), + lhand_force(), + rhand_force(), + lfoot_force(), + rfoot_force(), + servo_state(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 32; i++){ + *(outbuffer + offset + 0) = (this->joint_angles[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_angles[i]); + } + for( uint32_t i = 0; i < 6; i++){ + *(outbuffer + offset + 0) = (this->lhand_force[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->lhand_force[i]); + } + for( uint32_t i = 0; i < 6; i++){ + *(outbuffer + offset + 0) = (this->rhand_force[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->rhand_force[i]); + } + for( uint32_t i = 0; i < 6; i++){ + *(outbuffer + offset + 0) = (this->lfoot_force[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->lfoot_force[i]); + } + for( uint32_t i = 0; i < 6; i++){ + *(outbuffer + offset + 0) = (this->rfoot_force[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->rfoot_force[i]); + } + union { + bool real; + uint8_t base; + } u_servo_state; + u_servo_state.real = this->servo_state; + *(outbuffer + offset + 0) = (u_servo_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->servo_state); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 32; i++){ + this->joint_angles[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->joint_angles[i]); + } + for( uint32_t i = 0; i < 6; i++){ + this->lhand_force[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->lhand_force[i]); + } + for( uint32_t i = 0; i < 6; i++){ + this->rhand_force[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rhand_force[i]); + } + for( uint32_t i = 0; i < 6; i++){ + this->lfoot_force[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->lfoot_force[i]); + } + for( uint32_t i = 0; i < 6; i++){ + this->rfoot_force[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->rfoot_force[i]); + } + union { + bool real; + uint8_t base; + } u_servo_state; + u_servo_state.base = 0; + u_servo_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->servo_state = u_servo_state.real; + offset += sizeof(this->servo_state); + return offset; + } + + virtual const char * getType() override { return "jsk_network_tools/FC2OCS"; }; + virtual const char * getMD5() override { return "7a556e2b1084dcaa36eeac7b2f905853"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/FC2OCSLargeData.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/FC2OCSLargeData.h new file mode 100644 index 000000000..14d776035 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/FC2OCSLargeData.h @@ -0,0 +1,55 @@ +#ifndef _ROS_jsk_network_tools_FC2OCSLargeData_h +#define _ROS_jsk_network_tools_FC2OCSLargeData_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/JointState.h" + +namespace jsk_network_tools +{ + + class FC2OCSLargeData : public ros::Msg + { + public: + typedef sensor_msgs::Image _camera__rgb__image_rect_color_type; + _camera__rgb__image_rect_color_type camera__rgb__image_rect_color; + typedef sensor_msgs::JointState _joint_state_type; + _joint_state_type joint_state; + typedef sensor_msgs::Image _usb_cam__image_raw_type; + _usb_cam__image_raw_type usb_cam__image_raw; + + FC2OCSLargeData(): + camera__rgb__image_rect_color(), + joint_state(), + usb_cam__image_raw() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->camera__rgb__image_rect_color.serialize(outbuffer + offset); + offset += this->joint_state.serialize(outbuffer + offset); + offset += this->usb_cam__image_raw.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->camera__rgb__image_rect_color.deserialize(inbuffer + offset); + offset += this->joint_state.deserialize(inbuffer + offset); + offset += this->usb_cam__image_raw.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_network_tools/FC2OCSLargeData"; }; + virtual const char * getMD5() override { return "51c7ca6e66514e69ddd1a156f6a0b404"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/Heartbeat.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/Heartbeat.h new file mode 100644 index 000000000..fa7a3d63b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/Heartbeat.h @@ -0,0 +1,68 @@ +#ifndef _ROS_jsk_network_tools_Heartbeat_h +#define _ROS_jsk_network_tools_Heartbeat_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_network_tools +{ + + class Heartbeat : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _rate_type; + _rate_type rate; + + Heartbeat(): + header(), + rate(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_rate; + u_rate.real = this->rate; + *(outbuffer + offset + 0) = (u_rate.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rate.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rate.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rate.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->rate); + 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_rate; + u_rate.base = 0; + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->rate = u_rate.real; + offset += sizeof(this->rate); + return offset; + } + + virtual const char * getType() override { return "jsk_network_tools/Heartbeat"; }; + virtual const char * getMD5() override { return "5dcf7e58d50fbf046c592264dc354dea"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/HeartbeatResponse.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/HeartbeatResponse.h new file mode 100644 index 000000000..8139214a3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/HeartbeatResponse.h @@ -0,0 +1,50 @@ +#ifndef _ROS_jsk_network_tools_HeartbeatResponse_h +#define _ROS_jsk_network_tools_HeartbeatResponse_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_network_tools/Heartbeat.h" + +namespace jsk_network_tools +{ + + class HeartbeatResponse : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef jsk_network_tools::Heartbeat _heartbeat_type; + _heartbeat_type heartbeat; + + HeartbeatResponse(): + header(), + heartbeat() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->heartbeat.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->heartbeat.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_network_tools/HeartbeatResponse"; }; + virtual const char * getMD5() override { return "ffc0783982ce8ad53fd088a07b64ca4b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/OCS2FC.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/OCS2FC.h new file mode 100644 index 000000000..62f82ab0b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/OCS2FC.h @@ -0,0 +1,84 @@ +#ifndef _ROS_jsk_network_tools_OCS2FC_h +#define _ROS_jsk_network_tools_OCS2FC_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_network_tools +{ + + class OCS2FC : public ros::Msg + { + public: + uint8_t joint_angles[32]; + typedef bool _start_impedance_type; + _start_impedance_type start_impedance; + typedef bool _stop_type; + _stop_type stop; + + OCS2FC(): + joint_angles(), + start_impedance(0), + stop(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 32; i++){ + *(outbuffer + offset + 0) = (this->joint_angles[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->joint_angles[i]); + } + union { + bool real; + uint8_t base; + } u_start_impedance; + u_start_impedance.real = this->start_impedance; + *(outbuffer + offset + 0) = (u_start_impedance.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->start_impedance); + union { + bool real; + uint8_t base; + } u_stop; + u_stop.real = this->stop; + *(outbuffer + offset + 0) = (u_stop.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stop); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 32; i++){ + this->joint_angles[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->joint_angles[i]); + } + union { + bool real; + uint8_t base; + } u_start_impedance; + u_start_impedance.base = 0; + u_start_impedance.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->start_impedance = u_start_impedance.real; + offset += sizeof(this->start_impedance); + union { + bool real; + uint8_t base; + } u_stop; + u_stop.base = 0; + u_stop.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stop = u_stop.real; + offset += sizeof(this->stop); + return offset; + } + + virtual const char * getType() override { return "jsk_network_tools/OCS2FC"; }; + virtual const char * getMD5() override { return "036058ee69589b4817d296161ea7f432"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/OpenNISample.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/OpenNISample.h new file mode 100644 index 000000000..c1b06601b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/OpenNISample.h @@ -0,0 +1,50 @@ +#ifndef _ROS_jsk_network_tools_OpenNISample_h +#define _ROS_jsk_network_tools_OpenNISample_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/PointCloud2.h" + +namespace jsk_network_tools +{ + + class OpenNISample : public ros::Msg + { + public: + typedef sensor_msgs::Image _camera__rgb__image_rect_color_type; + _camera__rgb__image_rect_color_type camera__rgb__image_rect_color; + typedef sensor_msgs::PointCloud2 _camera__depth_registered__points_type; + _camera__depth_registered__points_type camera__depth_registered__points; + + OpenNISample(): + camera__rgb__image_rect_color(), + camera__depth_registered__points() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->camera__rgb__image_rect_color.serialize(outbuffer + offset); + offset += this->camera__depth_registered__points.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->camera__rgb__image_rect_color.deserialize(inbuffer + offset); + offset += this->camera__depth_registered__points.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_network_tools/OpenNISample"; }; + virtual const char * getMD5() override { return "c998c0df481d0ad4598a2534cadda5d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/SetSendRate.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/SetSendRate.h new file mode 100644 index 000000000..f8e2f2d70 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/SetSendRate.h @@ -0,0 +1,112 @@ +#ifndef _ROS_SERVICE_SetSendRate_h +#define _ROS_SERVICE_SetSendRate_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_network_tools +{ + +static const char SETSENDRATE[] = "jsk_network_tools/SetSendRate"; + + class SetSendRateRequest : public ros::Msg + { + public: + typedef float _rate_type; + _rate_type rate; + + SetSendRateRequest(): + rate(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_rate; + u_rate.real = this->rate; + *(outbuffer + offset + 0) = (u_rate.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rate.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rate.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rate.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->rate); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_rate; + u_rate.base = 0; + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->rate = u_rate.real; + offset += sizeof(this->rate); + return offset; + } + + virtual const char * getType() override { return SETSENDRATE; }; + virtual const char * getMD5() override { return "d123feed52ffd68fd389a747575f2b84"; }; + + }; + + class SetSendRateResponse : public ros::Msg + { + public: + typedef bool _ok_type; + _ok_type ok; + + SetSendRateResponse(): + 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 SETSENDRATE; }; + virtual const char * getMD5() override { return "6f6da3883749771fac40d6deb24a8c02"; }; + + }; + + class SetSendRate { + public: + typedef SetSendRateRequest Request; + typedef SetSendRateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/SilverhammerInternalBuffer.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/SilverhammerInternalBuffer.h new file mode 100644 index 000000000..e1888799d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/SilverhammerInternalBuffer.h @@ -0,0 +1,84 @@ +#ifndef _ROS_jsk_network_tools_SilverhammerInternalBuffer_h +#define _ROS_jsk_network_tools_SilverhammerInternalBuffer_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_network_tools +{ + + class SilverhammerInternalBuffer : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _seq_id_type; + _seq_id_type seq_id; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + SilverhammerInternalBuffer(): + header(), + seq_id(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->seq_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->seq_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->seq_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->seq_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_id); + *(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->seq_id = ((uint32_t) (*(inbuffer + offset))); + this->seq_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->seq_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->seq_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->seq_id); + 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 "jsk_network_tools/SilverhammerInternalBuffer"; }; + virtual const char * getMD5() override { return "b0224c297e0e2b6e1ac36f4f9188136f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/WifiStatus.h b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/WifiStatus.h new file mode 100644 index 000000000..ba640a260 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_network_tools/WifiStatus.h @@ -0,0 +1,243 @@ +#ifndef _ROS_jsk_network_tools_WifiStatus_h +#define _ROS_jsk_network_tools_WifiStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_network_tools +{ + + class WifiStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _interface_type; + _interface_type interface; + typedef bool _enabled_type; + _enabled_type enabled; + typedef bool _connected_type; + _connected_type connected; + typedef const char* _ssid_type; + _ssid_type ssid; + typedef float _frequency_type; + _frequency_type frequency; + typedef const char* _access_point_type; + _access_point_type access_point; + typedef float _bitrate_type; + _bitrate_type bitrate; + typedef int16_t _tx_power_type; + _tx_power_type tx_power; + typedef float _link_quality_type; + _link_quality_type link_quality; + typedef int16_t _signal_level_type; + _signal_level_type signal_level; + + WifiStatus(): + header(), + interface(""), + enabled(0), + connected(0), + ssid(""), + frequency(0), + access_point(""), + bitrate(0), + tx_power(0), + link_quality(0), + signal_level(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_interface = strlen(this->interface); + varToArr(outbuffer + offset, length_interface); + offset += 4; + memcpy(outbuffer + offset, this->interface, length_interface); + offset += length_interface; + union { + bool real; + uint8_t base; + } u_enabled; + u_enabled.real = this->enabled; + *(outbuffer + offset + 0) = (u_enabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->enabled); + 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); + uint32_t length_ssid = strlen(this->ssid); + varToArr(outbuffer + offset, length_ssid); + offset += 4; + memcpy(outbuffer + offset, this->ssid, length_ssid); + offset += length_ssid; + union { + float real; + uint32_t base; + } u_frequency; + u_frequency.real = this->frequency; + *(outbuffer + offset + 0) = (u_frequency.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_frequency.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_frequency.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_frequency.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->frequency); + uint32_t length_access_point = strlen(this->access_point); + varToArr(outbuffer + offset, length_access_point); + offset += 4; + memcpy(outbuffer + offset, this->access_point, length_access_point); + offset += length_access_point; + union { + float real; + uint32_t base; + } u_bitrate; + u_bitrate.real = this->bitrate; + *(outbuffer + offset + 0) = (u_bitrate.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_bitrate.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_bitrate.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_bitrate.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->bitrate); + union { + int16_t real; + uint16_t base; + } u_tx_power; + u_tx_power.real = this->tx_power; + *(outbuffer + offset + 0) = (u_tx_power.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_tx_power.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->tx_power); + union { + float real; + uint32_t base; + } u_link_quality; + u_link_quality.real = this->link_quality; + *(outbuffer + offset + 0) = (u_link_quality.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_link_quality.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_link_quality.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_link_quality.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->link_quality); + union { + int16_t real; + uint16_t base; + } u_signal_level; + u_signal_level.real = this->signal_level; + *(outbuffer + offset + 0) = (u_signal_level.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_signal_level.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->signal_level); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_interface; + arrToVar(length_interface, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_interface; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_interface-1]=0; + this->interface = (char *)(inbuffer + offset-1); + offset += length_interface; + union { + bool real; + uint8_t base; + } u_enabled; + u_enabled.base = 0; + u_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->enabled = u_enabled.real; + offset += sizeof(this->enabled); + 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); + uint32_t length_ssid; + arrToVar(length_ssid, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ssid; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ssid-1]=0; + this->ssid = (char *)(inbuffer + offset-1); + offset += length_ssid; + union { + float real; + uint32_t base; + } u_frequency; + u_frequency.base = 0; + u_frequency.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_frequency.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_frequency.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_frequency.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->frequency = u_frequency.real; + offset += sizeof(this->frequency); + uint32_t length_access_point; + arrToVar(length_access_point, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_access_point; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_access_point-1]=0; + this->access_point = (char *)(inbuffer + offset-1); + offset += length_access_point; + union { + float real; + uint32_t base; + } u_bitrate; + u_bitrate.base = 0; + u_bitrate.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_bitrate.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_bitrate.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_bitrate.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->bitrate = u_bitrate.real; + offset += sizeof(this->bitrate); + union { + int16_t real; + uint16_t base; + } u_tx_power; + u_tx_power.base = 0; + u_tx_power.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_tx_power.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->tx_power = u_tx_power.real; + offset += sizeof(this->tx_power); + union { + float real; + uint32_t base; + } u_link_quality; + u_link_quality.base = 0; + u_link_quality.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_link_quality.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_link_quality.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_link_quality.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->link_quality = u_link_quality.real; + offset += sizeof(this->link_quality); + union { + int16_t real; + uint16_t base; + } u_signal_level; + u_signal_level.base = 0; + u_signal_level.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_signal_level.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->signal_level = u_signal_level.real; + offset += sizeof(this->signal_level); + return offset; + } + + virtual const char * getType() override { return "jsk_network_tools/WifiStatus"; }; + virtual const char * getMD5() override { return "94da4b64008d69473c62c62019a8c0f6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_perception/EuclideanSegment.h b/smart_device_protocol/ros_lib/ros_lib/jsk_perception/EuclideanSegment.h new file mode 100644 index 000000000..487ff2918 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_perception/EuclideanSegment.h @@ -0,0 +1,125 @@ +#ifndef _ROS_SERVICE_EuclideanSegment_h +#define _ROS_SERVICE_EuclideanSegment_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace jsk_perception +{ + +static const char EUCLIDEANSEGMENT[] = "jsk_perception/EuclideanSegment"; + + class EuclideanSegmentRequest : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _input_type; + _input_type input; + typedef float _tolerance_type; + _tolerance_type tolerance; + + EuclideanSegmentRequest(): + input(), + tolerance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->input.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; + offset += this->input.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 EUCLIDEANSEGMENT; }; + virtual const char * getMD5() override { return "116dd66bdc82f46d7b7414ce880ea794"; }; + + }; + + class EuclideanSegmentResponse : public ros::Msg + { + public: + uint32_t output_length; + typedef sensor_msgs::PointCloud2 _output_type; + _output_type st_output; + _output_type * output; + + EuclideanSegmentResponse(): + output_length(0), st_output(), output(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->output_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->output_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->output_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->output_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->output_length); + for( uint32_t i = 0; i < output_length; i++){ + offset += this->output[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t output_lengthT = ((uint32_t) (*(inbuffer + offset))); + output_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + output_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + output_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->output_length); + if(output_lengthT > output_length) + this->output = (sensor_msgs::PointCloud2*)realloc(this->output, output_lengthT * sizeof(sensor_msgs::PointCloud2)); + output_length = output_lengthT; + for( uint32_t i = 0; i < output_length; i++){ + offset += this->st_output.deserialize(inbuffer + offset); + memcpy( &(this->output[i]), &(this->st_output), sizeof(sensor_msgs::PointCloud2)); + } + return offset; + } + + virtual const char * getType() override { return EUCLIDEANSEGMENT; }; + virtual const char * getMD5() override { return "6db5ac8d8316fdb3e0c62197115f87cd"; }; + + }; + + class EuclideanSegment { + public: + typedef EuclideanSegmentRequest Request; + typedef EuclideanSegmentResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_perception/NonMaximumSuppression.h b/smart_device_protocol/ros_lib/ros_lib/jsk_perception/NonMaximumSuppression.h new file mode 100644 index 000000000..6a5ceef4d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_perception/NonMaximumSuppression.h @@ -0,0 +1,177 @@ +#ifndef _ROS_SERVICE_NonMaximumSuppression_h +#define _ROS_SERVICE_NonMaximumSuppression_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_recognition_msgs/Rect.h" + +namespace jsk_perception +{ + +static const char NONMAXIMUMSUPPRESSION[] = "jsk_perception/NonMaximumSuppression"; + + class NonMaximumSuppressionRequest : public ros::Msg + { + public: + uint32_t rect_length; + typedef jsk_recognition_msgs::Rect _rect_type; + _rect_type st_rect; + _rect_type * rect; + typedef float _threshold_type; + _threshold_type threshold; + + NonMaximumSuppressionRequest(): + rect_length(0), st_rect(), rect(nullptr), + threshold(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->rect_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rect_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rect_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rect_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rect_length); + for( uint32_t i = 0; i < rect_length; i++){ + offset += this->rect[i].serialize(outbuffer + offset); + } + union { + float real; + uint32_t base; + } u_threshold; + u_threshold.real = this->threshold; + *(outbuffer + offset + 0) = (u_threshold.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_threshold.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_threshold.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_threshold.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->threshold); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t rect_lengthT = ((uint32_t) (*(inbuffer + offset))); + rect_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rect_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rect_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rect_length); + if(rect_lengthT > rect_length) + this->rect = (jsk_recognition_msgs::Rect*)realloc(this->rect, rect_lengthT * sizeof(jsk_recognition_msgs::Rect)); + rect_length = rect_lengthT; + for( uint32_t i = 0; i < rect_length; i++){ + offset += this->st_rect.deserialize(inbuffer + offset); + memcpy( &(this->rect[i]), &(this->st_rect), sizeof(jsk_recognition_msgs::Rect)); + } + union { + float real; + uint32_t base; + } u_threshold; + u_threshold.base = 0; + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->threshold = u_threshold.real; + offset += sizeof(this->threshold); + return offset; + } + + virtual const char * getType() override { return NONMAXIMUMSUPPRESSION; }; + virtual const char * getMD5() override { return "54b7e6632715e9e6592b503a3c881dfc"; }; + + }; + + class NonMaximumSuppressionResponse : public ros::Msg + { + public: + uint32_t bbox_length; + typedef jsk_recognition_msgs::Rect _bbox_type; + _bbox_type st_bbox; + _bbox_type * bbox; + typedef int64_t _bbox_count_type; + _bbox_count_type bbox_count; + + NonMaximumSuppressionResponse(): + bbox_length(0), st_bbox(), bbox(nullptr), + bbox_count(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->bbox_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->bbox_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->bbox_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->bbox_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->bbox_length); + for( uint32_t i = 0; i < bbox_length; i++){ + offset += this->bbox[i].serialize(outbuffer + offset); + } + union { + int64_t real; + uint64_t base; + } u_bbox_count; + u_bbox_count.real = this->bbox_count; + *(outbuffer + offset + 0) = (u_bbox_count.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_bbox_count.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_bbox_count.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_bbox_count.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_bbox_count.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_bbox_count.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_bbox_count.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_bbox_count.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->bbox_count); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t bbox_lengthT = ((uint32_t) (*(inbuffer + offset))); + bbox_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + bbox_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + bbox_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->bbox_length); + if(bbox_lengthT > bbox_length) + this->bbox = (jsk_recognition_msgs::Rect*)realloc(this->bbox, bbox_lengthT * sizeof(jsk_recognition_msgs::Rect)); + bbox_length = bbox_lengthT; + for( uint32_t i = 0; i < bbox_length; i++){ + offset += this->st_bbox.deserialize(inbuffer + offset); + memcpy( &(this->bbox[i]), &(this->st_bbox), sizeof(jsk_recognition_msgs::Rect)); + } + union { + int64_t real; + uint64_t base; + } u_bbox_count; + u_bbox_count.base = 0; + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->bbox_count = u_bbox_count.real; + offset += sizeof(this->bbox_count); + return offset; + } + + virtual const char * getType() override { return NONMAXIMUMSUPPRESSION; }; + virtual const char * getMD5() override { return "8db21435e67f6d13fc94ccbd355f30f1"; }; + + }; + + class NonMaximumSuppression { + public: + typedef NonMaximumSuppressionRequest Request; + typedef NonMaximumSuppressionResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_perception/SetTemplate.h b/smart_device_protocol/ros_lib/ros_lib/jsk_perception/SetTemplate.h new file mode 100644 index 000000000..06e797104 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_perception/SetTemplate.h @@ -0,0 +1,164 @@ +#ifndef _ROS_SERVICE_SetTemplate_h +#define _ROS_SERVICE_SetTemplate_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "sensor_msgs/Image.h" + +namespace jsk_perception +{ + +static const char SETTEMPLATE[] = "jsk_perception/SetTemplate"; + + class SetTemplateRequest : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + typedef sensor_msgs::Image _image_type; + _image_type image; + typedef float _dimx_type; + _dimx_type dimx; + typedef float _dimy_type; + _dimy_type dimy; + typedef geometry_msgs::Pose _relativepose_type; + _relativepose_type relativepose; + typedef const char* _savefilename_type; + _savefilename_type savefilename; + + SetTemplateRequest(): + type(""), + image(), + dimx(0), + dimy(0), + relativepose(), + savefilename("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + offset += this->image.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_dimx; + u_dimx.real = this->dimx; + *(outbuffer + offset + 0) = (u_dimx.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dimx.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dimx.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dimx.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dimx); + union { + float real; + uint32_t base; + } u_dimy; + u_dimy.real = this->dimy; + *(outbuffer + offset + 0) = (u_dimy.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dimy.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dimy.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dimy.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dimy); + offset += this->relativepose.serialize(outbuffer + offset); + uint32_t length_savefilename = strlen(this->savefilename); + varToArr(outbuffer + offset, length_savefilename); + offset += 4; + memcpy(outbuffer + offset, this->savefilename, length_savefilename); + offset += length_savefilename; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + offset += this->image.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_dimx; + u_dimx.base = 0; + u_dimx.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dimx.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dimx.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dimx.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dimx = u_dimx.real; + offset += sizeof(this->dimx); + union { + float real; + uint32_t base; + } u_dimy; + u_dimy.base = 0; + u_dimy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dimy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dimy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dimy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dimy = u_dimy.real; + offset += sizeof(this->dimy); + offset += this->relativepose.deserialize(inbuffer + offset); + uint32_t length_savefilename; + arrToVar(length_savefilename, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_savefilename; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_savefilename-1]=0; + this->savefilename = (char *)(inbuffer + offset-1); + offset += length_savefilename; + return offset; + } + + virtual const char * getType() override { return SETTEMPLATE; }; + virtual const char * getMD5() override { return "116fa80f27cbdfcd76d0b57a30ef79ec"; }; + + }; + + class SetTemplateResponse : public ros::Msg + { + public: + + SetTemplateResponse() + { + } + + 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 SETTEMPLATE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetTemplate { + public: + typedef SetTemplateRequest Request; + typedef SetTemplateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_perception/WhiteBalance.h b/smart_device_protocol/ros_lib/ros_lib/jsk_perception/WhiteBalance.h new file mode 100644 index 000000000..5e4ecb855 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_perception/WhiteBalance.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_WhiteBalance_h +#define _ROS_SERVICE_WhiteBalance_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/Image.h" + +namespace jsk_perception +{ + +static const char WHITEBALANCE[] = "jsk_perception/WhiteBalance"; + + class WhiteBalanceRequest : public ros::Msg + { + public: + float reference_color[3]; + typedef sensor_msgs::Image _input_type; + _input_type input; + + WhiteBalanceRequest(): + reference_color(), + input() + { + } + + 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_reference_colori; + u_reference_colori.real = this->reference_color[i]; + *(outbuffer + offset + 0) = (u_reference_colori.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_reference_colori.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_reference_colori.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_reference_colori.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->reference_color[i]); + } + offset += this->input.serialize(outbuffer + offset); + 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_reference_colori; + u_reference_colori.base = 0; + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->reference_color[i] = u_reference_colori.real; + offset += sizeof(this->reference_color[i]); + } + offset += this->input.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return WHITEBALANCE; }; + virtual const char * getMD5() override { return "d7702dac51626a53e0806ebd0ad35ca3"; }; + + }; + + class WhiteBalanceResponse : public ros::Msg + { + public: + typedef sensor_msgs::Image _output_type; + _output_type output; + + WhiteBalanceResponse(): + output() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->output.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->output.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return WHITEBALANCE; }; + virtual const char * getMD5() override { return "8eeb6eb8777baa5a80bbc676c219bfef"; }; + + }; + + class WhiteBalance { + public: + typedef WhiteBalanceRequest Request; + typedef WhiteBalanceResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_perception/WhiteBalancePoints.h b/smart_device_protocol/ros_lib/ros_lib/jsk_perception/WhiteBalancePoints.h new file mode 100644 index 000000000..1b24e55bd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_perception/WhiteBalancePoints.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_WhiteBalancePoints_h +#define _ROS_SERVICE_WhiteBalancePoints_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace jsk_perception +{ + +static const char WHITEBALANCEPOINTS[] = "jsk_perception/WhiteBalancePoints"; + + class WhiteBalancePointsRequest : public ros::Msg + { + public: + float reference_color[3]; + typedef sensor_msgs::PointCloud2 _input_type; + _input_type input; + + WhiteBalancePointsRequest(): + reference_color(), + input() + { + } + + 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_reference_colori; + u_reference_colori.real = this->reference_color[i]; + *(outbuffer + offset + 0) = (u_reference_colori.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_reference_colori.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_reference_colori.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_reference_colori.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->reference_color[i]); + } + offset += this->input.serialize(outbuffer + offset); + 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_reference_colori; + u_reference_colori.base = 0; + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->reference_color[i] = u_reference_colori.real; + offset += sizeof(this->reference_color[i]); + } + offset += this->input.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return WHITEBALANCEPOINTS; }; + virtual const char * getMD5() override { return "c114e8c81fa040c23390d86cd0cb8e3a"; }; + + }; + + class WhiteBalancePointsResponse : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _output_type; + _output_type output; + + WhiteBalancePointsResponse(): + output() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->output.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->output.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return WHITEBALANCEPOINTS; }; + virtual const char * getMD5() override { return "6db5ac8d8316fdb3e0c62197115f87cd"; }; + + }; + + class WhiteBalancePoints { + public: + typedef WhiteBalancePointsRequest Request; + typedef WhiteBalancePointsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Accuracy.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Accuracy.h new file mode 100644 index 000000000..388569046 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Accuracy.h @@ -0,0 +1,68 @@ +#ifndef _ROS_jsk_recognition_msgs_Accuracy_h +#define _ROS_jsk_recognition_msgs_Accuracy_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class Accuracy : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _accuracy_type; + _accuracy_type accuracy; + + Accuracy(): + header(), + accuracy(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_accuracy; + u_accuracy.real = this->accuracy; + *(outbuffer + offset + 0) = (u_accuracy.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_accuracy.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_accuracy.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_accuracy.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->accuracy); + 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_accuracy; + u_accuracy.base = 0; + u_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_accuracy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->accuracy = u_accuracy.real; + offset += sizeof(this->accuracy); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Accuracy"; }; + virtual const char * getMD5() override { return "198da9dc2684aac2aa03a85a3344f5ef"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoolStamped.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoolStamped.h new file mode 100644 index 000000000..3f9668b86 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoolStamped.h @@ -0,0 +1,62 @@ +#ifndef _ROS_jsk_recognition_msgs_BoolStamped_h +#define _ROS_jsk_recognition_msgs_BoolStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class BoolStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _data_type; + _data_type data; + + BoolStamped(): + header(), + data(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_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + 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_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/BoolStamped"; }; + virtual const char * getMD5() override { return "542e22b190dc8e6eb476d50dda88feb7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBox.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBox.h new file mode 100644 index 000000000..725fe094b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBox.h @@ -0,0 +1,93 @@ +#ifndef _ROS_jsk_recognition_msgs_BoundingBox_h +#define _ROS_jsk_recognition_msgs_BoundingBox_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Vector3.h" + +namespace jsk_recognition_msgs +{ + + class BoundingBox : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef geometry_msgs::Vector3 _dimensions_type; + _dimensions_type dimensions; + typedef float _value_type; + _value_type value; + typedef uint32_t _label_type; + _label_type label; + + BoundingBox(): + header(), + pose(), + dimensions(), + value(0), + label(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + offset += this->dimensions.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + *(outbuffer + offset + 0) = (this->label >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->label >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->label >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->label >> (8 * 3)) & 0xFF; + offset += sizeof(this->label); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + offset += this->dimensions.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + this->label = ((uint32_t) (*(inbuffer + offset))); + this->label |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->label |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->label |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->label); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/BoundingBox"; }; + virtual const char * getMD5() override { return "f4b35de043f6031fe29bcfe43eeb9dca"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxArray.h new file mode 100644 index 000000000..439688462 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_BoundingBoxArray_h +#define _ROS_jsk_recognition_msgs_BoundingBoxArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/BoundingBox.h" + +namespace jsk_recognition_msgs +{ + + class BoundingBoxArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t boxes_length; + typedef jsk_recognition_msgs::BoundingBox _boxes_type; + _boxes_type st_boxes; + _boxes_type * boxes; + + BoundingBoxArray(): + header(), + boxes_length(0), st_boxes(), boxes(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->boxes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->boxes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->boxes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->boxes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->boxes_length); + for( uint32_t i = 0; i < boxes_length; i++){ + offset += this->boxes[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t boxes_lengthT = ((uint32_t) (*(inbuffer + offset))); + boxes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + boxes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + boxes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->boxes_length); + if(boxes_lengthT > boxes_length) + this->boxes = (jsk_recognition_msgs::BoundingBox*)realloc(this->boxes, boxes_lengthT * sizeof(jsk_recognition_msgs::BoundingBox)); + boxes_length = boxes_lengthT; + for( uint32_t i = 0; i < boxes_length; i++){ + offset += this->st_boxes.deserialize(inbuffer + offset); + memcpy( &(this->boxes[i]), &(this->st_boxes), sizeof(jsk_recognition_msgs::BoundingBox)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/BoundingBoxArray"; }; + virtual const char * getMD5() override { return "c8f4a8bb1acd18ce778d183912bb472d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxArrayWithCameraInfo.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxArrayWithCameraInfo.h new file mode 100644 index 000000000..26852652d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxArrayWithCameraInfo.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_recognition_msgs_BoundingBoxArrayWithCameraInfo_h +#define _ROS_jsk_recognition_msgs_BoundingBoxArrayWithCameraInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/BoundingBoxArray.h" +#include "sensor_msgs/CameraInfo.h" + +namespace jsk_recognition_msgs +{ + + class BoundingBoxArrayWithCameraInfo : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef jsk_recognition_msgs::BoundingBoxArray _boxes_type; + _boxes_type boxes; + typedef sensor_msgs::CameraInfo _camera_info_type; + _camera_info_type camera_info; + + BoundingBoxArrayWithCameraInfo(): + header(), + boxes(), + camera_info() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->boxes.serialize(outbuffer + offset); + offset += this->camera_info.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->boxes.deserialize(inbuffer + offset); + offset += this->camera_info.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/BoundingBoxArrayWithCameraInfo"; }; + virtual const char * getMD5() override { return "e68d75609bb0b7f4ac5831524b0126e7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxMovement.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxMovement.h new file mode 100644 index 000000000..b87fa3688 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/BoundingBoxMovement.h @@ -0,0 +1,62 @@ +#ifndef _ROS_jsk_recognition_msgs_BoundingBoxMovement_h +#define _ROS_jsk_recognition_msgs_BoundingBoxMovement_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/BoundingBox.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/PoseStamped.h" + +namespace jsk_recognition_msgs +{ + + class BoundingBoxMovement : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef jsk_recognition_msgs::BoundingBox _box_type; + _box_type box; + typedef geometry_msgs::Pose _handle_pose_type; + _handle_pose_type handle_pose; + typedef geometry_msgs::PoseStamped _destination_type; + _destination_type destination; + + BoundingBoxMovement(): + header(), + box(), + handle_pose(), + destination() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->box.serialize(outbuffer + offset); + offset += this->handle_pose.serialize(outbuffer + offset); + offset += this->destination.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->box.deserialize(inbuffer + offset); + offset += this->handle_pose.deserialize(inbuffer + offset); + offset += this->destination.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/BoundingBoxMovement"; }; + virtual const char * getMD5() override { return "60aeb288c030d1b8a67ddeedc91812f0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CallPolygon.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CallPolygon.h new file mode 100644 index 000000000..cd2023da1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CallPolygon.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_CallPolygon_h +#define _ROS_SERVICE_CallPolygon_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PolygonStamped.h" + +namespace jsk_recognition_msgs +{ + +static const char CALLPOLYGON[] = "jsk_recognition_msgs/CallPolygon"; + + class CallPolygonRequest : public ros::Msg + { + public: + typedef const char* _filename_type; + _filename_type filename; + + CallPolygonRequest(): + filename("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_filename = strlen(this->filename); + varToArr(outbuffer + offset, length_filename); + offset += 4; + memcpy(outbuffer + offset, this->filename, length_filename); + offset += length_filename; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_filename; + arrToVar(length_filename, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_filename; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_filename-1]=0; + this->filename = (char *)(inbuffer + offset-1); + offset += length_filename; + return offset; + } + + virtual const char * getType() override { return CALLPOLYGON; }; + virtual const char * getMD5() override { return "030824f52a0628ead956fb9d67e66ae9"; }; + + }; + + class CallPolygonResponse : public ros::Msg + { + public: + typedef geometry_msgs::PolygonStamped _points_type; + _points_type points; + + CallPolygonResponse(): + points() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->points.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->points.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return CALLPOLYGON; }; + virtual const char * getMD5() override { return "5f7fab179463c3091ade3556924563da"; }; + + }; + + class CallPolygon { + public: + typedef CallPolygonRequest Request; + typedef CallPolygonResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CallSnapIt.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CallSnapIt.h new file mode 100644 index 000000000..3f1bb97cc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CallSnapIt.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_CallSnapIt_h +#define _ROS_SERVICE_CallSnapIt_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "jsk_recognition_msgs/SnapItRequest.h" + +namespace jsk_recognition_msgs +{ + +static const char CALLSNAPIT[] = "jsk_recognition_msgs/CallSnapIt"; + + class CallSnapItRequest : public ros::Msg + { + public: + typedef jsk_recognition_msgs::SnapItRequest _request_type; + _request_type request; + + CallSnapItRequest(): + request() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->request.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->request.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return CALLSNAPIT; }; + virtual const char * getMD5() override { return "5bf1ef2f060949ff03f39c08eb7bc6de"; }; + + }; + + class CallSnapItResponse : public ros::Msg + { + public: + typedef geometry_msgs::Pose _transformation_type; + _transformation_type transformation; + + CallSnapItResponse(): + transformation() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->transformation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->transformation.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return CALLSNAPIT; }; + virtual const char * getMD5() override { return "d787e2767b5ea7b19a81c647df92a8de"; }; + + }; + + class CallSnapIt { + public: + typedef CallSnapItRequest Request; + typedef CallSnapItResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CheckCircle.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CheckCircle.h new file mode 100644 index 000000000..8d512f14d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CheckCircle.h @@ -0,0 +1,135 @@ +#ifndef _ROS_SERVICE_CheckCircle_h +#define _ROS_SERVICE_CheckCircle_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" + +namespace jsk_recognition_msgs +{ + +static const char CHECKCIRCLE[] = "jsk_recognition_msgs/CheckCircle"; + + class CheckCircleRequest : public ros::Msg + { + public: + typedef geometry_msgs::Point _point_type; + _point_type point; + + CheckCircleRequest(): + point() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->point.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return CHECKCIRCLE; }; + virtual const char * getMD5() override { return "a7c84ff13976aa04656e56e300124444"; }; + + }; + + class CheckCircleResponse : public ros::Msg + { + public: + typedef bool _clicked_type; + _clicked_type clicked; + typedef int32_t _index_type; + _index_type index; + typedef const char* _msg_type; + _msg_type msg; + + CheckCircleResponse(): + clicked(0), + index(0), + msg("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_clicked; + u_clicked.real = this->clicked; + *(outbuffer + offset + 0) = (u_clicked.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->clicked); + 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); + uint32_t length_msg = strlen(this->msg); + varToArr(outbuffer + offset, length_msg); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_clicked; + u_clicked.base = 0; + u_clicked.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->clicked = u_clicked.real; + offset += sizeof(this->clicked); + 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); + uint32_t length_msg; + arrToVar(length_msg, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + return offset; + } + + virtual const char * getType() override { return CHECKCIRCLE; }; + virtual const char * getMD5() override { return "94ed41c732187b6ea58431df72ab10b2"; }; + + }; + + class CheckCircle { + public: + typedef CheckCircleRequest Request; + typedef CheckCircleResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CheckCollision.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CheckCollision.h new file mode 100644 index 000000000..547b19223 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/CheckCollision.h @@ -0,0 +1,100 @@ +#ifndef _ROS_SERVICE_CheckCollision_h +#define _ROS_SERVICE_CheckCollision_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "sensor_msgs/JointState.h" + +namespace jsk_recognition_msgs +{ + +static const char CHECKCOLLISION[] = "jsk_recognition_msgs/CheckCollision"; + + class CheckCollisionRequest : public ros::Msg + { + public: + typedef sensor_msgs::JointState _joint_type; + _joint_type joint; + typedef geometry_msgs::PoseStamped _pose_type; + _pose_type pose; + + CheckCollisionRequest(): + joint(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->joint.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->joint.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return CHECKCOLLISION; }; + virtual const char * getMD5() override { return "2bfa8f4c4d92353b38f908fbabfac432"; }; + + }; + + class CheckCollisionResponse : public ros::Msg + { + public: + typedef bool _result_type; + _result_type result; + + CheckCollisionResponse(): + result(0) + { + } + + 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); + 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); + return offset; + } + + virtual const char * getType() override { return CHECKCOLLISION; }; + virtual const char * getMD5() override { return "eb13ac1f1354ccecb7941ee8fa2192e8"; }; + + }; + + class CheckCollision { + public: + typedef CheckCollisionRequest Request; + typedef CheckCollisionResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Circle2D.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Circle2D.h new file mode 100644 index 000000000..63261c65a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Circle2D.h @@ -0,0 +1,59 @@ +#ifndef _ROS_jsk_recognition_msgs_Circle2D_h +#define _ROS_jsk_recognition_msgs_Circle2D_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class Circle2D : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _radius_type; + _radius_type radius; + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + + Circle2D(): + header(), + radius(0), + x(0), + y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->radius); + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->radius)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Circle2D"; }; + virtual const char * getMD5() override { return "2337fe90a715387bfdc3cf4b7fa2391e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Circle2DArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Circle2DArray.h new file mode 100644 index 000000000..432b17e3d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Circle2DArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_Circle2DArray_h +#define _ROS_jsk_recognition_msgs_Circle2DArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/Circle2D.h" + +namespace jsk_recognition_msgs +{ + + class Circle2DArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t circles_length; + typedef jsk_recognition_msgs::Circle2D _circles_type; + _circles_type st_circles; + _circles_type * circles; + + Circle2DArray(): + header(), + circles_length(0), st_circles(), circles(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->circles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->circles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->circles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->circles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->circles_length); + for( uint32_t i = 0; i < circles_length; i++){ + offset += this->circles[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t circles_lengthT = ((uint32_t) (*(inbuffer + offset))); + circles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + circles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + circles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->circles_length); + if(circles_lengthT > circles_length) + this->circles = (jsk_recognition_msgs::Circle2D*)realloc(this->circles, circles_lengthT * sizeof(jsk_recognition_msgs::Circle2D)); + circles_length = circles_lengthT; + for( uint32_t i = 0; i < circles_length; i++){ + offset += this->st_circles.deserialize(inbuffer + offset); + memcpy( &(this->circles[i]), &(this->st_circles), sizeof(jsk_recognition_msgs::Circle2D)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Circle2DArray"; }; + virtual const char * getMD5() override { return "7c3f0f08758538a1e02ce600cf99132f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ClassificationResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ClassificationResult.h new file mode 100644 index 000000000..123f71a48 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ClassificationResult.h @@ -0,0 +1,218 @@ +#ifndef _ROS_jsk_recognition_msgs_ClassificationResult_h +#define _ROS_jsk_recognition_msgs_ClassificationResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class ClassificationResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t labels_length; + typedef uint32_t _labels_type; + _labels_type st_labels; + _labels_type * labels; + uint32_t label_names_length; + typedef char* _label_names_type; + _label_names_type st_label_names; + _label_names_type * label_names; + uint32_t label_proba_length; + typedef float _label_proba_type; + _label_proba_type st_label_proba; + _label_proba_type * label_proba; + uint32_t probabilities_length; + typedef float _probabilities_type; + _probabilities_type st_probabilities; + _probabilities_type * probabilities; + typedef const char* _classifier_type; + _classifier_type classifier; + uint32_t target_names_length; + typedef char* _target_names_type; + _target_names_type st_target_names; + _target_names_type * target_names; + + ClassificationResult(): + header(), + labels_length(0), st_labels(), labels(nullptr), + label_names_length(0), st_label_names(), label_names(nullptr), + label_proba_length(0), st_label_proba(), label_proba(nullptr), + probabilities_length(0), st_probabilities(), probabilities(nullptr), + classifier(""), + target_names_length(0), st_target_names(), target_names(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(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++){ + *(outbuffer + offset + 0) = (this->labels[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->labels[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->labels[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->labels[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->labels[i]); + } + *(outbuffer + offset + 0) = (this->label_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->label_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->label_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->label_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->label_names_length); + for( uint32_t i = 0; i < label_names_length; i++){ + uint32_t length_label_namesi = strlen(this->label_names[i]); + varToArr(outbuffer + offset, length_label_namesi); + offset += 4; + memcpy(outbuffer + offset, this->label_names[i], length_label_namesi); + offset += length_label_namesi; + } + *(outbuffer + offset + 0) = (this->label_proba_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->label_proba_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->label_proba_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->label_proba_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->label_proba_length); + for( uint32_t i = 0; i < label_proba_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->label_proba[i]); + } + *(outbuffer + offset + 0) = (this->probabilities_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->probabilities_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->probabilities_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->probabilities_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->probabilities_length); + for( uint32_t i = 0; i < probabilities_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->probabilities[i]); + } + uint32_t length_classifier = strlen(this->classifier); + varToArr(outbuffer + offset, length_classifier); + offset += 4; + memcpy(outbuffer + offset, this->classifier, length_classifier); + offset += length_classifier; + *(outbuffer + offset + 0) = (this->target_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_names_length); + for( uint32_t i = 0; i < target_names_length; i++){ + uint32_t length_target_namesi = strlen(this->target_names[i]); + varToArr(outbuffer + offset, length_target_namesi); + offset += 4; + memcpy(outbuffer + offset, this->target_names[i], length_target_namesi); + offset += length_target_namesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + 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 = (uint32_t*)realloc(this->labels, labels_lengthT * sizeof(uint32_t)); + labels_length = labels_lengthT; + for( uint32_t i = 0; i < labels_length; i++){ + this->st_labels = ((uint32_t) (*(inbuffer + offset))); + this->st_labels |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_labels |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_labels |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_labels); + memcpy( &(this->labels[i]), &(this->st_labels), sizeof(uint32_t)); + } + uint32_t label_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + label_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + label_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + label_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->label_names_length); + if(label_names_lengthT > label_names_length) + this->label_names = (char**)realloc(this->label_names, label_names_lengthT * sizeof(char*)); + label_names_length = label_names_lengthT; + for( uint32_t i = 0; i < label_names_length; i++){ + uint32_t length_st_label_names; + arrToVar(length_st_label_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_label_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_label_names-1]=0; + this->st_label_names = (char *)(inbuffer + offset-1); + offset += length_st_label_names; + memcpy( &(this->label_names[i]), &(this->st_label_names), sizeof(char*)); + } + uint32_t label_proba_lengthT = ((uint32_t) (*(inbuffer + offset))); + label_proba_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + label_proba_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + label_proba_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->label_proba_length); + if(label_proba_lengthT > label_proba_length) + this->label_proba = (float*)realloc(this->label_proba, label_proba_lengthT * sizeof(float)); + label_proba_length = label_proba_lengthT; + for( uint32_t i = 0; i < label_proba_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_label_proba)); + memcpy( &(this->label_proba[i]), &(this->st_label_proba), sizeof(float)); + } + uint32_t probabilities_lengthT = ((uint32_t) (*(inbuffer + offset))); + probabilities_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + probabilities_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + probabilities_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->probabilities_length); + if(probabilities_lengthT > probabilities_length) + this->probabilities = (float*)realloc(this->probabilities, probabilities_lengthT * sizeof(float)); + probabilities_length = probabilities_lengthT; + for( uint32_t i = 0; i < probabilities_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_probabilities)); + memcpy( &(this->probabilities[i]), &(this->st_probabilities), sizeof(float)); + } + uint32_t length_classifier; + arrToVar(length_classifier, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_classifier; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_classifier-1]=0; + this->classifier = (char *)(inbuffer + offset-1); + offset += length_classifier; + uint32_t target_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + target_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + target_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + target_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_names_length); + if(target_names_lengthT > target_names_length) + this->target_names = (char**)realloc(this->target_names, target_names_lengthT * sizeof(char*)); + target_names_length = target_names_lengthT; + for( uint32_t i = 0; i < target_names_length; i++){ + uint32_t length_st_target_names; + arrToVar(length_st_target_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_target_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_target_names-1]=0; + this->st_target_names = (char *)(inbuffer + offset-1); + offset += length_st_target_names; + memcpy( &(this->target_names[i]), &(this->st_target_names), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ClassificationResult"; }; + virtual const char * getMD5() override { return "cce1f8edabff85a20e9cc013e319497c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ClusterPointIndices.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ClusterPointIndices.h new file mode 100644 index 000000000..73c603fa5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ClusterPointIndices.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_ClusterPointIndices_h +#define _ROS_jsk_recognition_msgs_ClusterPointIndices_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "pcl_msgs/PointIndices.h" + +namespace jsk_recognition_msgs +{ + + class ClusterPointIndices : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t cluster_indices_length; + typedef pcl_msgs::PointIndices _cluster_indices_type; + _cluster_indices_type st_cluster_indices; + _cluster_indices_type * cluster_indices; + + ClusterPointIndices(): + header(), + cluster_indices_length(0), st_cluster_indices(), cluster_indices(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->cluster_indices_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cluster_indices_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cluster_indices_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cluster_indices_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cluster_indices_length); + for( uint32_t i = 0; i < cluster_indices_length; i++){ + offset += this->cluster_indices[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t cluster_indices_lengthT = ((uint32_t) (*(inbuffer + offset))); + cluster_indices_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cluster_indices_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cluster_indices_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cluster_indices_length); + if(cluster_indices_lengthT > cluster_indices_length) + this->cluster_indices = (pcl_msgs::PointIndices*)realloc(this->cluster_indices, cluster_indices_lengthT * sizeof(pcl_msgs::PointIndices)); + cluster_indices_length = cluster_indices_lengthT; + for( uint32_t i = 0; i < cluster_indices_length; i++){ + offset += this->st_cluster_indices.deserialize(inbuffer + offset); + memcpy( &(this->cluster_indices[i]), &(this->st_cluster_indices), sizeof(pcl_msgs::PointIndices)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ClusterPointIndices"; }; + virtual const char * getMD5() override { return "d43e94ea5e491effac7685a42b7b9d14"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ColorHistogram.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ColorHistogram.h new file mode 100644 index 000000000..656fbf83f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ColorHistogram.h @@ -0,0 +1,88 @@ +#ifndef _ROS_jsk_recognition_msgs_ColorHistogram_h +#define _ROS_jsk_recognition_msgs_ColorHistogram_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class ColorHistogram : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t histogram_length; + typedef float _histogram_type; + _histogram_type st_histogram; + _histogram_type * histogram; + + ColorHistogram(): + header(), + histogram_length(0), st_histogram(), histogram(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->histogram_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->histogram_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->histogram_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->histogram_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->histogram_length); + for( uint32_t i = 0; i < histogram_length; i++){ + union { + float real; + uint32_t base; + } u_histogrami; + u_histogrami.real = this->histogram[i]; + *(outbuffer + offset + 0) = (u_histogrami.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_histogrami.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_histogrami.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_histogrami.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->histogram[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t histogram_lengthT = ((uint32_t) (*(inbuffer + offset))); + histogram_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + histogram_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + histogram_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->histogram_length); + if(histogram_lengthT > histogram_length) + this->histogram = (float*)realloc(this->histogram, histogram_lengthT * sizeof(float)); + histogram_length = histogram_lengthT; + for( uint32_t i = 0; i < histogram_length; i++){ + union { + float real; + uint32_t base; + } u_st_histogram; + u_st_histogram.base = 0; + u_st_histogram.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_histogram.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_histogram.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_histogram.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_histogram = u_st_histogram.real; + offset += sizeof(this->st_histogram); + memcpy( &(this->histogram[i]), &(this->st_histogram), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ColorHistogram"; }; + virtual const char * getMD5() override { return "5b08641478fdecd8720ba08b36fce2aa"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ColorHistogramArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ColorHistogramArray.h new file mode 100644 index 000000000..c3d41e4e6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ColorHistogramArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_ColorHistogramArray_h +#define _ROS_jsk_recognition_msgs_ColorHistogramArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/ColorHistogram.h" + +namespace jsk_recognition_msgs +{ + + class ColorHistogramArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t histograms_length; + typedef jsk_recognition_msgs::ColorHistogram _histograms_type; + _histograms_type st_histograms; + _histograms_type * histograms; + + ColorHistogramArray(): + header(), + histograms_length(0), st_histograms(), histograms(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->histograms_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->histograms_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->histograms_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->histograms_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->histograms_length); + for( uint32_t i = 0; i < histograms_length; i++){ + offset += this->histograms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t histograms_lengthT = ((uint32_t) (*(inbuffer + offset))); + histograms_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + histograms_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + histograms_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->histograms_length); + if(histograms_lengthT > histograms_length) + this->histograms = (jsk_recognition_msgs::ColorHistogram*)realloc(this->histograms, histograms_lengthT * sizeof(jsk_recognition_msgs::ColorHistogram)); + histograms_length = histograms_lengthT; + for( uint32_t i = 0; i < histograms_length; i++){ + offset += this->st_histograms.deserialize(inbuffer + offset); + memcpy( &(this->histograms[i]), &(this->st_histograms), sizeof(jsk_recognition_msgs::ColorHistogram)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ColorHistogramArray"; }; + virtual const char * getMD5() override { return "3bcc7f05c5520f311047096d5530e715"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ContactSensor.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ContactSensor.h new file mode 100644 index 000000000..27f04cd99 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ContactSensor.h @@ -0,0 +1,79 @@ +#ifndef _ROS_jsk_recognition_msgs_ContactSensor_h +#define _ROS_jsk_recognition_msgs_ContactSensor_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class ContactSensor : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _contact_type; + _contact_type contact; + typedef const char* _link_name_type; + _link_name_type link_name; + + ContactSensor(): + header(), + contact(0), + link_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_contact; + u_contact.real = this->contact; + *(outbuffer + offset + 0) = (u_contact.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->contact); + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + 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_contact; + u_contact.base = 0; + u_contact.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->contact = u_contact.real; + offset += sizeof(this->contact); + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ContactSensor"; }; + virtual const char * getMD5() override { return "364b2b952a51d85dfa877e334264e361"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ContactSensorArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ContactSensorArray.h new file mode 100644 index 000000000..4017bab27 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ContactSensorArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_ContactSensorArray_h +#define _ROS_jsk_recognition_msgs_ContactSensorArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/ContactSensor.h" + +namespace jsk_recognition_msgs +{ + + class ContactSensorArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t datas_length; + typedef jsk_recognition_msgs::ContactSensor _datas_type; + _datas_type st_datas; + _datas_type * datas; + + ContactSensorArray(): + header(), + datas_length(0), st_datas(), datas(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->datas_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->datas_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->datas_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->datas_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->datas_length); + for( uint32_t i = 0; i < datas_length; i++){ + offset += this->datas[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t datas_lengthT = ((uint32_t) (*(inbuffer + offset))); + datas_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + datas_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + datas_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->datas_length); + if(datas_lengthT > datas_length) + this->datas = (jsk_recognition_msgs::ContactSensor*)realloc(this->datas, datas_lengthT * sizeof(jsk_recognition_msgs::ContactSensor)); + datas_length = datas_lengthT; + for( uint32_t i = 0; i < datas_length; i++){ + offset += this->st_datas.deserialize(inbuffer + offset); + memcpy( &(this->datas[i]), &(this->st_datas), sizeof(jsk_recognition_msgs::ContactSensor)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ContactSensorArray"; }; + virtual const char * getMD5() override { return "c65f16fb3a523c0b77d7e31330b214da"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/DepthCalibrationParameter.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/DepthCalibrationParameter.h new file mode 100644 index 000000000..7215441cb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/DepthCalibrationParameter.h @@ -0,0 +1,131 @@ +#ifndef _ROS_jsk_recognition_msgs_DepthCalibrationParameter_h +#define _ROS_jsk_recognition_msgs_DepthCalibrationParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + + class DepthCalibrationParameter : public ros::Msg + { + public: + uint32_t coefficients2_length; + typedef float _coefficients2_type; + _coefficients2_type st_coefficients2; + _coefficients2_type * coefficients2; + uint32_t coefficients1_length; + typedef float _coefficients1_type; + _coefficients1_type st_coefficients1; + _coefficients1_type * coefficients1; + uint32_t coefficients0_length; + typedef float _coefficients0_type; + _coefficients0_type st_coefficients0; + _coefficients0_type * coefficients0; + typedef bool _use_abs_type; + _use_abs_type use_abs; + + DepthCalibrationParameter(): + coefficients2_length(0), st_coefficients2(), coefficients2(nullptr), + coefficients1_length(0), st_coefficients1(), coefficients1(nullptr), + coefficients0_length(0), st_coefficients0(), coefficients0(nullptr), + use_abs(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->coefficients2_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->coefficients2_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->coefficients2_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->coefficients2_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->coefficients2_length); + for( uint32_t i = 0; i < coefficients2_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->coefficients2[i]); + } + *(outbuffer + offset + 0) = (this->coefficients1_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->coefficients1_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->coefficients1_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->coefficients1_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->coefficients1_length); + for( uint32_t i = 0; i < coefficients1_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->coefficients1[i]); + } + *(outbuffer + offset + 0) = (this->coefficients0_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->coefficients0_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->coefficients0_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->coefficients0_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->coefficients0_length); + for( uint32_t i = 0; i < coefficients0_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->coefficients0[i]); + } + union { + bool real; + uint8_t base; + } u_use_abs; + u_use_abs.real = this->use_abs; + *(outbuffer + offset + 0) = (u_use_abs.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->use_abs); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t coefficients2_lengthT = ((uint32_t) (*(inbuffer + offset))); + coefficients2_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + coefficients2_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + coefficients2_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->coefficients2_length); + if(coefficients2_lengthT > coefficients2_length) + this->coefficients2 = (float*)realloc(this->coefficients2, coefficients2_lengthT * sizeof(float)); + coefficients2_length = coefficients2_lengthT; + for( uint32_t i = 0; i < coefficients2_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_coefficients2)); + memcpy( &(this->coefficients2[i]), &(this->st_coefficients2), sizeof(float)); + } + uint32_t coefficients1_lengthT = ((uint32_t) (*(inbuffer + offset))); + coefficients1_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + coefficients1_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + coefficients1_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->coefficients1_length); + if(coefficients1_lengthT > coefficients1_length) + this->coefficients1 = (float*)realloc(this->coefficients1, coefficients1_lengthT * sizeof(float)); + coefficients1_length = coefficients1_lengthT; + for( uint32_t i = 0; i < coefficients1_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_coefficients1)); + memcpy( &(this->coefficients1[i]), &(this->st_coefficients1), sizeof(float)); + } + uint32_t coefficients0_lengthT = ((uint32_t) (*(inbuffer + offset))); + coefficients0_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + coefficients0_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + coefficients0_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->coefficients0_length); + if(coefficients0_lengthT > coefficients0_length) + this->coefficients0 = (float*)realloc(this->coefficients0, coefficients0_lengthT * sizeof(float)); + coefficients0_length = coefficients0_lengthT; + for( uint32_t i = 0; i < coefficients0_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_coefficients0)); + memcpy( &(this->coefficients0[i]), &(this->st_coefficients0), sizeof(float)); + } + union { + bool real; + uint8_t base; + } u_use_abs; + u_use_abs.base = 0; + u_use_abs.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->use_abs = u_use_abs.real; + offset += sizeof(this->use_abs); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/DepthCalibrationParameter"; }; + virtual const char * getMD5() override { return "d8318983ee0a76ad66ecf4b504350888"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/DepthErrorResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/DepthErrorResult.h new file mode 100644 index 000000000..ed5a15121 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/DepthErrorResult.h @@ -0,0 +1,166 @@ +#ifndef _ROS_jsk_recognition_msgs_DepthErrorResult_h +#define _ROS_jsk_recognition_msgs_DepthErrorResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class DepthErrorResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _u_type; + _u_type u; + typedef uint32_t _v_type; + _v_type v; + typedef float _center_u_type; + _center_u_type center_u; + typedef float _center_v_type; + _center_v_type center_v; + typedef float _true_depth_type; + _true_depth_type true_depth; + typedef float _observed_depth_type; + _observed_depth_type observed_depth; + + DepthErrorResult(): + header(), + u(0), + v(0), + center_u(0), + center_v(0), + true_depth(0), + observed_depth(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->u >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->u >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->u >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->u >> (8 * 3)) & 0xFF; + offset += sizeof(this->u); + *(outbuffer + offset + 0) = (this->v >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->v >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->v >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->v >> (8 * 3)) & 0xFF; + offset += sizeof(this->v); + union { + float real; + uint32_t base; + } u_center_u; + u_center_u.real = this->center_u; + *(outbuffer + offset + 0) = (u_center_u.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_center_u.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_center_u.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_center_u.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->center_u); + union { + float real; + uint32_t base; + } u_center_v; + u_center_v.real = this->center_v; + *(outbuffer + offset + 0) = (u_center_v.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_center_v.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_center_v.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_center_v.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->center_v); + union { + float real; + uint32_t base; + } u_true_depth; + u_true_depth.real = this->true_depth; + *(outbuffer + offset + 0) = (u_true_depth.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_true_depth.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_true_depth.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_true_depth.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->true_depth); + union { + float real; + uint32_t base; + } u_observed_depth; + u_observed_depth.real = this->observed_depth; + *(outbuffer + offset + 0) = (u_observed_depth.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_observed_depth.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_observed_depth.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_observed_depth.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->observed_depth); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->u = ((uint32_t) (*(inbuffer + offset))); + this->u |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->u |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->u |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->u); + this->v = ((uint32_t) (*(inbuffer + offset))); + this->v |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->v |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->v |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->v); + union { + float real; + uint32_t base; + } u_center_u; + u_center_u.base = 0; + u_center_u.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_center_u.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_center_u.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_center_u.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->center_u = u_center_u.real; + offset += sizeof(this->center_u); + union { + float real; + uint32_t base; + } u_center_v; + u_center_v.base = 0; + u_center_v.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_center_v.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_center_v.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_center_v.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->center_v = u_center_v.real; + offset += sizeof(this->center_v); + union { + float real; + uint32_t base; + } u_true_depth; + u_true_depth.base = 0; + u_true_depth.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_true_depth.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_true_depth.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_true_depth.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->true_depth = u_true_depth.real; + offset += sizeof(this->true_depth); + union { + float real; + uint32_t base; + } u_observed_depth; + u_observed_depth.base = 0; + u_observed_depth.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_observed_depth.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_observed_depth.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_observed_depth.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->observed_depth = u_observed_depth.real; + offset += sizeof(this->observed_depth); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/DepthErrorResult"; }; + virtual const char * getMD5() override { return "cebbb2d000457fe5d971a29ee02ffb16"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/EnvironmentLock.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/EnvironmentLock.h new file mode 100644 index 000000000..6f35e9c27 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/EnvironmentLock.h @@ -0,0 +1,83 @@ +#ifndef _ROS_SERVICE_EnvironmentLock_h +#define _ROS_SERVICE_EnvironmentLock_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + +static const char ENVIRONMENTLOCK[] = "jsk_recognition_msgs/EnvironmentLock"; + + class EnvironmentLockRequest : public ros::Msg + { + public: + + EnvironmentLockRequest() + { + } + + 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 ENVIRONMENTLOCK; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EnvironmentLockResponse : public ros::Msg + { + public: + typedef uint32_t _environment_id_type; + _environment_id_type environment_id; + + EnvironmentLockResponse(): + environment_id(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->environment_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->environment_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->environment_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->environment_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->environment_id); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->environment_id = ((uint32_t) (*(inbuffer + offset))); + this->environment_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->environment_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->environment_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->environment_id); + return offset; + } + + virtual const char * getType() override { return ENVIRONMENTLOCK; }; + virtual const char * getMD5() override { return "109afc0d3bd22aa461d45c8ef5ab6d75"; }; + + }; + + class EnvironmentLock { + public: + typedef EnvironmentLockRequest Request; + typedef EnvironmentLockResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/EuclideanSegment.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/EuclideanSegment.h new file mode 100644 index 000000000..739d2df4f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/EuclideanSegment.h @@ -0,0 +1,125 @@ +#ifndef _ROS_SERVICE_EuclideanSegment_h +#define _ROS_SERVICE_EuclideanSegment_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace jsk_recognition_msgs +{ + +static const char EUCLIDEANSEGMENT[] = "jsk_recognition_msgs/EuclideanSegment"; + + class EuclideanSegmentRequest : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _input_type; + _input_type input; + typedef float _tolerance_type; + _tolerance_type tolerance; + + EuclideanSegmentRequest(): + input(), + tolerance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->input.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; + offset += this->input.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 EUCLIDEANSEGMENT; }; + virtual const char * getMD5() override { return "116dd66bdc82f46d7b7414ce880ea794"; }; + + }; + + class EuclideanSegmentResponse : public ros::Msg + { + public: + uint32_t output_length; + typedef sensor_msgs::PointCloud2 _output_type; + _output_type st_output; + _output_type * output; + + EuclideanSegmentResponse(): + output_length(0), st_output(), output(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->output_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->output_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->output_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->output_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->output_length); + for( uint32_t i = 0; i < output_length; i++){ + offset += this->output[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t output_lengthT = ((uint32_t) (*(inbuffer + offset))); + output_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + output_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + output_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->output_length); + if(output_lengthT > output_length) + this->output = (sensor_msgs::PointCloud2*)realloc(this->output, output_lengthT * sizeof(sensor_msgs::PointCloud2)); + output_length = output_lengthT; + for( uint32_t i = 0; i < output_length; i++){ + offset += this->st_output.deserialize(inbuffer + offset); + memcpy( &(this->output[i]), &(this->st_output), sizeof(sensor_msgs::PointCloud2)); + } + return offset; + } + + virtual const char * getType() override { return EUCLIDEANSEGMENT; }; + virtual const char * getMD5() override { return "6db5ac8d8316fdb3e0c62197115f87cd"; }; + + }; + + class EuclideanSegment { + public: + typedef EuclideanSegmentRequest Request; + typedef EuclideanSegmentResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HeightmapConfig.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HeightmapConfig.h new file mode 100644 index 000000000..18b1c8937 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HeightmapConfig.h @@ -0,0 +1,134 @@ +#ifndef _ROS_jsk_recognition_msgs_HeightmapConfig_h +#define _ROS_jsk_recognition_msgs_HeightmapConfig_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + + class HeightmapConfig : public ros::Msg + { + public: + typedef float _min_x_type; + _min_x_type min_x; + typedef float _max_x_type; + _max_x_type max_x; + typedef float _min_y_type; + _min_y_type min_y; + typedef float _max_y_type; + _max_y_type max_y; + + HeightmapConfig(): + min_x(0), + max_x(0), + min_y(0), + max_y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_min_x; + u_min_x.real = this->min_x; + *(outbuffer + offset + 0) = (u_min_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_x); + union { + float real; + uint32_t base; + } u_max_x; + u_max_x.real = this->max_x; + *(outbuffer + offset + 0) = (u_max_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_x); + union { + float real; + uint32_t base; + } u_min_y; + u_min_y.real = this->min_y; + *(outbuffer + offset + 0) = (u_min_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_y); + union { + float real; + uint32_t base; + } u_max_y; + u_max_y.real = this->max_y; + *(outbuffer + offset + 0) = (u_max_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + float real; + uint32_t base; + } u_min_x; + u_min_x.base = 0; + u_min_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_x = u_min_x.real; + offset += sizeof(this->min_x); + union { + float real; + uint32_t base; + } u_max_x; + u_max_x.base = 0; + u_max_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_x = u_max_x.real; + offset += sizeof(this->max_x); + union { + float real; + uint32_t base; + } u_min_y; + u_min_y.base = 0; + u_min_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_y = u_min_y.real; + offset += sizeof(this->min_y); + union { + float real; + uint32_t base; + } u_max_y; + u_max_y.base = 0; + u_max_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_y = u_max_y.real; + offset += sizeof(this->max_y); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/HeightmapConfig"; }; + virtual const char * getMD5() override { return "f2f90f6dd5aeedef48b062e1a4aabb89"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Histogram.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Histogram.h new file mode 100644 index 000000000..a57ea72f4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Histogram.h @@ -0,0 +1,69 @@ +#ifndef _ROS_jsk_recognition_msgs_Histogram_h +#define _ROS_jsk_recognition_msgs_Histogram_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class Histogram : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t histogram_length; + typedef float _histogram_type; + _histogram_type st_histogram; + _histogram_type * histogram; + + Histogram(): + header(), + histogram_length(0), st_histogram(), histogram(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->histogram_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->histogram_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->histogram_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->histogram_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->histogram_length); + for( uint32_t i = 0; i < histogram_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->histogram[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t histogram_lengthT = ((uint32_t) (*(inbuffer + offset))); + histogram_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + histogram_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + histogram_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->histogram_length); + if(histogram_lengthT > histogram_length) + this->histogram = (float*)realloc(this->histogram, histogram_lengthT * sizeof(float)); + histogram_length = histogram_lengthT; + for( uint32_t i = 0; i < histogram_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_histogram)); + memcpy( &(this->histogram[i]), &(this->st_histogram), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Histogram"; }; + virtual const char * getMD5() override { return "376372f016c22c39ab7ee6b6bdd0f10a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRange.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRange.h new file mode 100644 index 000000000..c63446637 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRange.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_HistogramWithRange_h +#define _ROS_jsk_recognition_msgs_HistogramWithRange_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/HistogramWithRangeBin.h" + +namespace jsk_recognition_msgs +{ + + class HistogramWithRange : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t bins_length; + typedef jsk_recognition_msgs::HistogramWithRangeBin _bins_type; + _bins_type st_bins; + _bins_type * bins; + + HistogramWithRange(): + header(), + bins_length(0), st_bins(), bins(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->bins_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->bins_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->bins_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->bins_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->bins_length); + for( uint32_t i = 0; i < bins_length; i++){ + offset += this->bins[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t bins_lengthT = ((uint32_t) (*(inbuffer + offset))); + bins_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + bins_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + bins_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->bins_length); + if(bins_lengthT > bins_length) + this->bins = (jsk_recognition_msgs::HistogramWithRangeBin*)realloc(this->bins, bins_lengthT * sizeof(jsk_recognition_msgs::HistogramWithRangeBin)); + bins_length = bins_lengthT; + for( uint32_t i = 0; i < bins_length; i++){ + offset += this->st_bins.deserialize(inbuffer + offset); + memcpy( &(this->bins[i]), &(this->st_bins), sizeof(jsk_recognition_msgs::HistogramWithRangeBin)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/HistogramWithRange"; }; + virtual const char * getMD5() override { return "aa922a22cbdcbdcc1146f30df5b605b8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRangeArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRangeArray.h new file mode 100644 index 000000000..7d596269e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRangeArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_HistogramWithRangeArray_h +#define _ROS_jsk_recognition_msgs_HistogramWithRangeArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/HistogramWithRange.h" + +namespace jsk_recognition_msgs +{ + + class HistogramWithRangeArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t histograms_length; + typedef jsk_recognition_msgs::HistogramWithRange _histograms_type; + _histograms_type st_histograms; + _histograms_type * histograms; + + HistogramWithRangeArray(): + header(), + histograms_length(0), st_histograms(), histograms(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->histograms_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->histograms_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->histograms_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->histograms_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->histograms_length); + for( uint32_t i = 0; i < histograms_length; i++){ + offset += this->histograms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t histograms_lengthT = ((uint32_t) (*(inbuffer + offset))); + histograms_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + histograms_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + histograms_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->histograms_length); + if(histograms_lengthT > histograms_length) + this->histograms = (jsk_recognition_msgs::HistogramWithRange*)realloc(this->histograms, histograms_lengthT * sizeof(jsk_recognition_msgs::HistogramWithRange)); + histograms_length = histograms_lengthT; + for( uint32_t i = 0; i < histograms_length; i++){ + offset += this->st_histograms.deserialize(inbuffer + offset); + memcpy( &(this->histograms[i]), &(this->st_histograms), sizeof(jsk_recognition_msgs::HistogramWithRange)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/HistogramWithRangeArray"; }; + virtual const char * getMD5() override { return "2622b1b7ae84f154677cf4c0d3a398c7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRangeBin.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRangeBin.h new file mode 100644 index 000000000..65c0ce860 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HistogramWithRangeBin.h @@ -0,0 +1,61 @@ +#ifndef _ROS_jsk_recognition_msgs_HistogramWithRangeBin_h +#define _ROS_jsk_recognition_msgs_HistogramWithRangeBin_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + + class HistogramWithRangeBin : public ros::Msg + { + public: + typedef float _min_value_type; + _min_value_type min_value; + typedef float _max_value_type; + _max_value_type max_value; + typedef uint32_t _count_type; + _count_type count; + + HistogramWithRangeBin(): + min_value(0), + max_value(0), + count(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->min_value); + offset += serializeAvrFloat64(outbuffer + offset, this->max_value); + *(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; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_value)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_value)); + 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 "jsk_recognition_msgs/HistogramWithRangeBin"; }; + virtual const char * getMD5() override { return "a7fe6c3021fcba2c6357f3db21601551"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HumanSkeleton.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HumanSkeleton.h new file mode 100644 index 000000000..680ad26c6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HumanSkeleton.h @@ -0,0 +1,107 @@ +#ifndef _ROS_jsk_recognition_msgs_HumanSkeleton_h +#define _ROS_jsk_recognition_msgs_HumanSkeleton_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/Segment.h" + +namespace jsk_recognition_msgs +{ + + class HumanSkeleton : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t bone_names_length; + typedef char* _bone_names_type; + _bone_names_type st_bone_names; + _bone_names_type * bone_names; + uint32_t bones_length; + typedef jsk_recognition_msgs::Segment _bones_type; + _bones_type st_bones; + _bones_type * bones; + + HumanSkeleton(): + header(), + bone_names_length(0), st_bone_names(), bone_names(nullptr), + bones_length(0), st_bones(), bones(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->bone_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->bone_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->bone_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->bone_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->bone_names_length); + for( uint32_t i = 0; i < bone_names_length; i++){ + uint32_t length_bone_namesi = strlen(this->bone_names[i]); + varToArr(outbuffer + offset, length_bone_namesi); + offset += 4; + memcpy(outbuffer + offset, this->bone_names[i], length_bone_namesi); + offset += length_bone_namesi; + } + *(outbuffer + offset + 0) = (this->bones_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->bones_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->bones_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->bones_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->bones_length); + for( uint32_t i = 0; i < bones_length; i++){ + offset += this->bones[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t bone_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + bone_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + bone_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + bone_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->bone_names_length); + if(bone_names_lengthT > bone_names_length) + this->bone_names = (char**)realloc(this->bone_names, bone_names_lengthT * sizeof(char*)); + bone_names_length = bone_names_lengthT; + for( uint32_t i = 0; i < bone_names_length; i++){ + uint32_t length_st_bone_names; + arrToVar(length_st_bone_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_bone_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_bone_names-1]=0; + this->st_bone_names = (char *)(inbuffer + offset-1); + offset += length_st_bone_names; + memcpy( &(this->bone_names[i]), &(this->st_bone_names), sizeof(char*)); + } + uint32_t bones_lengthT = ((uint32_t) (*(inbuffer + offset))); + bones_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + bones_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + bones_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->bones_length); + if(bones_lengthT > bones_length) + this->bones = (jsk_recognition_msgs::Segment*)realloc(this->bones, bones_lengthT * sizeof(jsk_recognition_msgs::Segment)); + bones_length = bones_lengthT; + for( uint32_t i = 0; i < bones_length; i++){ + offset += this->st_bones.deserialize(inbuffer + offset); + memcpy( &(this->bones[i]), &(this->st_bones), sizeof(jsk_recognition_msgs::Segment)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/HumanSkeleton"; }; + virtual const char * getMD5() override { return "b8098e195ee1734e91bc2e38c969a23f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HumanSkeletonArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HumanSkeletonArray.h new file mode 100644 index 000000000..031b98b7d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/HumanSkeletonArray.h @@ -0,0 +1,96 @@ +#ifndef _ROS_jsk_recognition_msgs_HumanSkeletonArray_h +#define _ROS_jsk_recognition_msgs_HumanSkeletonArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "std_msgs/Int32.h" +#include "jsk_recognition_msgs/HumanSkeleton.h" + +namespace jsk_recognition_msgs +{ + + class HumanSkeletonArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t human_ids_length; + typedef std_msgs::Int32 _human_ids_type; + _human_ids_type st_human_ids; + _human_ids_type * human_ids; + uint32_t skeletons_length; + typedef jsk_recognition_msgs::HumanSkeleton _skeletons_type; + _skeletons_type st_skeletons; + _skeletons_type * skeletons; + + HumanSkeletonArray(): + header(), + human_ids_length(0), st_human_ids(), human_ids(nullptr), + skeletons_length(0), st_skeletons(), skeletons(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->human_ids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->human_ids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->human_ids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->human_ids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->human_ids_length); + for( uint32_t i = 0; i < human_ids_length; i++){ + offset += this->human_ids[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->skeletons_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->skeletons_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->skeletons_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->skeletons_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->skeletons_length); + for( uint32_t i = 0; i < skeletons_length; i++){ + offset += this->skeletons[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t human_ids_lengthT = ((uint32_t) (*(inbuffer + offset))); + human_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + human_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + human_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->human_ids_length); + if(human_ids_lengthT > human_ids_length) + this->human_ids = (std_msgs::Int32*)realloc(this->human_ids, human_ids_lengthT * sizeof(std_msgs::Int32)); + human_ids_length = human_ids_lengthT; + for( uint32_t i = 0; i < human_ids_length; i++){ + offset += this->st_human_ids.deserialize(inbuffer + offset); + memcpy( &(this->human_ids[i]), &(this->st_human_ids), sizeof(std_msgs::Int32)); + } + uint32_t skeletons_lengthT = ((uint32_t) (*(inbuffer + offset))); + skeletons_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + skeletons_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + skeletons_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->skeletons_length); + if(skeletons_lengthT > skeletons_length) + this->skeletons = (jsk_recognition_msgs::HumanSkeleton*)realloc(this->skeletons, skeletons_lengthT * sizeof(jsk_recognition_msgs::HumanSkeleton)); + skeletons_length = skeletons_lengthT; + for( uint32_t i = 0; i < skeletons_length; i++){ + offset += this->st_skeletons.deserialize(inbuffer + offset); + memcpy( &(this->skeletons[i]), &(this->st_skeletons), sizeof(jsk_recognition_msgs::HumanSkeleton)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/HumanSkeletonArray"; }; + virtual const char * getMD5() override { return "4013ce44abe9aafa9055e095797a9d50"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPAlign.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPAlign.h new file mode 100644 index 000000000..c3115cab0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPAlign.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_ICPAlign_h +#define _ROS_SERVICE_ICPAlign_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_recognition_msgs/ICPResult.h" +#include "sensor_msgs/PointCloud2.h" + +namespace jsk_recognition_msgs +{ + +static const char ICPALIGN[] = "jsk_recognition_msgs/ICPAlign"; + + class ICPAlignRequest : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _reference_cloud_type; + _reference_cloud_type reference_cloud; + typedef sensor_msgs::PointCloud2 _target_cloud_type; + _target_cloud_type target_cloud; + + ICPAlignRequest(): + reference_cloud(), + target_cloud() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->reference_cloud.serialize(outbuffer + offset); + offset += this->target_cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->reference_cloud.deserialize(inbuffer + offset); + offset += this->target_cloud.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return ICPALIGN; }; + virtual const char * getMD5() override { return "3e0df534693afbbecb9cc87944720695"; }; + + }; + + class ICPAlignResponse : public ros::Msg + { + public: + typedef jsk_recognition_msgs::ICPResult _result_type; + _result_type result; + + ICPAlignResponse(): + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return ICPALIGN; }; + virtual const char * getMD5() override { return "a511a876c2be142caffd78741c68e4cf"; }; + + }; + + class ICPAlign { + public: + typedef ICPAlignRequest Request; + typedef ICPAlignResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPAlignWithBox.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPAlignWithBox.h new file mode 100644 index 000000000..7082cdef1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPAlignWithBox.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_ICPAlignWithBox_h +#define _ROS_SERVICE_ICPAlignWithBox_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_recognition_msgs/ICPResult.h" +#include "sensor_msgs/PointCloud2.h" +#include "jsk_recognition_msgs/BoundingBox.h" + +namespace jsk_recognition_msgs +{ + +static const char ICPALIGNWITHBOX[] = "jsk_recognition_msgs/ICPAlignWithBox"; + + class ICPAlignWithBoxRequest : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _target_cloud_type; + _target_cloud_type target_cloud; + typedef jsk_recognition_msgs::BoundingBox _target_box_type; + _target_box_type target_box; + + ICPAlignWithBoxRequest(): + target_cloud(), + target_box() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->target_cloud.serialize(outbuffer + offset); + offset += this->target_box.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->target_cloud.deserialize(inbuffer + offset); + offset += this->target_box.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return ICPALIGNWITHBOX; }; + virtual const char * getMD5() override { return "9431a0df63f5a2625b973e92c6229cf3"; }; + + }; + + class ICPAlignWithBoxResponse : public ros::Msg + { + public: + typedef jsk_recognition_msgs::ICPResult _result_type; + _result_type result; + + ICPAlignWithBoxResponse(): + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return ICPALIGNWITHBOX; }; + virtual const char * getMD5() override { return "a511a876c2be142caffd78741c68e4cf"; }; + + }; + + class ICPAlignWithBox { + public: + typedef ICPAlignWithBoxRequest Request; + typedef ICPAlignWithBoxResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPResult.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPResult.h new file mode 100644 index 000000000..fc3dc7f37 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ICPResult.h @@ -0,0 +1,72 @@ +#ifndef _ROS_jsk_recognition_msgs_ICPResult_h +#define _ROS_jsk_recognition_msgs_ICPResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace jsk_recognition_msgs +{ + + class ICPResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef const char* _name_type; + _name_type name; + typedef float _score_type; + _score_type score; + + ICPResult(): + header(), + pose(), + name(""), + score(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen(this->name); + varToArr(outbuffer + offset, length_name); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += serializeAvrFloat64(outbuffer + offset, this->score); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + 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; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->score)); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ICPResult"; }; + virtual const char * getMD5() override { return "2d0f1279ba6f378fd67c4a0324acf2d7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ImageDifferenceValue.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ImageDifferenceValue.h new file mode 100644 index 000000000..bd0d75719 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ImageDifferenceValue.h @@ -0,0 +1,68 @@ +#ifndef _ROS_jsk_recognition_msgs_ImageDifferenceValue_h +#define _ROS_jsk_recognition_msgs_ImageDifferenceValue_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class ImageDifferenceValue : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _difference_type; + _difference_type difference; + + ImageDifferenceValue(): + header(), + difference(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_difference; + u_difference.real = this->difference; + *(outbuffer + offset + 0) = (u_difference.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_difference.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_difference.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_difference.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->difference); + 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_difference; + u_difference.base = 0; + u_difference.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_difference.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_difference.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_difference.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->difference = u_difference.real; + offset += sizeof(this->difference); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ImageDifferenceValue"; }; + virtual const char * getMD5() override { return "80b6f355db87c1b2d8b04d2f620fe0a7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Int32Stamped.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Int32Stamped.h new file mode 100644 index 000000000..ebf1fe760 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Int32Stamped.h @@ -0,0 +1,68 @@ +#ifndef _ROS_jsk_recognition_msgs_Int32Stamped_h +#define _ROS_jsk_recognition_msgs_Int32Stamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class Int32Stamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _data_type; + _data_type data; + + Int32Stamped(): + header(), + data(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_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); + 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_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); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Int32Stamped"; }; + virtual const char * getMD5() override { return "e7344a45486eefa24d2f337265df37ce"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Label.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Label.h new file mode 100644 index 000000000..e2c0b17ea --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Label.h @@ -0,0 +1,79 @@ +#ifndef _ROS_jsk_recognition_msgs_Label_h +#define _ROS_jsk_recognition_msgs_Label_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + + class Label : public ros::Msg + { + public: + typedef int32_t _id_type; + _id_type id; + typedef const char* _name_type; + _name_type name; + + Label(): + id(0), + name("") + { + } + + 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); + 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 { + 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); + 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 "jsk_recognition_msgs/Label"; }; + virtual const char * getMD5() override { return "8fe5a440459dcada9c353c016dfb49d2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/LabelArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/LabelArray.h new file mode 100644 index 000000000..e5d041c0d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/LabelArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_LabelArray_h +#define _ROS_jsk_recognition_msgs_LabelArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/Label.h" + +namespace jsk_recognition_msgs +{ + + class LabelArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t labels_length; + typedef jsk_recognition_msgs::Label _labels_type; + _labels_type st_labels; + _labels_type * labels; + + LabelArray(): + header(), + labels_length(0), st_labels(), labels(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(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++){ + offset += this->labels[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + 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 = (jsk_recognition_msgs::Label*)realloc(this->labels, labels_lengthT * sizeof(jsk_recognition_msgs::Label)); + labels_length = labels_lengthT; + for( uint32_t i = 0; i < labels_length; i++){ + offset += this->st_labels.deserialize(inbuffer + offset); + memcpy( &(this->labels[i]), &(this->st_labels), sizeof(jsk_recognition_msgs::Label)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/LabelArray"; }; + virtual const char * getMD5() override { return "8cdb9aed89bee725ff5ad76b2986927d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Line.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Line.h new file mode 100644 index 000000000..22e87b941 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Line.h @@ -0,0 +1,58 @@ +#ifndef _ROS_jsk_recognition_msgs_Line_h +#define _ROS_jsk_recognition_msgs_Line_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + + class Line : public ros::Msg + { + public: + typedef float _x1_type; + _x1_type x1; + typedef float _y1_type; + _y1_type y1; + typedef float _x2_type; + _x2_type x2; + typedef float _y2_type; + _y2_type y2; + + Line(): + x1(0), + y1(0), + x2(0), + y2(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x1); + offset += serializeAvrFloat64(outbuffer + offset, this->y1); + offset += serializeAvrFloat64(outbuffer + offset, this->x2); + offset += serializeAvrFloat64(outbuffer + offset, this->y2); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x1)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y1)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x2)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y2)); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Line"; }; + virtual const char * getMD5() override { return "3010fad09b09b8d3fdecdd94d144f7a1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/LineArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/LineArray.h new file mode 100644 index 000000000..c4f9bc18d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/LineArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_LineArray_h +#define _ROS_jsk_recognition_msgs_LineArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/Line.h" + +namespace jsk_recognition_msgs +{ + + class LineArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t lines_length; + typedef jsk_recognition_msgs::Line _lines_type; + _lines_type st_lines; + _lines_type * lines; + + LineArray(): + header(), + lines_length(0), st_lines(), lines(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lines_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lines_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lines_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lines_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->lines_length); + for( uint32_t i = 0; i < lines_length; i++){ + offset += this->lines[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t lines_lengthT = ((uint32_t) (*(inbuffer + offset))); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lines_length); + if(lines_lengthT > lines_length) + this->lines = (jsk_recognition_msgs::Line*)realloc(this->lines, lines_lengthT * sizeof(jsk_recognition_msgs::Line)); + lines_length = lines_lengthT; + for( uint32_t i = 0; i < lines_length; i++){ + offset += this->st_lines.deserialize(inbuffer + offset); + memcpy( &(this->lines[i]), &(this->st_lines), sizeof(jsk_recognition_msgs::Line)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/LineArray"; }; + virtual const char * getMD5() override { return "1571346a320fd11e0b7dc11a90a72ddf"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ModelCoefficientsArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ModelCoefficientsArray.h new file mode 100644 index 000000000..99c968a4f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ModelCoefficientsArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_ModelCoefficientsArray_h +#define _ROS_jsk_recognition_msgs_ModelCoefficientsArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "pcl_msgs/ModelCoefficients.h" + +namespace jsk_recognition_msgs +{ + + class ModelCoefficientsArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t coefficients_length; + typedef pcl_msgs::ModelCoefficients _coefficients_type; + _coefficients_type st_coefficients; + _coefficients_type * coefficients; + + ModelCoefficientsArray(): + header(), + coefficients_length(0), st_coefficients(), coefficients(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->coefficients_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->coefficients_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->coefficients_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->coefficients_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->coefficients_length); + for( uint32_t i = 0; i < coefficients_length; i++){ + offset += this->coefficients[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t coefficients_lengthT = ((uint32_t) (*(inbuffer + offset))); + coefficients_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + coefficients_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + coefficients_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->coefficients_length); + if(coefficients_lengthT > coefficients_length) + this->coefficients = (pcl_msgs::ModelCoefficients*)realloc(this->coefficients, coefficients_lengthT * sizeof(pcl_msgs::ModelCoefficients)); + coefficients_length = coefficients_lengthT; + for( uint32_t i = 0; i < coefficients_length; i++){ + offset += this->st_coefficients.deserialize(inbuffer + offset); + memcpy( &(this->coefficients[i]), &(this->st_coefficients), sizeof(pcl_msgs::ModelCoefficients)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ModelCoefficientsArray"; }; + virtual const char * getMD5() override { return "059efee897c3f4ae027a493e30c4c26b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/NonMaximumSuppression.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/NonMaximumSuppression.h new file mode 100644 index 000000000..1c087c61a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/NonMaximumSuppression.h @@ -0,0 +1,177 @@ +#ifndef _ROS_SERVICE_NonMaximumSuppression_h +#define _ROS_SERVICE_NonMaximumSuppression_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_recognition_msgs/Rect.h" + +namespace jsk_recognition_msgs +{ + +static const char NONMAXIMUMSUPPRESSION[] = "jsk_recognition_msgs/NonMaximumSuppression"; + + class NonMaximumSuppressionRequest : public ros::Msg + { + public: + uint32_t rect_length; + typedef jsk_recognition_msgs::Rect _rect_type; + _rect_type st_rect; + _rect_type * rect; + typedef float _threshold_type; + _threshold_type threshold; + + NonMaximumSuppressionRequest(): + rect_length(0), st_rect(), rect(nullptr), + threshold(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->rect_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rect_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rect_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rect_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rect_length); + for( uint32_t i = 0; i < rect_length; i++){ + offset += this->rect[i].serialize(outbuffer + offset); + } + union { + float real; + uint32_t base; + } u_threshold; + u_threshold.real = this->threshold; + *(outbuffer + offset + 0) = (u_threshold.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_threshold.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_threshold.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_threshold.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->threshold); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t rect_lengthT = ((uint32_t) (*(inbuffer + offset))); + rect_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rect_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rect_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rect_length); + if(rect_lengthT > rect_length) + this->rect = (jsk_recognition_msgs::Rect*)realloc(this->rect, rect_lengthT * sizeof(jsk_recognition_msgs::Rect)); + rect_length = rect_lengthT; + for( uint32_t i = 0; i < rect_length; i++){ + offset += this->st_rect.deserialize(inbuffer + offset); + memcpy( &(this->rect[i]), &(this->st_rect), sizeof(jsk_recognition_msgs::Rect)); + } + union { + float real; + uint32_t base; + } u_threshold; + u_threshold.base = 0; + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->threshold = u_threshold.real; + offset += sizeof(this->threshold); + return offset; + } + + virtual const char * getType() override { return NONMAXIMUMSUPPRESSION; }; + virtual const char * getMD5() override { return "54b7e6632715e9e6592b503a3c881dfc"; }; + + }; + + class NonMaximumSuppressionResponse : public ros::Msg + { + public: + uint32_t bbox_length; + typedef jsk_recognition_msgs::Rect _bbox_type; + _bbox_type st_bbox; + _bbox_type * bbox; + typedef int64_t _bbox_count_type; + _bbox_count_type bbox_count; + + NonMaximumSuppressionResponse(): + bbox_length(0), st_bbox(), bbox(nullptr), + bbox_count(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->bbox_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->bbox_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->bbox_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->bbox_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->bbox_length); + for( uint32_t i = 0; i < bbox_length; i++){ + offset += this->bbox[i].serialize(outbuffer + offset); + } + union { + int64_t real; + uint64_t base; + } u_bbox_count; + u_bbox_count.real = this->bbox_count; + *(outbuffer + offset + 0) = (u_bbox_count.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_bbox_count.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_bbox_count.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_bbox_count.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_bbox_count.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_bbox_count.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_bbox_count.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_bbox_count.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->bbox_count); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t bbox_lengthT = ((uint32_t) (*(inbuffer + offset))); + bbox_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + bbox_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + bbox_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->bbox_length); + if(bbox_lengthT > bbox_length) + this->bbox = (jsk_recognition_msgs::Rect*)realloc(this->bbox, bbox_lengthT * sizeof(jsk_recognition_msgs::Rect)); + bbox_length = bbox_lengthT; + for( uint32_t i = 0; i < bbox_length; i++){ + offset += this->st_bbox.deserialize(inbuffer + offset); + memcpy( &(this->bbox[i]), &(this->st_bbox), sizeof(jsk_recognition_msgs::Rect)); + } + union { + int64_t real; + uint64_t base; + } u_bbox_count; + u_bbox_count.base = 0; + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_bbox_count.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->bbox_count = u_bbox_count.real; + offset += sizeof(this->bbox_count); + return offset; + } + + virtual const char * getType() override { return NONMAXIMUMSUPPRESSION; }; + virtual const char * getMD5() override { return "8db21435e67f6d13fc94ccbd355f30f1"; }; + + }; + + class NonMaximumSuppression { + public: + typedef NonMaximumSuppressionRequest Request; + typedef NonMaximumSuppressionResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Object.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Object.h new file mode 100644 index 000000000..e492d5c06 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Object.h @@ -0,0 +1,204 @@ +#ifndef _ROS_jsk_recognition_msgs_Object_h +#define _ROS_jsk_recognition_msgs_Object_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace jsk_recognition_msgs +{ + + class Object : public ros::Msg + { + public: + typedef int32_t _id_type; + _id_type id; + typedef const char* _name_type; + _name_type name; + typedef int32_t _class_id_type; + _class_id_type class_id; + typedef const char* _class_name_type; + _class_name_type class_name; + uint32_t image_resources_length; + typedef char* _image_resources_type; + _image_resources_type st_image_resources; + _image_resources_type * image_resources; + typedef const char* _mesh_resource_type; + _mesh_resource_type mesh_resource; + typedef float _weight_type; + _weight_type weight; + typedef geometry_msgs::Vector3 _dimensions_type; + _dimensions_type dimensions; + + Object(): + id(0), + name(""), + class_id(0), + class_name(""), + image_resources_length(0), st_image_resources(), image_resources(nullptr), + mesh_resource(""), + weight(0), + dimensions() + { + } + + 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); + 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 { + 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); + uint32_t length_class_name = strlen(this->class_name); + varToArr(outbuffer + offset, length_class_name); + offset += 4; + memcpy(outbuffer + offset, this->class_name, length_class_name); + offset += length_class_name; + *(outbuffer + offset + 0) = (this->image_resources_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->image_resources_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->image_resources_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->image_resources_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->image_resources_length); + for( uint32_t i = 0; i < image_resources_length; i++){ + uint32_t length_image_resourcesi = strlen(this->image_resources[i]); + varToArr(outbuffer + offset, length_image_resourcesi); + offset += 4; + memcpy(outbuffer + offset, this->image_resources[i], length_image_resourcesi); + offset += length_image_resourcesi; + } + uint32_t length_mesh_resource = strlen(this->mesh_resource); + varToArr(outbuffer + offset, length_mesh_resource); + offset += 4; + memcpy(outbuffer + offset, this->mesh_resource, length_mesh_resource); + offset += length_mesh_resource; + union { + float 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 += this->dimensions.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); + 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 { + 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); + uint32_t length_class_name; + arrToVar(length_class_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_class_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_class_name-1]=0; + this->class_name = (char *)(inbuffer + offset-1); + offset += length_class_name; + uint32_t image_resources_lengthT = ((uint32_t) (*(inbuffer + offset))); + image_resources_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + image_resources_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + image_resources_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->image_resources_length); + if(image_resources_lengthT > image_resources_length) + this->image_resources = (char**)realloc(this->image_resources, image_resources_lengthT * sizeof(char*)); + image_resources_length = image_resources_lengthT; + for( uint32_t i = 0; i < image_resources_length; i++){ + uint32_t length_st_image_resources; + arrToVar(length_st_image_resources, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_image_resources; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_image_resources-1]=0; + this->st_image_resources = (char *)(inbuffer + offset-1); + offset += length_st_image_resources; + memcpy( &(this->image_resources[i]), &(this->st_image_resources), sizeof(char*)); + } + uint32_t length_mesh_resource; + arrToVar(length_mesh_resource, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mesh_resource; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mesh_resource-1]=0; + this->mesh_resource = (char *)(inbuffer + offset-1); + offset += length_mesh_resource; + union { + float 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 += this->dimensions.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Object"; }; + virtual const char * getMD5() override { return "57c53e712043df0244b0482d0447adee"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ObjectArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ObjectArray.h new file mode 100644 index 000000000..b0431e488 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ObjectArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_ObjectArray_h +#define _ROS_jsk_recognition_msgs_ObjectArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/Object.h" + +namespace jsk_recognition_msgs +{ + + class ObjectArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t objects_length; + typedef jsk_recognition_msgs::Object _objects_type; + _objects_type st_objects; + _objects_type * objects; + + ObjectArray(): + 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 = (jsk_recognition_msgs::Object*)realloc(this->objects, objects_lengthT * sizeof(jsk_recognition_msgs::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(jsk_recognition_msgs::Object)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ObjectArray"; }; + virtual const char * getMD5() override { return "36314156578f919cf316fea64cc4a616"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ParallelEdge.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ParallelEdge.h new file mode 100644 index 000000000..bced26fa8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ParallelEdge.h @@ -0,0 +1,96 @@ +#ifndef _ROS_jsk_recognition_msgs_ParallelEdge_h +#define _ROS_jsk_recognition_msgs_ParallelEdge_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "pcl_msgs/PointIndices.h" +#include "pcl_msgs/ModelCoefficients.h" + +namespace jsk_recognition_msgs +{ + + class ParallelEdge : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t cluster_indices_length; + typedef pcl_msgs::PointIndices _cluster_indices_type; + _cluster_indices_type st_cluster_indices; + _cluster_indices_type * cluster_indices; + uint32_t coefficients_length; + typedef pcl_msgs::ModelCoefficients _coefficients_type; + _coefficients_type st_coefficients; + _coefficients_type * coefficients; + + ParallelEdge(): + header(), + cluster_indices_length(0), st_cluster_indices(), cluster_indices(nullptr), + coefficients_length(0), st_coefficients(), coefficients(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->cluster_indices_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cluster_indices_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cluster_indices_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cluster_indices_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cluster_indices_length); + for( uint32_t i = 0; i < cluster_indices_length; i++){ + offset += this->cluster_indices[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->coefficients_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->coefficients_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->coefficients_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->coefficients_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->coefficients_length); + for( uint32_t i = 0; i < coefficients_length; i++){ + offset += this->coefficients[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t cluster_indices_lengthT = ((uint32_t) (*(inbuffer + offset))); + cluster_indices_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cluster_indices_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cluster_indices_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cluster_indices_length); + if(cluster_indices_lengthT > cluster_indices_length) + this->cluster_indices = (pcl_msgs::PointIndices*)realloc(this->cluster_indices, cluster_indices_lengthT * sizeof(pcl_msgs::PointIndices)); + cluster_indices_length = cluster_indices_lengthT; + for( uint32_t i = 0; i < cluster_indices_length; i++){ + offset += this->st_cluster_indices.deserialize(inbuffer + offset); + memcpy( &(this->cluster_indices[i]), &(this->st_cluster_indices), sizeof(pcl_msgs::PointIndices)); + } + uint32_t coefficients_lengthT = ((uint32_t) (*(inbuffer + offset))); + coefficients_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + coefficients_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + coefficients_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->coefficients_length); + if(coefficients_lengthT > coefficients_length) + this->coefficients = (pcl_msgs::ModelCoefficients*)realloc(this->coefficients, coefficients_lengthT * sizeof(pcl_msgs::ModelCoefficients)); + coefficients_length = coefficients_lengthT; + for( uint32_t i = 0; i < coefficients_length; i++){ + offset += this->st_coefficients.deserialize(inbuffer + offset); + memcpy( &(this->coefficients[i]), &(this->st_coefficients), sizeof(pcl_msgs::ModelCoefficients)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ParallelEdge"; }; + virtual const char * getMD5() override { return "3a550d5b6275fe0a1580ebf8a62dd336"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ParallelEdgeArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ParallelEdgeArray.h new file mode 100644 index 000000000..123c03443 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/ParallelEdgeArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_ParallelEdgeArray_h +#define _ROS_jsk_recognition_msgs_ParallelEdgeArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/ParallelEdge.h" + +namespace jsk_recognition_msgs +{ + + class ParallelEdgeArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t edge_groups_length; + typedef jsk_recognition_msgs::ParallelEdge _edge_groups_type; + _edge_groups_type st_edge_groups; + _edge_groups_type * edge_groups; + + ParallelEdgeArray(): + header(), + edge_groups_length(0), st_edge_groups(), edge_groups(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->edge_groups_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->edge_groups_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->edge_groups_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->edge_groups_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->edge_groups_length); + for( uint32_t i = 0; i < edge_groups_length; i++){ + offset += this->edge_groups[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t edge_groups_lengthT = ((uint32_t) (*(inbuffer + offset))); + edge_groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + edge_groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + edge_groups_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->edge_groups_length); + if(edge_groups_lengthT > edge_groups_length) + this->edge_groups = (jsk_recognition_msgs::ParallelEdge*)realloc(this->edge_groups, edge_groups_lengthT * sizeof(jsk_recognition_msgs::ParallelEdge)); + edge_groups_length = edge_groups_lengthT; + for( uint32_t i = 0; i < edge_groups_length; i++){ + offset += this->st_edge_groups.deserialize(inbuffer + offset); + memcpy( &(this->edge_groups[i]), &(this->st_edge_groups), sizeof(jsk_recognition_msgs::ParallelEdge)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/ParallelEdgeArray"; }; + virtual const char * getMD5() override { return "7c8ef4f5976c55fb32293ceaa19a1189"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PeoplePose.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PeoplePose.h new file mode 100644 index 000000000..0b713faec --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PeoplePose.h @@ -0,0 +1,145 @@ +#ifndef _ROS_jsk_recognition_msgs_PeoplePose_h +#define _ROS_jsk_recognition_msgs_PeoplePose_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace jsk_recognition_msgs +{ + + class PeoplePose : public ros::Msg + { + public: + uint32_t limb_names_length; + typedef char* _limb_names_type; + _limb_names_type st_limb_names; + _limb_names_type * limb_names; + uint32_t poses_length; + typedef geometry_msgs::Pose _poses_type; + _poses_type st_poses; + _poses_type * poses; + uint32_t scores_length; + typedef float _scores_type; + _scores_type st_scores; + _scores_type * scores; + + PeoplePose(): + limb_names_length(0), st_limb_names(), limb_names(nullptr), + poses_length(0), st_poses(), poses(nullptr), + scores_length(0), st_scores(), scores(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->limb_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->limb_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->limb_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->limb_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->limb_names_length); + for( uint32_t i = 0; i < limb_names_length; i++){ + uint32_t length_limb_namesi = strlen(this->limb_names[i]); + varToArr(outbuffer + offset, length_limb_namesi); + offset += 4; + memcpy(outbuffer + offset, this->limb_names[i], length_limb_namesi); + offset += length_limb_namesi; + } + *(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->scores_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->scores_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->scores_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->scores_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->scores_length); + for( uint32_t i = 0; i < scores_length; i++){ + union { + float real; + uint32_t base; + } u_scoresi; + u_scoresi.real = this->scores[i]; + *(outbuffer + offset + 0) = (u_scoresi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scoresi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scoresi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scoresi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scores[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t limb_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + limb_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + limb_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + limb_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->limb_names_length); + if(limb_names_lengthT > limb_names_length) + this->limb_names = (char**)realloc(this->limb_names, limb_names_lengthT * sizeof(char*)); + limb_names_length = limb_names_lengthT; + for( uint32_t i = 0; i < limb_names_length; i++){ + uint32_t length_st_limb_names; + arrToVar(length_st_limb_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_limb_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_limb_names-1]=0; + this->st_limb_names = (char *)(inbuffer + offset-1); + offset += length_st_limb_names; + memcpy( &(this->limb_names[i]), &(this->st_limb_names), sizeof(char*)); + } + 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 scores_lengthT = ((uint32_t) (*(inbuffer + offset))); + scores_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + scores_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + scores_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->scores_length); + if(scores_lengthT > scores_length) + this->scores = (float*)realloc(this->scores, scores_lengthT * sizeof(float)); + scores_length = scores_lengthT; + for( uint32_t i = 0; i < scores_length; i++){ + union { + float real; + uint32_t base; + } u_st_scores; + u_st_scores.base = 0; + u_st_scores.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_scores.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_scores.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_scores.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_scores = u_st_scores.real; + offset += sizeof(this->st_scores); + memcpy( &(this->scores[i]), &(this->st_scores), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/PeoplePose"; }; + virtual const char * getMD5() override { return "24f6e59dae1b7cbd9d480f0008a5a515"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PeoplePoseArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PeoplePoseArray.h new file mode 100644 index 000000000..d73aee4f7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PeoplePoseArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_PeoplePoseArray_h +#define _ROS_jsk_recognition_msgs_PeoplePoseArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/PeoplePose.h" + +namespace jsk_recognition_msgs +{ + + class PeoplePoseArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t poses_length; + typedef jsk_recognition_msgs::PeoplePose _poses_type; + _poses_type st_poses; + _poses_type * poses; + + PeoplePoseArray(): + 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 = (jsk_recognition_msgs::PeoplePose*)realloc(this->poses, poses_lengthT * sizeof(jsk_recognition_msgs::PeoplePose)); + 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(jsk_recognition_msgs::PeoplePose)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/PeoplePoseArray"; }; + virtual const char * getMD5() override { return "57d49e8e639421734a0ce15bfde9d80d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PlotData.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PlotData.h new file mode 100644 index 000000000..b16dfb98d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PlotData.h @@ -0,0 +1,200 @@ +#ifndef _ROS_jsk_recognition_msgs_PlotData_h +#define _ROS_jsk_recognition_msgs_PlotData_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class PlotData : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t xs_length; + typedef float _xs_type; + _xs_type st_xs; + _xs_type * xs; + uint32_t ys_length; + typedef float _ys_type; + _ys_type st_ys; + _ys_type * ys; + typedef uint32_t _type_type; + _type_type type; + typedef const char* _label_type; + _label_type label; + typedef bool _fit_line_type; + _fit_line_type fit_line; + typedef bool _fit_line_ransac_type; + _fit_line_ransac_type fit_line_ransac; + enum { SCATTER = 1 }; + enum { LINE = 2 }; + + PlotData(): + header(), + xs_length(0), st_xs(), xs(nullptr), + ys_length(0), st_ys(), ys(nullptr), + type(0), + label(""), + fit_line(0), + fit_line_ransac(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->xs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->xs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->xs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->xs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->xs_length); + for( uint32_t i = 0; i < xs_length; i++){ + union { + float real; + uint32_t base; + } u_xsi; + u_xsi.real = this->xs[i]; + *(outbuffer + offset + 0) = (u_xsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_xsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_xsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_xsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->xs[i]); + } + *(outbuffer + offset + 0) = (this->ys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ys_length); + for( uint32_t i = 0; i < ys_length; i++){ + union { + float real; + uint32_t base; + } u_ysi; + u_ysi.real = this->ys[i]; + *(outbuffer + offset + 0) = (u_ysi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_ysi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_ysi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_ysi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ys[i]); + } + *(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); + 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 { + bool real; + uint8_t base; + } u_fit_line; + u_fit_line.real = this->fit_line; + *(outbuffer + offset + 0) = (u_fit_line.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->fit_line); + union { + bool real; + uint8_t base; + } u_fit_line_ransac; + u_fit_line_ransac.real = this->fit_line_ransac; + *(outbuffer + offset + 0) = (u_fit_line_ransac.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->fit_line_ransac); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t xs_lengthT = ((uint32_t) (*(inbuffer + offset))); + xs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + xs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + xs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->xs_length); + if(xs_lengthT > xs_length) + this->xs = (float*)realloc(this->xs, xs_lengthT * sizeof(float)); + xs_length = xs_lengthT; + for( uint32_t i = 0; i < xs_length; i++){ + union { + float real; + uint32_t base; + } u_st_xs; + u_st_xs.base = 0; + u_st_xs.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_xs.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_xs.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_xs.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_xs = u_st_xs.real; + offset += sizeof(this->st_xs); + memcpy( &(this->xs[i]), &(this->st_xs), sizeof(float)); + } + uint32_t ys_lengthT = ((uint32_t) (*(inbuffer + offset))); + ys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ys_length); + if(ys_lengthT > ys_length) + this->ys = (float*)realloc(this->ys, ys_lengthT * sizeof(float)); + ys_length = ys_lengthT; + for( uint32_t i = 0; i < ys_length; i++){ + union { + float real; + uint32_t base; + } u_st_ys; + u_st_ys.base = 0; + u_st_ys.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ys.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ys.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ys.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ys = u_st_ys.real; + offset += sizeof(this->st_ys); + memcpy( &(this->ys[i]), &(this->st_ys), sizeof(float)); + } + 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 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 { + bool real; + uint8_t base; + } u_fit_line; + u_fit_line.base = 0; + u_fit_line.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->fit_line = u_fit_line.real; + offset += sizeof(this->fit_line); + union { + bool real; + uint8_t base; + } u_fit_line_ransac; + u_fit_line_ransac.base = 0; + u_fit_line_ransac.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->fit_line_ransac = u_fit_line_ransac.real; + offset += sizeof(this->fit_line_ransac); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/PlotData"; }; + virtual const char * getMD5() override { return "abc388ba2207b305f8695ad025452af4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PlotDataArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PlotDataArray.h new file mode 100644 index 000000000..3c4a5f553 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PlotDataArray.h @@ -0,0 +1,208 @@ +#ifndef _ROS_jsk_recognition_msgs_PlotDataArray_h +#define _ROS_jsk_recognition_msgs_PlotDataArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/PlotData.h" + +namespace jsk_recognition_msgs +{ + + class PlotDataArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t data_length; + typedef jsk_recognition_msgs::PlotData _data_type; + _data_type st_data; + _data_type * data; + typedef bool _no_legend_type; + _no_legend_type no_legend; + typedef float _legend_font_size_type; + _legend_font_size_type legend_font_size; + typedef float _max_x_type; + _max_x_type max_x; + typedef float _min_x_type; + _min_x_type min_x; + typedef float _min_y_type; + _min_y_type min_y; + typedef float _max_y_type; + _max_y_type max_y; + + PlotDataArray(): + header(), + data_length(0), st_data(), data(nullptr), + no_legend(0), + legend_font_size(0), + max_x(0), + min_x(0), + min_y(0), + max_y(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++){ + offset += this->data[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_no_legend; + u_no_legend.real = this->no_legend; + *(outbuffer + offset + 0) = (u_no_legend.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->no_legend); + union { + float real; + uint32_t base; + } u_legend_font_size; + u_legend_font_size.real = this->legend_font_size; + *(outbuffer + offset + 0) = (u_legend_font_size.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_legend_font_size.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_legend_font_size.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_legend_font_size.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->legend_font_size); + union { + float real; + uint32_t base; + } u_max_x; + u_max_x.real = this->max_x; + *(outbuffer + offset + 0) = (u_max_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_x); + union { + float real; + uint32_t base; + } u_min_x; + u_min_x.real = this->min_x; + *(outbuffer + offset + 0) = (u_min_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_x); + union { + float real; + uint32_t base; + } u_min_y; + u_min_y.real = this->min_y; + *(outbuffer + offset + 0) = (u_min_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_y); + union { + float real; + uint32_t base; + } u_max_y; + u_max_y.real = this->max_y; + *(outbuffer + offset + 0) = (u_max_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_y); + 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 = (jsk_recognition_msgs::PlotData*)realloc(this->data, data_lengthT * sizeof(jsk_recognition_msgs::PlotData)); + 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(jsk_recognition_msgs::PlotData)); + } + union { + bool real; + uint8_t base; + } u_no_legend; + u_no_legend.base = 0; + u_no_legend.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->no_legend = u_no_legend.real; + offset += sizeof(this->no_legend); + union { + float real; + uint32_t base; + } u_legend_font_size; + u_legend_font_size.base = 0; + u_legend_font_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_legend_font_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_legend_font_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_legend_font_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->legend_font_size = u_legend_font_size.real; + offset += sizeof(this->legend_font_size); + union { + float real; + uint32_t base; + } u_max_x; + u_max_x.base = 0; + u_max_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_x = u_max_x.real; + offset += sizeof(this->max_x); + union { + float real; + uint32_t base; + } u_min_x; + u_min_x.base = 0; + u_min_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_x = u_min_x.real; + offset += sizeof(this->min_x); + union { + float real; + uint32_t base; + } u_min_y; + u_min_y.base = 0; + u_min_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_y = u_min_y.real; + offset += sizeof(this->min_y); + union { + float real; + uint32_t base; + } u_max_y; + u_max_y.base = 0; + u_max_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_y = u_max_y.real; + offset += sizeof(this->max_y); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/PlotDataArray"; }; + virtual const char * getMD5() override { return "e83e9378b374b8436f955a6cd212770a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PointsArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PointsArray.h new file mode 100644 index 000000000..4162f5b2c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PointsArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_PointsArray_h +#define _ROS_jsk_recognition_msgs_PointsArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointCloud2.h" + +namespace jsk_recognition_msgs +{ + + class PointsArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t cloud_list_length; + typedef sensor_msgs::PointCloud2 _cloud_list_type; + _cloud_list_type st_cloud_list; + _cloud_list_type * cloud_list; + + PointsArray(): + header(), + cloud_list_length(0), st_cloud_list(), cloud_list(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->cloud_list_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cloud_list_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cloud_list_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cloud_list_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cloud_list_length); + for( uint32_t i = 0; i < cloud_list_length; i++){ + offset += this->cloud_list[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t cloud_list_lengthT = ((uint32_t) (*(inbuffer + offset))); + cloud_list_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cloud_list_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cloud_list_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cloud_list_length); + if(cloud_list_lengthT > cloud_list_length) + this->cloud_list = (sensor_msgs::PointCloud2*)realloc(this->cloud_list, cloud_list_lengthT * sizeof(sensor_msgs::PointCloud2)); + cloud_list_length = cloud_list_lengthT; + for( uint32_t i = 0; i < cloud_list_length; i++){ + offset += this->st_cloud_list.deserialize(inbuffer + offset); + memcpy( &(this->cloud_list[i]), &(this->st_cloud_list), sizeof(sensor_msgs::PointCloud2)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/PointsArray"; }; + virtual const char * getMD5() override { return "0aa7e57c9da77fc1a0d8277bba5672b1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PolygonArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PolygonArray.h new file mode 100644 index 000000000..3ccbf7342 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PolygonArray.h @@ -0,0 +1,147 @@ +#ifndef _ROS_jsk_recognition_msgs_PolygonArray_h +#define _ROS_jsk_recognition_msgs_PolygonArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PolygonStamped.h" + +namespace jsk_recognition_msgs +{ + + class PolygonArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t polygons_length; + typedef geometry_msgs::PolygonStamped _polygons_type; + _polygons_type st_polygons; + _polygons_type * polygons; + uint32_t labels_length; + typedef uint32_t _labels_type; + _labels_type st_labels; + _labels_type * labels; + uint32_t likelihood_length; + typedef float _likelihood_type; + _likelihood_type st_likelihood; + _likelihood_type * likelihood; + + PolygonArray(): + header(), + polygons_length(0), st_polygons(), polygons(nullptr), + labels_length(0), st_labels(), labels(nullptr), + likelihood_length(0), st_likelihood(), likelihood(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->polygons_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->polygons_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->polygons_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->polygons_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->polygons_length); + for( uint32_t i = 0; i < polygons_length; i++){ + offset += this->polygons[i].serialize(outbuffer + offset); + } + *(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++){ + *(outbuffer + offset + 0) = (this->labels[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->labels[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->labels[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->labels[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->labels[i]); + } + *(outbuffer + offset + 0) = (this->likelihood_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->likelihood_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->likelihood_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->likelihood_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->likelihood_length); + for( uint32_t i = 0; i < likelihood_length; i++){ + union { + float real; + uint32_t base; + } u_likelihoodi; + u_likelihoodi.real = this->likelihood[i]; + *(outbuffer + offset + 0) = (u_likelihoodi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_likelihoodi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_likelihoodi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_likelihoodi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->likelihood[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t polygons_lengthT = ((uint32_t) (*(inbuffer + offset))); + polygons_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + polygons_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + polygons_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->polygons_length); + if(polygons_lengthT > polygons_length) + this->polygons = (geometry_msgs::PolygonStamped*)realloc(this->polygons, polygons_lengthT * sizeof(geometry_msgs::PolygonStamped)); + polygons_length = polygons_lengthT; + for( uint32_t i = 0; i < polygons_length; i++){ + offset += this->st_polygons.deserialize(inbuffer + offset); + memcpy( &(this->polygons[i]), &(this->st_polygons), sizeof(geometry_msgs::PolygonStamped)); + } + 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 = (uint32_t*)realloc(this->labels, labels_lengthT * sizeof(uint32_t)); + labels_length = labels_lengthT; + for( uint32_t i = 0; i < labels_length; i++){ + this->st_labels = ((uint32_t) (*(inbuffer + offset))); + this->st_labels |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_labels |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_labels |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_labels); + memcpy( &(this->labels[i]), &(this->st_labels), sizeof(uint32_t)); + } + uint32_t likelihood_lengthT = ((uint32_t) (*(inbuffer + offset))); + likelihood_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + likelihood_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + likelihood_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->likelihood_length); + if(likelihood_lengthT > likelihood_length) + this->likelihood = (float*)realloc(this->likelihood, likelihood_lengthT * sizeof(float)); + likelihood_length = likelihood_lengthT; + for( uint32_t i = 0; i < likelihood_length; i++){ + union { + float real; + uint32_t base; + } u_st_likelihood; + u_st_likelihood.base = 0; + u_st_likelihood.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_likelihood.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_likelihood.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_likelihood.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_likelihood = u_st_likelihood.real; + offset += sizeof(this->st_likelihood); + memcpy( &(this->likelihood[i]), &(this->st_likelihood), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/PolygonArray"; }; + virtual const char * getMD5() override { return "709b37d39871cfdbbfbd5c41cf9bc2be"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PolygonOnEnvironment.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PolygonOnEnvironment.h new file mode 100644 index 000000000..b89b214d6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PolygonOnEnvironment.h @@ -0,0 +1,137 @@ +#ifndef _ROS_SERVICE_PolygonOnEnvironment_h +#define _ROS_SERVICE_PolygonOnEnvironment_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PolygonStamped.h" + +namespace jsk_recognition_msgs +{ + +static const char POLYGONONENVIRONMENT[] = "jsk_recognition_msgs/PolygonOnEnvironment"; + + class PolygonOnEnvironmentRequest : public ros::Msg + { + public: + typedef uint32_t _environment_id_type; + _environment_id_type environment_id; + typedef uint32_t _plane_index_type; + _plane_index_type plane_index; + typedef geometry_msgs::PolygonStamped _polygon_type; + _polygon_type polygon; + + PolygonOnEnvironmentRequest(): + environment_id(0), + plane_index(0), + polygon() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->environment_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->environment_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->environment_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->environment_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->environment_id); + *(outbuffer + offset + 0) = (this->plane_index >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->plane_index >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->plane_index >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->plane_index >> (8 * 3)) & 0xFF; + offset += sizeof(this->plane_index); + offset += this->polygon.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->environment_id = ((uint32_t) (*(inbuffer + offset))); + this->environment_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->environment_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->environment_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->environment_id); + this->plane_index = ((uint32_t) (*(inbuffer + offset))); + this->plane_index |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->plane_index |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->plane_index |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->plane_index); + offset += this->polygon.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return POLYGONONENVIRONMENT; }; + virtual const char * getMD5() override { return "5c876f97015e6a599aa3c09455882c02"; }; + + }; + + class PolygonOnEnvironmentResponse : public ros::Msg + { + public: + typedef bool _result_type; + _result_type result; + typedef const char* _reason_type; + _reason_type reason; + + PolygonOnEnvironmentResponse(): + result(0), + reason("") + { + } + + 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_reason = strlen(this->reason); + varToArr(outbuffer + offset, length_reason); + offset += 4; + memcpy(outbuffer + offset, this->reason, length_reason); + offset += length_reason; + 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_reason; + arrToVar(length_reason, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reason; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reason-1]=0; + this->reason = (char *)(inbuffer + offset-1); + offset += length_reason; + return offset; + } + + virtual const char * getType() override { return POLYGONONENVIRONMENT; }; + virtual const char * getMD5() override { return "5d3fee08bf23ddff8ab543476a855d3f"; }; + + }; + + class PolygonOnEnvironment { + public: + typedef PolygonOnEnvironmentRequest Request; + typedef PolygonOnEnvironmentResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PosedCameraInfo.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PosedCameraInfo.h new file mode 100644 index 000000000..f40e71bfa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/PosedCameraInfo.h @@ -0,0 +1,56 @@ +#ifndef _ROS_jsk_recognition_msgs_PosedCameraInfo_h +#define _ROS_jsk_recognition_msgs_PosedCameraInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/CameraInfo.h" +#include "geometry_msgs/Pose.h" + +namespace jsk_recognition_msgs +{ + + class PosedCameraInfo : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef sensor_msgs::CameraInfo _camera_info_type; + _camera_info_type camera_info; + typedef geometry_msgs::Pose _offset_type; + _offset_type offset; + + PosedCameraInfo(): + header(), + camera_info(), + offset() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->camera_info.serialize(outbuffer + offset); + offset += this->offset.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->camera_info.deserialize(inbuffer + offset); + offset += this->offset.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/PosedCameraInfo"; }; + virtual const char * getMD5() override { return "bfcbc4847adb445a428e4af537ed849a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Rect.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Rect.h new file mode 100644 index 000000000..0a2df5828 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Rect.h @@ -0,0 +1,134 @@ +#ifndef _ROS_jsk_recognition_msgs_Rect_h +#define _ROS_jsk_recognition_msgs_Rect_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + + class Rect : public ros::Msg + { + public: + typedef int32_t _x_type; + _x_type x; + typedef int32_t _y_type; + _y_type y; + typedef int32_t _width_type; + _width_type width; + typedef int32_t _height_type; + _height_type height; + + Rect(): + x(0), + y(0), + width(0), + height(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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 { + int32_t real; + uint32_t base; + } u_width; + u_width.real = this->width; + *(outbuffer + offset + 0) = (u_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + union { + int32_t real; + uint32_t base; + } u_height; + u_height.real = this->height; + *(outbuffer + offset + 0) = (u_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 { + int32_t real; + uint32_t base; + } u_width; + u_width.base = 0; + u_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->width = u_width.real; + offset += sizeof(this->width); + union { + int32_t real; + uint32_t base; + } u_height; + u_height.base = 0; + u_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->height = u_height.real; + offset += sizeof(this->height); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Rect"; }; + virtual const char * getMD5() override { return "4425f1067abc7ec2e487d28194eccff4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RectArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RectArray.h new file mode 100644 index 000000000..297a396de --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RectArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_RectArray_h +#define _ROS_jsk_recognition_msgs_RectArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/Rect.h" + +namespace jsk_recognition_msgs +{ + + class RectArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t rects_length; + typedef jsk_recognition_msgs::Rect _rects_type; + _rects_type st_rects; + _rects_type * rects; + + RectArray(): + header(), + rects_length(0), st_rects(), rects(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->rects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rects_length); + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->rects[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t rects_lengthT = ((uint32_t) (*(inbuffer + offset))); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rects_length); + if(rects_lengthT > rects_length) + this->rects = (jsk_recognition_msgs::Rect*)realloc(this->rects, rects_lengthT * sizeof(jsk_recognition_msgs::Rect)); + rects_length = rects_lengthT; + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->st_rects.deserialize(inbuffer + offset); + memcpy( &(this->rects[i]), &(this->st_rects), sizeof(jsk_recognition_msgs::Rect)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/RectArray"; }; + virtual const char * getMD5() override { return "e83b38fbaea3a641fa77f009f9bf492e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RobotPickupReleasePoint.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RobotPickupReleasePoint.h new file mode 100644 index 000000000..38f9a24bd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RobotPickupReleasePoint.h @@ -0,0 +1,118 @@ +#ifndef _ROS_SERVICE_RobotPickupReleasePoint_h +#define _ROS_SERVICE_RobotPickupReleasePoint_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + +static const char ROBOTPICKUPRELEASEPOINT[] = "jsk_recognition_msgs/RobotPickupReleasePoint"; + + class RobotPickupReleasePointRequest : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Point _target_point_type; + _target_point_type target_point; + typedef int8_t _pick_or_release_type; + _pick_or_release_type pick_or_release; + + RobotPickupReleasePointRequest(): + header(), + target_point(), + pick_or_release(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->target_point.serialize(outbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_pick_or_release; + u_pick_or_release.real = this->pick_or_release; + *(outbuffer + offset + 0) = (u_pick_or_release.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pick_or_release); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->target_point.deserialize(inbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_pick_or_release; + u_pick_or_release.base = 0; + u_pick_or_release.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pick_or_release = u_pick_or_release.real; + offset += sizeof(this->pick_or_release); + return offset; + } + + virtual const char * getType() override { return ROBOTPICKUPRELEASEPOINT; }; + virtual const char * getMD5() override { return "deed053f0da0bc3c530cdf92dcf06642"; }; + + }; + + class RobotPickupReleasePointResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + RobotPickupReleasePointResponse(): + 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 ROBOTPICKUPRELEASEPOINT; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class RobotPickupReleasePoint { + public: + typedef RobotPickupReleasePointRequest Request; + typedef RobotPickupReleasePointResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RotatedRect.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RotatedRect.h new file mode 100644 index 000000000..f95ab36de --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RotatedRect.h @@ -0,0 +1,63 @@ +#ifndef _ROS_jsk_recognition_msgs_RotatedRect_h +#define _ROS_jsk_recognition_msgs_RotatedRect_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + + class RotatedRect : public ros::Msg + { + public: + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef float _width_type; + _width_type width; + typedef float _height_type; + _height_type height; + typedef float _angle_type; + _angle_type angle; + + RotatedRect(): + x(0), + y(0), + width(0), + height(0), + angle(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->width); + offset += serializeAvrFloat64(outbuffer + offset, this->height); + offset += serializeAvrFloat64(outbuffer + offset, this->angle); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->width)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->height)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->angle)); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/RotatedRect"; }; + virtual const char * getMD5() override { return "e970c93bbd35a570f7d9acc8228e9280"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RotatedRectStamped.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RotatedRectStamped.h new file mode 100644 index 000000000..5128f3200 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/RotatedRectStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_jsk_recognition_msgs_RotatedRectStamped_h +#define _ROS_jsk_recognition_msgs_RotatedRectStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/RotatedRect.h" + +namespace jsk_recognition_msgs +{ + + class RotatedRectStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef jsk_recognition_msgs::RotatedRect _rect_type; + _rect_type rect; + + RotatedRectStamped(): + header(), + rect() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->rect.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->rect.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/RotatedRectStamped"; }; + virtual const char * getMD5() override { return "0260299b5425567e14c7b295b58829e9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SaveMesh.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SaveMesh.h new file mode 100644 index 000000000..a74966ca1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SaveMesh.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_SaveMesh_h +#define _ROS_SERVICE_SaveMesh_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_recognition_msgs/BoundingBox.h" + +namespace jsk_recognition_msgs +{ + +static const char SAVEMESH[] = "jsk_recognition_msgs/SaveMesh"; + + class SaveMeshRequest : public ros::Msg + { + public: + typedef const char* _ground_frame_id_type; + _ground_frame_id_type ground_frame_id; + typedef jsk_recognition_msgs::BoundingBox _box_type; + _box_type box; + + SaveMeshRequest(): + ground_frame_id(""), + box() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_ground_frame_id = strlen(this->ground_frame_id); + varToArr(outbuffer + offset, length_ground_frame_id); + offset += 4; + memcpy(outbuffer + offset, this->ground_frame_id, length_ground_frame_id); + offset += length_ground_frame_id; + offset += this->box.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_ground_frame_id; + arrToVar(length_ground_frame_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ground_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ground_frame_id-1]=0; + this->ground_frame_id = (char *)(inbuffer + offset-1); + offset += length_ground_frame_id; + offset += this->box.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SAVEMESH; }; + virtual const char * getMD5() override { return "aedbb75b25dc1f22d6170286e35b1132"; }; + + }; + + class SaveMeshResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + SaveMeshResponse(): + 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 SAVEMESH; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SaveMesh { + public: + typedef SaveMeshRequest Request; + typedef SaveMeshResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Segment.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Segment.h new file mode 100644 index 000000000..4fbf23c51 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Segment.h @@ -0,0 +1,49 @@ +#ifndef _ROS_jsk_recognition_msgs_Segment_h +#define _ROS_jsk_recognition_msgs_Segment_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" + +namespace jsk_recognition_msgs +{ + + class Segment : public ros::Msg + { + public: + typedef geometry_msgs::Point _start_point_type; + _start_point_type start_point; + typedef geometry_msgs::Point _end_point_type; + _end_point_type end_point; + + Segment(): + start_point(), + end_point() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->start_point.serialize(outbuffer + offset); + offset += this->end_point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->start_point.deserialize(inbuffer + offset); + offset += this->end_point.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Segment"; }; + virtual const char * getMD5() override { return "0125c553546d7123dccaeab992a9e29e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SegmentArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SegmentArray.h new file mode 100644 index 000000000..24910a2a0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SegmentArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_SegmentArray_h +#define _ROS_jsk_recognition_msgs_SegmentArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/Segment.h" + +namespace jsk_recognition_msgs +{ + + class SegmentArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t segments_length; + typedef jsk_recognition_msgs::Segment _segments_type; + _segments_type st_segments; + _segments_type * segments; + + SegmentArray(): + header(), + segments_length(0), st_segments(), segments(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.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 = (jsk_recognition_msgs::Segment*)realloc(this->segments, segments_lengthT * sizeof(jsk_recognition_msgs::Segment)); + 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(jsk_recognition_msgs::Segment)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SegmentArray"; }; + virtual const char * getMD5() override { return "672a84c8545e1a65663c5497ab1a917c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SegmentStamped.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SegmentStamped.h new file mode 100644 index 000000000..a187acf93 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SegmentStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_jsk_recognition_msgs_SegmentStamped_h +#define _ROS_jsk_recognition_msgs_SegmentStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/Segment.h" + +namespace jsk_recognition_msgs +{ + + class SegmentStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef jsk_recognition_msgs::Segment _segment_type; + _segment_type segment; + + SegmentStamped(): + header(), + segment() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->segment.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->segment.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SegmentStamped"; }; + virtual const char * getMD5() override { return "1f2fbdf9b9a242110bee5312e7718d1f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetDepthCalibrationParameter.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetDepthCalibrationParameter.h new file mode 100644 index 000000000..2823fc02c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetDepthCalibrationParameter.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_SetDepthCalibrationParameter_h +#define _ROS_SERVICE_SetDepthCalibrationParameter_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_recognition_msgs/DepthCalibrationParameter.h" + +namespace jsk_recognition_msgs +{ + +static const char SETDEPTHCALIBRATIONPARAMETER[] = "jsk_recognition_msgs/SetDepthCalibrationParameter"; + + class SetDepthCalibrationParameterRequest : public ros::Msg + { + public: + typedef jsk_recognition_msgs::DepthCalibrationParameter _parameter_type; + _parameter_type parameter; + + SetDepthCalibrationParameterRequest(): + parameter() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->parameter.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->parameter.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETDEPTHCALIBRATIONPARAMETER; }; + virtual const char * getMD5() override { return "46b1552cd9512adcf9bbec97800b0e0d"; }; + + }; + + class SetDepthCalibrationParameterResponse : public ros::Msg + { + public: + + SetDepthCalibrationParameterResponse() + { + } + + 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 SETDEPTHCALIBRATIONPARAMETER; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetDepthCalibrationParameter { + public: + typedef SetDepthCalibrationParameterRequest Request; + typedef SetDepthCalibrationParameterResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetLabels.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetLabels.h new file mode 100644 index 000000000..19b131e5a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetLabels.h @@ -0,0 +1,140 @@ +#ifndef _ROS_SERVICE_SetLabels_h +#define _ROS_SERVICE_SetLabels_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + +static const char SETLABELS[] = "jsk_recognition_msgs/SetLabels"; + + class SetLabelsRequest : public ros::Msg + { + public: + uint32_t labels_length; + typedef int64_t _labels_type; + _labels_type st_labels; + _labels_type * labels; + + SetLabelsRequest(): + labels_length(0), st_labels(), labels(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(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++){ + union { + int64_t real; + uint64_t base; + } u_labelsi; + u_labelsi.real = this->labels[i]; + *(outbuffer + offset + 0) = (u_labelsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_labelsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_labelsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_labelsi.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_labelsi.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_labelsi.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_labelsi.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_labelsi.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->labels[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 = (int64_t*)realloc(this->labels, labels_lengthT * sizeof(int64_t)); + labels_length = labels_lengthT; + for( uint32_t i = 0; i < labels_length; i++){ + union { + int64_t real; + uint64_t base; + } u_st_labels; + u_st_labels.base = 0; + u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->st_labels = u_st_labels.real; + offset += sizeof(this->st_labels); + memcpy( &(this->labels[i]), &(this->st_labels), sizeof(int64_t)); + } + return offset; + } + + virtual const char * getType() override { return SETLABELS; }; + virtual const char * getMD5() override { return "59c228f541cab5b727a29411b8f17b33"; }; + + }; + + class SetLabelsResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + SetLabelsResponse(): + 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 SETLABELS; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SetLabels { + public: + typedef SetLabelsRequest Request; + typedef SetLabelsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetPointCloud2.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetPointCloud2.h new file mode 100644 index 000000000..7e15b7fb6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetPointCloud2.h @@ -0,0 +1,110 @@ +#ifndef _ROS_SERVICE_SetPointCloud2_h +#define _ROS_SERVICE_SetPointCloud2_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace jsk_recognition_msgs +{ + +static const char SETPOINTCLOUD2[] = "jsk_recognition_msgs/SetPointCloud2"; + + class SetPointCloud2Request : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _cloud_type; + _cloud_type cloud; + typedef const char* _name_type; + _name_type name; + + SetPointCloud2Request(): + cloud(), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + 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; + offset += this->cloud.deserialize(inbuffer + offset); + 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 SETPOINTCLOUD2; }; + virtual const char * getMD5() override { return "f233222fb244758562fcd56961c317c9"; }; + + }; + + class SetPointCloud2Response : public ros::Msg + { + public: + typedef const char* _output_type; + _output_type output; + + SetPointCloud2Response(): + output("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_output = strlen(this->output); + varToArr(outbuffer + offset, length_output); + offset += 4; + memcpy(outbuffer + offset, this->output, length_output); + offset += length_output; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_output; + arrToVar(length_output, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_output; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_output-1]=0; + this->output = (char *)(inbuffer + offset-1); + offset += length_output; + return offset; + } + + virtual const char * getType() override { return SETPOINTCLOUD2; }; + virtual const char * getMD5() override { return "0825d95fdfa2c8f4bbb4e9c74bccd3fd"; }; + + }; + + class SetPointCloud2 { + public: + typedef SetPointCloud2Request Request; + typedef SetPointCloud2Response Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetTemplate.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetTemplate.h new file mode 100644 index 000000000..d7586a22f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SetTemplate.h @@ -0,0 +1,164 @@ +#ifndef _ROS_SERVICE_SetTemplate_h +#define _ROS_SERVICE_SetTemplate_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "sensor_msgs/Image.h" + +namespace jsk_recognition_msgs +{ + +static const char SETTEMPLATE[] = "jsk_recognition_msgs/SetTemplate"; + + class SetTemplateRequest : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + typedef sensor_msgs::Image _image_type; + _image_type image; + typedef float _dimx_type; + _dimx_type dimx; + typedef float _dimy_type; + _dimy_type dimy; + typedef geometry_msgs::Pose _relativepose_type; + _relativepose_type relativepose; + typedef const char* _savefilename_type; + _savefilename_type savefilename; + + SetTemplateRequest(): + type(""), + image(), + dimx(0), + dimy(0), + relativepose(), + savefilename("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + offset += this->image.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_dimx; + u_dimx.real = this->dimx; + *(outbuffer + offset + 0) = (u_dimx.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dimx.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dimx.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dimx.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dimx); + union { + float real; + uint32_t base; + } u_dimy; + u_dimy.real = this->dimy; + *(outbuffer + offset + 0) = (u_dimy.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dimy.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dimy.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dimy.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dimy); + offset += this->relativepose.serialize(outbuffer + offset); + uint32_t length_savefilename = strlen(this->savefilename); + varToArr(outbuffer + offset, length_savefilename); + offset += 4; + memcpy(outbuffer + offset, this->savefilename, length_savefilename); + offset += length_savefilename; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + offset += this->image.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_dimx; + u_dimx.base = 0; + u_dimx.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dimx.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dimx.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dimx.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dimx = u_dimx.real; + offset += sizeof(this->dimx); + union { + float real; + uint32_t base; + } u_dimy; + u_dimy.base = 0; + u_dimy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dimy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dimy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dimy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dimy = u_dimy.real; + offset += sizeof(this->dimy); + offset += this->relativepose.deserialize(inbuffer + offset); + uint32_t length_savefilename; + arrToVar(length_savefilename, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_savefilename; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_savefilename-1]=0; + this->savefilename = (char *)(inbuffer + offset-1); + offset += length_savefilename; + return offset; + } + + virtual const char * getType() override { return SETTEMPLATE; }; + virtual const char * getMD5() override { return "116fa80f27cbdfcd76d0b57a30ef79ec"; }; + + }; + + class SetTemplateResponse : public ros::Msg + { + public: + + SetTemplateResponse() + { + } + + 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 SETTEMPLATE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetTemplate { + public: + typedef SetTemplateRequest Request; + typedef SetTemplateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleHandle.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleHandle.h new file mode 100644 index 000000000..83090a867 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleHandle.h @@ -0,0 +1,55 @@ +#ifndef _ROS_jsk_recognition_msgs_SimpleHandle_h +#define _ROS_jsk_recognition_msgs_SimpleHandle_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace jsk_recognition_msgs +{ + + class SimpleHandle : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef float _handle_width_type; + _handle_width_type handle_width; + + SimpleHandle(): + header(), + pose(), + handle_width(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->handle_width); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->handle_width)); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SimpleHandle"; }; + virtual const char * getMD5() override { return "3a87e21f72b9ed7090c46a47617b0740"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleOccupancyGrid.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleOccupancyGrid.h new file mode 100644 index 000000000..9d7f4c829 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleOccupancyGrid.h @@ -0,0 +1,121 @@ +#ifndef _ROS_jsk_recognition_msgs_SimpleOccupancyGrid_h +#define _ROS_jsk_recognition_msgs_SimpleOccupancyGrid_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace jsk_recognition_msgs +{ + + class SimpleOccupancyGrid : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + float coefficients[4]; + typedef float _resolution_type; + _resolution_type resolution; + uint32_t cells_length; + typedef geometry_msgs::Point _cells_type; + _cells_type st_cells; + _cells_type * cells; + + SimpleOccupancyGrid(): + header(), + coefficients(), + resolution(0), + cells_length(0), st_cells(), cells(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 4; i++){ + union { + float real; + uint32_t base; + } u_coefficientsi; + u_coefficientsi.real = this->coefficients[i]; + *(outbuffer + offset + 0) = (u_coefficientsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_coefficientsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_coefficientsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_coefficientsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->coefficients[i]); + } + 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); + *(outbuffer + offset + 0) = (this->cells_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cells_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cells_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cells_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cells_length); + for( uint32_t i = 0; i < cells_length; i++){ + offset += this->cells[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 4; i++){ + union { + float real; + uint32_t base; + } u_coefficientsi; + u_coefficientsi.base = 0; + u_coefficientsi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_coefficientsi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_coefficientsi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_coefficientsi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->coefficients[i] = u_coefficientsi.real; + offset += sizeof(this->coefficients[i]); + } + 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); + uint32_t cells_lengthT = ((uint32_t) (*(inbuffer + offset))); + cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cells_length); + if(cells_lengthT > cells_length) + this->cells = (geometry_msgs::Point*)realloc(this->cells, cells_lengthT * sizeof(geometry_msgs::Point)); + cells_length = cells_lengthT; + for( uint32_t i = 0; i < cells_length; i++){ + offset += this->st_cells.deserialize(inbuffer + offset); + memcpy( &(this->cells[i]), &(this->st_cells), sizeof(geometry_msgs::Point)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SimpleOccupancyGrid"; }; + virtual const char * getMD5() override { return "25fb4ce5a31aab052ba1250fcdda9da7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleOccupancyGridArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleOccupancyGridArray.h new file mode 100644 index 000000000..eb8adef10 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SimpleOccupancyGridArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_SimpleOccupancyGridArray_h +#define _ROS_jsk_recognition_msgs_SimpleOccupancyGridArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/SimpleOccupancyGrid.h" + +namespace jsk_recognition_msgs +{ + + class SimpleOccupancyGridArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t grids_length; + typedef jsk_recognition_msgs::SimpleOccupancyGrid _grids_type; + _grids_type st_grids; + _grids_type * grids; + + SimpleOccupancyGridArray(): + header(), + grids_length(0), st_grids(), grids(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->grids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->grids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->grids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->grids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->grids_length); + for( uint32_t i = 0; i < grids_length; i++){ + offset += this->grids[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t grids_lengthT = ((uint32_t) (*(inbuffer + offset))); + grids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + grids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + grids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->grids_length); + if(grids_lengthT > grids_length) + this->grids = (jsk_recognition_msgs::SimpleOccupancyGrid*)realloc(this->grids, grids_lengthT * sizeof(jsk_recognition_msgs::SimpleOccupancyGrid)); + grids_length = grids_lengthT; + for( uint32_t i = 0; i < grids_length; i++){ + offset += this->st_grids.deserialize(inbuffer + offset); + memcpy( &(this->grids[i]), &(this->st_grids), sizeof(jsk_recognition_msgs::SimpleOccupancyGrid)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SimpleOccupancyGridArray"; }; + virtual const char * getMD5() override { return "e448b458270a6ec465d66169c4180932"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SlicedPointCloud.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SlicedPointCloud.h new file mode 100644 index 000000000..7ddbb6828 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SlicedPointCloud.h @@ -0,0 +1,58 @@ +#ifndef _ROS_jsk_recognition_msgs_SlicedPointCloud_h +#define _ROS_jsk_recognition_msgs_SlicedPointCloud_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace jsk_recognition_msgs +{ + + class SlicedPointCloud : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _point_cloud_type; + _point_cloud_type point_cloud; + typedef uint8_t _slice_index_type; + _slice_index_type slice_index; + typedef uint8_t _sequence_id_type; + _sequence_id_type sequence_id; + + SlicedPointCloud(): + point_cloud(), + slice_index(0), + sequence_id(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->point_cloud.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->slice_index >> (8 * 0)) & 0xFF; + offset += sizeof(this->slice_index); + *(outbuffer + offset + 0) = (this->sequence_id >> (8 * 0)) & 0xFF; + offset += sizeof(this->sequence_id); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->point_cloud.deserialize(inbuffer + offset); + this->slice_index = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->slice_index); + this->sequence_id = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->sequence_id); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SlicedPointCloud"; }; + virtual const char * getMD5() override { return "37376a48b034bf543f8cfd86844487c7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SnapFootstep.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SnapFootstep.h new file mode 100644 index 000000000..d5081fcbd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SnapFootstep.h @@ -0,0 +1,81 @@ +#ifndef _ROS_SERVICE_SnapFootstep_h +#define _ROS_SERVICE_SnapFootstep_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_footstep_msgs/FootstepArray.h" + +namespace jsk_recognition_msgs +{ + +static const char SNAPFOOTSTEP[] = "jsk_recognition_msgs/SnapFootstep"; + + class SnapFootstepRequest : public ros::Msg + { + public: + typedef jsk_footstep_msgs::FootstepArray _input_type; + _input_type input; + + SnapFootstepRequest(): + input() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->input.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->input.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SNAPFOOTSTEP; }; + virtual const char * getMD5() override { return "acbed27d6a2c527657315248d9480de2"; }; + + }; + + class SnapFootstepResponse : public ros::Msg + { + public: + typedef jsk_footstep_msgs::FootstepArray _output_type; + _output_type output; + + SnapFootstepResponse(): + output() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->output.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->output.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SNAPFOOTSTEP; }; + virtual const char * getMD5() override { return "626bcd752f55cb0f7d967a8b0b14cc89"; }; + + }; + + class SnapFootstep { + public: + typedef SnapFootstepRequest Request; + typedef SnapFootstepResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SnapItRequest.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SnapItRequest.h new file mode 100644 index 000000000..664ba9ca3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SnapItRequest.h @@ -0,0 +1,91 @@ +#ifndef _ROS_jsk_recognition_msgs_SnapItRequest_h +#define _ROS_jsk_recognition_msgs_SnapItRequest_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PolygonStamped.h" +#include "geometry_msgs/PointStamped.h" +#include "geometry_msgs/Vector3Stamped.h" + +namespace jsk_recognition_msgs +{ + + class SnapItRequest : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _model_type_type; + _model_type_type model_type; + typedef geometry_msgs::PolygonStamped _target_plane_type; + _target_plane_type target_plane; + typedef geometry_msgs::PointStamped _center_type; + _center_type center; + typedef geometry_msgs::Vector3Stamped _direction_type; + _direction_type direction; + typedef float _radius_type; + _radius_type radius; + typedef float _height_type; + _height_type height; + typedef float _max_distance_type; + _max_distance_type max_distance; + typedef float _eps_angle_type; + _eps_angle_type eps_angle; + enum { MODEL_PLANE = 0 }; + enum { MODEL_CYLINDER = 1 }; + + SnapItRequest(): + header(), + model_type(0), + target_plane(), + center(), + direction(), + radius(0), + height(0), + max_distance(0), + eps_angle(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->model_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->model_type); + offset += this->target_plane.serialize(outbuffer + offset); + offset += this->center.serialize(outbuffer + offset); + offset += this->direction.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->radius); + offset += serializeAvrFloat64(outbuffer + offset, this->height); + offset += serializeAvrFloat64(outbuffer + offset, this->max_distance); + offset += serializeAvrFloat64(outbuffer + offset, this->eps_angle); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->model_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->model_type); + offset += this->target_plane.deserialize(inbuffer + offset); + offset += this->center.deserialize(inbuffer + offset); + offset += this->direction.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->radius)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->height)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_distance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->eps_angle)); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SnapItRequest"; }; + virtual const char * getMD5() override { return "5733f480694296678d81cff0483b399b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseImage.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseImage.h new file mode 100644 index 000000000..9bac4d2f8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseImage.h @@ -0,0 +1,132 @@ +#ifndef _ROS_jsk_recognition_msgs_SparseImage_h +#define _ROS_jsk_recognition_msgs_SparseImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class SparseImage : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _width_type; + _width_type width; + typedef uint32_t _height_type; + _height_type height; + uint32_t data16_length; + typedef uint16_t _data16_type; + _data16_type st_data16; + _data16_type * data16; + uint32_t data32_length; + typedef uint32_t _data32_type; + _data32_type st_data32; + _data32_type * data32; + + SparseImage(): + header(), + width(0), + height(0), + data16_length(0), st_data16(), data16(nullptr), + data32_length(0), st_data32(), data32(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->data16_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data16_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data16_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data16_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data16_length); + for( uint32_t i = 0; i < data16_length; i++){ + *(outbuffer + offset + 0) = (this->data16[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data16[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->data16[i]); + } + *(outbuffer + offset + 0) = (this->data32_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data32_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data32_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data32_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->data32_length); + for( uint32_t i = 0; i < data32_length; i++){ + *(outbuffer + offset + 0) = (this->data32[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data32[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data32[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data32[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->data32[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + uint32_t data16_lengthT = ((uint32_t) (*(inbuffer + offset))); + data16_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data16_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data16_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data16_length); + if(data16_lengthT > data16_length) + this->data16 = (uint16_t*)realloc(this->data16, data16_lengthT * sizeof(uint16_t)); + data16_length = data16_lengthT; + for( uint32_t i = 0; i < data16_length; i++){ + this->st_data16 = ((uint16_t) (*(inbuffer + offset))); + this->st_data16 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->st_data16); + memcpy( &(this->data16[i]), &(this->st_data16), sizeof(uint16_t)); + } + uint32_t data32_lengthT = ((uint32_t) (*(inbuffer + offset))); + data32_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + data32_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + data32_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data32_length); + if(data32_lengthT > data32_length) + this->data32 = (uint32_t*)realloc(this->data32, data32_lengthT * sizeof(uint32_t)); + data32_length = data32_lengthT; + for( uint32_t i = 0; i < data32_length; i++){ + this->st_data32 = ((uint32_t) (*(inbuffer + offset))); + this->st_data32 |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data32 |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_data32 |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_data32); + memcpy( &(this->data32[i]), &(this->st_data32), sizeof(uint32_t)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SparseImage"; }; + virtual const char * getMD5() override { return "7c361d829424bc5984fc0a1831f84751"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGrid.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGrid.h new file mode 100644 index 000000000..ddad9ccb5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGrid.h @@ -0,0 +1,100 @@ +#ifndef _ROS_jsk_recognition_msgs_SparseOccupancyGrid_h +#define _ROS_jsk_recognition_msgs_SparseOccupancyGrid_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "jsk_recognition_msgs/SparseOccupancyGridColumn.h" + +namespace jsk_recognition_msgs +{ + + class SparseOccupancyGrid : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _origin_pose_type; + _origin_pose_type origin_pose; + typedef float _resolution_type; + _resolution_type resolution; + uint32_t columns_length; + typedef jsk_recognition_msgs::SparseOccupancyGridColumn _columns_type; + _columns_type st_columns; + _columns_type * columns; + + SparseOccupancyGrid(): + header(), + origin_pose(), + resolution(0), + columns_length(0), st_columns(), columns(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->origin_pose.serialize(outbuffer + offset); + 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); + *(outbuffer + offset + 0) = (this->columns_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->columns_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->columns_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->columns_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->columns_length); + for( uint32_t i = 0; i < columns_length; i++){ + offset += this->columns[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->origin_pose.deserialize(inbuffer + offset); + 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); + uint32_t columns_lengthT = ((uint32_t) (*(inbuffer + offset))); + columns_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + columns_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + columns_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->columns_length); + if(columns_lengthT > columns_length) + this->columns = (jsk_recognition_msgs::SparseOccupancyGridColumn*)realloc(this->columns, columns_lengthT * sizeof(jsk_recognition_msgs::SparseOccupancyGridColumn)); + columns_length = columns_lengthT; + for( uint32_t i = 0; i < columns_length; i++){ + offset += this->st_columns.deserialize(inbuffer + offset); + memcpy( &(this->columns[i]), &(this->st_columns), sizeof(jsk_recognition_msgs::SparseOccupancyGridColumn)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SparseOccupancyGrid"; }; + virtual const char * getMD5() override { return "497269ddab6058d0d4860f25dc49448f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridArray.h new file mode 100644 index 000000000..e9726ab71 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_SparseOccupancyGridArray_h +#define _ROS_jsk_recognition_msgs_SparseOccupancyGridArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/SparseOccupancyGrid.h" + +namespace jsk_recognition_msgs +{ + + class SparseOccupancyGridArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t grids_length; + typedef jsk_recognition_msgs::SparseOccupancyGrid _grids_type; + _grids_type st_grids; + _grids_type * grids; + + SparseOccupancyGridArray(): + header(), + grids_length(0), st_grids(), grids(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->grids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->grids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->grids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->grids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->grids_length); + for( uint32_t i = 0; i < grids_length; i++){ + offset += this->grids[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t grids_lengthT = ((uint32_t) (*(inbuffer + offset))); + grids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + grids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + grids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->grids_length); + if(grids_lengthT > grids_length) + this->grids = (jsk_recognition_msgs::SparseOccupancyGrid*)realloc(this->grids, grids_lengthT * sizeof(jsk_recognition_msgs::SparseOccupancyGrid)); + grids_length = grids_lengthT; + for( uint32_t i = 0; i < grids_length; i++){ + offset += this->st_grids.deserialize(inbuffer + offset); + memcpy( &(this->grids[i]), &(this->st_grids), sizeof(jsk_recognition_msgs::SparseOccupancyGrid)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SparseOccupancyGridArray"; }; + virtual const char * getMD5() override { return "fa9a1f59b783128c759e159dd0c46731"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridCell.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridCell.h new file mode 100644 index 000000000..90b6b2c54 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridCell.h @@ -0,0 +1,86 @@ +#ifndef _ROS_jsk_recognition_msgs_SparseOccupancyGridCell_h +#define _ROS_jsk_recognition_msgs_SparseOccupancyGridCell_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + + class SparseOccupancyGridCell : public ros::Msg + { + public: + typedef int32_t _row_index_type; + _row_index_type row_index; + typedef float _value_type; + _value_type value; + + SparseOccupancyGridCell(): + row_index(0), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_row_index; + u_row_index.real = this->row_index; + *(outbuffer + offset + 0) = (u_row_index.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_row_index.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_row_index.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_row_index.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->row_index); + union { + float real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_row_index; + u_row_index.base = 0; + u_row_index.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_row_index.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_row_index.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_row_index.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->row_index = u_row_index.real; + offset += sizeof(this->row_index); + union { + float real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SparseOccupancyGridCell"; }; + virtual const char * getMD5() override { return "a5179e922852f82ee6322db1f097ab64"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridColumn.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridColumn.h new file mode 100644 index 000000000..1d5499b59 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SparseOccupancyGridColumn.h @@ -0,0 +1,88 @@ +#ifndef _ROS_jsk_recognition_msgs_SparseOccupancyGridColumn_h +#define _ROS_jsk_recognition_msgs_SparseOccupancyGridColumn_h + +#include +#include +#include +#include "ros/msg.h" +#include "jsk_recognition_msgs/SparseOccupancyGridCell.h" + +namespace jsk_recognition_msgs +{ + + class SparseOccupancyGridColumn : public ros::Msg + { + public: + typedef int32_t _column_index_type; + _column_index_type column_index; + uint32_t cells_length; + typedef jsk_recognition_msgs::SparseOccupancyGridCell _cells_type; + _cells_type st_cells; + _cells_type * cells; + + SparseOccupancyGridColumn(): + column_index(0), + cells_length(0), st_cells(), cells(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_column_index; + u_column_index.real = this->column_index; + *(outbuffer + offset + 0) = (u_column_index.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_column_index.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_column_index.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_column_index.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->column_index); + *(outbuffer + offset + 0) = (this->cells_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cells_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cells_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cells_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cells_length); + for( uint32_t i = 0; i < cells_length; i++){ + offset += this->cells[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_column_index; + u_column_index.base = 0; + u_column_index.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_column_index.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_column_index.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_column_index.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->column_index = u_column_index.real; + offset += sizeof(this->column_index); + uint32_t cells_lengthT = ((uint32_t) (*(inbuffer + offset))); + cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cells_length); + if(cells_lengthT > cells_length) + this->cells = (jsk_recognition_msgs::SparseOccupancyGridCell*)realloc(this->cells, cells_lengthT * sizeof(jsk_recognition_msgs::SparseOccupancyGridCell)); + cells_length = cells_lengthT; + for( uint32_t i = 0; i < cells_length; i++){ + offset += this->st_cells.deserialize(inbuffer + offset); + memcpy( &(this->cells[i]), &(this->st_cells), sizeof(jsk_recognition_msgs::SparseOccupancyGridCell)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/SparseOccupancyGridColumn"; }; + virtual const char * getMD5() override { return "55074b193e722d5ead092ffe27f06522"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Spectrum.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Spectrum.h new file mode 100644 index 000000000..96d05df1a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Spectrum.h @@ -0,0 +1,132 @@ +#ifndef _ROS_jsk_recognition_msgs_Spectrum_h +#define _ROS_jsk_recognition_msgs_Spectrum_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class Spectrum : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t amplitude_length; + typedef float _amplitude_type; + _amplitude_type st_amplitude; + _amplitude_type * amplitude; + uint32_t frequency_length; + typedef float _frequency_type; + _frequency_type st_frequency; + _frequency_type * frequency; + + Spectrum(): + header(), + amplitude_length(0), st_amplitude(), amplitude(nullptr), + frequency_length(0), st_frequency(), frequency(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->amplitude_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->amplitude_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->amplitude_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->amplitude_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->amplitude_length); + for( uint32_t i = 0; i < amplitude_length; i++){ + union { + float real; + uint32_t base; + } u_amplitudei; + u_amplitudei.real = this->amplitude[i]; + *(outbuffer + offset + 0) = (u_amplitudei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_amplitudei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_amplitudei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_amplitudei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->amplitude[i]); + } + *(outbuffer + offset + 0) = (this->frequency_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->frequency_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->frequency_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->frequency_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->frequency_length); + for( uint32_t i = 0; i < frequency_length; i++){ + union { + float real; + uint32_t base; + } u_frequencyi; + u_frequencyi.real = this->frequency[i]; + *(outbuffer + offset + 0) = (u_frequencyi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_frequencyi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_frequencyi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_frequencyi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->frequency[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t amplitude_lengthT = ((uint32_t) (*(inbuffer + offset))); + amplitude_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + amplitude_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + amplitude_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->amplitude_length); + if(amplitude_lengthT > amplitude_length) + this->amplitude = (float*)realloc(this->amplitude, amplitude_lengthT * sizeof(float)); + amplitude_length = amplitude_lengthT; + for( uint32_t i = 0; i < amplitude_length; i++){ + union { + float real; + uint32_t base; + } u_st_amplitude; + u_st_amplitude.base = 0; + u_st_amplitude.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_amplitude.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_amplitude.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_amplitude.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_amplitude = u_st_amplitude.real; + offset += sizeof(this->st_amplitude); + memcpy( &(this->amplitude[i]), &(this->st_amplitude), sizeof(float)); + } + uint32_t frequency_lengthT = ((uint32_t) (*(inbuffer + offset))); + frequency_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + frequency_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + frequency_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->frequency_length); + if(frequency_lengthT > frequency_length) + this->frequency = (float*)realloc(this->frequency, frequency_lengthT * sizeof(float)); + frequency_length = frequency_lengthT; + for( uint32_t i = 0; i < frequency_length; i++){ + union { + float real; + uint32_t base; + } u_st_frequency; + u_st_frequency.base = 0; + u_st_frequency.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_frequency.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_frequency.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_frequency.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_frequency = u_st_frequency.real; + offset += sizeof(this->st_frequency); + memcpy( &(this->frequency[i]), &(this->st_frequency), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Spectrum"; }; + virtual const char * getMD5() override { return "df74a130749a91198632eab1192d1cc9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SwitchTopic.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SwitchTopic.h new file mode 100644 index 000000000..949b98cb7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/SwitchTopic.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_SwitchTopic_h +#define _ROS_SERVICE_SwitchTopic_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + +static const char SWITCHTOPIC[] = "jsk_recognition_msgs/SwitchTopic"; + + class SwitchTopicRequest : public ros::Msg + { + public: + typedef const char* _camera_info_type; + _camera_info_type camera_info; + typedef const char* _points_type; + _points_type points; + + SwitchTopicRequest(): + camera_info(""), + points("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_camera_info = strlen(this->camera_info); + varToArr(outbuffer + offset, length_camera_info); + offset += 4; + memcpy(outbuffer + offset, this->camera_info, length_camera_info); + offset += length_camera_info; + uint32_t length_points = strlen(this->points); + varToArr(outbuffer + offset, length_points); + offset += 4; + memcpy(outbuffer + offset, this->points, length_points); + offset += length_points; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_camera_info; + arrToVar(length_camera_info, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_camera_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_camera_info-1]=0; + this->camera_info = (char *)(inbuffer + offset-1); + offset += length_camera_info; + uint32_t length_points; + arrToVar(length_points, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_points; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_points-1]=0; + this->points = (char *)(inbuffer + offset-1); + offset += length_points; + return offset; + } + + virtual const char * getType() override { return SWITCHTOPIC; }; + virtual const char * getMD5() override { return "e4a276b5a9b7b8fd97441d0fd991bdb9"; }; + + }; + + class SwitchTopicResponse : public ros::Msg + { + public: + + SwitchTopicResponse() + { + } + + 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 SWITCHTOPIC; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SwitchTopic { + public: + typedef SwitchTopicRequest Request; + typedef SwitchTopicResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TimeRange.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TimeRange.h new file mode 100644 index 000000000..a19748a06 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TimeRange.h @@ -0,0 +1,91 @@ +#ifndef _ROS_jsk_recognition_msgs_TimeRange_h +#define _ROS_jsk_recognition_msgs_TimeRange_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/time.h" + +namespace jsk_recognition_msgs +{ + + class TimeRange : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef ros::Time _start_type; + _start_type start; + typedef ros::Time _end_type; + _end_type end; + + TimeRange(): + header(), + start(), + end() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start.sec); + *(outbuffer + offset + 0) = (this->start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start.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; + offset += this->header.deserialize(inbuffer + offset); + this->start.sec = ((uint32_t) (*(inbuffer + offset))); + this->start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start.sec); + this->start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start.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 "jsk_recognition_msgs/TimeRange"; }; + virtual const char * getMD5() override { return "a8a69e1e51e3731790c8e4120a725398"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Torus.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Torus.h new file mode 100644 index 000000000..61e937062 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/Torus.h @@ -0,0 +1,78 @@ +#ifndef _ROS_jsk_recognition_msgs_Torus_h +#define _ROS_jsk_recognition_msgs_Torus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace jsk_recognition_msgs +{ + + class Torus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _failure_type; + _failure_type failure; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef float _large_radius_type; + _large_radius_type large_radius; + typedef float _small_radius_type; + _small_radius_type small_radius; + + Torus(): + header(), + failure(0), + pose(), + large_radius(0), + small_radius(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_failure; + u_failure.real = this->failure; + *(outbuffer + offset + 0) = (u_failure.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->failure); + offset += this->pose.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->large_radius); + offset += serializeAvrFloat64(outbuffer + offset, this->small_radius); + 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_failure; + u_failure.base = 0; + u_failure.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->failure = u_failure.real; + offset += sizeof(this->failure); + offset += this->pose.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->large_radius)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->small_radius)); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/Torus"; }; + virtual const char * getMD5() override { return "7172d433485e406ce56f4cf6e9ab1062"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TorusArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TorusArray.h new file mode 100644 index 000000000..990aac713 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TorusArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_recognition_msgs_TorusArray_h +#define _ROS_jsk_recognition_msgs_TorusArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_recognition_msgs/Torus.h" + +namespace jsk_recognition_msgs +{ + + class TorusArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t toruses_length; + typedef jsk_recognition_msgs::Torus _toruses_type; + _toruses_type st_toruses; + _toruses_type * toruses; + + TorusArray(): + header(), + toruses_length(0), st_toruses(), toruses(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->toruses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->toruses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->toruses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->toruses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->toruses_length); + for( uint32_t i = 0; i < toruses_length; i++){ + offset += this->toruses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t toruses_lengthT = ((uint32_t) (*(inbuffer + offset))); + toruses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + toruses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + toruses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->toruses_length); + if(toruses_lengthT > toruses_length) + this->toruses = (jsk_recognition_msgs::Torus*)realloc(this->toruses, toruses_lengthT * sizeof(jsk_recognition_msgs::Torus)); + toruses_length = toruses_lengthT; + for( uint32_t i = 0; i < toruses_length; i++){ + offset += this->st_toruses.deserialize(inbuffer + offset); + memcpy( &(this->toruses[i]), &(this->st_toruses), sizeof(jsk_recognition_msgs::Torus)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/TorusArray"; }; + virtual const char * getMD5() override { return "81d0dbf46016b5714fa4ea9eca5485e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TowerPickUp.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TowerPickUp.h new file mode 100644 index 000000000..dfefa20a8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TowerPickUp.h @@ -0,0 +1,94 @@ +#ifndef _ROS_SERVICE_TowerPickUp_h +#define _ROS_SERVICE_TowerPickUp_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + +static const char TOWERPICKUP[] = "jsk_recognition_msgs/TowerPickUp"; + + class TowerPickUpRequest : public ros::Msg + { + public: + typedef int32_t _tower_index_type; + _tower_index_type tower_index; + + TowerPickUpRequest(): + tower_index(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_tower_index; + u_tower_index.real = this->tower_index; + *(outbuffer + offset + 0) = (u_tower_index.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_tower_index.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_tower_index.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_tower_index.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->tower_index); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_tower_index; + u_tower_index.base = 0; + u_tower_index.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_tower_index.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_tower_index.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_tower_index.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->tower_index = u_tower_index.real; + offset += sizeof(this->tower_index); + return offset; + } + + virtual const char * getType() override { return TOWERPICKUP; }; + virtual const char * getMD5() override { return "e8bd24109f26b6d833bc4570d67d71c9"; }; + + }; + + class TowerPickUpResponse : public ros::Msg + { + public: + + TowerPickUpResponse() + { + } + + 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 TOWERPICKUP; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TowerPickUp { + public: + typedef TowerPickUpRequest Request; + typedef TowerPickUpResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TowerRobotMoveCommand.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TowerRobotMoveCommand.h new file mode 100644 index 000000000..37994cd4d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TowerRobotMoveCommand.h @@ -0,0 +1,202 @@ +#ifndef _ROS_SERVICE_TowerRobotMoveCommand_h +#define _ROS_SERVICE_TowerRobotMoveCommand_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_recognition_msgs +{ + +static const char TOWERROBOTMOVECOMMAND[] = "jsk_recognition_msgs/TowerRobotMoveCommand"; + + class TowerRobotMoveCommandRequest : public ros::Msg + { + public: + typedef int32_t _robot_index_type; + _robot_index_type robot_index; + typedef int32_t _plate_index_type; + _plate_index_type plate_index; + typedef int32_t _from_tower_type; + _from_tower_type from_tower; + typedef int32_t _to_tower_type; + _to_tower_type to_tower; + typedef int32_t _option_command_type; + _option_command_type option_command; + enum { ROBOT1 = 1 }; + enum { ROBOT2 = 2 }; + enum { ROBOT3 = 3 }; + enum { PLATE_SMALL = 1 }; + enum { PLATE_MIDDLE = 2 }; + enum { PLATE_LARGE = 3 }; + enum { TOWER_LOWEST = 1 }; + enum { TOWER_MIDDLE = 2 }; + enum { TOWER_HIGHEST = 3 }; + enum { TOWER_LOWEST2 = 1 }; + enum { OPTION_NONE = 0 }; + enum { OPTION_MOVE_INITIAL = 1 }; + + TowerRobotMoveCommandRequest(): + robot_index(0), + plate_index(0), + from_tower(0), + to_tower(0), + option_command(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_robot_index; + u_robot_index.real = this->robot_index; + *(outbuffer + offset + 0) = (u_robot_index.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_robot_index.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_robot_index.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_robot_index.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->robot_index); + union { + int32_t real; + uint32_t base; + } u_plate_index; + u_plate_index.real = this->plate_index; + *(outbuffer + offset + 0) = (u_plate_index.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_plate_index.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_plate_index.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_plate_index.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->plate_index); + union { + int32_t real; + uint32_t base; + } u_from_tower; + u_from_tower.real = this->from_tower; + *(outbuffer + offset + 0) = (u_from_tower.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_from_tower.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_from_tower.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_from_tower.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->from_tower); + union { + int32_t real; + uint32_t base; + } u_to_tower; + u_to_tower.real = this->to_tower; + *(outbuffer + offset + 0) = (u_to_tower.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_to_tower.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_to_tower.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_to_tower.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->to_tower); + union { + int32_t real; + uint32_t base; + } u_option_command; + u_option_command.real = this->option_command; + *(outbuffer + offset + 0) = (u_option_command.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_option_command.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_option_command.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_option_command.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->option_command); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_robot_index; + u_robot_index.base = 0; + u_robot_index.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_robot_index.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_robot_index.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_robot_index.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->robot_index = u_robot_index.real; + offset += sizeof(this->robot_index); + union { + int32_t real; + uint32_t base; + } u_plate_index; + u_plate_index.base = 0; + u_plate_index.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_plate_index.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_plate_index.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_plate_index.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->plate_index = u_plate_index.real; + offset += sizeof(this->plate_index); + union { + int32_t real; + uint32_t base; + } u_from_tower; + u_from_tower.base = 0; + u_from_tower.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_from_tower.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_from_tower.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_from_tower.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->from_tower = u_from_tower.real; + offset += sizeof(this->from_tower); + union { + int32_t real; + uint32_t base; + } u_to_tower; + u_to_tower.base = 0; + u_to_tower.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_to_tower.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_to_tower.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_to_tower.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->to_tower = u_to_tower.real; + offset += sizeof(this->to_tower); + union { + int32_t real; + uint32_t base; + } u_option_command; + u_option_command.base = 0; + u_option_command.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_option_command.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_option_command.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_option_command.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->option_command = u_option_command.real; + offset += sizeof(this->option_command); + return offset; + } + + virtual const char * getType() override { return TOWERROBOTMOVECOMMAND; }; + virtual const char * getMD5() override { return "aadba056bdce0494569ab50ecd2ec90c"; }; + + }; + + class TowerRobotMoveCommandResponse : public ros::Msg + { + public: + + TowerRobotMoveCommandResponse() + { + } + + 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 TOWERROBOTMOVECOMMAND; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TowerRobotMoveCommand { + public: + typedef TowerRobotMoveCommandRequest Request; + typedef TowerRobotMoveCommandResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TrackerStatus.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TrackerStatus.h new file mode 100644 index 000000000..bb06827f6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TrackerStatus.h @@ -0,0 +1,62 @@ +#ifndef _ROS_jsk_recognition_msgs_TrackerStatus_h +#define _ROS_jsk_recognition_msgs_TrackerStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class TrackerStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _is_tracking_type; + _is_tracking_type is_tracking; + + TrackerStatus(): + header(), + is_tracking(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_is_tracking; + u_is_tracking.real = this->is_tracking; + *(outbuffer + offset + 0) = (u_is_tracking.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_tracking); + 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_is_tracking; + u_is_tracking.base = 0; + u_is_tracking.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_tracking = u_is_tracking.real; + offset += sizeof(this->is_tracking); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/TrackerStatus"; }; + virtual const char * getMD5() override { return "78e8f06a6b728df052dd181bfcf6c26e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TrackingStatus.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TrackingStatus.h new file mode 100644 index 000000000..fe008d093 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TrackingStatus.h @@ -0,0 +1,62 @@ +#ifndef _ROS_jsk_recognition_msgs_TrackingStatus_h +#define _ROS_jsk_recognition_msgs_TrackingStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class TrackingStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _is_lost_type; + _is_lost_type is_lost; + + TrackingStatus(): + header(), + is_lost(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_is_lost; + u_is_lost.real = this->is_lost; + *(outbuffer + offset + 0) = (u_is_lost.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_lost); + 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_is_lost; + u_is_lost.base = 0; + u_is_lost.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_lost = u_is_lost.real; + offset += sizeof(this->is_lost); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/TrackingStatus"; }; + virtual const char * getMD5() override { return "2e374cd736cf06cc3e69b0c76b8cb117"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TransformScreenpoint.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TransformScreenpoint.h new file mode 100644 index 000000000..c48d1ff53 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/TransformScreenpoint.h @@ -0,0 +1,154 @@ +#ifndef _ROS_SERVICE_TransformScreenpoint_h +#define _ROS_SERVICE_TransformScreenpoint_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace jsk_recognition_msgs +{ + +static const char TRANSFORMSCREENPOINT[] = "jsk_recognition_msgs/TransformScreenpoint"; + + class TransformScreenpointRequest : public ros::Msg + { + public: + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef bool _no_update_type; + _no_update_type no_update; + + TransformScreenpointRequest(): + x(0), + y(0), + no_update(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 { + bool real; + uint8_t base; + } u_no_update; + u_no_update.real = this->no_update; + *(outbuffer + offset + 0) = (u_no_update.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->no_update); + 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 { + bool real; + uint8_t base; + } u_no_update; + u_no_update.base = 0; + u_no_update.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->no_update = u_no_update.real; + offset += sizeof(this->no_update); + return offset; + } + + virtual const char * getType() override { return TRANSFORMSCREENPOINT; }; + virtual const char * getMD5() override { return "3796b576f471dba594bd202be056132c"; }; + + }; + + class TransformScreenpointResponse : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Point _point_type; + _point_type point; + typedef geometry_msgs::Vector3 _vector_type; + _vector_type vector; + + TransformScreenpointResponse(): + header(), + point(), + vector() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->point.serialize(outbuffer + offset); + offset += this->vector.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->point.deserialize(inbuffer + offset); + offset += this->vector.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return TRANSFORMSCREENPOINT; }; + virtual const char * getMD5() override { return "b4d4e89e36c63a48672ef02dabdec610"; }; + + }; + + class TransformScreenpoint { + public: + typedef TransformScreenpointRequest Request; + typedef TransformScreenpointResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/UpdateOffset.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/UpdateOffset.h new file mode 100644 index 000000000..b6bc372ce --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/UpdateOffset.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_UpdateOffset_h +#define _ROS_SERVICE_UpdateOffset_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace jsk_recognition_msgs +{ + +static const char UPDATEOFFSET[] = "jsk_recognition_msgs/UpdateOffset"; + + class UpdateOffsetRequest : public ros::Msg + { + public: + typedef geometry_msgs::TransformStamped _transformation_type; + _transformation_type transformation; + + UpdateOffsetRequest(): + transformation() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->transformation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->transformation.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return UPDATEOFFSET; }; + virtual const char * getMD5() override { return "72c98a75ad1f2a3dcf256e7c072420a2"; }; + + }; + + class UpdateOffsetResponse : public ros::Msg + { + public: + + UpdateOffsetResponse() + { + } + + 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 UPDATEOFFSET; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class UpdateOffset { + public: + typedef UpdateOffsetRequest Request; + typedef UpdateOffsetResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/VectorArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/VectorArray.h new file mode 100644 index 000000000..8d576a4e6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/VectorArray.h @@ -0,0 +1,93 @@ +#ifndef _ROS_jsk_recognition_msgs_VectorArray_h +#define _ROS_jsk_recognition_msgs_VectorArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_recognition_msgs +{ + + class VectorArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _vector_dim_type; + _vector_dim_type vector_dim; + uint32_t data_length; + typedef float _data_type; + _data_type st_data; + _data_type * data; + + VectorArray(): + header(), + vector_dim(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 { + int32_t real; + uint32_t base; + } u_vector_dim; + u_vector_dim.real = this->vector_dim; + *(outbuffer + offset + 0) = (u_vector_dim.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_vector_dim.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_vector_dim.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_vector_dim.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->vector_dim); + *(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 += serializeAvrFloat64(outbuffer + offset, 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_vector_dim; + u_vector_dim.base = 0; + u_vector_dim.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_vector_dim.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_vector_dim.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_vector_dim.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->vector_dim = u_vector_dim.real; + offset += sizeof(this->vector_dim); + 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++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_data)); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/VectorArray"; }; + virtual const char * getMD5() override { return "5755776409eb8318e94c95cd52de2b69"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WeightedPoseArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WeightedPoseArray.h new file mode 100644 index 000000000..bf9415742 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WeightedPoseArray.h @@ -0,0 +1,94 @@ +#ifndef _ROS_jsk_recognition_msgs_WeightedPoseArray_h +#define _ROS_jsk_recognition_msgs_WeightedPoseArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseArray.h" + +namespace jsk_recognition_msgs +{ + + class WeightedPoseArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t weights_length; + typedef float _weights_type; + _weights_type st_weights; + _weights_type * weights; + typedef geometry_msgs::PoseArray _poses_type; + _poses_type poses; + + WeightedPoseArray(): + header(), + weights_length(0), st_weights(), weights(nullptr), + poses() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->weights_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->weights_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->weights_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->weights_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->weights_length); + for( uint32_t i = 0; i < weights_length; i++){ + union { + float real; + uint32_t base; + } u_weightsi; + u_weightsi.real = this->weights[i]; + *(outbuffer + offset + 0) = (u_weightsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_weightsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_weightsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_weightsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->weights[i]); + } + offset += this->poses.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t weights_lengthT = ((uint32_t) (*(inbuffer + offset))); + weights_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + weights_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + weights_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->weights_length); + if(weights_lengthT > weights_length) + this->weights = (float*)realloc(this->weights, weights_lengthT * sizeof(float)); + weights_length = weights_lengthT; + for( uint32_t i = 0; i < weights_length; i++){ + union { + float real; + uint32_t base; + } u_st_weights; + u_st_weights.base = 0; + u_st_weights.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_weights.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_weights.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_weights.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_weights = u_st_weights.real; + offset += sizeof(this->st_weights); + memcpy( &(this->weights[i]), &(this->st_weights), sizeof(float)); + } + offset += this->poses.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_recognition_msgs/WeightedPoseArray"; }; + virtual const char * getMD5() override { return "40f180494a75a8797b1c2ba81b2cb4c0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WhiteBalance.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WhiteBalance.h new file mode 100644 index 000000000..f2c14d99f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WhiteBalance.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_WhiteBalance_h +#define _ROS_SERVICE_WhiteBalance_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/Image.h" + +namespace jsk_recognition_msgs +{ + +static const char WHITEBALANCE[] = "jsk_recognition_msgs/WhiteBalance"; + + class WhiteBalanceRequest : public ros::Msg + { + public: + float reference_color[3]; + typedef sensor_msgs::Image _input_type; + _input_type input; + + WhiteBalanceRequest(): + reference_color(), + input() + { + } + + 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_reference_colori; + u_reference_colori.real = this->reference_color[i]; + *(outbuffer + offset + 0) = (u_reference_colori.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_reference_colori.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_reference_colori.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_reference_colori.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->reference_color[i]); + } + offset += this->input.serialize(outbuffer + offset); + 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_reference_colori; + u_reference_colori.base = 0; + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->reference_color[i] = u_reference_colori.real; + offset += sizeof(this->reference_color[i]); + } + offset += this->input.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return WHITEBALANCE; }; + virtual const char * getMD5() override { return "d7702dac51626a53e0806ebd0ad35ca3"; }; + + }; + + class WhiteBalanceResponse : public ros::Msg + { + public: + typedef sensor_msgs::Image _output_type; + _output_type output; + + WhiteBalanceResponse(): + output() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->output.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->output.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return WHITEBALANCE; }; + virtual const char * getMD5() override { return "8eeb6eb8777baa5a80bbc676c219bfef"; }; + + }; + + class WhiteBalance { + public: + typedef WhiteBalanceRequest Request; + typedef WhiteBalanceResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WhiteBalancePoints.h b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WhiteBalancePoints.h new file mode 100644 index 000000000..3f82ad519 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_recognition_msgs/WhiteBalancePoints.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_WhiteBalancePoints_h +#define _ROS_SERVICE_WhiteBalancePoints_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace jsk_recognition_msgs +{ + +static const char WHITEBALANCEPOINTS[] = "jsk_recognition_msgs/WhiteBalancePoints"; + + class WhiteBalancePointsRequest : public ros::Msg + { + public: + float reference_color[3]; + typedef sensor_msgs::PointCloud2 _input_type; + _input_type input; + + WhiteBalancePointsRequest(): + reference_color(), + input() + { + } + + 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_reference_colori; + u_reference_colori.real = this->reference_color[i]; + *(outbuffer + offset + 0) = (u_reference_colori.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_reference_colori.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_reference_colori.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_reference_colori.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->reference_color[i]); + } + offset += this->input.serialize(outbuffer + offset); + 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_reference_colori; + u_reference_colori.base = 0; + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_reference_colori.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->reference_color[i] = u_reference_colori.real; + offset += sizeof(this->reference_color[i]); + } + offset += this->input.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return WHITEBALANCEPOINTS; }; + virtual const char * getMD5() override { return "c114e8c81fa040c23390d86cd0cb8e3a"; }; + + }; + + class WhiteBalancePointsResponse : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _output_type; + _output_type output; + + WhiteBalancePointsResponse(): + output() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->output.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->output.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return WHITEBALANCEPOINTS; }; + virtual const char * getMD5() override { return "6db5ac8d8316fdb3e0c62197115f87cd"; }; + + }; + + class WhiteBalancePoints { + public: + typedef WhiteBalancePointsRequest Request; + typedef WhiteBalancePointsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/EusCommand.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/EusCommand.h new file mode 100644 index 000000000..1b3141511 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/EusCommand.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_EusCommand_h +#define _ROS_SERVICE_EusCommand_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_rviz_plugins +{ + +static const char EUSCOMMAND[] = "jsk_rviz_plugins/EusCommand"; + + class EusCommandRequest : public ros::Msg + { + public: + typedef const char* _command_type; + _command_type command; + + EusCommandRequest(): + command("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_command = strlen(this->command); + varToArr(outbuffer + offset, length_command); + offset += 4; + memcpy(outbuffer + offset, this->command, length_command); + offset += length_command; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_command; + arrToVar(length_command, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command-1]=0; + this->command = (char *)(inbuffer + offset-1); + offset += length_command; + return offset; + } + + virtual const char * getType() override { return EUSCOMMAND; }; + virtual const char * getMD5() override { return "cba5e21e920a3a2b7b375cb65b64cdea"; }; + + }; + + class EusCommandResponse : public ros::Msg + { + public: + + EusCommandResponse() + { + } + + 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 EUSCOMMAND; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EusCommand { + public: + typedef EusCommandRequest Request; + typedef EusCommandResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/ObjectFitCommand.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/ObjectFitCommand.h new file mode 100644 index 000000000..c2c79092f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/ObjectFitCommand.h @@ -0,0 +1,62 @@ +#ifndef _ROS_jsk_rviz_plugins_ObjectFitCommand_h +#define _ROS_jsk_rviz_plugins_ObjectFitCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_rviz_plugins +{ + + class ObjectFitCommand : public ros::Msg + { + public: + typedef int8_t _command_type; + _command_type command; + enum { FIT = 0 }; + enum { NEAR = 1 }; + enum { OTHER = 2 }; + enum { REVERSE_FIT = 3 }; + enum { REVERSE_NEAR = 4 }; + enum { REVERSE_OTHER = 5 }; + + ObjectFitCommand(): + command(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_command; + u_command.real = this->command; + *(outbuffer + offset + 0) = (u_command.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->command); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_command; + u_command.base = 0; + u_command.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->command = u_command.real; + offset += sizeof(this->command); + return offset; + } + + virtual const char * getType() override { return "jsk_rviz_plugins/ObjectFitCommand"; }; + virtual const char * getMD5() override { return "aaf37eac6a6717d09d438978a4117776"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/OverlayMenu.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/OverlayMenu.h new file mode 100644 index 000000000..067622308 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/OverlayMenu.h @@ -0,0 +1,142 @@ +#ifndef _ROS_jsk_rviz_plugins_OverlayMenu_h +#define _ROS_jsk_rviz_plugins_OverlayMenu_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/ColorRGBA.h" + +namespace jsk_rviz_plugins +{ + + class OverlayMenu : public ros::Msg + { + public: + typedef int32_t _action_type; + _action_type action; + typedef uint32_t _current_index_type; + _current_index_type current_index; + uint32_t menus_length; + typedef char* _menus_type; + _menus_type st_menus; + _menus_type * menus; + typedef const char* _title_type; + _title_type title; + typedef std_msgs::ColorRGBA _bg_color_type; + _bg_color_type bg_color; + typedef std_msgs::ColorRGBA _fg_color_type; + _fg_color_type fg_color; + enum { ACTION_SELECT = 0 }; + enum { ACTION_CLOSE = 1 }; + + OverlayMenu(): + action(0), + current_index(0), + menus_length(0), st_menus(), menus(nullptr), + title(""), + bg_color(), + fg_color() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + *(outbuffer + offset + 0) = (this->current_index >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->current_index >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->current_index >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->current_index >> (8 * 3)) & 0xFF; + offset += sizeof(this->current_index); + *(outbuffer + offset + 0) = (this->menus_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->menus_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->menus_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->menus_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->menus_length); + for( uint32_t i = 0; i < menus_length; i++){ + uint32_t length_menusi = strlen(this->menus[i]); + varToArr(outbuffer + offset, length_menusi); + offset += 4; + memcpy(outbuffer + offset, this->menus[i], length_menusi); + offset += length_menusi; + } + uint32_t length_title = strlen(this->title); + varToArr(outbuffer + offset, length_title); + offset += 4; + memcpy(outbuffer + offset, this->title, length_title); + offset += length_title; + offset += this->bg_color.serialize(outbuffer + offset); + offset += this->fg_color.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + this->current_index = ((uint32_t) (*(inbuffer + offset))); + this->current_index |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->current_index |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->current_index |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->current_index); + uint32_t menus_lengthT = ((uint32_t) (*(inbuffer + offset))); + menus_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + menus_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + menus_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->menus_length); + if(menus_lengthT > menus_length) + this->menus = (char**)realloc(this->menus, menus_lengthT * sizeof(char*)); + menus_length = menus_lengthT; + for( uint32_t i = 0; i < menus_length; i++){ + uint32_t length_st_menus; + arrToVar(length_st_menus, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_menus; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_menus-1]=0; + this->st_menus = (char *)(inbuffer + offset-1); + offset += length_st_menus; + memcpy( &(this->menus[i]), &(this->st_menus), sizeof(char*)); + } + uint32_t length_title; + arrToVar(length_title, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_title; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_title-1]=0; + this->title = (char *)(inbuffer + offset-1); + offset += length_title; + offset += this->bg_color.deserialize(inbuffer + offset); + offset += this->fg_color.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_rviz_plugins/OverlayMenu"; }; + virtual const char * getMD5() override { return "517426ba068ca022d86cf2c56c98889f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/OverlayText.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/OverlayText.h new file mode 100644 index 000000000..49861e8e0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/OverlayText.h @@ -0,0 +1,236 @@ +#ifndef _ROS_jsk_rviz_plugins_OverlayText_h +#define _ROS_jsk_rviz_plugins_OverlayText_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/ColorRGBA.h" + +namespace jsk_rviz_plugins +{ + + class OverlayText : public ros::Msg + { + public: + typedef uint8_t _action_type; + _action_type action; + typedef int32_t _width_type; + _width_type width; + typedef int32_t _height_type; + _height_type height; + typedef int32_t _left_type; + _left_type left; + typedef int32_t _top_type; + _top_type top; + typedef std_msgs::ColorRGBA _bg_color_type; + _bg_color_type bg_color; + typedef int32_t _line_width_type; + _line_width_type line_width; + typedef float _text_size_type; + _text_size_type text_size; + typedef const char* _font_type; + _font_type font; + typedef std_msgs::ColorRGBA _fg_color_type; + _fg_color_type fg_color; + typedef const char* _text_type; + _text_type text; + enum { ADD = 0 }; + enum { DELETE = 1 }; + + OverlayText(): + action(0), + width(0), + height(0), + left(0), + top(0), + bg_color(), + line_width(0), + text_size(0), + font(""), + fg_color(), + text("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->action >> (8 * 0)) & 0xFF; + offset += sizeof(this->action); + union { + int32_t real; + uint32_t base; + } u_width; + u_width.real = this->width; + *(outbuffer + offset + 0) = (u_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + union { + int32_t real; + uint32_t base; + } u_height; + u_height.real = this->height; + *(outbuffer + offset + 0) = (u_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + union { + int32_t real; + uint32_t base; + } u_left; + u_left.real = this->left; + *(outbuffer + offset + 0) = (u_left.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_left.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_left.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_left.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->left); + union { + int32_t real; + uint32_t base; + } u_top; + u_top.real = this->top; + *(outbuffer + offset + 0) = (u_top.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_top.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_top.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_top.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->top); + offset += this->bg_color.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_line_width; + u_line_width.real = this->line_width; + *(outbuffer + offset + 0) = (u_line_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_line_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_line_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_line_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->line_width); + union { + float real; + uint32_t base; + } u_text_size; + u_text_size.real = this->text_size; + *(outbuffer + offset + 0) = (u_text_size.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_text_size.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_text_size.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_text_size.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->text_size); + uint32_t length_font = strlen(this->font); + varToArr(outbuffer + offset, length_font); + offset += 4; + memcpy(outbuffer + offset, this->font, length_font); + offset += length_font; + offset += this->fg_color.serialize(outbuffer + offset); + 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; + this->action = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->action); + union { + int32_t real; + uint32_t base; + } u_width; + u_width.base = 0; + u_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->width = u_width.real; + offset += sizeof(this->width); + union { + int32_t real; + uint32_t base; + } u_height; + u_height.base = 0; + u_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->height = u_height.real; + offset += sizeof(this->height); + union { + int32_t real; + uint32_t base; + } u_left; + u_left.base = 0; + u_left.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_left.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_left.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_left.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->left = u_left.real; + offset += sizeof(this->left); + union { + int32_t real; + uint32_t base; + } u_top; + u_top.base = 0; + u_top.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_top.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_top.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_top.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->top = u_top.real; + offset += sizeof(this->top); + offset += this->bg_color.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_line_width; + u_line_width.base = 0; + u_line_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_line_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_line_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_line_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->line_width = u_line_width.real; + offset += sizeof(this->line_width); + union { + float real; + uint32_t base; + } u_text_size; + u_text_size.base = 0; + u_text_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_text_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_text_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_text_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->text_size = u_text_size.real; + offset += sizeof(this->text_size); + uint32_t length_font; + arrToVar(length_font, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_font; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_font-1]=0; + this->font = (char *)(inbuffer + offset-1); + offset += length_font; + offset += this->fg_color.deserialize(inbuffer + offset); + 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 "jsk_rviz_plugins/OverlayText"; }; + virtual const char * getMD5() override { return "7efc1ed34881f913afcee6ba02aa1242"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/Pictogram.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/Pictogram.h new file mode 100644 index 000000000..678dd9eef --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/Pictogram.h @@ -0,0 +1,111 @@ +#ifndef _ROS_jsk_rviz_plugins_Pictogram_h +#define _ROS_jsk_rviz_plugins_Pictogram_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "std_msgs/ColorRGBA.h" + +namespace jsk_rviz_plugins +{ + + class Pictogram : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef uint8_t _action_type; + _action_type action; + typedef uint8_t _mode_type; + _mode_type mode; + typedef const char* _character_type; + _character_type character; + typedef float _size_type; + _size_type size; + typedef float _ttl_type; + _ttl_type ttl; + typedef float _speed_type; + _speed_type speed; + typedef std_msgs::ColorRGBA _color_type; + _color_type color; + enum { ADD = 0 }; + enum { DELETE = 1 }; + enum { ROTATE_Z = 2 }; + enum { ROTATE_Y = 3 }; + enum { ROTATE_X = 4 }; + enum { JUMP = 5 }; + enum { JUMP_ONCE = 6 }; + enum { PICTOGRAM_MODE = 0 }; + enum { STRING_MODE = 1 }; + + Pictogram(): + header(), + pose(), + action(0), + mode(0), + character(""), + size(0), + ttl(0), + speed(0), + color() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->action >> (8 * 0)) & 0xFF; + offset += sizeof(this->action); + *(outbuffer + offset + 0) = (this->mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->mode); + uint32_t length_character = strlen(this->character); + varToArr(outbuffer + offset, length_character); + offset += 4; + memcpy(outbuffer + offset, this->character, length_character); + offset += length_character; + offset += serializeAvrFloat64(outbuffer + offset, this->size); + offset += serializeAvrFloat64(outbuffer + offset, this->ttl); + offset += serializeAvrFloat64(outbuffer + offset, this->speed); + offset += this->color.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); + this->action = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->action); + this->mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->mode); + uint32_t length_character; + arrToVar(length_character, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_character; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_character-1]=0; + this->character = (char *)(inbuffer + offset-1); + offset += length_character; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->size)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ttl)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->speed)); + offset += this->color.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "jsk_rviz_plugins/Pictogram"; }; + virtual const char * getMD5() override { return "29667e5652a8cfdc9c87d2ed97aa7bbc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/PictogramArray.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/PictogramArray.h new file mode 100644 index 000000000..2b37bd3fb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/PictogramArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_jsk_rviz_plugins_PictogramArray_h +#define _ROS_jsk_rviz_plugins_PictogramArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "jsk_rviz_plugins/Pictogram.h" + +namespace jsk_rviz_plugins +{ + + class PictogramArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t pictograms_length; + typedef jsk_rviz_plugins::Pictogram _pictograms_type; + _pictograms_type st_pictograms; + _pictograms_type * pictograms; + + PictogramArray(): + header(), + pictograms_length(0), st_pictograms(), pictograms(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->pictograms_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pictograms_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pictograms_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pictograms_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->pictograms_length); + for( uint32_t i = 0; i < pictograms_length; i++){ + offset += this->pictograms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t pictograms_lengthT = ((uint32_t) (*(inbuffer + offset))); + pictograms_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + pictograms_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + pictograms_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pictograms_length); + if(pictograms_lengthT > pictograms_length) + this->pictograms = (jsk_rviz_plugins::Pictogram*)realloc(this->pictograms, pictograms_lengthT * sizeof(jsk_rviz_plugins::Pictogram)); + pictograms_length = pictograms_lengthT; + for( uint32_t i = 0; i < pictograms_length; i++){ + offset += this->st_pictograms.deserialize(inbuffer + offset); + memcpy( &(this->pictograms[i]), &(this->st_pictograms), sizeof(jsk_rviz_plugins::Pictogram)); + } + return offset; + } + + virtual const char * getType() override { return "jsk_rviz_plugins/PictogramArray"; }; + virtual const char * getMD5() override { return "bfdafbfcdf121aed91dae673b47ae3fe"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/RecordCommand.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/RecordCommand.h new file mode 100644 index 000000000..e3b6252f5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/RecordCommand.h @@ -0,0 +1,76 @@ +#ifndef _ROS_jsk_rviz_plugins_RecordCommand_h +#define _ROS_jsk_rviz_plugins_RecordCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_rviz_plugins +{ + + class RecordCommand : public ros::Msg + { + public: + typedef int8_t _command_type; + _command_type command; + typedef const char* _target_type; + _target_type target; + enum { RECORD = 0 }; + enum { RECORD_STOP = 1 }; + enum { PLAY = 2 }; + + RecordCommand(): + command(0), + target("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_command; + u_command.real = this->command; + *(outbuffer + offset + 0) = (u_command.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->command); + uint32_t length_target = strlen(this->target); + varToArr(outbuffer + offset, length_target); + offset += 4; + memcpy(outbuffer + offset, this->target, length_target); + offset += length_target; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_command; + u_command.base = 0; + u_command.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->command = u_command.real; + offset += sizeof(this->command); + uint32_t length_target; + arrToVar(length_target, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target-1]=0; + this->target = (char *)(inbuffer + offset-1); + offset += length_target; + return offset; + } + + virtual const char * getType() override { return "jsk_rviz_plugins/RecordCommand"; }; + virtual const char * getMD5() override { return "31931c62eab5500089183eef0161c139"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/RequestMarkerOperate.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/RequestMarkerOperate.h new file mode 100644 index 000000000..e83d467e1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/RequestMarkerOperate.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_RequestMarkerOperate_h +#define _ROS_SERVICE_RequestMarkerOperate_h +#include +#include +#include +#include "ros/msg.h" +#include "jsk_rviz_plugins/TransformableMarkerOperate.h" + +namespace jsk_rviz_plugins +{ + +static const char REQUESTMARKEROPERATE[] = "jsk_rviz_plugins/RequestMarkerOperate"; + + class RequestMarkerOperateRequest : public ros::Msg + { + public: + typedef jsk_rviz_plugins::TransformableMarkerOperate _operate_type; + _operate_type operate; + + RequestMarkerOperateRequest(): + operate() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->operate.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->operate.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return REQUESTMARKEROPERATE; }; + virtual const char * getMD5() override { return "5d5e6dca1cfed7e0be1a8c17221d0619"; }; + + }; + + class RequestMarkerOperateResponse : public ros::Msg + { + public: + + RequestMarkerOperateResponse() + { + } + + 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 REQUESTMARKEROPERATE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class RequestMarkerOperate { + public: + typedef RequestMarkerOperateRequest Request; + typedef RequestMarkerOperateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/Screenshot.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/Screenshot.h new file mode 100644 index 000000000..d55aed64c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/Screenshot.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_Screenshot_h +#define _ROS_SERVICE_Screenshot_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_rviz_plugins +{ + +static const char SCREENSHOT[] = "jsk_rviz_plugins/Screenshot"; + + class ScreenshotRequest : public ros::Msg + { + public: + typedef const char* _file_name_type; + _file_name_type file_name; + + ScreenshotRequest(): + file_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_file_name = strlen(this->file_name); + varToArr(outbuffer + offset, length_file_name); + offset += 4; + memcpy(outbuffer + offset, this->file_name, length_file_name); + offset += length_file_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_file_name; + arrToVar(length_file_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file_name-1]=0; + this->file_name = (char *)(inbuffer + offset-1); + offset += length_file_name; + return offset; + } + + virtual const char * getType() override { return SCREENSHOT; }; + virtual const char * getMD5() override { return "2415261c9605b9f38867ffbbe495fc04"; }; + + }; + + class ScreenshotResponse : public ros::Msg + { + public: + + ScreenshotResponse() + { + } + + 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 SCREENSHOT; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Screenshot { + public: + typedef ScreenshotRequest Request; + typedef ScreenshotResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/StringStamped.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/StringStamped.h new file mode 100644 index 000000000..08a19420f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/StringStamped.h @@ -0,0 +1,61 @@ +#ifndef _ROS_jsk_rviz_plugins_StringStamped_h +#define _ROS_jsk_rviz_plugins_StringStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace jsk_rviz_plugins +{ + + class StringStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _data_type; + _data_type data; + + StringStamped(): + 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 "jsk_rviz_plugins/StringStamped"; }; + virtual const char * getMD5() override { return "c99a9440709e4d4a9716d55b8270d5e7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/TransformableMarkerOperate.h b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/TransformableMarkerOperate.h new file mode 100644 index 000000000..c03421a51 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_rviz_plugins/TransformableMarkerOperate.h @@ -0,0 +1,181 @@ +#ifndef _ROS_jsk_rviz_plugins_TransformableMarkerOperate_h +#define _ROS_jsk_rviz_plugins_TransformableMarkerOperate_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_rviz_plugins +{ + + class TransformableMarkerOperate : public ros::Msg + { + public: + typedef int32_t _type_type; + _type_type type; + typedef int32_t _action_type; + _action_type action; + typedef const char* _frame_id_type; + _frame_id_type frame_id; + typedef const char* _name_type; + _name_type name; + typedef const char* _description_type; + _description_type description; + typedef const char* _mesh_resource_type; + _mesh_resource_type mesh_resource; + typedef bool _mesh_use_embedded_materials_type; + _mesh_use_embedded_materials_type mesh_use_embedded_materials; + enum { BOX = 0 }; + enum { CYLINDER = 1 }; + enum { TORUS = 2 }; + enum { MESH_RESOURCE = 3 }; + enum { INSERT = 0 }; + enum { ERASE = 1 }; + enum { ERASEALL = 2 }; + enum { ERASEFOCUS = 3 }; + enum { COPY = 4 }; + + TransformableMarkerOperate(): + type(0), + action(0), + frame_id(""), + name(""), + description(""), + mesh_resource(""), + mesh_use_embedded_materials(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_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + 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; + 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_description = strlen(this->description); + varToArr(outbuffer + offset, length_description); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + uint32_t length_mesh_resource = strlen(this->mesh_resource); + varToArr(outbuffer + offset, length_mesh_resource); + offset += 4; + memcpy(outbuffer + offset, this->mesh_resource, length_mesh_resource); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.real = this->mesh_use_embedded_materials; + *(outbuffer + offset + 0) = (u_mesh_use_embedded_materials.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mesh_use_embedded_materials); + 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_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + 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; + 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_description; + arrToVar(length_description, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + uint32_t length_mesh_resource; + arrToVar(length_mesh_resource, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mesh_resource; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mesh_resource-1]=0; + this->mesh_resource = (char *)(inbuffer + offset-1); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.base = 0; + u_mesh_use_embedded_materials.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mesh_use_embedded_materials = u_mesh_use_embedded_materials.real; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + virtual const char * getType() override { return "jsk_rviz_plugins/TransformableMarkerOperate"; }; + virtual const char * getMD5() override { return "3f5042567d7e11634fa94e4b5452169c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/ChangeTopic.h b/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/ChangeTopic.h new file mode 100644 index 000000000..cd339d71d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/ChangeTopic.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_ChangeTopic_h +#define _ROS_SERVICE_ChangeTopic_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_topic_tools +{ + +static const char CHANGETOPIC[] = "jsk_topic_tools/ChangeTopic"; + + class ChangeTopicRequest : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + + ChangeTopicRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return CHANGETOPIC; }; + virtual const char * getMD5() override { return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class ChangeTopicResponse : public ros::Msg + { + public: + + ChangeTopicResponse() + { + } + + 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 CHANGETOPIC; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ChangeTopic { + public: + typedef ChangeTopicRequest Request; + typedef ChangeTopicResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/List.h b/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/List.h new file mode 100644 index 000000000..da7e86b5d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/List.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_List_h +#define _ROS_SERVICE_List_h +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_topic_tools +{ + +static const char LIST[] = "jsk_topic_tools/List"; + + class ListRequest : public ros::Msg + { + public: + + ListRequest() + { + } + + 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 LIST; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ListResponse : public ros::Msg + { + public: + uint32_t topic_names_length; + typedef char* _topic_names_type; + _topic_names_type st_topic_names; + _topic_names_type * topic_names; + + ListResponse(): + topic_names_length(0), st_topic_names(), topic_names(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topic_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topic_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->topic_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->topic_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->topic_names_length); + for( uint32_t i = 0; i < topic_names_length; i++){ + uint32_t length_topic_namesi = strlen(this->topic_names[i]); + varToArr(outbuffer + offset, length_topic_namesi); + offset += 4; + memcpy(outbuffer + offset, this->topic_names[i], length_topic_namesi); + offset += length_topic_namesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t topic_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + topic_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + topic_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + topic_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->topic_names_length); + if(topic_names_lengthT > topic_names_length) + this->topic_names = (char**)realloc(this->topic_names, topic_names_lengthT * sizeof(char*)); + topic_names_length = topic_names_lengthT; + for( uint32_t i = 0; i < topic_names_length; i++){ + uint32_t length_st_topic_names; + arrToVar(length_st_topic_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topic_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topic_names-1]=0; + this->st_topic_names = (char *)(inbuffer + offset-1); + offset += length_st_topic_names; + memcpy( &(this->topic_names[i]), &(this->st_topic_names), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return LIST; }; + virtual const char * getMD5() override { return "f88f7a076bf16dde010b2480af40dcdb"; }; + + }; + + class List { + public: + typedef ListRequest Request; + typedef ListResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/PassthroughDuration.h b/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/PassthroughDuration.h new file mode 100644 index 000000000..b7d67a607 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/PassthroughDuration.h @@ -0,0 +1,94 @@ +#ifndef _ROS_SERVICE_PassthroughDuration_h +#define _ROS_SERVICE_PassthroughDuration_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace jsk_topic_tools +{ + +static const char PASSTHROUGHDURATION[] = "jsk_topic_tools/PassthroughDuration"; + + class PassthroughDurationRequest : public ros::Msg + { + public: + typedef ros::Duration _duration_type; + _duration_type duration; + + PassthroughDurationRequest(): + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual const char * getType() override { return PASSTHROUGHDURATION; }; + virtual const char * getMD5() override { return "2aa5b5d494c682527e9e9161e1fa58ac"; }; + + }; + + class PassthroughDurationResponse : public ros::Msg + { + public: + + PassthroughDurationResponse() + { + } + + 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 PASSTHROUGHDURATION; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class PassthroughDuration { + public: + typedef PassthroughDurationRequest Request; + typedef PassthroughDurationResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/TopicInfo.h b/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/TopicInfo.h new file mode 100644 index 000000000..1264e166a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/TopicInfo.h @@ -0,0 +1,60 @@ +#ifndef _ROS_jsk_topic_tools_TopicInfo_h +#define _ROS_jsk_topic_tools_TopicInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace jsk_topic_tools +{ + + class TopicInfo : public ros::Msg + { + public: + typedef const char* _topic_name_type; + _topic_name_type topic_name; + typedef float _rate_type; + _rate_type rate; + + TopicInfo(): + topic_name(""), + rate(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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; + offset += serializeAvrFloat64(outbuffer + offset, this->rate); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->rate)); + return offset; + } + + virtual const char * getType() override { return "jsk_topic_tools/TopicInfo"; }; + virtual const char * getMD5() override { return "78edf14defd72c2fcd29e4fad0165ea9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/Update.h b/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/Update.h new file mode 100644 index 000000000..6cd9e74ee --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/jsk_topic_tools/Update.h @@ -0,0 +1,134 @@ +#ifndef _ROS_SERVICE_Update_h +#define _ROS_SERVICE_Update_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace jsk_topic_tools +{ + +static const char UPDATE[] = "jsk_topic_tools/Update"; + + class UpdateRequest : public ros::Msg + { + public: + typedef const char* _topic_name_type; + _topic_name_type topic_name; + typedef bool _periodic_type; + _periodic_type periodic; + typedef ros::Duration _periodic_rate_type; + _periodic_rate_type periodic_rate; + + UpdateRequest(): + topic_name(""), + periodic(0), + periodic_rate() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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; + union { + bool real; + uint8_t base; + } u_periodic; + u_periodic.real = this->periodic; + *(outbuffer + offset + 0) = (u_periodic.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->periodic); + *(outbuffer + offset + 0) = (this->periodic_rate.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->periodic_rate.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->periodic_rate.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->periodic_rate.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->periodic_rate.sec); + *(outbuffer + offset + 0) = (this->periodic_rate.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->periodic_rate.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->periodic_rate.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->periodic_rate.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->periodic_rate.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + union { + bool real; + uint8_t base; + } u_periodic; + u_periodic.base = 0; + u_periodic.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->periodic = u_periodic.real; + offset += sizeof(this->periodic); + this->periodic_rate.sec = ((uint32_t) (*(inbuffer + offset))); + this->periodic_rate.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->periodic_rate.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->periodic_rate.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->periodic_rate.sec); + this->periodic_rate.nsec = ((uint32_t) (*(inbuffer + offset))); + this->periodic_rate.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->periodic_rate.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->periodic_rate.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->periodic_rate.nsec); + return offset; + } + + virtual const char * getType() override { return UPDATE; }; + virtual const char * getMD5() override { return "0050acd5c94510531ac3023287e6b559"; }; + + }; + + class UpdateResponse : public ros::Msg + { + public: + typedef float _rate_type; + _rate_type rate; + + UpdateResponse(): + rate(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->rate); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->rate)); + return offset; + } + + virtual const char * getType() override { return UPDATE; }; + virtual const char * getMD5() override { return "4910f3d55cbb29566b6c8f8f16528adf"; }; + + }; + + class Update { + public: + typedef UpdateRequest Request; + typedef UpdateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/laser_assembler/AssembleScans.h b/smart_device_protocol/ros_lib/ros_lib/laser_assembler/AssembleScans.h new file mode 100644 index 000000000..2d299d5fb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/laser_assembler/AssembleScans.h @@ -0,0 +1,123 @@ +#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/smart_device_protocol/ros_lib/ros_lib/laser_assembler/AssembleScans2.h b/smart_device_protocol/ros_lib/ros_lib/laser_assembler/AssembleScans2.h new file mode 100644 index 000000000..f7ed1ad18 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/laser_assembler/AssembleScans2.h @@ -0,0 +1,123 @@ +#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/smart_device_protocol/ros_lib/ros_lib/map_msgs/GetMapROI.h b/smart_device_protocol/ros_lib/ros_lib/map_msgs/GetMapROI.h new file mode 100644 index 000000000..6ffcbcbb7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/map_msgs/GetMapROI.h @@ -0,0 +1,96 @@ +#ifndef _ROS_SERVICE_GetMapROI_h +#define _ROS_SERVICE_GetMapROI_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace map_msgs +{ + +static const char GETMAPROI[] = "map_msgs/GetMapROI"; + + class GetMapROIRequest : public ros::Msg + { + public: + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef float _l_x_type; + _l_x_type l_x; + typedef float _l_y_type; + _l_y_type l_y; + + GetMapROIRequest(): + x(0), + y(0), + l_x(0), + l_y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->l_x); + offset += serializeAvrFloat64(outbuffer + offset, this->l_y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_y)); + return offset; + } + + virtual const char * getType() override { return GETMAPROI; }; + virtual const char * getMD5() override { return "43c2ff8f45af555c0eaf070c401e9a47"; }; + + }; + + class GetMapROIResponse : public ros::Msg + { + public: + typedef nav_msgs::OccupancyGrid _sub_map_type; + _sub_map_type sub_map; + + GetMapROIResponse(): + sub_map() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->sub_map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->sub_map.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETMAPROI; }; + virtual const char * getMD5() override { return "4d1986519c00d81967d2891a606b234c"; }; + + }; + + class GetMapROI { + public: + typedef GetMapROIRequest Request; + typedef GetMapROIResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/map_msgs/GetPointMap.h b/smart_device_protocol/ros_lib/ros_lib/map_msgs/GetPointMap.h new file mode 100644 index 000000000..f24f6e1ff --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/map_msgs/GetPointMap.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_GetPointMap_h +#define _ROS_SERVICE_GetPointMap_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + +static const char GETPOINTMAP[] = "map_msgs/GetPointMap"; + + class GetPointMapRequest : public ros::Msg + { + public: + + GetPointMapRequest() + { + } + + 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 GETPOINTMAP; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPointMapResponse : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _map_type; + _map_type map; + + GetPointMapResponse(): + 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 GETPOINTMAP; }; + virtual const char * getMD5() override { return "b84fbb39505086eb6a62d933c75cb7b4"; }; + + }; + + class GetPointMap { + public: + typedef GetPointMapRequest Request; + typedef GetPointMapResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/map_msgs/GetPointMapROI.h b/smart_device_protocol/ros_lib/ros_lib/map_msgs/GetPointMapROI.h new file mode 100644 index 000000000..3d4f6ed4a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/map_msgs/GetPointMapROI.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_GetPointMapROI_h +#define _ROS_SERVICE_GetPointMapROI_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + +static const char GETPOINTMAPROI[] = "map_msgs/GetPointMapROI"; + + class GetPointMapROIRequest : 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 _l_x_type; + _l_x_type l_x; + typedef float _l_y_type; + _l_y_type l_y; + typedef float _l_z_type; + _l_z_type l_z; + + GetPointMapROIRequest(): + x(0), + y(0), + z(0), + r(0), + l_x(0), + l_y(0), + l_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + offset += serializeAvrFloat64(outbuffer + offset, this->r); + offset += serializeAvrFloat64(outbuffer + offset, this->l_x); + offset += serializeAvrFloat64(outbuffer + offset, this->l_y); + offset += serializeAvrFloat64(outbuffer + offset, this->l_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->r)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_z)); + return offset; + } + + virtual const char * getType() override { return GETPOINTMAPROI; }; + virtual const char * getMD5() override { return "895f7e437a9a6dd225316872b187a303"; }; + + }; + + class GetPointMapROIResponse : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _sub_map_type; + _sub_map_type sub_map; + + GetPointMapROIResponse(): + sub_map() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->sub_map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->sub_map.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETPOINTMAPROI; }; + virtual const char * getMD5() override { return "313769f8b0e724525c6463336cbccd63"; }; + + }; + + class GetPointMapROI { + public: + typedef GetPointMapROIRequest Request; + typedef GetPointMapROIResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/map_msgs/OccupancyGridUpdate.h b/smart_device_protocol/ros_lib/ros_lib/map_msgs/OccupancyGridUpdate.h new file mode 100644 index 000000000..e95cd4082 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/map_msgs/OccupancyGridUpdate.h @@ -0,0 +1,156 @@ +#ifndef _ROS_map_msgs_OccupancyGridUpdate_h +#define _ROS_map_msgs_OccupancyGridUpdate_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace map_msgs +{ + + class OccupancyGridUpdate : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _x_type; + _x_type x; + typedef int32_t _y_type; + _y_type y; + typedef uint32_t _width_type; + _width_type width; + typedef uint32_t _height_type; + _height_type height; + uint32_t data_length; + typedef int8_t _data_type; + _data_type st_data; + _data_type * data; + + OccupancyGridUpdate(): + header(), + x(0), + y(0), + width(0), + height(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 { + 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); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(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 { + 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); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + 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 "map_msgs/OccupancyGridUpdate"; }; + virtual const char * getMD5() override { return "b295be292b335c34718bd939deebe1c9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/map_msgs/PointCloud2Update.h b/smart_device_protocol/ros_lib/ros_lib/map_msgs/PointCloud2Update.h new file mode 100644 index 000000000..245662e25 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/map_msgs/PointCloud2Update.h @@ -0,0 +1,65 @@ +#ifndef _ROS_map_msgs_PointCloud2Update_h +#define _ROS_map_msgs_PointCloud2Update_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + + class PointCloud2Update : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _type_type; + _type_type type; + typedef sensor_msgs::PointCloud2 _points_type; + _points_type points; + enum { ADD = 0 }; + enum { DELETE = 1 }; + + PointCloud2Update(): + header(), + type(0), + points() + { + } + + 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; + *(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); + offset += this->points.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + 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); + offset += this->points.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "map_msgs/PointCloud2Update"; }; + virtual const char * getMD5() override { return "6c58e4f249ae9cd2b24fb1ee0f99195e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMap.h b/smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMap.h new file mode 100644 index 000000000..9a17d2755 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMap.h @@ -0,0 +1,54 @@ +#ifndef _ROS_map_msgs_ProjectedMap_h +#define _ROS_map_msgs_ProjectedMap_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace map_msgs +{ + + class ProjectedMap : public ros::Msg + { + public: + typedef nav_msgs::OccupancyGrid _map_type; + _map_type map; + typedef float _min_z_type; + _min_z_type min_z; + typedef float _max_z_type; + _max_z_type max_z; + + ProjectedMap(): + map(), + min_z(0), + max_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->min_z); + offset += serializeAvrFloat64(outbuffer + offset, this->max_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_z)); + return offset; + } + + virtual const char * getType() override { return "map_msgs/ProjectedMap"; }; + virtual const char * getMD5() override { return "7bbe8f96e45089681dc1ea7d023cbfca"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMapInfo.h b/smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMapInfo.h new file mode 100644 index 000000000..bd1f15c4e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMapInfo.h @@ -0,0 +1,85 @@ +#ifndef _ROS_map_msgs_ProjectedMapInfo_h +#define _ROS_map_msgs_ProjectedMapInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace map_msgs +{ + + class ProjectedMapInfo : public ros::Msg + { + public: + typedef const char* _frame_id_type; + _frame_id_type frame_id; + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef float _width_type; + _width_type width; + typedef float _height_type; + _height_type height; + typedef float _min_z_type; + _min_z_type min_z; + typedef float _max_z_type; + _max_z_type max_z; + + ProjectedMapInfo(): + frame_id(""), + x(0), + y(0), + width(0), + height(0), + min_z(0), + max_z(0) + { + } + + 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->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->width); + offset += serializeAvrFloat64(outbuffer + offset, this->height); + offset += serializeAvrFloat64(outbuffer + offset, this->min_z); + offset += serializeAvrFloat64(outbuffer + offset, this->max_z); + 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->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->width)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->height)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_z)); + return offset; + } + + virtual const char * getType() override { return "map_msgs/ProjectedMapInfo"; }; + virtual const char * getMD5() override { return "2dc10595ae94de23f22f8a6d2a0eef7a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMapsInfo.h b/smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMapsInfo.h new file mode 100644 index 000000000..d2a9aa681 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/map_msgs/ProjectedMapsInfo.h @@ -0,0 +1,96 @@ +#ifndef _ROS_SERVICE_ProjectedMapsInfo_h +#define _ROS_SERVICE_ProjectedMapsInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "map_msgs/ProjectedMapInfo.h" + +namespace map_msgs +{ + +static const char PROJECTEDMAPSINFO[] = "map_msgs/ProjectedMapsInfo"; + + class ProjectedMapsInfoRequest : public ros::Msg + { + public: + uint32_t projected_maps_info_length; + typedef map_msgs::ProjectedMapInfo _projected_maps_info_type; + _projected_maps_info_type st_projected_maps_info; + _projected_maps_info_type * projected_maps_info; + + ProjectedMapsInfoRequest(): + projected_maps_info_length(0), st_projected_maps_info(), projected_maps_info(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->projected_maps_info_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->projected_maps_info_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->projected_maps_info_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->projected_maps_info_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->projected_maps_info_length); + for( uint32_t i = 0; i < projected_maps_info_length; i++){ + offset += this->projected_maps_info[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t projected_maps_info_lengthT = ((uint32_t) (*(inbuffer + offset))); + projected_maps_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + projected_maps_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + projected_maps_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->projected_maps_info_length); + if(projected_maps_info_lengthT > projected_maps_info_length) + this->projected_maps_info = (map_msgs::ProjectedMapInfo*)realloc(this->projected_maps_info, projected_maps_info_lengthT * sizeof(map_msgs::ProjectedMapInfo)); + projected_maps_info_length = projected_maps_info_lengthT; + for( uint32_t i = 0; i < projected_maps_info_length; i++){ + offset += this->st_projected_maps_info.deserialize(inbuffer + offset); + memcpy( &(this->projected_maps_info[i]), &(this->st_projected_maps_info), sizeof(map_msgs::ProjectedMapInfo)); + } + return offset; + } + + virtual const char * getType() override { return PROJECTEDMAPSINFO; }; + virtual const char * getMD5() override { return "d7980a33202421c8cd74565e57a4d229"; }; + + }; + + class ProjectedMapsInfoResponse : public ros::Msg + { + public: + + ProjectedMapsInfoResponse() + { + } + + 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 PROJECTEDMAPSINFO; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ProjectedMapsInfo { + public: + typedef ProjectedMapsInfoRequest Request; + typedef ProjectedMapsInfoResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/map_msgs/SaveMap.h b/smart_device_protocol/ros_lib/ros_lib/map_msgs/SaveMap.h new file mode 100644 index 000000000..96352411f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/map_msgs/SaveMap.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_SaveMap_h +#define _ROS_SERVICE_SaveMap_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/String.h" + +namespace map_msgs +{ + +static const char SAVEMAP[] = "map_msgs/SaveMap"; + + class SaveMapRequest : public ros::Msg + { + public: + typedef std_msgs::String _filename_type; + _filename_type filename; + + SaveMapRequest(): + filename() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->filename.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->filename.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SAVEMAP; }; + virtual const char * getMD5() override { return "716e25f9d9dc76ceba197f93cbf05dc7"; }; + + }; + + class SaveMapResponse : public ros::Msg + { + public: + + SaveMapResponse() + { + } + + 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 SAVEMAP; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SaveMap { + public: + typedef SaveMapRequest Request; + typedef SaveMapResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/map_msgs/SetMapProjections.h b/smart_device_protocol/ros_lib/ros_lib/map_msgs/SetMapProjections.h new file mode 100644 index 000000000..e237a14f1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/map_msgs/SetMapProjections.h @@ -0,0 +1,96 @@ +#ifndef _ROS_SERVICE_SetMapProjections_h +#define _ROS_SERVICE_SetMapProjections_h +#include +#include +#include +#include "ros/msg.h" +#include "map_msgs/ProjectedMapInfo.h" + +namespace map_msgs +{ + +static const char SETMAPPROJECTIONS[] = "map_msgs/SetMapProjections"; + + class SetMapProjectionsRequest : public ros::Msg + { + public: + + SetMapProjectionsRequest() + { + } + + 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 SETMAPPROJECTIONS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetMapProjectionsResponse : public ros::Msg + { + public: + uint32_t projected_maps_info_length; + typedef map_msgs::ProjectedMapInfo _projected_maps_info_type; + _projected_maps_info_type st_projected_maps_info; + _projected_maps_info_type * projected_maps_info; + + SetMapProjectionsResponse(): + projected_maps_info_length(0), st_projected_maps_info(), projected_maps_info(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->projected_maps_info_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->projected_maps_info_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->projected_maps_info_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->projected_maps_info_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->projected_maps_info_length); + for( uint32_t i = 0; i < projected_maps_info_length; i++){ + offset += this->projected_maps_info[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t projected_maps_info_lengthT = ((uint32_t) (*(inbuffer + offset))); + projected_maps_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + projected_maps_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + projected_maps_info_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->projected_maps_info_length); + if(projected_maps_info_lengthT > projected_maps_info_length) + this->projected_maps_info = (map_msgs::ProjectedMapInfo*)realloc(this->projected_maps_info, projected_maps_info_lengthT * sizeof(map_msgs::ProjectedMapInfo)); + projected_maps_info_length = projected_maps_info_lengthT; + for( uint32_t i = 0; i < projected_maps_info_length; i++){ + offset += this->st_projected_maps_info.deserialize(inbuffer + offset); + memcpy( &(this->projected_maps_info[i]), &(this->st_projected_maps_info), sizeof(map_msgs::ProjectedMapInfo)); + } + return offset; + } + + virtual const char * getType() override { return SETMAPPROJECTIONS; }; + virtual const char * getMD5() override { return "d7980a33202421c8cd74565e57a4d229"; }; + + }; + + class SetMapProjections { + public: + typedef SetMapProjectionsRequest Request; + typedef SetMapProjectionsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPath.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPath.h new file mode 100644 index 000000000..b2126c992 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPath.h @@ -0,0 +1,251 @@ +#ifndef _ROS_SERVICE_CheckPath_h +#define _ROS_SERVICE_CheckPath_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/Path.h" + +namespace mbf_msgs +{ + +static const char CHECKPATH[] = "mbf_msgs/CheckPath"; + + class CheckPathRequest : public ros::Msg + { + public: + typedef nav_msgs::Path _path_type; + _path_type path; + typedef float _safety_dist_type; + _safety_dist_type safety_dist; + typedef float _lethal_cost_mult_type; + _lethal_cost_mult_type lethal_cost_mult; + typedef float _inscrib_cost_mult_type; + _inscrib_cost_mult_type inscrib_cost_mult; + typedef float _unknown_cost_mult_type; + _unknown_cost_mult_type unknown_cost_mult; + typedef uint8_t _costmap_type; + _costmap_type costmap; + typedef uint8_t _return_on_type; + _return_on_type return_on; + typedef uint8_t _skip_poses_type; + _skip_poses_type skip_poses; + typedef bool _path_cells_only_type; + _path_cells_only_type path_cells_only; + enum { LOCAL_COSTMAP = 1 }; + enum { GLOBAL_COSTMAP = 2 }; + + CheckPathRequest(): + path(), + safety_dist(0), + lethal_cost_mult(0), + inscrib_cost_mult(0), + unknown_cost_mult(0), + costmap(0), + return_on(0), + skip_poses(0), + path_cells_only(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->path.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_safety_dist; + u_safety_dist.real = this->safety_dist; + *(outbuffer + offset + 0) = (u_safety_dist.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_safety_dist.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_safety_dist.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_safety_dist.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->safety_dist); + union { + float real; + uint32_t base; + } u_lethal_cost_mult; + u_lethal_cost_mult.real = this->lethal_cost_mult; + *(outbuffer + offset + 0) = (u_lethal_cost_mult.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_lethal_cost_mult.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_lethal_cost_mult.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_lethal_cost_mult.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->lethal_cost_mult); + union { + float real; + uint32_t base; + } u_inscrib_cost_mult; + u_inscrib_cost_mult.real = this->inscrib_cost_mult; + *(outbuffer + offset + 0) = (u_inscrib_cost_mult.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_inscrib_cost_mult.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_inscrib_cost_mult.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_inscrib_cost_mult.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->inscrib_cost_mult); + union { + float real; + uint32_t base; + } u_unknown_cost_mult; + u_unknown_cost_mult.real = this->unknown_cost_mult; + *(outbuffer + offset + 0) = (u_unknown_cost_mult.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_unknown_cost_mult.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_unknown_cost_mult.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_unknown_cost_mult.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->unknown_cost_mult); + *(outbuffer + offset + 0) = (this->costmap >> (8 * 0)) & 0xFF; + offset += sizeof(this->costmap); + *(outbuffer + offset + 0) = (this->return_on >> (8 * 0)) & 0xFF; + offset += sizeof(this->return_on); + *(outbuffer + offset + 0) = (this->skip_poses >> (8 * 0)) & 0xFF; + offset += sizeof(this->skip_poses); + union { + bool real; + uint8_t base; + } u_path_cells_only; + u_path_cells_only.real = this->path_cells_only; + *(outbuffer + offset + 0) = (u_path_cells_only.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->path_cells_only); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->path.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_safety_dist; + u_safety_dist.base = 0; + u_safety_dist.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_safety_dist.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_safety_dist.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_safety_dist.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->safety_dist = u_safety_dist.real; + offset += sizeof(this->safety_dist); + union { + float real; + uint32_t base; + } u_lethal_cost_mult; + u_lethal_cost_mult.base = 0; + u_lethal_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_lethal_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_lethal_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_lethal_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->lethal_cost_mult = u_lethal_cost_mult.real; + offset += sizeof(this->lethal_cost_mult); + union { + float real; + uint32_t base; + } u_inscrib_cost_mult; + u_inscrib_cost_mult.base = 0; + u_inscrib_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_inscrib_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_inscrib_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_inscrib_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->inscrib_cost_mult = u_inscrib_cost_mult.real; + offset += sizeof(this->inscrib_cost_mult); + union { + float real; + uint32_t base; + } u_unknown_cost_mult; + u_unknown_cost_mult.base = 0; + u_unknown_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_unknown_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_unknown_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_unknown_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->unknown_cost_mult = u_unknown_cost_mult.real; + offset += sizeof(this->unknown_cost_mult); + this->costmap = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->costmap); + this->return_on = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->return_on); + this->skip_poses = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->skip_poses); + union { + bool real; + uint8_t base; + } u_path_cells_only; + u_path_cells_only.base = 0; + u_path_cells_only.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->path_cells_only = u_path_cells_only.real; + offset += sizeof(this->path_cells_only); + return offset; + } + + virtual const char * getType() override { return CHECKPATH; }; + virtual const char * getMD5() override { return "16f70020b17f5c034724ed8fb518b9f5"; }; + + }; + + class CheckPathResponse : public ros::Msg + { + public: + typedef uint32_t _last_checked_type; + _last_checked_type last_checked; + typedef uint8_t _state_type; + _state_type state; + typedef uint32_t _cost_type; + _cost_type cost; + enum { FREE = 0 }; + enum { INSCRIBED = 1 }; + enum { LETHAL = 2 }; + enum { UNKNOWN = 3 }; + enum { OUTSIDE = 4 }; + + CheckPathResponse(): + last_checked(0), + state(0), + cost(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->last_checked >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->last_checked >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->last_checked >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->last_checked >> (8 * 3)) & 0xFF; + offset += sizeof(this->last_checked); + *(outbuffer + offset + 0) = (this->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + *(outbuffer + offset + 0) = (this->cost >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cost >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cost >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cost >> (8 * 3)) & 0xFF; + offset += sizeof(this->cost); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->last_checked = ((uint32_t) (*(inbuffer + offset))); + this->last_checked |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->last_checked |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->last_checked |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->last_checked); + this->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + this->cost = ((uint32_t) (*(inbuffer + offset))); + this->cost |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->cost |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->cost |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cost); + return offset; + } + + virtual const char * getType() override { return CHECKPATH; }; + virtual const char * getMD5() override { return "420eb6a13d128bba3770710452ea1c17"; }; + + }; + + class CheckPath { + public: + typedef CheckPathRequest Request; + typedef CheckPathResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPoint.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPoint.h new file mode 100644 index 000000000..81f73eb38 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPoint.h @@ -0,0 +1,110 @@ +#ifndef _ROS_SERVICE_CheckPoint_h +#define _ROS_SERVICE_CheckPoint_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PointStamped.h" + +namespace mbf_msgs +{ + +static const char CHECKPOINT[] = "mbf_msgs/CheckPoint"; + + class CheckPointRequest : public ros::Msg + { + public: + typedef geometry_msgs::PointStamped _point_type; + _point_type point; + typedef uint8_t _costmap_type; + _costmap_type costmap; + enum { LOCAL_COSTMAP = 1 }; + enum { GLOBAL_COSTMAP = 2 }; + + CheckPointRequest(): + point(), + costmap(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->point.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->costmap >> (8 * 0)) & 0xFF; + offset += sizeof(this->costmap); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->point.deserialize(inbuffer + offset); + this->costmap = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->costmap); + return offset; + } + + virtual const char * getType() override { return CHECKPOINT; }; + virtual const char * getMD5() override { return "36e9c2f425eee0a2ebd8c4b0aae9f573"; }; + + }; + + class CheckPointResponse : public ros::Msg + { + public: + typedef uint8_t _state_type; + _state_type state; + typedef uint32_t _cost_type; + _cost_type cost; + enum { FREE = 0 }; + enum { INSCRIBED = 1 }; + enum { LETHAL = 2 }; + enum { UNKNOWN = 3 }; + enum { OUTSIDE = 4 }; + + CheckPointResponse(): + state(0), + cost(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + *(outbuffer + offset + 0) = (this->cost >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cost >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cost >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cost >> (8 * 3)) & 0xFF; + offset += sizeof(this->cost); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + this->cost = ((uint32_t) (*(inbuffer + offset))); + this->cost |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->cost |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->cost |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cost); + return offset; + } + + virtual const char * getType() override { return CHECKPOINT; }; + virtual const char * getMD5() override { return "d74139e1f7169aa4fb64b44c3a698692"; }; + + }; + + class CheckPoint { + public: + typedef CheckPointRequest Request; + typedef CheckPointResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPose.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPose.h new file mode 100644 index 000000000..bf37a06e6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/CheckPose.h @@ -0,0 +1,224 @@ +#ifndef _ROS_SERVICE_CheckPose_h +#define _ROS_SERVICE_CheckPose_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace mbf_msgs +{ + +static const char CHECKPOSE[] = "mbf_msgs/CheckPose"; + + class CheckPoseRequest : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _pose_type; + _pose_type pose; + typedef float _safety_dist_type; + _safety_dist_type safety_dist; + typedef float _lethal_cost_mult_type; + _lethal_cost_mult_type lethal_cost_mult; + typedef float _inscrib_cost_mult_type; + _inscrib_cost_mult_type inscrib_cost_mult; + typedef float _unknown_cost_mult_type; + _unknown_cost_mult_type unknown_cost_mult; + typedef uint8_t _costmap_type; + _costmap_type costmap; + typedef bool _current_pose_type; + _current_pose_type current_pose; + enum { LOCAL_COSTMAP = 1 }; + enum { GLOBAL_COSTMAP = 2 }; + + CheckPoseRequest(): + pose(), + safety_dist(0), + lethal_cost_mult(0), + inscrib_cost_mult(0), + unknown_cost_mult(0), + costmap(0), + current_pose(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_safety_dist; + u_safety_dist.real = this->safety_dist; + *(outbuffer + offset + 0) = (u_safety_dist.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_safety_dist.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_safety_dist.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_safety_dist.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->safety_dist); + union { + float real; + uint32_t base; + } u_lethal_cost_mult; + u_lethal_cost_mult.real = this->lethal_cost_mult; + *(outbuffer + offset + 0) = (u_lethal_cost_mult.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_lethal_cost_mult.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_lethal_cost_mult.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_lethal_cost_mult.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->lethal_cost_mult); + union { + float real; + uint32_t base; + } u_inscrib_cost_mult; + u_inscrib_cost_mult.real = this->inscrib_cost_mult; + *(outbuffer + offset + 0) = (u_inscrib_cost_mult.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_inscrib_cost_mult.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_inscrib_cost_mult.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_inscrib_cost_mult.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->inscrib_cost_mult); + union { + float real; + uint32_t base; + } u_unknown_cost_mult; + u_unknown_cost_mult.real = this->unknown_cost_mult; + *(outbuffer + offset + 0) = (u_unknown_cost_mult.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_unknown_cost_mult.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_unknown_cost_mult.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_unknown_cost_mult.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->unknown_cost_mult); + *(outbuffer + offset + 0) = (this->costmap >> (8 * 0)) & 0xFF; + offset += sizeof(this->costmap); + union { + bool real; + uint8_t base; + } u_current_pose; + u_current_pose.real = this->current_pose; + *(outbuffer + offset + 0) = (u_current_pose.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->current_pose); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_safety_dist; + u_safety_dist.base = 0; + u_safety_dist.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_safety_dist.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_safety_dist.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_safety_dist.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->safety_dist = u_safety_dist.real; + offset += sizeof(this->safety_dist); + union { + float real; + uint32_t base; + } u_lethal_cost_mult; + u_lethal_cost_mult.base = 0; + u_lethal_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_lethal_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_lethal_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_lethal_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->lethal_cost_mult = u_lethal_cost_mult.real; + offset += sizeof(this->lethal_cost_mult); + union { + float real; + uint32_t base; + } u_inscrib_cost_mult; + u_inscrib_cost_mult.base = 0; + u_inscrib_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_inscrib_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_inscrib_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_inscrib_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->inscrib_cost_mult = u_inscrib_cost_mult.real; + offset += sizeof(this->inscrib_cost_mult); + union { + float real; + uint32_t base; + } u_unknown_cost_mult; + u_unknown_cost_mult.base = 0; + u_unknown_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_unknown_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_unknown_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_unknown_cost_mult.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->unknown_cost_mult = u_unknown_cost_mult.real; + offset += sizeof(this->unknown_cost_mult); + this->costmap = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->costmap); + union { + bool real; + uint8_t base; + } u_current_pose; + u_current_pose.base = 0; + u_current_pose.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->current_pose = u_current_pose.real; + offset += sizeof(this->current_pose); + return offset; + } + + virtual const char * getType() override { return CHECKPOSE; }; + virtual const char * getMD5() override { return "265e0591fcb39074b9d918fb13f423f4"; }; + + }; + + class CheckPoseResponse : public ros::Msg + { + public: + typedef uint8_t _state_type; + _state_type state; + typedef uint32_t _cost_type; + _cost_type cost; + enum { FREE = 0 }; + enum { INSCRIBED = 1 }; + enum { LETHAL = 2 }; + enum { UNKNOWN = 3 }; + enum { OUTSIDE = 4 }; + + CheckPoseResponse(): + state(0), + cost(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + *(outbuffer + offset + 0) = (this->cost >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cost >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cost >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cost >> (8 * 3)) & 0xFF; + offset += sizeof(this->cost); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + this->cost = ((uint32_t) (*(inbuffer + offset))); + this->cost |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->cost |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->cost |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cost); + return offset; + } + + virtual const char * getType() override { return CHECKPOSE; }; + virtual const char * getMD5() override { return "d74139e1f7169aa4fb64b44c3a698692"; }; + + }; + + class CheckPose { + public: + typedef CheckPoseRequest Request; + typedef CheckPoseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathAction.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathAction.h new file mode 100644 index 000000000..ca81860e7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_ExePathAction_h +#define _ROS_mbf_msgs_ExePathAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "mbf_msgs/ExePathActionGoal.h" +#include "mbf_msgs/ExePathActionResult.h" +#include "mbf_msgs/ExePathActionFeedback.h" + +namespace mbf_msgs +{ + + class ExePathAction : public ros::Msg + { + public: + typedef mbf_msgs::ExePathActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef mbf_msgs::ExePathActionResult _action_result_type; + _action_result_type action_result; + typedef mbf_msgs::ExePathActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + ExePathAction(): + 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 "mbf_msgs/ExePathAction"; }; + virtual const char * getMD5() override { return "1eb3204035d1ceb85b999c9c0a477f7b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionFeedback.h new file mode 100644 index 000000000..55007b8b3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_ExePathActionFeedback_h +#define _ROS_mbf_msgs_ExePathActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "mbf_msgs/ExePathFeedback.h" + +namespace mbf_msgs +{ + + class ExePathActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef mbf_msgs::ExePathFeedback _feedback_type; + _feedback_type feedback; + + ExePathActionFeedback(): + 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 "mbf_msgs/ExePathActionFeedback"; }; + virtual const char * getMD5() override { return "41e5119fe263f5296a0eba2eff692cd2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionGoal.h new file mode 100644 index 000000000..ec305cd98 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_ExePathActionGoal_h +#define _ROS_mbf_msgs_ExePathActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "mbf_msgs/ExePathGoal.h" + +namespace mbf_msgs +{ + + class ExePathActionGoal : 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 mbf_msgs::ExePathGoal _goal_type; + _goal_type goal; + + ExePathActionGoal(): + 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 "mbf_msgs/ExePathActionGoal"; }; + virtual const char * getMD5() override { return "2e906bfb25f223a7c3bdf127e99a7e16"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionResult.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionResult.h new file mode 100644 index 000000000..c9c8c1d64 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_ExePathActionResult_h +#define _ROS_mbf_msgs_ExePathActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "mbf_msgs/ExePathResult.h" + +namespace mbf_msgs +{ + + class ExePathActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef mbf_msgs::ExePathResult _result_type; + _result_type result; + + ExePathActionResult(): + 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 "mbf_msgs/ExePathActionResult"; }; + virtual const char * getMD5() override { return "c0c371e6e71c834fcf0eea1b2ae047b5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathFeedback.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathFeedback.h new file mode 100644 index 000000000..e12195b9d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathFeedback.h @@ -0,0 +1,128 @@ +#ifndef _ROS_mbf_msgs_ExePathFeedback_h +#define _ROS_mbf_msgs_ExePathFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "geometry_msgs/TwistStamped.h" + +namespace mbf_msgs +{ + + class ExePathFeedback : public ros::Msg + { + public: + typedef uint32_t _outcome_type; + _outcome_type outcome; + typedef const char* _message_type; + _message_type message; + typedef float _dist_to_goal_type; + _dist_to_goal_type dist_to_goal; + typedef float _angle_to_goal_type; + _angle_to_goal_type angle_to_goal; + typedef geometry_msgs::PoseStamped _current_pose_type; + _current_pose_type current_pose; + typedef geometry_msgs::TwistStamped _last_cmd_vel_type; + _last_cmd_vel_type last_cmd_vel; + + ExePathFeedback(): + outcome(0), + message(""), + dist_to_goal(0), + angle_to_goal(0), + current_pose(), + last_cmd_vel() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->outcome >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outcome >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outcome >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outcome >> (8 * 3)) & 0xFF; + offset += sizeof(this->outcome); + uint32_t length_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + union { + float real; + uint32_t base; + } u_dist_to_goal; + u_dist_to_goal.real = this->dist_to_goal; + *(outbuffer + offset + 0) = (u_dist_to_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dist_to_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dist_to_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dist_to_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dist_to_goal); + union { + float real; + uint32_t base; + } u_angle_to_goal; + u_angle_to_goal.real = this->angle_to_goal; + *(outbuffer + offset + 0) = (u_angle_to_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_to_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_to_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_to_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_to_goal); + offset += this->current_pose.serialize(outbuffer + offset); + offset += this->last_cmd_vel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->outcome = ((uint32_t) (*(inbuffer + offset))); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outcome); + 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; + union { + float real; + uint32_t base; + } u_dist_to_goal; + u_dist_to_goal.base = 0; + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dist_to_goal = u_dist_to_goal.real; + offset += sizeof(this->dist_to_goal); + union { + float real; + uint32_t base; + } u_angle_to_goal; + u_angle_to_goal.base = 0; + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_to_goal = u_angle_to_goal.real; + offset += sizeof(this->angle_to_goal); + offset += this->current_pose.deserialize(inbuffer + offset); + offset += this->last_cmd_vel.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "mbf_msgs/ExePathFeedback"; }; + virtual const char * getMD5() override { return "1b30e381361670e9521046df439847e2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathGoal.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathGoal.h new file mode 100644 index 000000000..abddcf4bb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathGoal.h @@ -0,0 +1,134 @@ +#ifndef _ROS_mbf_msgs_ExePathGoal_h +#define _ROS_mbf_msgs_ExePathGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/Path.h" + +namespace mbf_msgs +{ + + class ExePathGoal : public ros::Msg + { + public: + typedef nav_msgs::Path _path_type; + _path_type path; + typedef const char* _controller_type; + _controller_type controller; + typedef uint8_t _concurrency_slot_type; + _concurrency_slot_type concurrency_slot; + typedef bool _tolerance_from_action_type; + _tolerance_from_action_type tolerance_from_action; + typedef float _dist_tolerance_type; + _dist_tolerance_type dist_tolerance; + typedef float _angle_tolerance_type; + _angle_tolerance_type angle_tolerance; + + ExePathGoal(): + path(), + controller(""), + concurrency_slot(0), + tolerance_from_action(0), + dist_tolerance(0), + angle_tolerance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->path.serialize(outbuffer + offset); + uint32_t length_controller = strlen(this->controller); + varToArr(outbuffer + offset, length_controller); + offset += 4; + memcpy(outbuffer + offset, this->controller, length_controller); + offset += length_controller; + *(outbuffer + offset + 0) = (this->concurrency_slot >> (8 * 0)) & 0xFF; + offset += sizeof(this->concurrency_slot); + union { + bool real; + uint8_t base; + } u_tolerance_from_action; + u_tolerance_from_action.real = this->tolerance_from_action; + *(outbuffer + offset + 0) = (u_tolerance_from_action.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->tolerance_from_action); + union { + float real; + uint32_t base; + } u_dist_tolerance; + u_dist_tolerance.real = this->dist_tolerance; + *(outbuffer + offset + 0) = (u_dist_tolerance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dist_tolerance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dist_tolerance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dist_tolerance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dist_tolerance); + union { + float real; + uint32_t base; + } u_angle_tolerance; + u_angle_tolerance.real = this->angle_tolerance; + *(outbuffer + offset + 0) = (u_angle_tolerance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_tolerance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_tolerance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_tolerance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_tolerance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->path.deserialize(inbuffer + offset); + uint32_t length_controller; + arrToVar(length_controller, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_controller; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_controller-1]=0; + this->controller = (char *)(inbuffer + offset-1); + offset += length_controller; + this->concurrency_slot = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->concurrency_slot); + union { + bool real; + uint8_t base; + } u_tolerance_from_action; + u_tolerance_from_action.base = 0; + u_tolerance_from_action.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->tolerance_from_action = u_tolerance_from_action.real; + offset += sizeof(this->tolerance_from_action); + union { + float real; + uint32_t base; + } u_dist_tolerance; + u_dist_tolerance.base = 0; + u_dist_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dist_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dist_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dist_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dist_tolerance = u_dist_tolerance.real; + offset += sizeof(this->dist_tolerance); + union { + float real; + uint32_t base; + } u_angle_tolerance; + u_angle_tolerance.base = 0; + u_angle_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_tolerance = u_angle_tolerance.real; + offset += sizeof(this->angle_tolerance); + return offset; + } + + virtual const char * getType() override { return "mbf_msgs/ExePathGoal"; }; + virtual const char * getMD5() override { return "997d05ac3260fea4e2e2586ca47d2578"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathResult.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathResult.h new file mode 100644 index 000000000..05567e355 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/ExePathResult.h @@ -0,0 +1,141 @@ +#ifndef _ROS_mbf_msgs_ExePathResult_h +#define _ROS_mbf_msgs_ExePathResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace mbf_msgs +{ + + class ExePathResult : public ros::Msg + { + public: + typedef uint32_t _outcome_type; + _outcome_type outcome; + typedef const char* _message_type; + _message_type message; + typedef geometry_msgs::PoseStamped _final_pose_type; + _final_pose_type final_pose; + typedef float _dist_to_goal_type; + _dist_to_goal_type dist_to_goal; + typedef float _angle_to_goal_type; + _angle_to_goal_type angle_to_goal; + enum { SUCCESS = 0 }; + enum { FAILURE = 100 }; + enum { CANCELED = 101 }; + enum { NO_VALID_CMD = 102 }; + enum { PAT_EXCEEDED = 103 }; + enum { COLLISION = 104 }; + enum { OSCILLATION = 105 }; + enum { ROBOT_STUCK = 106 }; + enum { MISSED_GOAL = 107 }; + enum { MISSED_PATH = 108 }; + enum { BLOCKED_PATH = 109 }; + enum { INVALID_PATH = 110 }; + enum { TF_ERROR = 111 }; + enum { NOT_INITIALIZED = 112 }; + enum { INVALID_PLUGIN = 113 }; + enum { INTERNAL_ERROR = 114 }; + enum { OUT_OF_MAP = 115 }; + enum { MAP_ERROR = 116 }; + enum { STOPPED = 117 }; + + ExePathResult(): + outcome(0), + message(""), + final_pose(), + dist_to_goal(0), + angle_to_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->outcome >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outcome >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outcome >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outcome >> (8 * 3)) & 0xFF; + offset += sizeof(this->outcome); + uint32_t length_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + offset += this->final_pose.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_dist_to_goal; + u_dist_to_goal.real = this->dist_to_goal; + *(outbuffer + offset + 0) = (u_dist_to_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dist_to_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dist_to_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dist_to_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dist_to_goal); + union { + float real; + uint32_t base; + } u_angle_to_goal; + u_angle_to_goal.real = this->angle_to_goal; + *(outbuffer + offset + 0) = (u_angle_to_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_to_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_to_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_to_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_to_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->outcome = ((uint32_t) (*(inbuffer + offset))); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outcome); + 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; + offset += this->final_pose.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_dist_to_goal; + u_dist_to_goal.base = 0; + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dist_to_goal = u_dist_to_goal.real; + offset += sizeof(this->dist_to_goal); + union { + float real; + uint32_t base; + } u_angle_to_goal; + u_angle_to_goal.base = 0; + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_to_goal = u_angle_to_goal.real; + offset += sizeof(this->angle_to_goal); + return offset; + } + + virtual const char * getType() override { return "mbf_msgs/ExePathResult"; }; + virtual const char * getMD5() override { return "b22f308686bb4e3a7364ea944ef68fd0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathAction.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathAction.h new file mode 100644 index 000000000..74a067417 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_GetPathAction_h +#define _ROS_mbf_msgs_GetPathAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "mbf_msgs/GetPathActionGoal.h" +#include "mbf_msgs/GetPathActionResult.h" +#include "mbf_msgs/GetPathActionFeedback.h" + +namespace mbf_msgs +{ + + class GetPathAction : public ros::Msg + { + public: + typedef mbf_msgs::GetPathActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef mbf_msgs::GetPathActionResult _action_result_type; + _action_result_type action_result; + typedef mbf_msgs::GetPathActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + GetPathAction(): + 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 "mbf_msgs/GetPathAction"; }; + virtual const char * getMD5() override { return "f4d6567e6c5805b81da135676625d187"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionFeedback.h new file mode 100644 index 000000000..ddbb3a0d4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_GetPathActionFeedback_h +#define _ROS_mbf_msgs_GetPathActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "mbf_msgs/GetPathFeedback.h" + +namespace mbf_msgs +{ + + class GetPathActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef mbf_msgs::GetPathFeedback _feedback_type; + _feedback_type feedback; + + GetPathActionFeedback(): + 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 "mbf_msgs/GetPathActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionGoal.h new file mode 100644 index 000000000..60d6f1abe --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_GetPathActionGoal_h +#define _ROS_mbf_msgs_GetPathActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "mbf_msgs/GetPathGoal.h" + +namespace mbf_msgs +{ + + class GetPathActionGoal : 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 mbf_msgs::GetPathGoal _goal_type; + _goal_type goal; + + GetPathActionGoal(): + 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 "mbf_msgs/GetPathActionGoal"; }; + virtual const char * getMD5() override { return "d557bc13deb1742d682c0788c70012fa"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionResult.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionResult.h new file mode 100644 index 000000000..40e623a7a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_GetPathActionResult_h +#define _ROS_mbf_msgs_GetPathActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "mbf_msgs/GetPathResult.h" + +namespace mbf_msgs +{ + + class GetPathActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef mbf_msgs::GetPathResult _result_type; + _result_type result; + + GetPathActionResult(): + 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 "mbf_msgs/GetPathActionResult"; }; + virtual const char * getMD5() override { return "b591e970edf53cd68b6436930a31222a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathFeedback.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathFeedback.h new file mode 100644 index 000000000..d5d191507 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_mbf_msgs_GetPathFeedback_h +#define _ROS_mbf_msgs_GetPathFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mbf_msgs +{ + + class GetPathFeedback : public ros::Msg + { + public: + + GetPathFeedback() + { + } + + 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 "mbf_msgs/GetPathFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathGoal.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathGoal.h new file mode 100644 index 000000000..32dc6183b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathGoal.h @@ -0,0 +1,96 @@ +#ifndef _ROS_mbf_msgs_GetPathGoal_h +#define _ROS_mbf_msgs_GetPathGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace mbf_msgs +{ + + class GetPathGoal : public ros::Msg + { + public: + typedef bool _use_start_pose_type; + _use_start_pose_type use_start_pose; + typedef geometry_msgs::PoseStamped _start_pose_type; + _start_pose_type start_pose; + typedef geometry_msgs::PoseStamped _target_pose_type; + _target_pose_type target_pose; + typedef float _tolerance_type; + _tolerance_type tolerance; + typedef const char* _planner_type; + _planner_type planner; + typedef uint8_t _concurrency_slot_type; + _concurrency_slot_type concurrency_slot; + + GetPathGoal(): + use_start_pose(0), + start_pose(), + target_pose(), + tolerance(0), + planner(""), + concurrency_slot(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_use_start_pose; + u_use_start_pose.real = this->use_start_pose; + *(outbuffer + offset + 0) = (u_use_start_pose.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->use_start_pose); + offset += this->start_pose.serialize(outbuffer + offset); + offset += this->target_pose.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->tolerance); + uint32_t length_planner = strlen(this->planner); + varToArr(outbuffer + offset, length_planner); + offset += 4; + memcpy(outbuffer + offset, this->planner, length_planner); + offset += length_planner; + *(outbuffer + offset + 0) = (this->concurrency_slot >> (8 * 0)) & 0xFF; + offset += sizeof(this->concurrency_slot); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_use_start_pose; + u_use_start_pose.base = 0; + u_use_start_pose.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->use_start_pose = u_use_start_pose.real; + offset += sizeof(this->use_start_pose); + offset += this->start_pose.deserialize(inbuffer + offset); + offset += this->target_pose.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->tolerance)); + uint32_t length_planner; + arrToVar(length_planner, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_planner; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_planner-1]=0; + this->planner = (char *)(inbuffer + offset-1); + offset += length_planner; + this->concurrency_slot = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->concurrency_slot); + return offset; + } + + virtual const char * getType() override { return "mbf_msgs/GetPathGoal"; }; + virtual const char * getMD5() override { return "301d9f5ec2f8f08d1d4e16663a6d2c5a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathResult.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathResult.h new file mode 100644 index 000000000..ff30c98ad --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/GetPathResult.h @@ -0,0 +1,94 @@ +#ifndef _ROS_mbf_msgs_GetPathResult_h +#define _ROS_mbf_msgs_GetPathResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/Path.h" + +namespace mbf_msgs +{ + + class GetPathResult : public ros::Msg + { + public: + typedef uint32_t _outcome_type; + _outcome_type outcome; + typedef const char* _message_type; + _message_type message; + typedef nav_msgs::Path _path_type; + _path_type path; + typedef float _cost_type; + _cost_type cost; + enum { SUCCESS = 0 }; + enum { FAILURE = 50 }; + enum { CANCELED = 51 }; + enum { INVALID_START = 52 }; + enum { INVALID_GOAL = 53 }; + enum { NO_PATH_FOUND = 54 }; + enum { PAT_EXCEEDED = 55 }; + enum { EMPTY_PATH = 56 }; + enum { TF_ERROR = 57 }; + enum { NOT_INITIALIZED = 58 }; + enum { INVALID_PLUGIN = 59 }; + enum { INTERNAL_ERROR = 60 }; + enum { OUT_OF_MAP = 61 }; + enum { MAP_ERROR = 62 }; + enum { STOPPED = 63 }; + + GetPathResult(): + outcome(0), + message(""), + path(), + cost(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->outcome >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outcome >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outcome >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outcome >> (8 * 3)) & 0xFF; + offset += sizeof(this->outcome); + uint32_t length_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + offset += this->path.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->cost); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->outcome = ((uint32_t) (*(inbuffer + offset))); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outcome); + 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; + offset += this->path.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->cost)); + return offset; + } + + virtual const char * getType() override { return "mbf_msgs/GetPathResult"; }; + virtual const char * getMD5() override { return "b737d51aec954f878a4cd57e83f5767c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseAction.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseAction.h new file mode 100644 index 000000000..ffc47098e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_MoveBaseAction_h +#define _ROS_mbf_msgs_MoveBaseAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "mbf_msgs/MoveBaseActionGoal.h" +#include "mbf_msgs/MoveBaseActionResult.h" +#include "mbf_msgs/MoveBaseActionFeedback.h" + +namespace mbf_msgs +{ + + class MoveBaseAction : public ros::Msg + { + public: + typedef mbf_msgs::MoveBaseActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef mbf_msgs::MoveBaseActionResult _action_result_type; + _action_result_type action_result; + typedef mbf_msgs::MoveBaseActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + MoveBaseAction(): + 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 "mbf_msgs/MoveBaseAction"; }; + virtual const char * getMD5() override { return "c98ceb3d38dd07397b09c7280aa0d553"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionFeedback.h new file mode 100644 index 000000000..6620aa3e0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_MoveBaseActionFeedback_h +#define _ROS_mbf_msgs_MoveBaseActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "mbf_msgs/MoveBaseFeedback.h" + +namespace mbf_msgs +{ + + 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 mbf_msgs::MoveBaseFeedback _feedback_type; + _feedback_type feedback; + + MoveBaseActionFeedback(): + 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 "mbf_msgs/MoveBaseActionFeedback"; }; + virtual const char * getMD5() override { return "41e5119fe263f5296a0eba2eff692cd2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionGoal.h new file mode 100644 index 000000000..ec8878b85 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_MoveBaseActionGoal_h +#define _ROS_mbf_msgs_MoveBaseActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "mbf_msgs/MoveBaseGoal.h" + +namespace mbf_msgs +{ + + 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 mbf_msgs::MoveBaseGoal _goal_type; + _goal_type goal; + + MoveBaseActionGoal(): + 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 "mbf_msgs/MoveBaseActionGoal"; }; + virtual const char * getMD5() override { return "2536b6e0a889940672a086994f497615"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionResult.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionResult.h new file mode 100644 index 000000000..3bac878e1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_MoveBaseActionResult_h +#define _ROS_mbf_msgs_MoveBaseActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "mbf_msgs/MoveBaseResult.h" + +namespace mbf_msgs +{ + + 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 mbf_msgs::MoveBaseResult _result_type; + _result_type result; + + MoveBaseActionResult(): + 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 "mbf_msgs/MoveBaseActionResult"; }; + virtual const char * getMD5() override { return "3ba171ea938c4125488c9249510c56e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseFeedback.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseFeedback.h new file mode 100644 index 000000000..95971d690 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseFeedback.h @@ -0,0 +1,128 @@ +#ifndef _ROS_mbf_msgs_MoveBaseFeedback_h +#define _ROS_mbf_msgs_MoveBaseFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "geometry_msgs/TwistStamped.h" + +namespace mbf_msgs +{ + + class MoveBaseFeedback : public ros::Msg + { + public: + typedef uint32_t _outcome_type; + _outcome_type outcome; + typedef const char* _message_type; + _message_type message; + typedef float _dist_to_goal_type; + _dist_to_goal_type dist_to_goal; + typedef float _angle_to_goal_type; + _angle_to_goal_type angle_to_goal; + typedef geometry_msgs::PoseStamped _current_pose_type; + _current_pose_type current_pose; + typedef geometry_msgs::TwistStamped _last_cmd_vel_type; + _last_cmd_vel_type last_cmd_vel; + + MoveBaseFeedback(): + outcome(0), + message(""), + dist_to_goal(0), + angle_to_goal(0), + current_pose(), + last_cmd_vel() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->outcome >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outcome >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outcome >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outcome >> (8 * 3)) & 0xFF; + offset += sizeof(this->outcome); + uint32_t length_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + union { + float real; + uint32_t base; + } u_dist_to_goal; + u_dist_to_goal.real = this->dist_to_goal; + *(outbuffer + offset + 0) = (u_dist_to_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dist_to_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dist_to_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dist_to_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dist_to_goal); + union { + float real; + uint32_t base; + } u_angle_to_goal; + u_angle_to_goal.real = this->angle_to_goal; + *(outbuffer + offset + 0) = (u_angle_to_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_to_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_to_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_to_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_to_goal); + offset += this->current_pose.serialize(outbuffer + offset); + offset += this->last_cmd_vel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->outcome = ((uint32_t) (*(inbuffer + offset))); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outcome); + 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; + union { + float real; + uint32_t base; + } u_dist_to_goal; + u_dist_to_goal.base = 0; + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dist_to_goal = u_dist_to_goal.real; + offset += sizeof(this->dist_to_goal); + union { + float real; + uint32_t base; + } u_angle_to_goal; + u_angle_to_goal.base = 0; + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_to_goal = u_angle_to_goal.real; + offset += sizeof(this->angle_to_goal); + offset += this->current_pose.deserialize(inbuffer + offset); + offset += this->last_cmd_vel.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "mbf_msgs/MoveBaseFeedback"; }; + virtual const char * getMD5() override { return "1b30e381361670e9521046df439847e2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseGoal.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseGoal.h new file mode 100644 index 000000000..d5cf59618 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseGoal.h @@ -0,0 +1,115 @@ +#ifndef _ROS_mbf_msgs_MoveBaseGoal_h +#define _ROS_mbf_msgs_MoveBaseGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace mbf_msgs +{ + + class MoveBaseGoal : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _target_pose_type; + _target_pose_type target_pose; + typedef const char* _controller_type; + _controller_type controller; + typedef const char* _planner_type; + _planner_type planner; + uint32_t recovery_behaviors_length; + typedef char* _recovery_behaviors_type; + _recovery_behaviors_type st_recovery_behaviors; + _recovery_behaviors_type * recovery_behaviors; + + MoveBaseGoal(): + target_pose(), + controller(""), + planner(""), + recovery_behaviors_length(0), st_recovery_behaviors(), recovery_behaviors(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->target_pose.serialize(outbuffer + offset); + uint32_t length_controller = strlen(this->controller); + varToArr(outbuffer + offset, length_controller); + offset += 4; + memcpy(outbuffer + offset, this->controller, length_controller); + offset += length_controller; + uint32_t length_planner = strlen(this->planner); + varToArr(outbuffer + offset, length_planner); + offset += 4; + memcpy(outbuffer + offset, this->planner, length_planner); + offset += length_planner; + *(outbuffer + offset + 0) = (this->recovery_behaviors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->recovery_behaviors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->recovery_behaviors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->recovery_behaviors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->recovery_behaviors_length); + for( uint32_t i = 0; i < recovery_behaviors_length; i++){ + uint32_t length_recovery_behaviorsi = strlen(this->recovery_behaviors[i]); + varToArr(outbuffer + offset, length_recovery_behaviorsi); + offset += 4; + memcpy(outbuffer + offset, this->recovery_behaviors[i], length_recovery_behaviorsi); + offset += length_recovery_behaviorsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->target_pose.deserialize(inbuffer + offset); + uint32_t length_controller; + arrToVar(length_controller, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_controller; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_controller-1]=0; + this->controller = (char *)(inbuffer + offset-1); + offset += length_controller; + uint32_t length_planner; + arrToVar(length_planner, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_planner; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_planner-1]=0; + this->planner = (char *)(inbuffer + offset-1); + offset += length_planner; + uint32_t recovery_behaviors_lengthT = ((uint32_t) (*(inbuffer + offset))); + recovery_behaviors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + recovery_behaviors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + recovery_behaviors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->recovery_behaviors_length); + if(recovery_behaviors_lengthT > recovery_behaviors_length) + this->recovery_behaviors = (char**)realloc(this->recovery_behaviors, recovery_behaviors_lengthT * sizeof(char*)); + recovery_behaviors_length = recovery_behaviors_lengthT; + for( uint32_t i = 0; i < recovery_behaviors_length; i++){ + uint32_t length_st_recovery_behaviors; + arrToVar(length_st_recovery_behaviors, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_recovery_behaviors; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_recovery_behaviors-1]=0; + this->st_recovery_behaviors = (char *)(inbuffer + offset-1); + offset += length_st_recovery_behaviors; + memcpy( &(this->recovery_behaviors[i]), &(this->st_recovery_behaviors), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "mbf_msgs/MoveBaseGoal"; }; + virtual const char * getMD5() override { return "722601faf59588c53b718bb090b96808"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseResult.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseResult.h new file mode 100644 index 000000000..1d1a6ef41 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/MoveBaseResult.h @@ -0,0 +1,133 @@ +#ifndef _ROS_mbf_msgs_MoveBaseResult_h +#define _ROS_mbf_msgs_MoveBaseResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace mbf_msgs +{ + + class MoveBaseResult : public ros::Msg + { + public: + typedef uint32_t _outcome_type; + _outcome_type outcome; + typedef const char* _message_type; + _message_type message; + typedef float _dist_to_goal_type; + _dist_to_goal_type dist_to_goal; + typedef float _angle_to_goal_type; + _angle_to_goal_type angle_to_goal; + typedef geometry_msgs::PoseStamped _final_pose_type; + _final_pose_type final_pose; + enum { SUCCESS = 0 }; + enum { FAILURE = 10 }; + enum { CANCELED = 11 }; + enum { COLLISION = 12 }; + enum { OSCILLATION = 13 }; + enum { START_BLOCKED = 14 }; + enum { GOAL_BLOCKED = 15 }; + enum { TF_ERROR = 16 }; + enum { INTERNAL_ERROR = 17 }; + enum { PLAN_FAILURE = 50 }; + enum { CTRL_FAILURE = 100 }; + + MoveBaseResult(): + outcome(0), + message(""), + dist_to_goal(0), + angle_to_goal(0), + final_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->outcome >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outcome >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outcome >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outcome >> (8 * 3)) & 0xFF; + offset += sizeof(this->outcome); + uint32_t length_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + union { + float real; + uint32_t base; + } u_dist_to_goal; + u_dist_to_goal.real = this->dist_to_goal; + *(outbuffer + offset + 0) = (u_dist_to_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dist_to_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dist_to_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dist_to_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dist_to_goal); + union { + float real; + uint32_t base; + } u_angle_to_goal; + u_angle_to_goal.real = this->angle_to_goal; + *(outbuffer + offset + 0) = (u_angle_to_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_to_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_to_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_to_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_to_goal); + offset += this->final_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->outcome = ((uint32_t) (*(inbuffer + offset))); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outcome); + 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; + union { + float real; + uint32_t base; + } u_dist_to_goal; + u_dist_to_goal.base = 0; + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dist_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dist_to_goal = u_dist_to_goal.real; + offset += sizeof(this->dist_to_goal); + union { + float real; + uint32_t base; + } u_angle_to_goal; + u_angle_to_goal.base = 0; + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_to_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_to_goal = u_angle_to_goal.real; + offset += sizeof(this->angle_to_goal); + offset += this->final_pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "mbf_msgs/MoveBaseResult"; }; + virtual const char * getMD5() override { return "c65d301ffa20590244253c6a99c37c5e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryAction.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryAction.h new file mode 100644 index 000000000..705ffe309 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_RecoveryAction_h +#define _ROS_mbf_msgs_RecoveryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "mbf_msgs/RecoveryActionGoal.h" +#include "mbf_msgs/RecoveryActionResult.h" +#include "mbf_msgs/RecoveryActionFeedback.h" + +namespace mbf_msgs +{ + + class RecoveryAction : public ros::Msg + { + public: + typedef mbf_msgs::RecoveryActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef mbf_msgs::RecoveryActionResult _action_result_type; + _action_result_type action_result; + typedef mbf_msgs::RecoveryActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + RecoveryAction(): + 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 "mbf_msgs/RecoveryAction"; }; + virtual const char * getMD5() override { return "b35ffa9c1783e3d612414d87fbc80598"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionFeedback.h new file mode 100644 index 000000000..c1b0250b0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_RecoveryActionFeedback_h +#define _ROS_mbf_msgs_RecoveryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "mbf_msgs/RecoveryFeedback.h" + +namespace mbf_msgs +{ + + class RecoveryActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef mbf_msgs::RecoveryFeedback _feedback_type; + _feedback_type feedback; + + RecoveryActionFeedback(): + 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 "mbf_msgs/RecoveryActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionGoal.h new file mode 100644 index 000000000..f98e9136d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_RecoveryActionGoal_h +#define _ROS_mbf_msgs_RecoveryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "mbf_msgs/RecoveryGoal.h" + +namespace mbf_msgs +{ + + class RecoveryActionGoal : 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 mbf_msgs::RecoveryGoal _goal_type; + _goal_type goal; + + RecoveryActionGoal(): + 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 "mbf_msgs/RecoveryActionGoal"; }; + virtual const char * getMD5() override { return "3a9f8ac70c8c2835fd7b695b2437b7ef"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionResult.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionResult.h new file mode 100644 index 000000000..3431e99e6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mbf_msgs_RecoveryActionResult_h +#define _ROS_mbf_msgs_RecoveryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "mbf_msgs/RecoveryResult.h" + +namespace mbf_msgs +{ + + class RecoveryActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef mbf_msgs::RecoveryResult _result_type; + _result_type result; + + RecoveryActionResult(): + 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 "mbf_msgs/RecoveryActionResult"; }; + virtual const char * getMD5() override { return "cae6c01476f7c64808fc85f9972a982e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryFeedback.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryFeedback.h new file mode 100644 index 000000000..3bc5c6212 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_mbf_msgs_RecoveryFeedback_h +#define _ROS_mbf_msgs_RecoveryFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mbf_msgs +{ + + class RecoveryFeedback : public ros::Msg + { + public: + + RecoveryFeedback() + { + } + + 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 "mbf_msgs/RecoveryFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryGoal.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryGoal.h new file mode 100644 index 000000000..ebc79859e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryGoal.h @@ -0,0 +1,62 @@ +#ifndef _ROS_mbf_msgs_RecoveryGoal_h +#define _ROS_mbf_msgs_RecoveryGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mbf_msgs +{ + + class RecoveryGoal : public ros::Msg + { + public: + typedef const char* _behavior_type; + _behavior_type behavior; + typedef uint8_t _concurrency_slot_type; + _concurrency_slot_type concurrency_slot; + + RecoveryGoal(): + behavior(""), + concurrency_slot(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_behavior = strlen(this->behavior); + varToArr(outbuffer + offset, length_behavior); + offset += 4; + memcpy(outbuffer + offset, this->behavior, length_behavior); + offset += length_behavior; + *(outbuffer + offset + 0) = (this->concurrency_slot >> (8 * 0)) & 0xFF; + offset += sizeof(this->concurrency_slot); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_behavior; + arrToVar(length_behavior, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_behavior; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_behavior-1]=0; + this->behavior = (char *)(inbuffer + offset-1); + offset += length_behavior; + this->concurrency_slot = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->concurrency_slot); + return offset; + } + + virtual const char * getType() override { return "mbf_msgs/RecoveryGoal"; }; + virtual const char * getMD5() override { return "ce28884316a172b85e57b78a84014451"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryResult.h b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryResult.h new file mode 100644 index 000000000..12891e68d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mbf_msgs/RecoveryResult.h @@ -0,0 +1,95 @@ +#ifndef _ROS_mbf_msgs_RecoveryResult_h +#define _ROS_mbf_msgs_RecoveryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mbf_msgs +{ + + class RecoveryResult : public ros::Msg + { + public: + typedef uint32_t _outcome_type; + _outcome_type outcome; + typedef const char* _message_type; + _message_type message; + typedef const char* _used_plugin_type; + _used_plugin_type used_plugin; + enum { SUCCESS = 0 }; + enum { FAILURE = 150 }; + enum { CANCELED = 151 }; + enum { PAT_EXCEEDED = 152 }; + enum { TF_ERROR = 153 }; + enum { NOT_INITIALIZED = 154 }; + enum { INVALID_PLUGIN = 155 }; + enum { INTERNAL_ERROR = 156 }; + enum { STOPPED = 157 }; + enum { IMPASSABLE = 158 }; + + RecoveryResult(): + outcome(0), + message(""), + used_plugin("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->outcome >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outcome >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outcome >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outcome >> (8 * 3)) & 0xFF; + offset += sizeof(this->outcome); + uint32_t length_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + uint32_t length_used_plugin = strlen(this->used_plugin); + varToArr(outbuffer + offset, length_used_plugin); + offset += 4; + memcpy(outbuffer + offset, this->used_plugin, length_used_plugin); + offset += length_used_plugin; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->outcome = ((uint32_t) (*(inbuffer + offset))); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->outcome |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outcome); + 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; + uint32_t length_used_plugin; + arrToVar(length_used_plugin, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_used_plugin; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_used_plugin-1]=0; + this->used_plugin = (char *)(inbuffer + offset-1); + offset += length_used_plugin; + return offset; + } + + virtual const char * getType() override { return "mbf_msgs/RecoveryResult"; }; + virtual const char * getMD5() override { return "41d522f528f315af4a6c19e2fde7a3d0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/microstrain_3dmgx2_imu/AddOffset.h b/smart_device_protocol/ros_lib/ros_lib/microstrain_3dmgx2_imu/AddOffset.h new file mode 100644 index 000000000..7d16fd9b2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/microstrain_3dmgx2_imu/AddOffset.h @@ -0,0 +1,80 @@ +#ifndef _ROS_SERVICE_AddOffset_h +#define _ROS_SERVICE_AddOffset_h +#include +#include +#include +#include "ros/msg.h" + +namespace microstrain_3dmgx2_imu +{ + +static const char ADDOFFSET[] = "microstrain_3dmgx2_imu/AddOffset"; + + class AddOffsetRequest : public ros::Msg + { + public: + typedef float _add_offset_type; + _add_offset_type add_offset; + + AddOffsetRequest(): + add_offset(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->add_offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->add_offset)); + return offset; + } + + virtual const char * getType() override { return ADDOFFSET; }; + virtual const char * getMD5() override { return "10fe27c5d4591264b9d05acc7497a18a"; }; + + }; + + class AddOffsetResponse : public ros::Msg + { + public: + typedef float _total_offset_type; + _total_offset_type total_offset; + + AddOffsetResponse(): + total_offset(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->total_offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->total_offset)); + return offset; + } + + virtual const char * getType() override { return ADDOFFSET; }; + virtual const char * getMD5() override { return "5dea42ce4656fada4736ce3508b56aca"; }; + + }; + + class AddOffset { + public: + typedef AddOffsetRequest Request; + typedef AddOffsetResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store/GetParam.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store/GetParam.h new file mode 100644 index 000000000..6aac79084 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store/GetParam.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_GetParam_h +#define _ROS_SERVICE_GetParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store +{ + +static const char GETPARAM[] = "mongodb_store/GetParam"; + + class GetParamRequest : public ros::Msg + { + public: + typedef const char* _param_name_type; + _param_name_type param_name; + + GetParamRequest(): + param_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_param_name = strlen(this->param_name); + varToArr(outbuffer + offset, length_param_name); + offset += 4; + memcpy(outbuffer + offset, this->param_name, length_param_name); + offset += length_param_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_param_name; + arrToVar(length_param_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_param_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_param_name-1]=0; + this->param_name = (char *)(inbuffer + offset-1); + offset += length_param_name; + return offset; + } + + virtual const char * getType() override { return GETPARAM; }; + virtual const char * getMD5() override { return "b381fd4edcffd7ff5b5a7e1630491a17"; }; + + }; + + class GetParamResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _param_value_type; + _param_value_type param_value; + + GetParamResponse(): + success(0), + param_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); + uint32_t length_param_value = strlen(this->param_value); + varToArr(outbuffer + offset, length_param_value); + offset += 4; + memcpy(outbuffer + offset, this->param_value, length_param_value); + offset += length_param_value; + 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_param_value; + arrToVar(length_param_value, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_param_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_param_value-1]=0; + this->param_value = (char *)(inbuffer + offset-1); + offset += length_param_value; + return offset; + } + + virtual const char * getType() override { return GETPARAM; }; + virtual const char * getMD5() override { return "bfcec4af20d6b267ef6ee8d3934547c3"; }; + + }; + + class GetParam { + public: + typedef GetParamRequest Request; + typedef GetParamResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoFind.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoFind.h new file mode 100644 index 000000000..696a53fa4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoFind.h @@ -0,0 +1,138 @@ +#ifndef _ROS_SERVICE_MongoFind_h +#define _ROS_SERVICE_MongoFind_h +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store +{ + +static const char MONGOFIND[] = "mongodb_store/MongoFind"; + + class MongoFindRequest : public ros::Msg + { + public: + typedef const char* _db_type; + _db_type db; + typedef const char* _collection_type; + _collection_type collection; + typedef const char* _query_type; + _query_type query; + + MongoFindRequest(): + db(""), + collection(""), + query("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_db = strlen(this->db); + varToArr(outbuffer + offset, length_db); + offset += 4; + memcpy(outbuffer + offset, this->db, length_db); + offset += length_db; + uint32_t length_collection = strlen(this->collection); + varToArr(outbuffer + offset, length_collection); + offset += 4; + memcpy(outbuffer + offset, this->collection, length_collection); + offset += length_collection; + uint32_t length_query = strlen(this->query); + varToArr(outbuffer + offset, length_query); + offset += 4; + memcpy(outbuffer + offset, this->query, length_query); + offset += length_query; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_db; + arrToVar(length_db, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_db; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_db-1]=0; + this->db = (char *)(inbuffer + offset-1); + offset += length_db; + uint32_t length_collection; + arrToVar(length_collection, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collection; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collection-1]=0; + this->collection = (char *)(inbuffer + offset-1); + offset += length_collection; + uint32_t length_query; + arrToVar(length_query, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_query; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_query-1]=0; + this->query = (char *)(inbuffer + offset-1); + offset += length_query; + return offset; + } + + virtual const char * getType() override { return MONGOFIND; }; + virtual const char * getMD5() override { return "bfbcacecc78c9fa4f520fc6e13cbb788"; }; + + }; + + class MongoFindResponse : public ros::Msg + { + public: + typedef const char* _result_type; + _result_type result; + + MongoFindResponse(): + result("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_result = strlen(this->result); + varToArr(outbuffer + offset, length_result); + offset += 4; + memcpy(outbuffer + offset, this->result, length_result); + offset += length_result; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_result; + arrToVar(length_result, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_result; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_result-1]=0; + this->result = (char *)(inbuffer + offset-1); + offset += length_result; + return offset; + } + + virtual const char * getType() override { return MONGOFIND; }; + virtual const char * getMD5() override { return "c22f2a1ed8654a0b365f1bb3f7ff2c0f"; }; + + }; + + class MongoFind { + public: + typedef MongoFindRequest Request; + typedef MongoFindResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoInsert.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoInsert.h new file mode 100644 index 000000000..490187875 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoInsert.h @@ -0,0 +1,138 @@ +#ifndef _ROS_SERVICE_MongoInsert_h +#define _ROS_SERVICE_MongoInsert_h +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store +{ + +static const char MONGOINSERT[] = "mongodb_store/MongoInsert"; + + class MongoInsertRequest : public ros::Msg + { + public: + typedef const char* _db_type; + _db_type db; + typedef const char* _collection_type; + _collection_type collection; + typedef const char* _document_type; + _document_type document; + + MongoInsertRequest(): + db(""), + collection(""), + document("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_db = strlen(this->db); + varToArr(outbuffer + offset, length_db); + offset += 4; + memcpy(outbuffer + offset, this->db, length_db); + offset += length_db; + uint32_t length_collection = strlen(this->collection); + varToArr(outbuffer + offset, length_collection); + offset += 4; + memcpy(outbuffer + offset, this->collection, length_collection); + offset += length_collection; + uint32_t length_document = strlen(this->document); + varToArr(outbuffer + offset, length_document); + offset += 4; + memcpy(outbuffer + offset, this->document, length_document); + offset += length_document; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_db; + arrToVar(length_db, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_db; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_db-1]=0; + this->db = (char *)(inbuffer + offset-1); + offset += length_db; + uint32_t length_collection; + arrToVar(length_collection, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collection; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collection-1]=0; + this->collection = (char *)(inbuffer + offset-1); + offset += length_collection; + uint32_t length_document; + arrToVar(length_document, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_document; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_document-1]=0; + this->document = (char *)(inbuffer + offset-1); + offset += length_document; + return offset; + } + + virtual const char * getType() override { return MONGOINSERT; }; + virtual const char * getMD5() override { return "370f65c72e031302f4aca6bcf64817f9"; }; + + }; + + class MongoInsertResponse : public ros::Msg + { + public: + typedef const char* _result_type; + _result_type result; + + MongoInsertResponse(): + result("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_result = strlen(this->result); + varToArr(outbuffer + offset, length_result); + offset += 4; + memcpy(outbuffer + offset, this->result, length_result); + offset += length_result; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_result; + arrToVar(length_result, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_result; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_result-1]=0; + this->result = (char *)(inbuffer + offset-1); + offset += length_result; + return offset; + } + + virtual const char * getType() override { return MONGOINSERT; }; + virtual const char * getMD5() override { return "c22f2a1ed8654a0b365f1bb3f7ff2c0f"; }; + + }; + + class MongoInsert { + public: + typedef MongoInsertRequest Request; + typedef MongoInsertResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoUpdate.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoUpdate.h new file mode 100644 index 000000000..6f3cb3787 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store/MongoUpdate.h @@ -0,0 +1,155 @@ +#ifndef _ROS_SERVICE_MongoUpdate_h +#define _ROS_SERVICE_MongoUpdate_h +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store +{ + +static const char MONGOUPDATE[] = "mongodb_store/MongoUpdate"; + + class MongoUpdateRequest : public ros::Msg + { + public: + typedef const char* _db_type; + _db_type db; + typedef const char* _collection_type; + _collection_type collection; + typedef const char* _query_type; + _query_type query; + typedef const char* _update_type; + _update_type update; + + MongoUpdateRequest(): + db(""), + collection(""), + query(""), + update("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_db = strlen(this->db); + varToArr(outbuffer + offset, length_db); + offset += 4; + memcpy(outbuffer + offset, this->db, length_db); + offset += length_db; + uint32_t length_collection = strlen(this->collection); + varToArr(outbuffer + offset, length_collection); + offset += 4; + memcpy(outbuffer + offset, this->collection, length_collection); + offset += length_collection; + uint32_t length_query = strlen(this->query); + varToArr(outbuffer + offset, length_query); + offset += 4; + memcpy(outbuffer + offset, this->query, length_query); + offset += length_query; + uint32_t length_update = strlen(this->update); + varToArr(outbuffer + offset, length_update); + offset += 4; + memcpy(outbuffer + offset, this->update, length_update); + offset += length_update; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_db; + arrToVar(length_db, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_db; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_db-1]=0; + this->db = (char *)(inbuffer + offset-1); + offset += length_db; + uint32_t length_collection; + arrToVar(length_collection, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collection; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collection-1]=0; + this->collection = (char *)(inbuffer + offset-1); + offset += length_collection; + uint32_t length_query; + arrToVar(length_query, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_query; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_query-1]=0; + this->query = (char *)(inbuffer + offset-1); + offset += length_query; + uint32_t length_update; + arrToVar(length_update, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_update; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_update-1]=0; + this->update = (char *)(inbuffer + offset-1); + offset += length_update; + return offset; + } + + virtual const char * getType() override { return MONGOUPDATE; }; + virtual const char * getMD5() override { return "2b149bc6a0fea76ae96dfb48fcf24065"; }; + + }; + + class MongoUpdateResponse : public ros::Msg + { + public: + typedef const char* _result_type; + _result_type result; + + MongoUpdateResponse(): + result("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_result = strlen(this->result); + varToArr(outbuffer + offset, length_result); + offset += 4; + memcpy(outbuffer + offset, this->result, length_result); + offset += length_result; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_result; + arrToVar(length_result, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_result; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_result-1]=0; + this->result = (char *)(inbuffer + offset-1); + offset += length_result; + return offset; + } + + virtual const char * getType() override { return MONGOUPDATE; }; + virtual const char * getMD5() override { return "c22f2a1ed8654a0b365f1bb3f7ff2c0f"; }; + + }; + + class MongoUpdate { + public: + typedef MongoUpdateRequest Request; + typedef MongoUpdateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store/SetParam.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store/SetParam.h new file mode 100644 index 000000000..fd1be8a96 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store/SetParam.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_SetParam_h +#define _ROS_SERVICE_SetParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store +{ + +static const char SETPARAM[] = "mongodb_store/SetParam"; + + class SetParamRequest : public ros::Msg + { + public: + typedef const char* _param_type; + _param_type param; + + SetParamRequest(): + param("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_param = strlen(this->param); + varToArr(outbuffer + offset, length_param); + offset += 4; + memcpy(outbuffer + offset, this->param, length_param); + offset += length_param; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_param; + arrToVar(length_param, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_param; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_param-1]=0; + this->param = (char *)(inbuffer + offset-1); + offset += length_param; + return offset; + } + + virtual const char * getType() override { return SETPARAM; }; + virtual const char * getMD5() override { return "eb04b7504512676dca105ab8842899a4"; }; + + }; + + class SetParamResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + SetParamResponse(): + 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 SETPARAM; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SetParam { + public: + typedef SetParamRequest Request; + typedef SetParamResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/Insert.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/Insert.h new file mode 100644 index 000000000..a832ac00c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/Insert.h @@ -0,0 +1,84 @@ +#ifndef _ROS_mongodb_store_msgs_Insert_h +#define _ROS_mongodb_store_msgs_Insert_h + +#include +#include +#include +#include "ros/msg.h" +#include "mongodb_store_msgs/SerialisedMessage.h" +#include "mongodb_store_msgs/StringPairList.h" + +namespace mongodb_store_msgs +{ + + class Insert : public ros::Msg + { + public: + typedef const char* _database_type; + _database_type database; + typedef const char* _collection_type; + _collection_type collection; + typedef mongodb_store_msgs::SerialisedMessage _message_type; + _message_type message; + typedef mongodb_store_msgs::StringPairList _meta_type; + _meta_type meta; + + Insert(): + database(""), + collection(""), + message(), + meta() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_database = strlen(this->database); + varToArr(outbuffer + offset, length_database); + offset += 4; + memcpy(outbuffer + offset, this->database, length_database); + offset += length_database; + uint32_t length_collection = strlen(this->collection); + varToArr(outbuffer + offset, length_collection); + offset += 4; + memcpy(outbuffer + offset, this->collection, length_collection); + offset += length_collection; + offset += this->message.serialize(outbuffer + offset); + offset += this->meta.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_database; + arrToVar(length_database, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_database; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_database-1]=0; + this->database = (char *)(inbuffer + offset-1); + offset += length_database; + uint32_t length_collection; + arrToVar(length_collection, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collection; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collection-1]=0; + this->collection = (char *)(inbuffer + offset-1); + offset += length_collection; + offset += this->message.deserialize(inbuffer + offset); + offset += this->meta.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "mongodb_store_msgs/Insert"; }; + virtual const char * getMD5() override { return "d071b179071167c692331b5356e30470"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoDeleteMsg.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoDeleteMsg.h new file mode 100644 index 000000000..c51174b41 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoDeleteMsg.h @@ -0,0 +1,139 @@ +#ifndef _ROS_SERVICE_MongoDeleteMsg_h +#define _ROS_SERVICE_MongoDeleteMsg_h +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store_msgs +{ + +static const char MONGODELETEMSG[] = "mongodb_store_msgs/MongoDeleteMsg"; + + class MongoDeleteMsgRequest : public ros::Msg + { + public: + typedef const char* _database_type; + _database_type database; + typedef const char* _collection_type; + _collection_type collection; + typedef const char* _document_id_type; + _document_id_type document_id; + + MongoDeleteMsgRequest(): + database(""), + collection(""), + document_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_database = strlen(this->database); + varToArr(outbuffer + offset, length_database); + offset += 4; + memcpy(outbuffer + offset, this->database, length_database); + offset += length_database; + uint32_t length_collection = strlen(this->collection); + varToArr(outbuffer + offset, length_collection); + offset += 4; + memcpy(outbuffer + offset, this->collection, length_collection); + offset += length_collection; + uint32_t length_document_id = strlen(this->document_id); + varToArr(outbuffer + offset, length_document_id); + offset += 4; + memcpy(outbuffer + offset, this->document_id, length_document_id); + offset += length_document_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_database; + arrToVar(length_database, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_database; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_database-1]=0; + this->database = (char *)(inbuffer + offset-1); + offset += length_database; + uint32_t length_collection; + arrToVar(length_collection, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collection; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collection-1]=0; + this->collection = (char *)(inbuffer + offset-1); + offset += length_collection; + uint32_t length_document_id; + arrToVar(length_document_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_document_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_document_id-1]=0; + this->document_id = (char *)(inbuffer + offset-1); + offset += length_document_id; + return offset; + } + + virtual const char * getType() override { return MONGODELETEMSG; }; + virtual const char * getMD5() override { return "8db26da88c264ed1aced8ce3427e0db0"; }; + + }; + + class MongoDeleteMsgResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + MongoDeleteMsgResponse(): + 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 MONGODELETEMSG; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class MongoDeleteMsg { + public: + typedef MongoDeleteMsgRequest Request; + typedef MongoDeleteMsgResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoInsertMsg.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoInsertMsg.h new file mode 100644 index 000000000..68889776a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoInsertMsg.h @@ -0,0 +1,133 @@ +#ifndef _ROS_SERVICE_MongoInsertMsg_h +#define _ROS_SERVICE_MongoInsertMsg_h +#include +#include +#include +#include "ros/msg.h" +#include "mongodb_store_msgs/StringPairList.h" +#include "mongodb_store_msgs/SerialisedMessage.h" + +namespace mongodb_store_msgs +{ + +static const char MONGOINSERTMSG[] = "mongodb_store_msgs/MongoInsertMsg"; + + class MongoInsertMsgRequest : public ros::Msg + { + public: + typedef const char* _database_type; + _database_type database; + typedef const char* _collection_type; + _collection_type collection; + typedef mongodb_store_msgs::SerialisedMessage _message_type; + _message_type message; + typedef mongodb_store_msgs::StringPairList _meta_type; + _meta_type meta; + + MongoInsertMsgRequest(): + database(""), + collection(""), + message(), + meta() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_database = strlen(this->database); + varToArr(outbuffer + offset, length_database); + offset += 4; + memcpy(outbuffer + offset, this->database, length_database); + offset += length_database; + uint32_t length_collection = strlen(this->collection); + varToArr(outbuffer + offset, length_collection); + offset += 4; + memcpy(outbuffer + offset, this->collection, length_collection); + offset += length_collection; + offset += this->message.serialize(outbuffer + offset); + offset += this->meta.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_database; + arrToVar(length_database, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_database; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_database-1]=0; + this->database = (char *)(inbuffer + offset-1); + offset += length_database; + uint32_t length_collection; + arrToVar(length_collection, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collection; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collection-1]=0; + this->collection = (char *)(inbuffer + offset-1); + offset += length_collection; + offset += this->message.deserialize(inbuffer + offset); + offset += this->meta.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return MONGOINSERTMSG; }; + virtual const char * getMD5() override { return "d071b179071167c692331b5356e30470"; }; + + }; + + class MongoInsertMsgResponse : public ros::Msg + { + public: + typedef const char* _id_type; + _id_type id; + + MongoInsertMsgResponse(): + id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_id = strlen(this->id); + varToArr(outbuffer + offset, length_id); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return MONGOINSERTMSG; }; + virtual const char * getMD5() override { return "bbfcda76036ebbe3d36caf7af80b260c"; }; + + }; + + class MongoInsertMsg { + public: + typedef MongoInsertMsgRequest Request; + typedef MongoInsertMsgResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoQueryMsg.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoQueryMsg.h new file mode 100644 index 000000000..6c5e0f438 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoQueryMsg.h @@ -0,0 +1,221 @@ +#ifndef _ROS_SERVICE_MongoQueryMsg_h +#define _ROS_SERVICE_MongoQueryMsg_h +#include +#include +#include +#include "ros/msg.h" +#include "mongodb_store_msgs/StringPairList.h" +#include "mongodb_store_msgs/SerialisedMessage.h" + +namespace mongodb_store_msgs +{ + +static const char MONGOQUERYMSG[] = "mongodb_store_msgs/MongoQueryMsg"; + + class MongoQueryMsgRequest : public ros::Msg + { + public: + typedef const char* _database_type; + _database_type database; + typedef const char* _collection_type; + _collection_type collection; + typedef const char* _type_type; + _type_type type; + typedef bool _single_type; + _single_type single; + typedef uint16_t _limit_type; + _limit_type limit; + typedef mongodb_store_msgs::StringPairList _message_query_type; + _message_query_type message_query; + typedef mongodb_store_msgs::StringPairList _meta_query_type; + _meta_query_type meta_query; + typedef mongodb_store_msgs::StringPairList _sort_query_type; + _sort_query_type sort_query; + typedef mongodb_store_msgs::StringPairList _projection_query_type; + _projection_query_type projection_query; + enum { JSON_QUERY = "jnsdfskajd_fmgs.dlf" }; + + MongoQueryMsgRequest(): + database(""), + collection(""), + type(""), + single(0), + limit(0), + message_query(), + meta_query(), + sort_query(), + projection_query() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_database = strlen(this->database); + varToArr(outbuffer + offset, length_database); + offset += 4; + memcpy(outbuffer + offset, this->database, length_database); + offset += length_database; + uint32_t length_collection = strlen(this->collection); + varToArr(outbuffer + offset, length_collection); + offset += 4; + memcpy(outbuffer + offset, this->collection, length_collection); + offset += length_collection; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + union { + bool real; + uint8_t base; + } u_single; + u_single.real = this->single; + *(outbuffer + offset + 0) = (u_single.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->single); + *(outbuffer + offset + 0) = (this->limit >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->limit >> (8 * 1)) & 0xFF; + offset += sizeof(this->limit); + offset += this->message_query.serialize(outbuffer + offset); + offset += this->meta_query.serialize(outbuffer + offset); + offset += this->sort_query.serialize(outbuffer + offset); + offset += this->projection_query.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_database; + arrToVar(length_database, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_database; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_database-1]=0; + this->database = (char *)(inbuffer + offset-1); + offset += length_database; + uint32_t length_collection; + arrToVar(length_collection, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collection; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collection-1]=0; + this->collection = (char *)(inbuffer + offset-1); + offset += length_collection; + 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; + union { + bool real; + uint8_t base; + } u_single; + u_single.base = 0; + u_single.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->single = u_single.real; + offset += sizeof(this->single); + this->limit = ((uint16_t) (*(inbuffer + offset))); + this->limit |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->limit); + offset += this->message_query.deserialize(inbuffer + offset); + offset += this->meta_query.deserialize(inbuffer + offset); + offset += this->sort_query.deserialize(inbuffer + offset); + offset += this->projection_query.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return MONGOQUERYMSG; }; + virtual const char * getMD5() override { return "3dce95387658eb89ce25e603efe525cd"; }; + + }; + + class MongoQueryMsgResponse : public ros::Msg + { + public: + uint32_t messages_length; + typedef mongodb_store_msgs::SerialisedMessage _messages_type; + _messages_type st_messages; + _messages_type * messages; + uint32_t metas_length; + typedef mongodb_store_msgs::StringPairList _metas_type; + _metas_type st_metas; + _metas_type * metas; + + MongoQueryMsgResponse(): + messages_length(0), st_messages(), messages(nullptr), + metas_length(0), st_metas(), metas(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->messages_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->messages_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->messages_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->messages_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->messages_length); + for( uint32_t i = 0; i < messages_length; i++){ + offset += this->messages[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->metas_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->metas_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->metas_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->metas_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->metas_length); + for( uint32_t i = 0; i < metas_length; i++){ + offset += this->metas[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t messages_lengthT = ((uint32_t) (*(inbuffer + offset))); + messages_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + messages_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + messages_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->messages_length); + if(messages_lengthT > messages_length) + this->messages = (mongodb_store_msgs::SerialisedMessage*)realloc(this->messages, messages_lengthT * sizeof(mongodb_store_msgs::SerialisedMessage)); + messages_length = messages_lengthT; + for( uint32_t i = 0; i < messages_length; i++){ + offset += this->st_messages.deserialize(inbuffer + offset); + memcpy( &(this->messages[i]), &(this->st_messages), sizeof(mongodb_store_msgs::SerialisedMessage)); + } + uint32_t metas_lengthT = ((uint32_t) (*(inbuffer + offset))); + metas_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + metas_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + metas_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->metas_length); + if(metas_lengthT > metas_length) + this->metas = (mongodb_store_msgs::StringPairList*)realloc(this->metas, metas_lengthT * sizeof(mongodb_store_msgs::StringPairList)); + metas_length = metas_lengthT; + for( uint32_t i = 0; i < metas_length; i++){ + offset += this->st_metas.deserialize(inbuffer + offset); + memcpy( &(this->metas[i]), &(this->st_metas), sizeof(mongodb_store_msgs::StringPairList)); + } + return offset; + } + + virtual const char * getType() override { return MONGOQUERYMSG; }; + virtual const char * getMD5() override { return "f348d453c2d7347807f66360b61cd0ef"; }; + + }; + + class MongoQueryMsg { + public: + typedef MongoQueryMsgRequest Request; + typedef MongoQueryMsgResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoQuerywithProjectionMsg.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoQuerywithProjectionMsg.h new file mode 100644 index 000000000..558b151ea --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoQuerywithProjectionMsg.h @@ -0,0 +1,221 @@ +#ifndef _ROS_SERVICE_MongoQuerywithProjectionMsg_h +#define _ROS_SERVICE_MongoQuerywithProjectionMsg_h +#include +#include +#include +#include "ros/msg.h" +#include "mongodb_store_msgs/StringPairList.h" +#include "mongodb_store_msgs/SerialisedMessage.h" + +namespace mongodb_store_msgs +{ + +static const char MONGOQUERYWITHPROJECTIONMSG[] = "mongodb_store_msgs/MongoQuerywithProjectionMsg"; + + class MongoQuerywithProjectionMsgRequest : public ros::Msg + { + public: + typedef const char* _database_type; + _database_type database; + typedef const char* _collection_type; + _collection_type collection; + typedef const char* _type_type; + _type_type type; + typedef bool _single_type; + _single_type single; + typedef uint16_t _limit_type; + _limit_type limit; + typedef mongodb_store_msgs::StringPairList _message_query_type; + _message_query_type message_query; + typedef mongodb_store_msgs::StringPairList _meta_query_type; + _meta_query_type meta_query; + typedef mongodb_store_msgs::StringPairList _sort_query_type; + _sort_query_type sort_query; + typedef mongodb_store_msgs::StringPairList _projection_query_type; + _projection_query_type projection_query; + enum { JSON_QUERY = "jnsdfskajd_fmgs.dlf" }; + + MongoQuerywithProjectionMsgRequest(): + database(""), + collection(""), + type(""), + single(0), + limit(0), + message_query(), + meta_query(), + sort_query(), + projection_query() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_database = strlen(this->database); + varToArr(outbuffer + offset, length_database); + offset += 4; + memcpy(outbuffer + offset, this->database, length_database); + offset += length_database; + uint32_t length_collection = strlen(this->collection); + varToArr(outbuffer + offset, length_collection); + offset += 4; + memcpy(outbuffer + offset, this->collection, length_collection); + offset += length_collection; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + union { + bool real; + uint8_t base; + } u_single; + u_single.real = this->single; + *(outbuffer + offset + 0) = (u_single.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->single); + *(outbuffer + offset + 0) = (this->limit >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->limit >> (8 * 1)) & 0xFF; + offset += sizeof(this->limit); + offset += this->message_query.serialize(outbuffer + offset); + offset += this->meta_query.serialize(outbuffer + offset); + offset += this->sort_query.serialize(outbuffer + offset); + offset += this->projection_query.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_database; + arrToVar(length_database, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_database; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_database-1]=0; + this->database = (char *)(inbuffer + offset-1); + offset += length_database; + uint32_t length_collection; + arrToVar(length_collection, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collection; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collection-1]=0; + this->collection = (char *)(inbuffer + offset-1); + offset += length_collection; + 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; + union { + bool real; + uint8_t base; + } u_single; + u_single.base = 0; + u_single.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->single = u_single.real; + offset += sizeof(this->single); + this->limit = ((uint16_t) (*(inbuffer + offset))); + this->limit |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->limit); + offset += this->message_query.deserialize(inbuffer + offset); + offset += this->meta_query.deserialize(inbuffer + offset); + offset += this->sort_query.deserialize(inbuffer + offset); + offset += this->projection_query.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return MONGOQUERYWITHPROJECTIONMSG; }; + virtual const char * getMD5() override { return "3dce95387658eb89ce25e603efe525cd"; }; + + }; + + class MongoQuerywithProjectionMsgResponse : public ros::Msg + { + public: + uint32_t messages_length; + typedef mongodb_store_msgs::SerialisedMessage _messages_type; + _messages_type st_messages; + _messages_type * messages; + uint32_t metas_length; + typedef mongodb_store_msgs::StringPairList _metas_type; + _metas_type st_metas; + _metas_type * metas; + + MongoQuerywithProjectionMsgResponse(): + messages_length(0), st_messages(), messages(nullptr), + metas_length(0), st_metas(), metas(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->messages_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->messages_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->messages_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->messages_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->messages_length); + for( uint32_t i = 0; i < messages_length; i++){ + offset += this->messages[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->metas_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->metas_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->metas_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->metas_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->metas_length); + for( uint32_t i = 0; i < metas_length; i++){ + offset += this->metas[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t messages_lengthT = ((uint32_t) (*(inbuffer + offset))); + messages_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + messages_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + messages_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->messages_length); + if(messages_lengthT > messages_length) + this->messages = (mongodb_store_msgs::SerialisedMessage*)realloc(this->messages, messages_lengthT * sizeof(mongodb_store_msgs::SerialisedMessage)); + messages_length = messages_lengthT; + for( uint32_t i = 0; i < messages_length; i++){ + offset += this->st_messages.deserialize(inbuffer + offset); + memcpy( &(this->messages[i]), &(this->st_messages), sizeof(mongodb_store_msgs::SerialisedMessage)); + } + uint32_t metas_lengthT = ((uint32_t) (*(inbuffer + offset))); + metas_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + metas_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + metas_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->metas_length); + if(metas_lengthT > metas_length) + this->metas = (mongodb_store_msgs::StringPairList*)realloc(this->metas, metas_lengthT * sizeof(mongodb_store_msgs::StringPairList)); + metas_length = metas_lengthT; + for( uint32_t i = 0; i < metas_length; i++){ + offset += this->st_metas.deserialize(inbuffer + offset); + memcpy( &(this->metas[i]), &(this->st_metas), sizeof(mongodb_store_msgs::StringPairList)); + } + return offset; + } + + virtual const char * getType() override { return MONGOQUERYWITHPROJECTIONMSG; }; + virtual const char * getMD5() override { return "f348d453c2d7347807f66360b61cd0ef"; }; + + }; + + class MongoQuerywithProjectionMsg { + public: + typedef MongoQuerywithProjectionMsgRequest Request; + typedef MongoQuerywithProjectionMsgResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoUpdateMsg.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoUpdateMsg.h new file mode 100644 index 000000000..6649224e7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MongoUpdateMsg.h @@ -0,0 +1,179 @@ +#ifndef _ROS_SERVICE_MongoUpdateMsg_h +#define _ROS_SERVICE_MongoUpdateMsg_h +#include +#include +#include +#include "ros/msg.h" +#include "mongodb_store_msgs/StringPairList.h" +#include "mongodb_store_msgs/SerialisedMessage.h" + +namespace mongodb_store_msgs +{ + +static const char MONGOUPDATEMSG[] = "mongodb_store_msgs/MongoUpdateMsg"; + + class MongoUpdateMsgRequest : public ros::Msg + { + public: + typedef const char* _database_type; + _database_type database; + typedef const char* _collection_type; + _collection_type collection; + typedef bool _upsert_type; + _upsert_type upsert; + typedef mongodb_store_msgs::StringPairList _message_query_type; + _message_query_type message_query; + typedef mongodb_store_msgs::StringPairList _meta_query_type; + _meta_query_type meta_query; + typedef mongodb_store_msgs::SerialisedMessage _message_type; + _message_type message; + typedef mongodb_store_msgs::StringPairList _meta_type; + _meta_type meta; + + MongoUpdateMsgRequest(): + database(""), + collection(""), + upsert(0), + message_query(), + meta_query(), + message(), + meta() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_database = strlen(this->database); + varToArr(outbuffer + offset, length_database); + offset += 4; + memcpy(outbuffer + offset, this->database, length_database); + offset += length_database; + uint32_t length_collection = strlen(this->collection); + varToArr(outbuffer + offset, length_collection); + offset += 4; + memcpy(outbuffer + offset, this->collection, length_collection); + offset += length_collection; + union { + bool real; + uint8_t base; + } u_upsert; + u_upsert.real = this->upsert; + *(outbuffer + offset + 0) = (u_upsert.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->upsert); + offset += this->message_query.serialize(outbuffer + offset); + offset += this->meta_query.serialize(outbuffer + offset); + offset += this->message.serialize(outbuffer + offset); + offset += this->meta.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_database; + arrToVar(length_database, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_database; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_database-1]=0; + this->database = (char *)(inbuffer + offset-1); + offset += length_database; + uint32_t length_collection; + arrToVar(length_collection, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collection; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collection-1]=0; + this->collection = (char *)(inbuffer + offset-1); + offset += length_collection; + union { + bool real; + uint8_t base; + } u_upsert; + u_upsert.base = 0; + u_upsert.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->upsert = u_upsert.real; + offset += sizeof(this->upsert); + offset += this->message_query.deserialize(inbuffer + offset); + offset += this->meta_query.deserialize(inbuffer + offset); + offset += this->message.deserialize(inbuffer + offset); + offset += this->meta.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return MONGOUPDATEMSG; }; + virtual const char * getMD5() override { return "5d87a90aa8c3d8f4cf31305f10951711"; }; + + }; + + class MongoUpdateMsgResponse : public ros::Msg + { + public: + typedef const char* _id_type; + _id_type id; + typedef bool _success_type; + _success_type success; + + MongoUpdateMsgResponse(): + id(""), + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_id = strlen(this->id); + varToArr(outbuffer + offset, length_id); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + 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; + 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; + 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 MONGOUPDATEMSG; }; + virtual const char * getMD5() override { return "eb98d6e8d810388b13fa8e5a365eec6a"; }; + + }; + + class MongoUpdateMsg { + public: + typedef MongoUpdateMsgRequest Request; + typedef MongoUpdateMsgResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesAction.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesAction.h new file mode 100644 index 000000000..3c098c324 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mongodb_store_msgs_MoveEntriesAction_h +#define _ROS_mongodb_store_msgs_MoveEntriesAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "mongodb_store_msgs/MoveEntriesActionGoal.h" +#include "mongodb_store_msgs/MoveEntriesActionResult.h" +#include "mongodb_store_msgs/MoveEntriesActionFeedback.h" + +namespace mongodb_store_msgs +{ + + class MoveEntriesAction : public ros::Msg + { + public: + typedef mongodb_store_msgs::MoveEntriesActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef mongodb_store_msgs::MoveEntriesActionResult _action_result_type; + _action_result_type action_result; + typedef mongodb_store_msgs::MoveEntriesActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + MoveEntriesAction(): + 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 "mongodb_store_msgs/MoveEntriesAction"; }; + virtual const char * getMD5() override { return "603d33caf9a321e4af460957d0a9266a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionFeedback.h new file mode 100644 index 000000000..858b70fac --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mongodb_store_msgs_MoveEntriesActionFeedback_h +#define _ROS_mongodb_store_msgs_MoveEntriesActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "mongodb_store_msgs/MoveEntriesFeedback.h" + +namespace mongodb_store_msgs +{ + + class MoveEntriesActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef mongodb_store_msgs::MoveEntriesFeedback _feedback_type; + _feedback_type feedback; + + MoveEntriesActionFeedback(): + 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 "mongodb_store_msgs/MoveEntriesActionFeedback"; }; + virtual const char * getMD5() override { return "6dafd6ecae79e05a072ce163776da775"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionGoal.h new file mode 100644 index 000000000..d89ab33c1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mongodb_store_msgs_MoveEntriesActionGoal_h +#define _ROS_mongodb_store_msgs_MoveEntriesActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "mongodb_store_msgs/MoveEntriesGoal.h" + +namespace mongodb_store_msgs +{ + + class MoveEntriesActionGoal : 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 mongodb_store_msgs::MoveEntriesGoal _goal_type; + _goal_type goal; + + MoveEntriesActionGoal(): + 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 "mongodb_store_msgs/MoveEntriesActionGoal"; }; + virtual const char * getMD5() override { return "8cd0c3d38e1c3ed7bce235f7ebbaf759"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionResult.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionResult.h new file mode 100644 index 000000000..d60990211 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_mongodb_store_msgs_MoveEntriesActionResult_h +#define _ROS_mongodb_store_msgs_MoveEntriesActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "mongodb_store_msgs/MoveEntriesResult.h" + +namespace mongodb_store_msgs +{ + + class MoveEntriesActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef mongodb_store_msgs::MoveEntriesResult _result_type; + _result_type result; + + MoveEntriesActionResult(): + 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 "mongodb_store_msgs/MoveEntriesActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesFeedback.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesFeedback.h new file mode 100644 index 000000000..89fc5f371 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesFeedback.h @@ -0,0 +1,75 @@ +#ifndef _ROS_mongodb_store_msgs_MoveEntriesFeedback_h +#define _ROS_mongodb_store_msgs_MoveEntriesFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store_msgs +{ + + class MoveEntriesFeedback : public ros::Msg + { + public: + uint32_t completed_length; + typedef char* _completed_type; + _completed_type st_completed; + _completed_type * completed; + + MoveEntriesFeedback(): + completed_length(0), st_completed(), completed(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->completed_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->completed_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->completed_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->completed_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->completed_length); + for( uint32_t i = 0; i < completed_length; i++){ + uint32_t length_completedi = strlen(this->completed[i]); + varToArr(outbuffer + offset, length_completedi); + offset += 4; + memcpy(outbuffer + offset, this->completed[i], length_completedi); + offset += length_completedi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t completed_lengthT = ((uint32_t) (*(inbuffer + offset))); + completed_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + completed_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + completed_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->completed_length); + if(completed_lengthT > completed_length) + this->completed = (char**)realloc(this->completed, completed_lengthT * sizeof(char*)); + completed_length = completed_lengthT; + for( uint32_t i = 0; i < completed_length; i++){ + uint32_t length_st_completed; + arrToVar(length_st_completed, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_completed; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_completed-1]=0; + this->st_completed = (char *)(inbuffer + offset-1); + offset += length_st_completed; + memcpy( &(this->completed[i]), &(this->st_completed), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "mongodb_store_msgs/MoveEntriesFeedback"; }; + virtual const char * getMD5() override { return "a62bad29223cd7da9d6f04397aee5b94"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesGoal.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesGoal.h new file mode 100644 index 000000000..82d1710f6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesGoal.h @@ -0,0 +1,109 @@ +#ifndef _ROS_mongodb_store_msgs_MoveEntriesGoal_h +#define _ROS_mongodb_store_msgs_MoveEntriesGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "mongodb_store_msgs/StringList.h" +#include "ros/duration.h" +#include "mongodb_store_msgs/StringPairList.h" + +namespace mongodb_store_msgs +{ + + class MoveEntriesGoal : public ros::Msg + { + public: + typedef const char* _database_type; + _database_type database; + typedef mongodb_store_msgs::StringList _collections_type; + _collections_type collections; + typedef ros::Duration _move_before_type; + _move_before_type move_before; + typedef bool _delete_after_move_type; + _delete_after_move_type delete_after_move; + typedef mongodb_store_msgs::StringPairList _query_type; + _query_type query; + + MoveEntriesGoal(): + database(""), + collections(), + move_before(), + delete_after_move(0), + query() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_database = strlen(this->database); + varToArr(outbuffer + offset, length_database); + offset += 4; + memcpy(outbuffer + offset, this->database, length_database); + offset += length_database; + offset += this->collections.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->move_before.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->move_before.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->move_before.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->move_before.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->move_before.sec); + *(outbuffer + offset + 0) = (this->move_before.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->move_before.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->move_before.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->move_before.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->move_before.nsec); + union { + bool real; + uint8_t base; + } u_delete_after_move; + u_delete_after_move.real = this->delete_after_move; + *(outbuffer + offset + 0) = (u_delete_after_move.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->delete_after_move); + offset += this->query.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_database; + arrToVar(length_database, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_database; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_database-1]=0; + this->database = (char *)(inbuffer + offset-1); + offset += length_database; + offset += this->collections.deserialize(inbuffer + offset); + this->move_before.sec = ((uint32_t) (*(inbuffer + offset))); + this->move_before.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->move_before.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->move_before.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->move_before.sec); + this->move_before.nsec = ((uint32_t) (*(inbuffer + offset))); + this->move_before.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->move_before.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->move_before.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->move_before.nsec); + union { + bool real; + uint8_t base; + } u_delete_after_move; + u_delete_after_move.base = 0; + u_delete_after_move.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->delete_after_move = u_delete_after_move.real; + offset += sizeof(this->delete_after_move); + offset += this->query.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "mongodb_store_msgs/MoveEntriesGoal"; }; + virtual const char * getMD5() override { return "48aa6e70c15714ce3dfa1b8f64da4ec6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesResult.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesResult.h new file mode 100644 index 000000000..0f1649aaf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/MoveEntriesResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_mongodb_store_msgs_MoveEntriesResult_h +#define _ROS_mongodb_store_msgs_MoveEntriesResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store_msgs +{ + + class MoveEntriesResult : public ros::Msg + { + public: + + MoveEntriesResult() + { + } + + 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 "mongodb_store_msgs/MoveEntriesResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/SerialisedMessage.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/SerialisedMessage.h new file mode 100644 index 000000000..21a3b6cbf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/SerialisedMessage.h @@ -0,0 +1,82 @@ +#ifndef _ROS_mongodb_store_msgs_SerialisedMessage_h +#define _ROS_mongodb_store_msgs_SerialisedMessage_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store_msgs +{ + + class SerialisedMessage : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + uint32_t msg_length; + typedef uint8_t _msg_type; + _msg_type st_msg; + _msg_type * msg; + + SerialisedMessage(): + type(""), + msg_length(0), st_msg(), msg(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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->msg_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->msg_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->msg_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->msg_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->msg_length); + for( uint32_t i = 0; i < msg_length; i++){ + *(outbuffer + offset + 0) = (this->msg[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->msg[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 msg_lengthT = ((uint32_t) (*(inbuffer + offset))); + msg_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + msg_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + msg_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->msg_length); + if(msg_lengthT > msg_length) + this->msg = (uint8_t*)realloc(this->msg, msg_lengthT * sizeof(uint8_t)); + msg_length = msg_lengthT; + for( uint32_t i = 0; i < msg_length; i++){ + this->st_msg = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_msg); + memcpy( &(this->msg[i]), &(this->st_msg), sizeof(uint8_t)); + } + return offset; + } + + virtual const char * getType() override { return "mongodb_store_msgs/SerialisedMessage"; }; + virtual const char * getMD5() override { return "42f77e70b6ff70f99d1597d836874cfc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringList.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringList.h new file mode 100644 index 000000000..0f9688b14 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringList.h @@ -0,0 +1,75 @@ +#ifndef _ROS_mongodb_store_msgs_StringList_h +#define _ROS_mongodb_store_msgs_StringList_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store_msgs +{ + + class StringList : public ros::Msg + { + public: + uint32_t data_length; + typedef char* _data_type; + _data_type st_data; + _data_type * data; + + StringList(): + 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++){ + uint32_t length_datai = strlen(this->data[i]); + varToArr(outbuffer + offset, length_datai); + offset += 4; + memcpy(outbuffer + offset, this->data[i], length_datai); + offset += length_datai; + } + 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 = (char**)realloc(this->data, data_lengthT * sizeof(char*)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + uint32_t length_st_data; + arrToVar(length_st_data, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_data-1]=0; + this->st_data = (char *)(inbuffer + offset-1); + offset += length_st_data; + memcpy( &(this->data[i]), &(this->st_data), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "mongodb_store_msgs/StringList"; }; + virtual const char * getMD5() override { return "cce5a364f3a3be12c9722c6dcad2fa94"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringPair.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringPair.h new file mode 100644 index 000000000..c8f5c69ff --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringPair.h @@ -0,0 +1,72 @@ +#ifndef _ROS_mongodb_store_msgs_StringPair_h +#define _ROS_mongodb_store_msgs_StringPair_h + +#include +#include +#include +#include "ros/msg.h" + +namespace mongodb_store_msgs +{ + + class StringPair : public ros::Msg + { + public: + typedef const char* _first_type; + _first_type first; + typedef const char* _second_type; + _second_type second; + + StringPair(): + first(""), + second("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_first = strlen(this->first); + varToArr(outbuffer + offset, length_first); + offset += 4; + memcpy(outbuffer + offset, this->first, length_first); + offset += length_first; + uint32_t length_second = strlen(this->second); + varToArr(outbuffer + offset, length_second); + offset += 4; + memcpy(outbuffer + offset, this->second, length_second); + offset += length_second; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_first; + arrToVar(length_first, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_first; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_first-1]=0; + this->first = (char *)(inbuffer + offset-1); + offset += length_first; + uint32_t length_second; + arrToVar(length_second, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_second; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_second-1]=0; + this->second = (char *)(inbuffer + offset-1); + offset += length_second; + return offset; + } + + virtual const char * getType() override { return "mongodb_store_msgs/StringPair"; }; + virtual const char * getMD5() override { return "c0d0db6e21f3fc1eb068f9cc22ba8beb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringPairList.h b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringPairList.h new file mode 100644 index 000000000..e295547d4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/mongodb_store_msgs/StringPairList.h @@ -0,0 +1,64 @@ +#ifndef _ROS_mongodb_store_msgs_StringPairList_h +#define _ROS_mongodb_store_msgs_StringPairList_h + +#include +#include +#include +#include "ros/msg.h" +#include "mongodb_store_msgs/StringPair.h" + +namespace mongodb_store_msgs +{ + + class StringPairList : public ros::Msg + { + public: + uint32_t pairs_length; + typedef mongodb_store_msgs::StringPair _pairs_type; + _pairs_type st_pairs; + _pairs_type * pairs; + + StringPairList(): + pairs_length(0), st_pairs(), pairs(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->pairs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pairs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pairs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pairs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->pairs_length); + for( uint32_t i = 0; i < pairs_length; i++){ + offset += this->pairs[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t pairs_lengthT = ((uint32_t) (*(inbuffer + offset))); + pairs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + pairs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + pairs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pairs_length); + if(pairs_lengthT > pairs_length) + this->pairs = (mongodb_store_msgs::StringPair*)realloc(this->pairs, pairs_lengthT * sizeof(mongodb_store_msgs::StringPair)); + pairs_length = pairs_lengthT; + for( uint32_t i = 0; i < pairs_length; i++){ + offset += this->st_pairs.deserialize(inbuffer + offset); + memcpy( &(this->pairs[i]), &(this->st_pairs), sizeof(mongodb_store_msgs::StringPair)); + } + return offset; + } + + virtual const char * getType() override { return "mongodb_store_msgs/StringPairList"; }; + virtual const char * getMD5() override { return "50c368c0f345d8de86876a3bada40aad"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseAction.h b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseAction.h new file mode 100644 index 000000000..dd2d33e8b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_move_base_msgs_MoveBaseAction_h +#define _ROS_move_base_msgs_MoveBaseAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "move_base_msgs/MoveBaseActionGoal.h" +#include "move_base_msgs/MoveBaseActionResult.h" +#include "move_base_msgs/MoveBaseActionFeedback.h" + +namespace move_base_msgs +{ + + class MoveBaseAction : public ros::Msg + { + public: + typedef move_base_msgs::MoveBaseActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef move_base_msgs::MoveBaseActionResult _action_result_type; + _action_result_type action_result; + typedef move_base_msgs::MoveBaseActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + MoveBaseAction(): + 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 "move_base_msgs/MoveBaseAction"; }; + virtual const char * getMD5() override { return "70b6aca7c7f7746d8d1609ad94c80bb8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionFeedback.h new file mode 100644 index 000000000..216fd77e2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_move_base_msgs_MoveBaseActionFeedback_h +#define _ROS_move_base_msgs_MoveBaseActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "move_base_msgs/MoveBaseFeedback.h" + +namespace move_base_msgs +{ + + 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 move_base_msgs::MoveBaseFeedback _feedback_type; + _feedback_type feedback; + + MoveBaseActionFeedback(): + 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 "move_base_msgs/MoveBaseActionFeedback"; }; + virtual const char * getMD5() override { return "7d1870ff6e0decea702b943b5af0b42e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionGoal.h new file mode 100644 index 000000000..6bc4cb142 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_move_base_msgs_MoveBaseActionGoal_h +#define _ROS_move_base_msgs_MoveBaseActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "move_base_msgs/MoveBaseGoal.h" + +namespace move_base_msgs +{ + + 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 move_base_msgs::MoveBaseGoal _goal_type; + _goal_type goal; + + MoveBaseActionGoal(): + 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 "move_base_msgs/MoveBaseActionGoal"; }; + virtual const char * getMD5() override { return "660d6895a1b9a16dce51fbdd9a64a56b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionResult.h b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionResult.h new file mode 100644 index 000000000..809122c54 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_move_base_msgs_MoveBaseActionResult_h +#define _ROS_move_base_msgs_MoveBaseActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "move_base_msgs/MoveBaseResult.h" + +namespace move_base_msgs +{ + + 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 move_base_msgs::MoveBaseResult _result_type; + _result_type result; + + MoveBaseActionResult(): + 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 "move_base_msgs/MoveBaseActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseFeedback.h b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseFeedback.h new file mode 100644 index 000000000..4bcd0ac7e --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseGoal.h b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseGoal.h new file mode 100644 index 000000000..0a4b0290b --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseResult.h b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseResult.h new file mode 100644 index 000000000..a8844e44c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/MoveBaseResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_move_base_msgs_MoveBaseResult_h +#define _ROS_move_base_msgs_MoveBaseResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace move_base_msgs +{ + + class MoveBaseResult : public ros::Msg + { + public: + + MoveBaseResult() + { + } + + 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 "move_base_msgs/MoveBaseResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/RecoveryStatus.h b/smart_device_protocol/ros_lib/ros_lib/move_base_msgs/RecoveryStatus.h new file mode 100644 index 000000000..8568ea7de --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AllowedCollisionEntry.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AllowedCollisionEntry.h new file mode 100644 index 000000000..c0cabf83b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AllowedCollisionEntry.h @@ -0,0 +1,76 @@ +#ifndef _ROS_moveit_msgs_AllowedCollisionEntry_h +#define _ROS_moveit_msgs_AllowedCollisionEntry_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class AllowedCollisionEntry : public ros::Msg + { + public: + uint32_t enabled_length; + typedef bool _enabled_type; + _enabled_type st_enabled; + _enabled_type * enabled; + + AllowedCollisionEntry(): + enabled_length(0), st_enabled(), enabled(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->enabled_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->enabled_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->enabled_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->enabled_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->enabled_length); + for( uint32_t i = 0; i < enabled_length; i++){ + union { + bool real; + uint8_t base; + } u_enabledi; + u_enabledi.real = this->enabled[i]; + *(outbuffer + offset + 0) = (u_enabledi.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->enabled[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t enabled_lengthT = ((uint32_t) (*(inbuffer + offset))); + enabled_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + enabled_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + enabled_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->enabled_length); + if(enabled_lengthT > enabled_length) + this->enabled = (bool*)realloc(this->enabled, enabled_lengthT * sizeof(bool)); + enabled_length = enabled_lengthT; + for( uint32_t i = 0; i < enabled_length; i++){ + union { + bool real; + uint8_t base; + } u_st_enabled; + u_st_enabled.base = 0; + u_st_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_enabled = u_st_enabled.real; + offset += sizeof(this->st_enabled); + memcpy( &(this->enabled[i]), &(this->st_enabled), sizeof(bool)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/AllowedCollisionEntry"; }; + virtual const char * getMD5() override { return "90d1ae1850840724bb043562fe3285fc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AllowedCollisionMatrix.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AllowedCollisionMatrix.h new file mode 100644 index 000000000..4d6468bab --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AllowedCollisionMatrix.h @@ -0,0 +1,176 @@ +#ifndef _ROS_moveit_msgs_AllowedCollisionMatrix_h +#define _ROS_moveit_msgs_AllowedCollisionMatrix_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/AllowedCollisionEntry.h" + +namespace moveit_msgs +{ + + class AllowedCollisionMatrix : public ros::Msg + { + public: + uint32_t entry_names_length; + typedef char* _entry_names_type; + _entry_names_type st_entry_names; + _entry_names_type * entry_names; + uint32_t entry_values_length; + typedef moveit_msgs::AllowedCollisionEntry _entry_values_type; + _entry_values_type st_entry_values; + _entry_values_type * entry_values; + uint32_t default_entry_names_length; + typedef char* _default_entry_names_type; + _default_entry_names_type st_default_entry_names; + _default_entry_names_type * default_entry_names; + uint32_t default_entry_values_length; + typedef bool _default_entry_values_type; + _default_entry_values_type st_default_entry_values; + _default_entry_values_type * default_entry_values; + + AllowedCollisionMatrix(): + entry_names_length(0), st_entry_names(), entry_names(nullptr), + entry_values_length(0), st_entry_values(), entry_values(nullptr), + default_entry_names_length(0), st_default_entry_names(), default_entry_names(nullptr), + default_entry_values_length(0), st_default_entry_values(), default_entry_values(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->entry_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->entry_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->entry_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->entry_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->entry_names_length); + for( uint32_t i = 0; i < entry_names_length; i++){ + uint32_t length_entry_namesi = strlen(this->entry_names[i]); + varToArr(outbuffer + offset, length_entry_namesi); + offset += 4; + memcpy(outbuffer + offset, this->entry_names[i], length_entry_namesi); + offset += length_entry_namesi; + } + *(outbuffer + offset + 0) = (this->entry_values_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->entry_values_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->entry_values_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->entry_values_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->entry_values_length); + for( uint32_t i = 0; i < entry_values_length; i++){ + offset += this->entry_values[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->default_entry_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->default_entry_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->default_entry_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->default_entry_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->default_entry_names_length); + for( uint32_t i = 0; i < default_entry_names_length; i++){ + uint32_t length_default_entry_namesi = strlen(this->default_entry_names[i]); + varToArr(outbuffer + offset, length_default_entry_namesi); + offset += 4; + memcpy(outbuffer + offset, this->default_entry_names[i], length_default_entry_namesi); + offset += length_default_entry_namesi; + } + *(outbuffer + offset + 0) = (this->default_entry_values_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->default_entry_values_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->default_entry_values_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->default_entry_values_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->default_entry_values_length); + for( uint32_t i = 0; i < default_entry_values_length; i++){ + union { + bool real; + uint8_t base; + } u_default_entry_valuesi; + u_default_entry_valuesi.real = this->default_entry_values[i]; + *(outbuffer + offset + 0) = (u_default_entry_valuesi.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->default_entry_values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t entry_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + entry_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + entry_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + entry_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->entry_names_length); + if(entry_names_lengthT > entry_names_length) + this->entry_names = (char**)realloc(this->entry_names, entry_names_lengthT * sizeof(char*)); + entry_names_length = entry_names_lengthT; + for( uint32_t i = 0; i < entry_names_length; i++){ + uint32_t length_st_entry_names; + arrToVar(length_st_entry_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_entry_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_entry_names-1]=0; + this->st_entry_names = (char *)(inbuffer + offset-1); + offset += length_st_entry_names; + memcpy( &(this->entry_names[i]), &(this->st_entry_names), sizeof(char*)); + } + uint32_t entry_values_lengthT = ((uint32_t) (*(inbuffer + offset))); + entry_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + entry_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + entry_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->entry_values_length); + if(entry_values_lengthT > entry_values_length) + this->entry_values = (moveit_msgs::AllowedCollisionEntry*)realloc(this->entry_values, entry_values_lengthT * sizeof(moveit_msgs::AllowedCollisionEntry)); + entry_values_length = entry_values_lengthT; + for( uint32_t i = 0; i < entry_values_length; i++){ + offset += this->st_entry_values.deserialize(inbuffer + offset); + memcpy( &(this->entry_values[i]), &(this->st_entry_values), sizeof(moveit_msgs::AllowedCollisionEntry)); + } + uint32_t default_entry_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + default_entry_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + default_entry_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + default_entry_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->default_entry_names_length); + if(default_entry_names_lengthT > default_entry_names_length) + this->default_entry_names = (char**)realloc(this->default_entry_names, default_entry_names_lengthT * sizeof(char*)); + default_entry_names_length = default_entry_names_lengthT; + for( uint32_t i = 0; i < default_entry_names_length; i++){ + uint32_t length_st_default_entry_names; + arrToVar(length_st_default_entry_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_default_entry_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_default_entry_names-1]=0; + this->st_default_entry_names = (char *)(inbuffer + offset-1); + offset += length_st_default_entry_names; + memcpy( &(this->default_entry_names[i]), &(this->st_default_entry_names), sizeof(char*)); + } + uint32_t default_entry_values_lengthT = ((uint32_t) (*(inbuffer + offset))); + default_entry_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + default_entry_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + default_entry_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->default_entry_values_length); + if(default_entry_values_lengthT > default_entry_values_length) + this->default_entry_values = (bool*)realloc(this->default_entry_values, default_entry_values_lengthT * sizeof(bool)); + default_entry_values_length = default_entry_values_lengthT; + for( uint32_t i = 0; i < default_entry_values_length; i++){ + union { + bool real; + uint8_t base; + } u_st_default_entry_values; + u_st_default_entry_values.base = 0; + u_st_default_entry_values.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_default_entry_values = u_st_default_entry_values.real; + offset += sizeof(this->st_default_entry_values); + memcpy( &(this->default_entry_values[i]), &(this->st_default_entry_values), sizeof(bool)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/AllowedCollisionMatrix"; }; + virtual const char * getMD5() override { return "aedce13587eef0d79165a075659c1879"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ApplyPlanningScene.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ApplyPlanningScene.h new file mode 100644 index 000000000..ae267d4b1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ApplyPlanningScene.h @@ -0,0 +1,94 @@ +#ifndef _ROS_SERVICE_ApplyPlanningScene_h +#define _ROS_SERVICE_ApplyPlanningScene_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/PlanningScene.h" + +namespace moveit_msgs +{ + +static const char APPLYPLANNINGSCENE[] = "moveit_msgs/ApplyPlanningScene"; + + class ApplyPlanningSceneRequest : public ros::Msg + { + public: + typedef moveit_msgs::PlanningScene _scene_type; + _scene_type scene; + + ApplyPlanningSceneRequest(): + scene() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->scene.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->scene.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return APPLYPLANNINGSCENE; }; + virtual const char * getMD5() override { return "532b54e7c502b73178625025da63b084"; }; + + }; + + class ApplyPlanningSceneResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + ApplyPlanningSceneResponse(): + 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 APPLYPLANNINGSCENE; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class ApplyPlanningScene { + public: + typedef ApplyPlanningSceneRequest Request; + typedef ApplyPlanningSceneResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AttachedCollisionObject.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AttachedCollisionObject.h new file mode 100644 index 000000000..5aa38846c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/AttachedCollisionObject.h @@ -0,0 +1,109 @@ +#ifndef _ROS_moveit_msgs_AttachedCollisionObject_h +#define _ROS_moveit_msgs_AttachedCollisionObject_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/CollisionObject.h" +#include "trajectory_msgs/JointTrajectory.h" + +namespace moveit_msgs +{ + + class AttachedCollisionObject : public ros::Msg + { + public: + typedef const char* _link_name_type; + _link_name_type link_name; + typedef moveit_msgs::CollisionObject _object_type; + _object_type object; + uint32_t touch_links_length; + typedef char* _touch_links_type; + _touch_links_type st_touch_links; + _touch_links_type * touch_links; + typedef trajectory_msgs::JointTrajectory _detach_posture_type; + _detach_posture_type detach_posture; + typedef float _weight_type; + _weight_type weight; + + AttachedCollisionObject(): + link_name(""), + object(), + touch_links_length(0), st_touch_links(), touch_links(nullptr), + detach_posture(), + weight(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->object.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->touch_links_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->touch_links_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->touch_links_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->touch_links_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->touch_links_length); + for( uint32_t i = 0; i < touch_links_length; i++){ + uint32_t length_touch_linksi = strlen(this->touch_links[i]); + varToArr(outbuffer + offset, length_touch_linksi); + offset += 4; + memcpy(outbuffer + offset, this->touch_links[i], length_touch_linksi); + offset += length_touch_linksi; + } + offset += this->detach_posture.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->weight); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->object.deserialize(inbuffer + offset); + uint32_t touch_links_lengthT = ((uint32_t) (*(inbuffer + offset))); + touch_links_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + touch_links_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + touch_links_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->touch_links_length); + if(touch_links_lengthT > touch_links_length) + this->touch_links = (char**)realloc(this->touch_links, touch_links_lengthT * sizeof(char*)); + touch_links_length = touch_links_lengthT; + for( uint32_t i = 0; i < touch_links_length; i++){ + uint32_t length_st_touch_links; + arrToVar(length_st_touch_links, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_touch_links; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_touch_links-1]=0; + this->st_touch_links = (char *)(inbuffer + offset-1); + offset += length_st_touch_links; + memcpy( &(this->touch_links[i]), &(this->st_touch_links), sizeof(char*)); + } + offset += this->detach_posture.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->weight)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/AttachedCollisionObject"; }; + virtual const char * getMD5() override { return "30199ef516f64c8bc1edb1084ce4584e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/BoundingVolume.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/BoundingVolume.h new file mode 100644 index 000000000..6209abef0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/BoundingVolume.h @@ -0,0 +1,141 @@ +#ifndef _ROS_moveit_msgs_BoundingVolume_h +#define _ROS_moveit_msgs_BoundingVolume_h + +#include +#include +#include +#include "ros/msg.h" +#include "shape_msgs/SolidPrimitive.h" +#include "geometry_msgs/Pose.h" +#include "shape_msgs/Mesh.h" + +namespace moveit_msgs +{ + + class BoundingVolume : public ros::Msg + { + public: + uint32_t primitives_length; + typedef shape_msgs::SolidPrimitive _primitives_type; + _primitives_type st_primitives; + _primitives_type * primitives; + uint32_t primitive_poses_length; + typedef geometry_msgs::Pose _primitive_poses_type; + _primitive_poses_type st_primitive_poses; + _primitive_poses_type * primitive_poses; + uint32_t meshes_length; + typedef shape_msgs::Mesh _meshes_type; + _meshes_type st_meshes; + _meshes_type * meshes; + uint32_t mesh_poses_length; + typedef geometry_msgs::Pose _mesh_poses_type; + _mesh_poses_type st_mesh_poses; + _mesh_poses_type * mesh_poses; + + BoundingVolume(): + primitives_length(0), st_primitives(), primitives(nullptr), + primitive_poses_length(0), st_primitive_poses(), primitive_poses(nullptr), + meshes_length(0), st_meshes(), meshes(nullptr), + mesh_poses_length(0), st_mesh_poses(), mesh_poses(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->primitives_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->primitives_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->primitives_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->primitives_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->primitives_length); + for( uint32_t i = 0; i < primitives_length; i++){ + offset += this->primitives[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->primitive_poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->primitive_poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->primitive_poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->primitive_poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->primitive_poses_length); + for( uint32_t i = 0; i < primitive_poses_length; i++){ + offset += this->primitive_poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->meshes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->meshes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->meshes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->meshes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->meshes_length); + for( uint32_t i = 0; i < meshes_length; i++){ + offset += this->meshes[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->mesh_poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->mesh_poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->mesh_poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->mesh_poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->mesh_poses_length); + for( uint32_t i = 0; i < mesh_poses_length; i++){ + offset += this->mesh_poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t primitives_lengthT = ((uint32_t) (*(inbuffer + offset))); + primitives_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + primitives_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + primitives_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->primitives_length); + if(primitives_lengthT > primitives_length) + this->primitives = (shape_msgs::SolidPrimitive*)realloc(this->primitives, primitives_lengthT * sizeof(shape_msgs::SolidPrimitive)); + primitives_length = primitives_lengthT; + for( uint32_t i = 0; i < primitives_length; i++){ + offset += this->st_primitives.deserialize(inbuffer + offset); + memcpy( &(this->primitives[i]), &(this->st_primitives), sizeof(shape_msgs::SolidPrimitive)); + } + uint32_t primitive_poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + primitive_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + primitive_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + primitive_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->primitive_poses_length); + if(primitive_poses_lengthT > primitive_poses_length) + this->primitive_poses = (geometry_msgs::Pose*)realloc(this->primitive_poses, primitive_poses_lengthT * sizeof(geometry_msgs::Pose)); + primitive_poses_length = primitive_poses_lengthT; + for( uint32_t i = 0; i < primitive_poses_length; i++){ + offset += this->st_primitive_poses.deserialize(inbuffer + offset); + memcpy( &(this->primitive_poses[i]), &(this->st_primitive_poses), sizeof(geometry_msgs::Pose)); + } + uint32_t meshes_lengthT = ((uint32_t) (*(inbuffer + offset))); + meshes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + meshes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + meshes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->meshes_length); + if(meshes_lengthT > meshes_length) + this->meshes = (shape_msgs::Mesh*)realloc(this->meshes, meshes_lengthT * sizeof(shape_msgs::Mesh)); + meshes_length = meshes_lengthT; + for( uint32_t i = 0; i < meshes_length; i++){ + offset += this->st_meshes.deserialize(inbuffer + offset); + memcpy( &(this->meshes[i]), &(this->st_meshes), sizeof(shape_msgs::Mesh)); + } + uint32_t mesh_poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + mesh_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + mesh_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + mesh_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->mesh_poses_length); + if(mesh_poses_lengthT > mesh_poses_length) + this->mesh_poses = (geometry_msgs::Pose*)realloc(this->mesh_poses, mesh_poses_lengthT * sizeof(geometry_msgs::Pose)); + mesh_poses_length = mesh_poses_lengthT; + for( uint32_t i = 0; i < mesh_poses_length; i++){ + offset += this->st_mesh_poses.deserialize(inbuffer + offset); + memcpy( &(this->mesh_poses[i]), &(this->st_mesh_poses), sizeof(geometry_msgs::Pose)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/BoundingVolume"; }; + virtual const char * getMD5() override { return "22db94010f39e9198032cb4a1aeda26e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianPoint.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianPoint.h new file mode 100644 index 000000000..66a5be87f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianPoint.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_CartesianPoint_h +#define _ROS_moveit_msgs_CartesianPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Accel.h" + +namespace moveit_msgs +{ + + class CartesianPoint : public ros::Msg + { + public: + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef geometry_msgs::Twist _velocity_type; + _velocity_type velocity; + typedef geometry_msgs::Accel _acceleration_type; + _acceleration_type acceleration; + + CartesianPoint(): + pose(), + velocity(), + acceleration() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + offset += this->velocity.serialize(outbuffer + offset); + offset += this->acceleration.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->velocity.deserialize(inbuffer + offset); + offset += this->acceleration.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/CartesianPoint"; }; + virtual const char * getMD5() override { return "d3c213cdb4382c43adbff1f2dd2cf669"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianTrajectory.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianTrajectory.h new file mode 100644 index 000000000..82caaa82a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianTrajectory.h @@ -0,0 +1,87 @@ +#ifndef _ROS_moveit_msgs_CartesianTrajectory_h +#define _ROS_moveit_msgs_CartesianTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "moveit_msgs/CartesianTrajectoryPoint.h" + +namespace moveit_msgs +{ + + class CartesianTrajectory : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _tracked_frame_type; + _tracked_frame_type tracked_frame; + uint32_t points_length; + typedef moveit_msgs::CartesianTrajectoryPoint _points_type; + _points_type st_points; + _points_type * points; + + CartesianTrajectory(): + header(), + tracked_frame(""), + points_length(0), st_points(), points(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_tracked_frame = strlen(this->tracked_frame); + varToArr(outbuffer + offset, length_tracked_frame); + offset += 4; + memcpy(outbuffer + offset, this->tracked_frame, length_tracked_frame); + offset += length_tracked_frame; + *(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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_tracked_frame; + arrToVar(length_tracked_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_tracked_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_tracked_frame-1]=0; + this->tracked_frame = (char *)(inbuffer + offset-1); + offset += length_tracked_frame; + 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 = (moveit_msgs::CartesianTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(moveit_msgs::CartesianTrajectoryPoint)); + 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(moveit_msgs::CartesianTrajectoryPoint)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/CartesianTrajectory"; }; + virtual const char * getMD5() override { return "4886769850ce858fcceba546fd5c793b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianTrajectoryPoint.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianTrajectoryPoint.h new file mode 100644 index 000000000..1f241cfdc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CartesianTrajectoryPoint.h @@ -0,0 +1,68 @@ +#ifndef _ROS_moveit_msgs_CartesianTrajectoryPoint_h +#define _ROS_moveit_msgs_CartesianTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/CartesianPoint.h" +#include "ros/duration.h" + +namespace moveit_msgs +{ + + class CartesianTrajectoryPoint : public ros::Msg + { + public: + typedef moveit_msgs::CartesianPoint _point_type; + _point_type point; + typedef ros::Duration _time_from_start_type; + _time_from_start_type time_from_start; + + CartesianTrajectoryPoint(): + point(), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->point.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->point.deserialize(inbuffer + offset); + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/CartesianTrajectoryPoint"; }; + virtual const char * getMD5() override { return "e996ea294f646e6911b3e85e624f5acf"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ChangeControlDimensions.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ChangeControlDimensions.h new file mode 100644 index 000000000..6b06fbbd0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ChangeControlDimensions.h @@ -0,0 +1,196 @@ +#ifndef _ROS_SERVICE_ChangeControlDimensions_h +#define _ROS_SERVICE_ChangeControlDimensions_h +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + +static const char CHANGECONTROLDIMENSIONS[] = "moveit_msgs/ChangeControlDimensions"; + + class ChangeControlDimensionsRequest : public ros::Msg + { + public: + typedef bool _control_x_translation_type; + _control_x_translation_type control_x_translation; + typedef bool _control_y_translation_type; + _control_y_translation_type control_y_translation; + typedef bool _control_z_translation_type; + _control_z_translation_type control_z_translation; + typedef bool _control_x_rotation_type; + _control_x_rotation_type control_x_rotation; + typedef bool _control_y_rotation_type; + _control_y_rotation_type control_y_rotation; + typedef bool _control_z_rotation_type; + _control_z_rotation_type control_z_rotation; + + ChangeControlDimensionsRequest(): + control_x_translation(0), + control_y_translation(0), + control_z_translation(0), + control_x_rotation(0), + control_y_rotation(0), + control_z_rotation(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_control_x_translation; + u_control_x_translation.real = this->control_x_translation; + *(outbuffer + offset + 0) = (u_control_x_translation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->control_x_translation); + union { + bool real; + uint8_t base; + } u_control_y_translation; + u_control_y_translation.real = this->control_y_translation; + *(outbuffer + offset + 0) = (u_control_y_translation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->control_y_translation); + union { + bool real; + uint8_t base; + } u_control_z_translation; + u_control_z_translation.real = this->control_z_translation; + *(outbuffer + offset + 0) = (u_control_z_translation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->control_z_translation); + union { + bool real; + uint8_t base; + } u_control_x_rotation; + u_control_x_rotation.real = this->control_x_rotation; + *(outbuffer + offset + 0) = (u_control_x_rotation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->control_x_rotation); + union { + bool real; + uint8_t base; + } u_control_y_rotation; + u_control_y_rotation.real = this->control_y_rotation; + *(outbuffer + offset + 0) = (u_control_y_rotation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->control_y_rotation); + union { + bool real; + uint8_t base; + } u_control_z_rotation; + u_control_z_rotation.real = this->control_z_rotation; + *(outbuffer + offset + 0) = (u_control_z_rotation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->control_z_rotation); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_control_x_translation; + u_control_x_translation.base = 0; + u_control_x_translation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->control_x_translation = u_control_x_translation.real; + offset += sizeof(this->control_x_translation); + union { + bool real; + uint8_t base; + } u_control_y_translation; + u_control_y_translation.base = 0; + u_control_y_translation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->control_y_translation = u_control_y_translation.real; + offset += sizeof(this->control_y_translation); + union { + bool real; + uint8_t base; + } u_control_z_translation; + u_control_z_translation.base = 0; + u_control_z_translation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->control_z_translation = u_control_z_translation.real; + offset += sizeof(this->control_z_translation); + union { + bool real; + uint8_t base; + } u_control_x_rotation; + u_control_x_rotation.base = 0; + u_control_x_rotation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->control_x_rotation = u_control_x_rotation.real; + offset += sizeof(this->control_x_rotation); + union { + bool real; + uint8_t base; + } u_control_y_rotation; + u_control_y_rotation.base = 0; + u_control_y_rotation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->control_y_rotation = u_control_y_rotation.real; + offset += sizeof(this->control_y_rotation); + union { + bool real; + uint8_t base; + } u_control_z_rotation; + u_control_z_rotation.base = 0; + u_control_z_rotation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->control_z_rotation = u_control_z_rotation.real; + offset += sizeof(this->control_z_rotation); + return offset; + } + + virtual const char * getType() override { return CHANGECONTROLDIMENSIONS; }; + virtual const char * getMD5() override { return "64c0dd6d519e78f5ce2626b06dab34c1"; }; + + }; + + class ChangeControlDimensionsResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + ChangeControlDimensionsResponse(): + 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 CHANGECONTROLDIMENSIONS; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class ChangeControlDimensions { + public: + typedef ChangeControlDimensionsRequest Request; + typedef ChangeControlDimensionsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ChangeDriftDimensions.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ChangeDriftDimensions.h new file mode 100644 index 000000000..fb3bc771e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ChangeDriftDimensions.h @@ -0,0 +1,202 @@ +#ifndef _ROS_SERVICE_ChangeDriftDimensions_h +#define _ROS_SERVICE_ChangeDriftDimensions_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Transform.h" + +namespace moveit_msgs +{ + +static const char CHANGEDRIFTDIMENSIONS[] = "moveit_msgs/ChangeDriftDimensions"; + + class ChangeDriftDimensionsRequest : public ros::Msg + { + public: + typedef bool _drift_x_translation_type; + _drift_x_translation_type drift_x_translation; + typedef bool _drift_y_translation_type; + _drift_y_translation_type drift_y_translation; + typedef bool _drift_z_translation_type; + _drift_z_translation_type drift_z_translation; + typedef bool _drift_x_rotation_type; + _drift_x_rotation_type drift_x_rotation; + typedef bool _drift_y_rotation_type; + _drift_y_rotation_type drift_y_rotation; + typedef bool _drift_z_rotation_type; + _drift_z_rotation_type drift_z_rotation; + typedef geometry_msgs::Transform _transform_jog_frame_to_drift_frame_type; + _transform_jog_frame_to_drift_frame_type transform_jog_frame_to_drift_frame; + + ChangeDriftDimensionsRequest(): + drift_x_translation(0), + drift_y_translation(0), + drift_z_translation(0), + drift_x_rotation(0), + drift_y_rotation(0), + drift_z_rotation(0), + transform_jog_frame_to_drift_frame() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_drift_x_translation; + u_drift_x_translation.real = this->drift_x_translation; + *(outbuffer + offset + 0) = (u_drift_x_translation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->drift_x_translation); + union { + bool real; + uint8_t base; + } u_drift_y_translation; + u_drift_y_translation.real = this->drift_y_translation; + *(outbuffer + offset + 0) = (u_drift_y_translation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->drift_y_translation); + union { + bool real; + uint8_t base; + } u_drift_z_translation; + u_drift_z_translation.real = this->drift_z_translation; + *(outbuffer + offset + 0) = (u_drift_z_translation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->drift_z_translation); + union { + bool real; + uint8_t base; + } u_drift_x_rotation; + u_drift_x_rotation.real = this->drift_x_rotation; + *(outbuffer + offset + 0) = (u_drift_x_rotation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->drift_x_rotation); + union { + bool real; + uint8_t base; + } u_drift_y_rotation; + u_drift_y_rotation.real = this->drift_y_rotation; + *(outbuffer + offset + 0) = (u_drift_y_rotation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->drift_y_rotation); + union { + bool real; + uint8_t base; + } u_drift_z_rotation; + u_drift_z_rotation.real = this->drift_z_rotation; + *(outbuffer + offset + 0) = (u_drift_z_rotation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->drift_z_rotation); + offset += this->transform_jog_frame_to_drift_frame.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_drift_x_translation; + u_drift_x_translation.base = 0; + u_drift_x_translation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->drift_x_translation = u_drift_x_translation.real; + offset += sizeof(this->drift_x_translation); + union { + bool real; + uint8_t base; + } u_drift_y_translation; + u_drift_y_translation.base = 0; + u_drift_y_translation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->drift_y_translation = u_drift_y_translation.real; + offset += sizeof(this->drift_y_translation); + union { + bool real; + uint8_t base; + } u_drift_z_translation; + u_drift_z_translation.base = 0; + u_drift_z_translation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->drift_z_translation = u_drift_z_translation.real; + offset += sizeof(this->drift_z_translation); + union { + bool real; + uint8_t base; + } u_drift_x_rotation; + u_drift_x_rotation.base = 0; + u_drift_x_rotation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->drift_x_rotation = u_drift_x_rotation.real; + offset += sizeof(this->drift_x_rotation); + union { + bool real; + uint8_t base; + } u_drift_y_rotation; + u_drift_y_rotation.base = 0; + u_drift_y_rotation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->drift_y_rotation = u_drift_y_rotation.real; + offset += sizeof(this->drift_y_rotation); + union { + bool real; + uint8_t base; + } u_drift_z_rotation; + u_drift_z_rotation.base = 0; + u_drift_z_rotation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->drift_z_rotation = u_drift_z_rotation.real; + offset += sizeof(this->drift_z_rotation); + offset += this->transform_jog_frame_to_drift_frame.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return CHANGEDRIFTDIMENSIONS; }; + virtual const char * getMD5() override { return "4a5ce44f94cdee672e699df89b1ebaf1"; }; + + }; + + class ChangeDriftDimensionsResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + ChangeDriftDimensionsResponse(): + 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 CHANGEDRIFTDIMENSIONS; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class ChangeDriftDimensions { + public: + typedef ChangeDriftDimensionsRequest Request; + typedef ChangeDriftDimensionsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CheckIfRobotStateExistsInWarehouse.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CheckIfRobotStateExistsInWarehouse.h new file mode 100644 index 000000000..bd4dcac7b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CheckIfRobotStateExistsInWarehouse.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_CheckIfRobotStateExistsInWarehouse_h +#define _ROS_SERVICE_CheckIfRobotStateExistsInWarehouse_h +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + +static const char CHECKIFROBOTSTATEEXISTSINWAREHOUSE[] = "moveit_msgs/CheckIfRobotStateExistsInWarehouse"; + + class CheckIfRobotStateExistsInWarehouseRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _robot_type; + _robot_type robot; + + CheckIfRobotStateExistsInWarehouseRequest(): + name(""), + robot("") + { + } + + 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_robot = strlen(this->robot); + varToArr(outbuffer + offset, length_robot); + offset += 4; + memcpy(outbuffer + offset, this->robot, length_robot); + offset += length_robot; + 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_robot; + arrToVar(length_robot, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot-1]=0; + this->robot = (char *)(inbuffer + offset-1); + offset += length_robot; + return offset; + } + + virtual const char * getType() override { return CHECKIFROBOTSTATEEXISTSINWAREHOUSE; }; + virtual const char * getMD5() override { return "dab44354403f811c40b84964e068219c"; }; + + }; + + class CheckIfRobotStateExistsInWarehouseResponse : public ros::Msg + { + public: + typedef bool _exists_type; + _exists_type exists; + + CheckIfRobotStateExistsInWarehouseResponse(): + exists(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_exists; + u_exists.real = this->exists; + *(outbuffer + offset + 0) = (u_exists.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->exists); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_exists; + u_exists.base = 0; + u_exists.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->exists = u_exists.real; + offset += sizeof(this->exists); + return offset; + } + + virtual const char * getType() override { return CHECKIFROBOTSTATEEXISTSINWAREHOUSE; }; + virtual const char * getMD5() override { return "e8c90de4adc1219c86af9c2874c0c1b5"; }; + + }; + + class CheckIfRobotStateExistsInWarehouse { + public: + typedef CheckIfRobotStateExistsInWarehouseRequest Request; + typedef CheckIfRobotStateExistsInWarehouseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CollisionObject.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CollisionObject.h new file mode 100644 index 000000000..cb0c6fa86 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CollisionObject.h @@ -0,0 +1,310 @@ +#ifndef _ROS_moveit_msgs_CollisionObject_h +#define _ROS_moveit_msgs_CollisionObject_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "object_recognition_msgs/ObjectType.h" +#include "shape_msgs/SolidPrimitive.h" +#include "shape_msgs/Mesh.h" +#include "shape_msgs/Plane.h" + +namespace moveit_msgs +{ + + class CollisionObject : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef const char* _id_type; + _id_type id; + typedef object_recognition_msgs::ObjectType _type_type; + _type_type type; + uint32_t primitives_length; + typedef shape_msgs::SolidPrimitive _primitives_type; + _primitives_type st_primitives; + _primitives_type * primitives; + uint32_t primitive_poses_length; + typedef geometry_msgs::Pose _primitive_poses_type; + _primitive_poses_type st_primitive_poses; + _primitive_poses_type * primitive_poses; + uint32_t meshes_length; + typedef shape_msgs::Mesh _meshes_type; + _meshes_type st_meshes; + _meshes_type * meshes; + uint32_t mesh_poses_length; + typedef geometry_msgs::Pose _mesh_poses_type; + _mesh_poses_type st_mesh_poses; + _mesh_poses_type * mesh_poses; + uint32_t planes_length; + typedef shape_msgs::Plane _planes_type; + _planes_type st_planes; + _planes_type * planes; + uint32_t plane_poses_length; + typedef geometry_msgs::Pose _plane_poses_type; + _plane_poses_type st_plane_poses; + _plane_poses_type * plane_poses; + uint32_t subframe_names_length; + typedef char* _subframe_names_type; + _subframe_names_type st_subframe_names; + _subframe_names_type * subframe_names; + uint32_t subframe_poses_length; + typedef geometry_msgs::Pose _subframe_poses_type; + _subframe_poses_type st_subframe_poses; + _subframe_poses_type * subframe_poses; + typedef int8_t _operation_type; + _operation_type operation; + enum { ADD = 0 }; + enum { REMOVE = 1 }; + enum { APPEND = 2 }; + enum { MOVE = 3 }; + + CollisionObject(): + header(), + pose(), + id(""), + type(), + primitives_length(0), st_primitives(), primitives(nullptr), + primitive_poses_length(0), st_primitive_poses(), primitive_poses(nullptr), + meshes_length(0), st_meshes(), meshes(nullptr), + mesh_poses_length(0), st_mesh_poses(), mesh_poses(nullptr), + planes_length(0), st_planes(), planes(nullptr), + plane_poses_length(0), st_plane_poses(), plane_poses(nullptr), + subframe_names_length(0), st_subframe_names(), subframe_names(nullptr), + subframe_poses_length(0), st_subframe_poses(), subframe_poses(nullptr), + operation(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + 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 += this->type.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->primitives_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->primitives_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->primitives_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->primitives_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->primitives_length); + for( uint32_t i = 0; i < primitives_length; i++){ + offset += this->primitives[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->primitive_poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->primitive_poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->primitive_poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->primitive_poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->primitive_poses_length); + for( uint32_t i = 0; i < primitive_poses_length; i++){ + offset += this->primitive_poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->meshes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->meshes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->meshes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->meshes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->meshes_length); + for( uint32_t i = 0; i < meshes_length; i++){ + offset += this->meshes[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->mesh_poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->mesh_poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->mesh_poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->mesh_poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->mesh_poses_length); + for( uint32_t i = 0; i < mesh_poses_length; i++){ + offset += this->mesh_poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->planes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->planes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->planes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->planes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->planes_length); + for( uint32_t i = 0; i < planes_length; i++){ + offset += this->planes[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->plane_poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->plane_poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->plane_poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->plane_poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->plane_poses_length); + for( uint32_t i = 0; i < plane_poses_length; i++){ + offset += this->plane_poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->subframe_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->subframe_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->subframe_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->subframe_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->subframe_names_length); + for( uint32_t i = 0; i < subframe_names_length; i++){ + uint32_t length_subframe_namesi = strlen(this->subframe_names[i]); + varToArr(outbuffer + offset, length_subframe_namesi); + offset += 4; + memcpy(outbuffer + offset, this->subframe_names[i], length_subframe_namesi); + offset += length_subframe_namesi; + } + *(outbuffer + offset + 0) = (this->subframe_poses_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->subframe_poses_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->subframe_poses_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->subframe_poses_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->subframe_poses_length); + for( uint32_t i = 0; i < subframe_poses_length; i++){ + offset += this->subframe_poses[i].serialize(outbuffer + offset); + } + union { + int8_t real; + uint8_t base; + } u_operation; + u_operation.real = this->operation; + *(outbuffer + offset + 0) = (u_operation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->operation); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + 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 += this->type.deserialize(inbuffer + offset); + uint32_t primitives_lengthT = ((uint32_t) (*(inbuffer + offset))); + primitives_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + primitives_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + primitives_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->primitives_length); + if(primitives_lengthT > primitives_length) + this->primitives = (shape_msgs::SolidPrimitive*)realloc(this->primitives, primitives_lengthT * sizeof(shape_msgs::SolidPrimitive)); + primitives_length = primitives_lengthT; + for( uint32_t i = 0; i < primitives_length; i++){ + offset += this->st_primitives.deserialize(inbuffer + offset); + memcpy( &(this->primitives[i]), &(this->st_primitives), sizeof(shape_msgs::SolidPrimitive)); + } + uint32_t primitive_poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + primitive_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + primitive_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + primitive_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->primitive_poses_length); + if(primitive_poses_lengthT > primitive_poses_length) + this->primitive_poses = (geometry_msgs::Pose*)realloc(this->primitive_poses, primitive_poses_lengthT * sizeof(geometry_msgs::Pose)); + primitive_poses_length = primitive_poses_lengthT; + for( uint32_t i = 0; i < primitive_poses_length; i++){ + offset += this->st_primitive_poses.deserialize(inbuffer + offset); + memcpy( &(this->primitive_poses[i]), &(this->st_primitive_poses), sizeof(geometry_msgs::Pose)); + } + uint32_t meshes_lengthT = ((uint32_t) (*(inbuffer + offset))); + meshes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + meshes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + meshes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->meshes_length); + if(meshes_lengthT > meshes_length) + this->meshes = (shape_msgs::Mesh*)realloc(this->meshes, meshes_lengthT * sizeof(shape_msgs::Mesh)); + meshes_length = meshes_lengthT; + for( uint32_t i = 0; i < meshes_length; i++){ + offset += this->st_meshes.deserialize(inbuffer + offset); + memcpy( &(this->meshes[i]), &(this->st_meshes), sizeof(shape_msgs::Mesh)); + } + uint32_t mesh_poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + mesh_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + mesh_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + mesh_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->mesh_poses_length); + if(mesh_poses_lengthT > mesh_poses_length) + this->mesh_poses = (geometry_msgs::Pose*)realloc(this->mesh_poses, mesh_poses_lengthT * sizeof(geometry_msgs::Pose)); + mesh_poses_length = mesh_poses_lengthT; + for( uint32_t i = 0; i < mesh_poses_length; i++){ + offset += this->st_mesh_poses.deserialize(inbuffer + offset); + memcpy( &(this->mesh_poses[i]), &(this->st_mesh_poses), sizeof(geometry_msgs::Pose)); + } + uint32_t planes_lengthT = ((uint32_t) (*(inbuffer + offset))); + planes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + planes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + planes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->planes_length); + if(planes_lengthT > planes_length) + this->planes = (shape_msgs::Plane*)realloc(this->planes, planes_lengthT * sizeof(shape_msgs::Plane)); + planes_length = planes_lengthT; + for( uint32_t i = 0; i < planes_length; i++){ + offset += this->st_planes.deserialize(inbuffer + offset); + memcpy( &(this->planes[i]), &(this->st_planes), sizeof(shape_msgs::Plane)); + } + uint32_t plane_poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + plane_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + plane_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + plane_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->plane_poses_length); + if(plane_poses_lengthT > plane_poses_length) + this->plane_poses = (geometry_msgs::Pose*)realloc(this->plane_poses, plane_poses_lengthT * sizeof(geometry_msgs::Pose)); + plane_poses_length = plane_poses_lengthT; + for( uint32_t i = 0; i < plane_poses_length; i++){ + offset += this->st_plane_poses.deserialize(inbuffer + offset); + memcpy( &(this->plane_poses[i]), &(this->st_plane_poses), sizeof(geometry_msgs::Pose)); + } + uint32_t subframe_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + subframe_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + subframe_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + subframe_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->subframe_names_length); + if(subframe_names_lengthT > subframe_names_length) + this->subframe_names = (char**)realloc(this->subframe_names, subframe_names_lengthT * sizeof(char*)); + subframe_names_length = subframe_names_lengthT; + for( uint32_t i = 0; i < subframe_names_length; i++){ + uint32_t length_st_subframe_names; + arrToVar(length_st_subframe_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_subframe_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_subframe_names-1]=0; + this->st_subframe_names = (char *)(inbuffer + offset-1); + offset += length_st_subframe_names; + memcpy( &(this->subframe_names[i]), &(this->st_subframe_names), sizeof(char*)); + } + uint32_t subframe_poses_lengthT = ((uint32_t) (*(inbuffer + offset))); + subframe_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + subframe_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + subframe_poses_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->subframe_poses_length); + if(subframe_poses_lengthT > subframe_poses_length) + this->subframe_poses = (geometry_msgs::Pose*)realloc(this->subframe_poses, subframe_poses_lengthT * sizeof(geometry_msgs::Pose)); + subframe_poses_length = subframe_poses_lengthT; + for( uint32_t i = 0; i < subframe_poses_length; i++){ + offset += this->st_subframe_poses.deserialize(inbuffer + offset); + memcpy( &(this->subframe_poses[i]), &(this->st_subframe_poses), sizeof(geometry_msgs::Pose)); + } + union { + int8_t real; + uint8_t base; + } u_operation; + u_operation.base = 0; + u_operation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->operation = u_operation.real; + offset += sizeof(this->operation); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/CollisionObject"; }; + virtual const char * getMD5() override { return "dbba710596087da521c07564160dfccb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ConstraintEvalResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ConstraintEvalResult.h new file mode 100644 index 000000000..2264f43b0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ConstraintEvalResult.h @@ -0,0 +1,61 @@ +#ifndef _ROS_moveit_msgs_ConstraintEvalResult_h +#define _ROS_moveit_msgs_ConstraintEvalResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class ConstraintEvalResult : public ros::Msg + { + public: + typedef bool _result_type; + _result_type result; + typedef float _distance_type; + _distance_type distance; + + ConstraintEvalResult(): + result(0), + distance(0) + { + } + + 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); + 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_result; + u_result.base = 0; + u_result.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->result = u_result.real; + offset += sizeof(this->result); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->distance)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/ConstraintEvalResult"; }; + virtual const char * getMD5() override { return "093643083d24f6488cb5a868bd47c090"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/Constraints.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/Constraints.h new file mode 100644 index 000000000..6964fab06 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/Constraints.h @@ -0,0 +1,159 @@ +#ifndef _ROS_moveit_msgs_Constraints_h +#define _ROS_moveit_msgs_Constraints_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/JointConstraint.h" +#include "moveit_msgs/PositionConstraint.h" +#include "moveit_msgs/OrientationConstraint.h" +#include "moveit_msgs/VisibilityConstraint.h" + +namespace moveit_msgs +{ + + class Constraints : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + uint32_t joint_constraints_length; + typedef moveit_msgs::JointConstraint _joint_constraints_type; + _joint_constraints_type st_joint_constraints; + _joint_constraints_type * joint_constraints; + uint32_t position_constraints_length; + typedef moveit_msgs::PositionConstraint _position_constraints_type; + _position_constraints_type st_position_constraints; + _position_constraints_type * position_constraints; + uint32_t orientation_constraints_length; + typedef moveit_msgs::OrientationConstraint _orientation_constraints_type; + _orientation_constraints_type st_orientation_constraints; + _orientation_constraints_type * orientation_constraints; + uint32_t visibility_constraints_length; + typedef moveit_msgs::VisibilityConstraint _visibility_constraints_type; + _visibility_constraints_type st_visibility_constraints; + _visibility_constraints_type * visibility_constraints; + + Constraints(): + name(""), + joint_constraints_length(0), st_joint_constraints(), joint_constraints(nullptr), + position_constraints_length(0), st_position_constraints(), position_constraints(nullptr), + orientation_constraints_length(0), st_orientation_constraints(), orientation_constraints(nullptr), + visibility_constraints_length(0), st_visibility_constraints(), visibility_constraints(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; + *(outbuffer + offset + 0) = (this->joint_constraints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_constraints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_constraints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_constraints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_constraints_length); + for( uint32_t i = 0; i < joint_constraints_length; i++){ + offset += this->joint_constraints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->position_constraints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->position_constraints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->position_constraints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->position_constraints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->position_constraints_length); + for( uint32_t i = 0; i < position_constraints_length; i++){ + offset += this->position_constraints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->orientation_constraints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->orientation_constraints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->orientation_constraints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->orientation_constraints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->orientation_constraints_length); + for( uint32_t i = 0; i < orientation_constraints_length; i++){ + offset += this->orientation_constraints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->visibility_constraints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->visibility_constraints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->visibility_constraints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->visibility_constraints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->visibility_constraints_length); + for( uint32_t i = 0; i < visibility_constraints_length; i++){ + offset += this->visibility_constraints[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 joint_constraints_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_constraints_length); + if(joint_constraints_lengthT > joint_constraints_length) + this->joint_constraints = (moveit_msgs::JointConstraint*)realloc(this->joint_constraints, joint_constraints_lengthT * sizeof(moveit_msgs::JointConstraint)); + joint_constraints_length = joint_constraints_lengthT; + for( uint32_t i = 0; i < joint_constraints_length; i++){ + offset += this->st_joint_constraints.deserialize(inbuffer + offset); + memcpy( &(this->joint_constraints[i]), &(this->st_joint_constraints), sizeof(moveit_msgs::JointConstraint)); + } + uint32_t position_constraints_lengthT = ((uint32_t) (*(inbuffer + offset))); + position_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + position_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + position_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->position_constraints_length); + if(position_constraints_lengthT > position_constraints_length) + this->position_constraints = (moveit_msgs::PositionConstraint*)realloc(this->position_constraints, position_constraints_lengthT * sizeof(moveit_msgs::PositionConstraint)); + position_constraints_length = position_constraints_lengthT; + for( uint32_t i = 0; i < position_constraints_length; i++){ + offset += this->st_position_constraints.deserialize(inbuffer + offset); + memcpy( &(this->position_constraints[i]), &(this->st_position_constraints), sizeof(moveit_msgs::PositionConstraint)); + } + uint32_t orientation_constraints_lengthT = ((uint32_t) (*(inbuffer + offset))); + orientation_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + orientation_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + orientation_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->orientation_constraints_length); + if(orientation_constraints_lengthT > orientation_constraints_length) + this->orientation_constraints = (moveit_msgs::OrientationConstraint*)realloc(this->orientation_constraints, orientation_constraints_lengthT * sizeof(moveit_msgs::OrientationConstraint)); + orientation_constraints_length = orientation_constraints_lengthT; + for( uint32_t i = 0; i < orientation_constraints_length; i++){ + offset += this->st_orientation_constraints.deserialize(inbuffer + offset); + memcpy( &(this->orientation_constraints[i]), &(this->st_orientation_constraints), sizeof(moveit_msgs::OrientationConstraint)); + } + uint32_t visibility_constraints_lengthT = ((uint32_t) (*(inbuffer + offset))); + visibility_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + visibility_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + visibility_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->visibility_constraints_length); + if(visibility_constraints_lengthT > visibility_constraints_length) + this->visibility_constraints = (moveit_msgs::VisibilityConstraint*)realloc(this->visibility_constraints, visibility_constraints_lengthT * sizeof(moveit_msgs::VisibilityConstraint)); + visibility_constraints_length = visibility_constraints_lengthT; + for( uint32_t i = 0; i < visibility_constraints_length; i++){ + offset += this->st_visibility_constraints.deserialize(inbuffer + offset); + memcpy( &(this->visibility_constraints[i]), &(this->st_visibility_constraints), sizeof(moveit_msgs::VisibilityConstraint)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/Constraints"; }; + virtual const char * getMD5() override { return "cfd22a10c51e0dc2b28d98772d2b55d5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ContactInformation.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ContactInformation.h new file mode 100644 index 000000000..c06cbc7bd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ContactInformation.h @@ -0,0 +1,124 @@ +#ifndef _ROS_moveit_msgs_ContactInformation_h +#define _ROS_moveit_msgs_ContactInformation_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/Vector3.h" + +namespace moveit_msgs +{ + + class ContactInformation : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Point _position_type; + _position_type position; + typedef geometry_msgs::Vector3 _normal_type; + _normal_type normal; + typedef float _depth_type; + _depth_type depth; + typedef const char* _contact_body_1_type; + _contact_body_1_type contact_body_1; + typedef uint32_t _body_type_1_type; + _body_type_1_type body_type_1; + typedef const char* _contact_body_2_type; + _contact_body_2_type contact_body_2; + typedef uint32_t _body_type_2_type; + _body_type_2_type body_type_2; + enum { ROBOT_LINK = 0 }; + enum { WORLD_OBJECT = 1 }; + enum { ROBOT_ATTACHED = 2 }; + + ContactInformation(): + header(), + position(), + normal(), + depth(0), + contact_body_1(""), + body_type_1(0), + contact_body_2(""), + body_type_2(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->position.serialize(outbuffer + offset); + offset += this->normal.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->depth); + uint32_t length_contact_body_1 = strlen(this->contact_body_1); + varToArr(outbuffer + offset, length_contact_body_1); + offset += 4; + memcpy(outbuffer + offset, this->contact_body_1, length_contact_body_1); + offset += length_contact_body_1; + *(outbuffer + offset + 0) = (this->body_type_1 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->body_type_1 >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->body_type_1 >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->body_type_1 >> (8 * 3)) & 0xFF; + offset += sizeof(this->body_type_1); + uint32_t length_contact_body_2 = strlen(this->contact_body_2); + varToArr(outbuffer + offset, length_contact_body_2); + offset += 4; + memcpy(outbuffer + offset, this->contact_body_2, length_contact_body_2); + offset += length_contact_body_2; + *(outbuffer + offset + 0) = (this->body_type_2 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->body_type_2 >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->body_type_2 >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->body_type_2 >> (8 * 3)) & 0xFF; + offset += sizeof(this->body_type_2); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->position.deserialize(inbuffer + offset); + offset += this->normal.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->depth)); + uint32_t length_contact_body_1; + arrToVar(length_contact_body_1, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_contact_body_1; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_contact_body_1-1]=0; + this->contact_body_1 = (char *)(inbuffer + offset-1); + offset += length_contact_body_1; + this->body_type_1 = ((uint32_t) (*(inbuffer + offset))); + this->body_type_1 |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->body_type_1 |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->body_type_1 |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->body_type_1); + uint32_t length_contact_body_2; + arrToVar(length_contact_body_2, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_contact_body_2; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_contact_body_2-1]=0; + this->contact_body_2 = (char *)(inbuffer + offset-1); + offset += length_contact_body_2; + this->body_type_2 = ((uint32_t) (*(inbuffer + offset))); + this->body_type_2 |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->body_type_2 |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->body_type_2 |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->body_type_2); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/ContactInformation"; }; + virtual const char * getMD5() override { return "116228ca08b0c286ec5ca32a50fdc17b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CostSource.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CostSource.h new file mode 100644 index 000000000..99200489f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/CostSource.h @@ -0,0 +1,54 @@ +#ifndef _ROS_moveit_msgs_CostSource_h +#define _ROS_moveit_msgs_CostSource_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace moveit_msgs +{ + + class CostSource : public ros::Msg + { + public: + typedef float _cost_density_type; + _cost_density_type cost_density; + typedef geometry_msgs::Vector3 _aabb_min_type; + _aabb_min_type aabb_min; + typedef geometry_msgs::Vector3 _aabb_max_type; + _aabb_max_type aabb_max; + + CostSource(): + cost_density(0), + aabb_min(), + aabb_max() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->cost_density); + offset += this->aabb_min.serialize(outbuffer + offset); + offset += this->aabb_max.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->cost_density)); + offset += this->aabb_min.deserialize(inbuffer + offset); + offset += this->aabb_max.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/CostSource"; }; + virtual const char * getMD5() override { return "abb7e013237dacaaa8b97e704102f908"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DeleteRobotStateFromWarehouse.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DeleteRobotStateFromWarehouse.h new file mode 100644 index 000000000..67243073e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DeleteRobotStateFromWarehouse.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_DeleteRobotStateFromWarehouse_h +#define _ROS_SERVICE_DeleteRobotStateFromWarehouse_h +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + +static const char DELETEROBOTSTATEFROMWAREHOUSE[] = "moveit_msgs/DeleteRobotStateFromWarehouse"; + + class DeleteRobotStateFromWarehouseRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _robot_type; + _robot_type robot; + + DeleteRobotStateFromWarehouseRequest(): + name(""), + robot("") + { + } + + 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_robot = strlen(this->robot); + varToArr(outbuffer + offset, length_robot); + offset += 4; + memcpy(outbuffer + offset, this->robot, length_robot); + offset += length_robot; + 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_robot; + arrToVar(length_robot, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot-1]=0; + this->robot = (char *)(inbuffer + offset-1); + offset += length_robot; + return offset; + } + + virtual const char * getType() override { return DELETEROBOTSTATEFROMWAREHOUSE; }; + virtual const char * getMD5() override { return "dab44354403f811c40b84964e068219c"; }; + + }; + + class DeleteRobotStateFromWarehouseResponse : public ros::Msg + { + public: + + DeleteRobotStateFromWarehouseResponse() + { + } + + 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 DELETEROBOTSTATEFROMWAREHOUSE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DeleteRobotStateFromWarehouse { + public: + typedef DeleteRobotStateFromWarehouseRequest Request; + typedef DeleteRobotStateFromWarehouseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DisplayRobotState.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DisplayRobotState.h new file mode 100644 index 000000000..219906c0d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DisplayRobotState.h @@ -0,0 +1,88 @@ +#ifndef _ROS_moveit_msgs_DisplayRobotState_h +#define _ROS_moveit_msgs_DisplayRobotState_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/ObjectColor.h" + +namespace moveit_msgs +{ + + class DisplayRobotState : public ros::Msg + { + public: + typedef moveit_msgs::RobotState _state_type; + _state_type state; + uint32_t highlight_links_length; + typedef moveit_msgs::ObjectColor _highlight_links_type; + _highlight_links_type st_highlight_links; + _highlight_links_type * highlight_links; + typedef bool _hide_type; + _hide_type hide; + + DisplayRobotState(): + state(), + highlight_links_length(0), st_highlight_links(), highlight_links(nullptr), + hide(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->state.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->highlight_links_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->highlight_links_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->highlight_links_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->highlight_links_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->highlight_links_length); + for( uint32_t i = 0; i < highlight_links_length; i++){ + offset += this->highlight_links[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_hide; + u_hide.real = this->hide; + *(outbuffer + offset + 0) = (u_hide.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->hide); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->state.deserialize(inbuffer + offset); + uint32_t highlight_links_lengthT = ((uint32_t) (*(inbuffer + offset))); + highlight_links_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + highlight_links_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + highlight_links_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->highlight_links_length); + if(highlight_links_lengthT > highlight_links_length) + this->highlight_links = (moveit_msgs::ObjectColor*)realloc(this->highlight_links, highlight_links_lengthT * sizeof(moveit_msgs::ObjectColor)); + highlight_links_length = highlight_links_lengthT; + for( uint32_t i = 0; i < highlight_links_length; i++){ + offset += this->st_highlight_links.deserialize(inbuffer + offset); + memcpy( &(this->highlight_links[i]), &(this->st_highlight_links), sizeof(moveit_msgs::ObjectColor)); + } + union { + bool real; + uint8_t base; + } u_hide; + u_hide.base = 0; + u_hide.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->hide = u_hide.real; + offset += sizeof(this->hide); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/DisplayRobotState"; }; + virtual const char * getMD5() override { return "61c4e677a6fbbc83f0d5d9df2be85e3c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DisplayTrajectory.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DisplayTrajectory.h new file mode 100644 index 000000000..cb0b456f4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/DisplayTrajectory.h @@ -0,0 +1,87 @@ +#ifndef _ROS_moveit_msgs_DisplayTrajectory_h +#define _ROS_moveit_msgs_DisplayTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/RobotTrajectory.h" +#include "moveit_msgs/RobotState.h" + +namespace moveit_msgs +{ + + class DisplayTrajectory : public ros::Msg + { + public: + typedef const char* _model_id_type; + _model_id_type model_id; + uint32_t trajectory_length; + typedef moveit_msgs::RobotTrajectory _trajectory_type; + _trajectory_type st_trajectory; + _trajectory_type * trajectory; + typedef moveit_msgs::RobotState _trajectory_start_type; + _trajectory_start_type trajectory_start; + + DisplayTrajectory(): + model_id(""), + trajectory_length(0), st_trajectory(), trajectory(nullptr), + trajectory_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_model_id = strlen(this->model_id); + varToArr(outbuffer + offset, length_model_id); + offset += 4; + memcpy(outbuffer + offset, this->model_id, length_model_id); + offset += length_model_id; + *(outbuffer + offset + 0) = (this->trajectory_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->trajectory_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->trajectory_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->trajectory_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->trajectory_length); + for( uint32_t i = 0; i < trajectory_length; i++){ + offset += this->trajectory[i].serialize(outbuffer + offset); + } + offset += this->trajectory_start.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_model_id; + arrToVar(length_model_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_id-1]=0; + this->model_id = (char *)(inbuffer + offset-1); + offset += length_model_id; + uint32_t trajectory_lengthT = ((uint32_t) (*(inbuffer + offset))); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->trajectory_length); + if(trajectory_lengthT > trajectory_length) + this->trajectory = (moveit_msgs::RobotTrajectory*)realloc(this->trajectory, trajectory_lengthT * sizeof(moveit_msgs::RobotTrajectory)); + trajectory_length = trajectory_lengthT; + for( uint32_t i = 0; i < trajectory_length; i++){ + offset += this->st_trajectory.deserialize(inbuffer + offset); + memcpy( &(this->trajectory[i]), &(this->st_trajectory), sizeof(moveit_msgs::RobotTrajectory)); + } + offset += this->trajectory_start.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/DisplayTrajectory"; }; + virtual const char * getMD5() override { return "41936b74e168ba754279ae683ce3f121"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteKnownTrajectory.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteKnownTrajectory.h new file mode 100644 index 000000000..35ceac561 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteKnownTrajectory.h @@ -0,0 +1,100 @@ +#ifndef _ROS_SERVICE_ExecuteKnownTrajectory_h +#define _ROS_SERVICE_ExecuteKnownTrajectory_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/RobotTrajectory.h" +#include "moveit_msgs/MoveItErrorCodes.h" + +namespace moveit_msgs +{ + +static const char EXECUTEKNOWNTRAJECTORY[] = "moveit_msgs/ExecuteKnownTrajectory"; + + class ExecuteKnownTrajectoryRequest : public ros::Msg + { + public: + typedef moveit_msgs::RobotTrajectory _trajectory_type; + _trajectory_type trajectory; + typedef bool _wait_for_execution_type; + _wait_for_execution_type wait_for_execution; + + ExecuteKnownTrajectoryRequest(): + trajectory(), + wait_for_execution(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_wait_for_execution; + u_wait_for_execution.real = this->wait_for_execution; + *(outbuffer + offset + 0) = (u_wait_for_execution.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->wait_for_execution); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_wait_for_execution; + u_wait_for_execution.base = 0; + u_wait_for_execution.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->wait_for_execution = u_wait_for_execution.real; + offset += sizeof(this->wait_for_execution); + return offset; + } + + virtual const char * getType() override { return EXECUTEKNOWNTRAJECTORY; }; + virtual const char * getMD5() override { return "2a3d2a0b337c6a27da4468bb351928e5"; }; + + }; + + class ExecuteKnownTrajectoryResponse : public ros::Msg + { + public: + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + + ExecuteKnownTrajectoryResponse(): + error_code() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->error_code.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->error_code.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return EXECUTEKNOWNTRAJECTORY; }; + virtual const char * getMD5() override { return "6a39f41e4bc445a437e9a0cabdd5ef5c"; }; + + }; + + class ExecuteKnownTrajectory { + public: + typedef ExecuteKnownTrajectoryRequest Request; + typedef ExecuteKnownTrajectoryResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryAction.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryAction.h new file mode 100644 index 000000000..4ee229b12 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_ExecuteTrajectoryAction_h +#define _ROS_moveit_msgs_ExecuteTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/ExecuteTrajectoryActionGoal.h" +#include "moveit_msgs/ExecuteTrajectoryActionResult.h" +#include "moveit_msgs/ExecuteTrajectoryActionFeedback.h" + +namespace moveit_msgs +{ + + class ExecuteTrajectoryAction : public ros::Msg + { + public: + typedef moveit_msgs::ExecuteTrajectoryActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef moveit_msgs::ExecuteTrajectoryActionResult _action_result_type; + _action_result_type action_result; + typedef moveit_msgs::ExecuteTrajectoryActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + ExecuteTrajectoryAction(): + 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 "moveit_msgs/ExecuteTrajectoryAction"; }; + virtual const char * getMD5() override { return "add56f6df2e6f2ee8830e030d0953807"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionFeedback.h new file mode 100644 index 000000000..74fed4423 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_ExecuteTrajectoryActionFeedback_h +#define _ROS_moveit_msgs_ExecuteTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "moveit_msgs/ExecuteTrajectoryFeedback.h" + +namespace moveit_msgs +{ + + class ExecuteTrajectoryActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef moveit_msgs::ExecuteTrajectoryFeedback _feedback_type; + _feedback_type feedback; + + ExecuteTrajectoryActionFeedback(): + 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 "moveit_msgs/ExecuteTrajectoryActionFeedback"; }; + virtual const char * getMD5() override { return "12232ef97486c7962f264c105aae2958"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionGoal.h new file mode 100644 index 000000000..c4b75c8a0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_ExecuteTrajectoryActionGoal_h +#define _ROS_moveit_msgs_ExecuteTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "moveit_msgs/ExecuteTrajectoryGoal.h" + +namespace moveit_msgs +{ + + class ExecuteTrajectoryActionGoal : 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 moveit_msgs::ExecuteTrajectoryGoal _goal_type; + _goal_type goal; + + ExecuteTrajectoryActionGoal(): + 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 "moveit_msgs/ExecuteTrajectoryActionGoal"; }; + virtual const char * getMD5() override { return "36f350977c67bc94e8cd408452bad0f0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionResult.h new file mode 100644 index 000000000..e326f01cf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_ExecuteTrajectoryActionResult_h +#define _ROS_moveit_msgs_ExecuteTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "moveit_msgs/ExecuteTrajectoryResult.h" + +namespace moveit_msgs +{ + + class ExecuteTrajectoryActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef moveit_msgs::ExecuteTrajectoryResult _result_type; + _result_type result; + + ExecuteTrajectoryActionResult(): + 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 "moveit_msgs/ExecuteTrajectoryActionResult"; }; + virtual const char * getMD5() override { return "2a052ef9772722c8338e057a61e60639"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryFeedback.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryFeedback.h new file mode 100644 index 000000000..b30035323 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryFeedback.h @@ -0,0 +1,55 @@ +#ifndef _ROS_moveit_msgs_ExecuteTrajectoryFeedback_h +#define _ROS_moveit_msgs_ExecuteTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class ExecuteTrajectoryFeedback : public ros::Msg + { + public: + typedef const char* _state_type; + _state_type state; + + ExecuteTrajectoryFeedback(): + state("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_state = strlen(this->state); + varToArr(outbuffer + offset, length_state); + offset += 4; + memcpy(outbuffer + offset, this->state, length_state); + offset += length_state; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/ExecuteTrajectoryFeedback"; }; + virtual const char * getMD5() override { return "af6d3a99f0fbeb66d3248fa4b3e675fb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryGoal.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryGoal.h new file mode 100644 index 000000000..cb1e71fb0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_moveit_msgs_ExecuteTrajectoryGoal_h +#define _ROS_moveit_msgs_ExecuteTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/RobotTrajectory.h" + +namespace moveit_msgs +{ + + class ExecuteTrajectoryGoal : public ros::Msg + { + public: + typedef moveit_msgs::RobotTrajectory _trajectory_type; + _trajectory_type trajectory; + + ExecuteTrajectoryGoal(): + trajectory() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/ExecuteTrajectoryGoal"; }; + virtual const char * getMD5() override { return "054c09e62210d7faad2f9fffdad07b57"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryResult.h new file mode 100644 index 000000000..f8e640833 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ExecuteTrajectoryResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_moveit_msgs_ExecuteTrajectoryResult_h +#define _ROS_moveit_msgs_ExecuteTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MoveItErrorCodes.h" + +namespace moveit_msgs +{ + + class ExecuteTrajectoryResult : public ros::Msg + { + public: + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + + ExecuteTrajectoryResult(): + error_code() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->error_code.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->error_code.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/ExecuteTrajectoryResult"; }; + virtual const char * getMD5() override { return "6a39f41e4bc445a437e9a0cabdd5ef5c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GenericTrajectory.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GenericTrajectory.h new file mode 100644 index 000000000..a85c45926 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GenericTrajectory.h @@ -0,0 +1,96 @@ +#ifndef _ROS_moveit_msgs_GenericTrajectory_h +#define _ROS_moveit_msgs_GenericTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "moveit_msgs/CartesianTrajectory.h" + +namespace moveit_msgs +{ + + class GenericTrajectory : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_trajectory_length; + typedef trajectory_msgs::JointTrajectory _joint_trajectory_type; + _joint_trajectory_type st_joint_trajectory; + _joint_trajectory_type * joint_trajectory; + uint32_t cartesian_trajectory_length; + typedef moveit_msgs::CartesianTrajectory _cartesian_trajectory_type; + _cartesian_trajectory_type st_cartesian_trajectory; + _cartesian_trajectory_type * cartesian_trajectory; + + GenericTrajectory(): + header(), + joint_trajectory_length(0), st_joint_trajectory(), joint_trajectory(nullptr), + cartesian_trajectory_length(0), st_cartesian_trajectory(), cartesian_trajectory(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_trajectory_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_trajectory_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_trajectory_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_trajectory_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_trajectory_length); + for( uint32_t i = 0; i < joint_trajectory_length; i++){ + offset += this->joint_trajectory[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->cartesian_trajectory_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cartesian_trajectory_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cartesian_trajectory_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cartesian_trajectory_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cartesian_trajectory_length); + for( uint32_t i = 0; i < cartesian_trajectory_length; i++){ + offset += this->cartesian_trajectory[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_trajectory_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_trajectory_length); + if(joint_trajectory_lengthT > joint_trajectory_length) + this->joint_trajectory = (trajectory_msgs::JointTrajectory*)realloc(this->joint_trajectory, joint_trajectory_lengthT * sizeof(trajectory_msgs::JointTrajectory)); + joint_trajectory_length = joint_trajectory_lengthT; + for( uint32_t i = 0; i < joint_trajectory_length; i++){ + offset += this->st_joint_trajectory.deserialize(inbuffer + offset); + memcpy( &(this->joint_trajectory[i]), &(this->st_joint_trajectory), sizeof(trajectory_msgs::JointTrajectory)); + } + uint32_t cartesian_trajectory_lengthT = ((uint32_t) (*(inbuffer + offset))); + cartesian_trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cartesian_trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cartesian_trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cartesian_trajectory_length); + if(cartesian_trajectory_lengthT > cartesian_trajectory_length) + this->cartesian_trajectory = (moveit_msgs::CartesianTrajectory*)realloc(this->cartesian_trajectory, cartesian_trajectory_lengthT * sizeof(moveit_msgs::CartesianTrajectory)); + cartesian_trajectory_length = cartesian_trajectory_lengthT; + for( uint32_t i = 0; i < cartesian_trajectory_length; i++){ + offset += this->st_cartesian_trajectory.deserialize(inbuffer + offset); + memcpy( &(this->cartesian_trajectory[i]), &(this->st_cartesian_trajectory), sizeof(moveit_msgs::CartesianTrajectory)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/GenericTrajectory"; }; + virtual const char * getMD5() override { return "d68b5c73072efa2012238a77e49c2c58"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetCartesianPath.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetCartesianPath.h new file mode 100644 index 000000000..f4aa0c8e0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetCartesianPath.h @@ -0,0 +1,230 @@ +#ifndef _ROS_SERVICE_GetCartesianPath_h +#define _ROS_SERVICE_GetCartesianPath_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/Constraints.h" +#include "std_msgs/Header.h" +#include "moveit_msgs/RobotTrajectory.h" +#include "moveit_msgs/RobotState.h" +#include "geometry_msgs/Pose.h" +#include "moveit_msgs/MoveItErrorCodes.h" + +namespace moveit_msgs +{ + +static const char GETCARTESIANPATH[] = "moveit_msgs/GetCartesianPath"; + + class GetCartesianPathRequest : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef moveit_msgs::RobotState _start_state_type; + _start_state_type start_state; + typedef const char* _group_name_type; + _group_name_type group_name; + typedef const char* _link_name_type; + _link_name_type link_name; + uint32_t waypoints_length; + typedef geometry_msgs::Pose _waypoints_type; + _waypoints_type st_waypoints; + _waypoints_type * waypoints; + typedef float _max_step_type; + _max_step_type max_step; + typedef float _jump_threshold_type; + _jump_threshold_type jump_threshold; + typedef float _prismatic_jump_threshold_type; + _prismatic_jump_threshold_type prismatic_jump_threshold; + typedef float _revolute_jump_threshold_type; + _revolute_jump_threshold_type revolute_jump_threshold; + typedef bool _avoid_collisions_type; + _avoid_collisions_type avoid_collisions; + typedef moveit_msgs::Constraints _path_constraints_type; + _path_constraints_type path_constraints; + typedef const char* _cartesian_speed_limited_link_type; + _cartesian_speed_limited_link_type cartesian_speed_limited_link; + typedef float _max_cartesian_speed_type; + _max_cartesian_speed_type max_cartesian_speed; + + GetCartesianPathRequest(): + header(), + start_state(), + group_name(""), + link_name(""), + waypoints_length(0), st_waypoints(), waypoints(nullptr), + max_step(0), + jump_threshold(0), + prismatic_jump_threshold(0), + revolute_jump_threshold(0), + avoid_collisions(0), + path_constraints(), + cartesian_speed_limited_link(""), + max_cartesian_speed(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->start_state.serialize(outbuffer + offset); + uint32_t length_group_name = strlen(this->group_name); + varToArr(outbuffer + offset, length_group_name); + offset += 4; + memcpy(outbuffer + offset, this->group_name, length_group_name); + offset += length_group_name; + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + *(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); + } + offset += serializeAvrFloat64(outbuffer + offset, this->max_step); + offset += serializeAvrFloat64(outbuffer + offset, this->jump_threshold); + offset += serializeAvrFloat64(outbuffer + offset, this->prismatic_jump_threshold); + offset += serializeAvrFloat64(outbuffer + offset, this->revolute_jump_threshold); + union { + bool real; + uint8_t base; + } u_avoid_collisions; + u_avoid_collisions.real = this->avoid_collisions; + *(outbuffer + offset + 0) = (u_avoid_collisions.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->avoid_collisions); + offset += this->path_constraints.serialize(outbuffer + offset); + uint32_t length_cartesian_speed_limited_link = strlen(this->cartesian_speed_limited_link); + varToArr(outbuffer + offset, length_cartesian_speed_limited_link); + offset += 4; + memcpy(outbuffer + offset, this->cartesian_speed_limited_link, length_cartesian_speed_limited_link); + offset += length_cartesian_speed_limited_link; + offset += serializeAvrFloat64(outbuffer + offset, this->max_cartesian_speed); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->start_state.deserialize(inbuffer + offset); + uint32_t length_group_name; + arrToVar(length_group_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group_name-1]=0; + this->group_name = (char *)(inbuffer + offset-1); + offset += length_group_name; + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + 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 = (geometry_msgs::Pose*)realloc(this->waypoints, waypoints_lengthT * sizeof(geometry_msgs::Pose)); + 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(geometry_msgs::Pose)); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_step)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->jump_threshold)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->prismatic_jump_threshold)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->revolute_jump_threshold)); + union { + bool real; + uint8_t base; + } u_avoid_collisions; + u_avoid_collisions.base = 0; + u_avoid_collisions.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->avoid_collisions = u_avoid_collisions.real; + offset += sizeof(this->avoid_collisions); + offset += this->path_constraints.deserialize(inbuffer + offset); + uint32_t length_cartesian_speed_limited_link; + arrToVar(length_cartesian_speed_limited_link, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_cartesian_speed_limited_link; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_cartesian_speed_limited_link-1]=0; + this->cartesian_speed_limited_link = (char *)(inbuffer + offset-1); + offset += length_cartesian_speed_limited_link; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_cartesian_speed)); + return offset; + } + + virtual const char * getType() override { return GETCARTESIANPATH; }; + virtual const char * getMD5() override { return "97b21c683d2b97f701099048039a05af"; }; + + }; + + class GetCartesianPathResponse : public ros::Msg + { + public: + typedef moveit_msgs::RobotState _start_state_type; + _start_state_type start_state; + typedef moveit_msgs::RobotTrajectory _solution_type; + _solution_type solution; + typedef float _fraction_type; + _fraction_type fraction; + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + + GetCartesianPathResponse(): + start_state(), + solution(), + fraction(0), + error_code() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->start_state.serialize(outbuffer + offset); + offset += this->solution.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->fraction); + offset += this->error_code.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->start_state.deserialize(inbuffer + offset); + offset += this->solution.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->fraction)); + offset += this->error_code.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETCARTESIANPATH; }; + virtual const char * getMD5() override { return "13da68a622269d4097c7ad732fb4a27f"; }; + + }; + + class GetCartesianPath { + public: + typedef GetCartesianPathRequest Request; + typedef GetCartesianPathResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetMotionPlan.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetMotionPlan.h new file mode 100644 index 000000000..e07c727ed --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetMotionPlan.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_GetMotionPlan_h +#define _ROS_SERVICE_GetMotionPlan_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MotionPlanRequest.h" +#include "moveit_msgs/MotionPlanResponse.h" + +namespace moveit_msgs +{ + +static const char GETMOTIONPLAN[] = "moveit_msgs/GetMotionPlan"; + + class GetMotionPlanRequest : public ros::Msg + { + public: + typedef moveit_msgs::MotionPlanRequest _motion_plan_request_type; + _motion_plan_request_type motion_plan_request; + + GetMotionPlanRequest(): + motion_plan_request() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->motion_plan_request.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->motion_plan_request.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETMOTIONPLAN; }; + virtual const char * getMD5() override { return "6a898bcb42d7efc5e6953750994b0c60"; }; + + }; + + class GetMotionPlanResponse : public ros::Msg + { + public: + typedef moveit_msgs::MotionPlanResponse _motion_plan_response_type; + _motion_plan_response_type motion_plan_response; + + GetMotionPlanResponse(): + motion_plan_response() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->motion_plan_response.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->motion_plan_response.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETMOTIONPLAN; }; + virtual const char * getMD5() override { return "77f9b8913c41b197c8c0674d43a64622"; }; + + }; + + class GetMotionPlan { + public: + typedef GetMotionPlanRequest Request; + typedef GetMotionPlanResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetMotionSequence.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetMotionSequence.h new file mode 100644 index 000000000..fd302d9ae --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetMotionSequence.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_GetMotionSequence_h +#define _ROS_SERVICE_GetMotionSequence_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MotionSequenceResponse.h" +#include "moveit_msgs/MotionSequenceRequest.h" + +namespace moveit_msgs +{ + +static const char GETMOTIONSEQUENCE[] = "moveit_msgs/GetMotionSequence"; + + class GetMotionSequenceRequest : public ros::Msg + { + public: + typedef moveit_msgs::MotionSequenceRequest _request_type; + _request_type request; + + GetMotionSequenceRequest(): + request() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->request.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->request.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETMOTIONSEQUENCE; }; + virtual const char * getMD5() override { return "5d6557b050683526542723621922afe0"; }; + + }; + + class GetMotionSequenceResponse : public ros::Msg + { + public: + typedef moveit_msgs::MotionSequenceResponse _response_type; + _response_type response; + + GetMotionSequenceResponse(): + response() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->response.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->response.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETMOTIONSEQUENCE; }; + virtual const char * getMD5() override { return "3e3d83067566e443fa885c9428941f17"; }; + + }; + + class GetMotionSequence { + public: + typedef GetMotionSequenceRequest Request; + typedef GetMotionSequenceResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPlannerParams.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPlannerParams.h new file mode 100644 index 000000000..a7181fc87 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPlannerParams.h @@ -0,0 +1,127 @@ +#ifndef _ROS_SERVICE_GetPlannerParams_h +#define _ROS_SERVICE_GetPlannerParams_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/PlannerParams.h" + +namespace moveit_msgs +{ + +static const char GETPLANNERPARAMS[] = "moveit_msgs/GetPlannerParams"; + + class GetPlannerParamsRequest : public ros::Msg + { + public: + typedef const char* _pipeline_id_type; + _pipeline_id_type pipeline_id; + typedef const char* _planner_config_type; + _planner_config_type planner_config; + typedef const char* _group_type; + _group_type group; + + GetPlannerParamsRequest(): + pipeline_id(""), + planner_config(""), + group("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_pipeline_id = strlen(this->pipeline_id); + varToArr(outbuffer + offset, length_pipeline_id); + offset += 4; + memcpy(outbuffer + offset, this->pipeline_id, length_pipeline_id); + offset += length_pipeline_id; + uint32_t length_planner_config = strlen(this->planner_config); + varToArr(outbuffer + offset, length_planner_config); + offset += 4; + memcpy(outbuffer + offset, this->planner_config, length_planner_config); + offset += length_planner_config; + uint32_t length_group = strlen(this->group); + varToArr(outbuffer + offset, length_group); + offset += 4; + memcpy(outbuffer + offset, this->group, length_group); + offset += length_group; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_pipeline_id; + arrToVar(length_pipeline_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pipeline_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pipeline_id-1]=0; + this->pipeline_id = (char *)(inbuffer + offset-1); + offset += length_pipeline_id; + uint32_t length_planner_config; + arrToVar(length_planner_config, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_planner_config; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_planner_config-1]=0; + this->planner_config = (char *)(inbuffer + offset-1); + offset += length_planner_config; + uint32_t length_group; + arrToVar(length_group, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group-1]=0; + this->group = (char *)(inbuffer + offset-1); + offset += length_group; + return offset; + } + + virtual const char * getType() override { return GETPLANNERPARAMS; }; + virtual const char * getMD5() override { return "f5065dceae6a10319c47163ab1012104"; }; + + }; + + class GetPlannerParamsResponse : public ros::Msg + { + public: + typedef moveit_msgs::PlannerParams _params_type; + _params_type params; + + GetPlannerParamsResponse(): + params() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->params.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->params.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETPLANNERPARAMS; }; + virtual const char * getMD5() override { return "462b1bd59976ece800f6a48f2b0bf1a2"; }; + + }; + + class GetPlannerParams { + public: + typedef GetPlannerParamsRequest Request; + typedef GetPlannerParamsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPlanningScene.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPlanningScene.h new file mode 100644 index 000000000..e965b2bb5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPlanningScene.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_GetPlanningScene_h +#define _ROS_SERVICE_GetPlanningScene_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/PlanningScene.h" +#include "moveit_msgs/PlanningSceneComponents.h" + +namespace moveit_msgs +{ + +static const char GETPLANNINGSCENE[] = "moveit_msgs/GetPlanningScene"; + + class GetPlanningSceneRequest : public ros::Msg + { + public: + typedef moveit_msgs::PlanningSceneComponents _components_type; + _components_type components; + + GetPlanningSceneRequest(): + components() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->components.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->components.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETPLANNINGSCENE; }; + virtual const char * getMD5() override { return "d81da6c0e5e015646a4efe344f33d7dc"; }; + + }; + + class GetPlanningSceneResponse : public ros::Msg + { + public: + typedef moveit_msgs::PlanningScene _scene_type; + _scene_type scene; + + GetPlanningSceneResponse(): + scene() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->scene.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->scene.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETPLANNINGSCENE; }; + virtual const char * getMD5() override { return "532b54e7c502b73178625025da63b084"; }; + + }; + + class GetPlanningScene { + public: + typedef GetPlanningSceneRequest Request; + typedef GetPlanningSceneResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPositionFK.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPositionFK.h new file mode 100644 index 000000000..faeefe348 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPositionFK.h @@ -0,0 +1,188 @@ +#ifndef _ROS_SERVICE_GetPositionFK_h +#define _ROS_SERVICE_GetPositionFK_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/MoveItErrorCodes.h" +#include "std_msgs/Header.h" + +namespace moveit_msgs +{ + +static const char GETPOSITIONFK[] = "moveit_msgs/GetPositionFK"; + + class GetPositionFKRequest : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t fk_link_names_length; + typedef char* _fk_link_names_type; + _fk_link_names_type st_fk_link_names; + _fk_link_names_type * fk_link_names; + typedef moveit_msgs::RobotState _robot_state_type; + _robot_state_type robot_state; + + GetPositionFKRequest(): + header(), + fk_link_names_length(0), st_fk_link_names(), fk_link_names(nullptr), + robot_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->fk_link_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fk_link_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fk_link_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fk_link_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->fk_link_names_length); + for( uint32_t i = 0; i < fk_link_names_length; i++){ + uint32_t length_fk_link_namesi = strlen(this->fk_link_names[i]); + varToArr(outbuffer + offset, length_fk_link_namesi); + offset += 4; + memcpy(outbuffer + offset, this->fk_link_names[i], length_fk_link_namesi); + offset += length_fk_link_namesi; + } + offset += this->robot_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t fk_link_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + fk_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + fk_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + fk_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fk_link_names_length); + if(fk_link_names_lengthT > fk_link_names_length) + this->fk_link_names = (char**)realloc(this->fk_link_names, fk_link_names_lengthT * sizeof(char*)); + fk_link_names_length = fk_link_names_lengthT; + for( uint32_t i = 0; i < fk_link_names_length; i++){ + uint32_t length_st_fk_link_names; + arrToVar(length_st_fk_link_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_fk_link_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_fk_link_names-1]=0; + this->st_fk_link_names = (char *)(inbuffer + offset-1); + offset += length_st_fk_link_names; + memcpy( &(this->fk_link_names[i]), &(this->st_fk_link_names), sizeof(char*)); + } + offset += this->robot_state.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETPOSITIONFK; }; + virtual const char * getMD5() override { return "0cc2c8039d5792659dd3a5a92f64c5bb"; }; + + }; + + class GetPositionFKResponse : public ros::Msg + { + public: + uint32_t pose_stamped_length; + typedef geometry_msgs::PoseStamped _pose_stamped_type; + _pose_stamped_type st_pose_stamped; + _pose_stamped_type * pose_stamped; + uint32_t fk_link_names_length; + typedef char* _fk_link_names_type; + _fk_link_names_type st_fk_link_names; + _fk_link_names_type * fk_link_names; + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + + GetPositionFKResponse(): + pose_stamped_length(0), st_pose_stamped(), pose_stamped(nullptr), + fk_link_names_length(0), st_fk_link_names(), fk_link_names(nullptr), + error_code() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->pose_stamped_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pose_stamped_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pose_stamped_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pose_stamped_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->pose_stamped_length); + for( uint32_t i = 0; i < pose_stamped_length; i++){ + offset += this->pose_stamped[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->fk_link_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fk_link_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fk_link_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fk_link_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->fk_link_names_length); + for( uint32_t i = 0; i < fk_link_names_length; i++){ + uint32_t length_fk_link_namesi = strlen(this->fk_link_names[i]); + varToArr(outbuffer + offset, length_fk_link_namesi); + offset += 4; + memcpy(outbuffer + offset, this->fk_link_names[i], length_fk_link_namesi); + offset += length_fk_link_namesi; + } + offset += this->error_code.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t pose_stamped_lengthT = ((uint32_t) (*(inbuffer + offset))); + pose_stamped_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + pose_stamped_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + pose_stamped_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pose_stamped_length); + if(pose_stamped_lengthT > pose_stamped_length) + this->pose_stamped = (geometry_msgs::PoseStamped*)realloc(this->pose_stamped, pose_stamped_lengthT * sizeof(geometry_msgs::PoseStamped)); + pose_stamped_length = pose_stamped_lengthT; + for( uint32_t i = 0; i < pose_stamped_length; i++){ + offset += this->st_pose_stamped.deserialize(inbuffer + offset); + memcpy( &(this->pose_stamped[i]), &(this->st_pose_stamped), sizeof(geometry_msgs::PoseStamped)); + } + uint32_t fk_link_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + fk_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + fk_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + fk_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fk_link_names_length); + if(fk_link_names_lengthT > fk_link_names_length) + this->fk_link_names = (char**)realloc(this->fk_link_names, fk_link_names_lengthT * sizeof(char*)); + fk_link_names_length = fk_link_names_lengthT; + for( uint32_t i = 0; i < fk_link_names_length; i++){ + uint32_t length_st_fk_link_names; + arrToVar(length_st_fk_link_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_fk_link_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_fk_link_names-1]=0; + this->st_fk_link_names = (char *)(inbuffer + offset-1); + offset += length_st_fk_link_names; + memcpy( &(this->fk_link_names[i]), &(this->st_fk_link_names), sizeof(char*)); + } + offset += this->error_code.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETPOSITIONFK; }; + virtual const char * getMD5() override { return "b5b55b32842bebce6b38ffd6b7885acb"; }; + + }; + + class GetPositionFK { + public: + typedef GetPositionFKRequest Request; + typedef GetPositionFKResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPositionIK.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPositionIK.h new file mode 100644 index 000000000..fb5c9928a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetPositionIK.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_GetPositionIK_h +#define _ROS_SERVICE_GetPositionIK_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/PositionIKRequest.h" +#include "moveit_msgs/MoveItErrorCodes.h" +#include "moveit_msgs/RobotState.h" + +namespace moveit_msgs +{ + +static const char GETPOSITIONIK[] = "moveit_msgs/GetPositionIK"; + + class GetPositionIKRequest : public ros::Msg + { + public: + typedef moveit_msgs::PositionIKRequest _ik_request_type; + _ik_request_type ik_request; + + GetPositionIKRequest(): + ik_request() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->ik_request.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->ik_request.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETPOSITIONIK; }; + virtual const char * getMD5() override { return "8388b54598336654bca82763f918a740"; }; + + }; + + class GetPositionIKResponse : public ros::Msg + { + public: + typedef moveit_msgs::RobotState _solution_type; + _solution_type solution; + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + + GetPositionIKResponse(): + solution(), + error_code() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->solution.serialize(outbuffer + offset); + offset += this->error_code.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->solution.deserialize(inbuffer + offset); + offset += this->error_code.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETPOSITIONIK; }; + virtual const char * getMD5() override { return "e86518bd3328ca4065f167ad5ce72802"; }; + + }; + + class GetPositionIK { + public: + typedef GetPositionIKRequest Request; + typedef GetPositionIKResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetRobotStateFromWarehouse.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetRobotStateFromWarehouse.h new file mode 100644 index 000000000..e2a9351b9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetRobotStateFromWarehouse.h @@ -0,0 +1,110 @@ +#ifndef _ROS_SERVICE_GetRobotStateFromWarehouse_h +#define _ROS_SERVICE_GetRobotStateFromWarehouse_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/RobotState.h" + +namespace moveit_msgs +{ + +static const char GETROBOTSTATEFROMWAREHOUSE[] = "moveit_msgs/GetRobotStateFromWarehouse"; + + class GetRobotStateFromWarehouseRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _robot_type; + _robot_type robot; + + GetRobotStateFromWarehouseRequest(): + name(""), + robot("") + { + } + + 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_robot = strlen(this->robot); + varToArr(outbuffer + offset, length_robot); + offset += 4; + memcpy(outbuffer + offset, this->robot, length_robot); + offset += length_robot; + 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_robot; + arrToVar(length_robot, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot-1]=0; + this->robot = (char *)(inbuffer + offset-1); + offset += length_robot; + return offset; + } + + virtual const char * getType() override { return GETROBOTSTATEFROMWAREHOUSE; }; + virtual const char * getMD5() override { return "dab44354403f811c40b84964e068219c"; }; + + }; + + class GetRobotStateFromWarehouseResponse : public ros::Msg + { + public: + typedef moveit_msgs::RobotState _state_type; + _state_type state; + + GetRobotStateFromWarehouseResponse(): + state() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->state.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETROBOTSTATEFROMWAREHOUSE; }; + virtual const char * getMD5() override { return "32b39d3cd2b342c3c43eb44df55f86e0"; }; + + }; + + class GetRobotStateFromWarehouse { + public: + typedef GetRobotStateFromWarehouseRequest Request; + typedef GetRobotStateFromWarehouseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetStateValidity.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetStateValidity.h new file mode 100644 index 000000000..8cd36cafe --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GetStateValidity.h @@ -0,0 +1,195 @@ +#ifndef _ROS_SERVICE_GetStateValidity_h +#define _ROS_SERVICE_GetStateValidity_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/Constraints.h" +#include "moveit_msgs/ConstraintEvalResult.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/ContactInformation.h" +#include "moveit_msgs/CostSource.h" + +namespace moveit_msgs +{ + +static const char GETSTATEVALIDITY[] = "moveit_msgs/GetStateValidity"; + + class GetStateValidityRequest : public ros::Msg + { + public: + typedef moveit_msgs::RobotState _robot_state_type; + _robot_state_type robot_state; + typedef const char* _group_name_type; + _group_name_type group_name; + typedef moveit_msgs::Constraints _constraints_type; + _constraints_type constraints; + + GetStateValidityRequest(): + robot_state(), + group_name(""), + constraints() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->robot_state.serialize(outbuffer + offset); + uint32_t length_group_name = strlen(this->group_name); + varToArr(outbuffer + offset, length_group_name); + offset += 4; + memcpy(outbuffer + offset, this->group_name, length_group_name); + offset += length_group_name; + offset += this->constraints.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->robot_state.deserialize(inbuffer + offset); + uint32_t length_group_name; + arrToVar(length_group_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group_name-1]=0; + this->group_name = (char *)(inbuffer + offset-1); + offset += length_group_name; + offset += this->constraints.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETSTATEVALIDITY; }; + virtual const char * getMD5() override { return "a82b6cce5fd6d63051640aef60a848b1"; }; + + }; + + class GetStateValidityResponse : public ros::Msg + { + public: + typedef bool _valid_type; + _valid_type valid; + uint32_t contacts_length; + typedef moveit_msgs::ContactInformation _contacts_type; + _contacts_type st_contacts; + _contacts_type * contacts; + uint32_t cost_sources_length; + typedef moveit_msgs::CostSource _cost_sources_type; + _cost_sources_type st_cost_sources; + _cost_sources_type * cost_sources; + uint32_t constraint_result_length; + typedef moveit_msgs::ConstraintEvalResult _constraint_result_type; + _constraint_result_type st_constraint_result; + _constraint_result_type * constraint_result; + + GetStateValidityResponse(): + valid(0), + contacts_length(0), st_contacts(), contacts(nullptr), + cost_sources_length(0), st_cost_sources(), cost_sources(nullptr), + constraint_result_length(0), st_constraint_result(), constraint_result(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_valid; + u_valid.real = this->valid; + *(outbuffer + offset + 0) = (u_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->valid); + *(outbuffer + offset + 0) = (this->contacts_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->contacts_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->contacts_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->contacts_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->contacts_length); + for( uint32_t i = 0; i < contacts_length; i++){ + offset += this->contacts[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->cost_sources_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cost_sources_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cost_sources_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cost_sources_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cost_sources_length); + for( uint32_t i = 0; i < cost_sources_length; i++){ + offset += this->cost_sources[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->constraint_result_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->constraint_result_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->constraint_result_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->constraint_result_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->constraint_result_length); + for( uint32_t i = 0; i < constraint_result_length; i++){ + offset += this->constraint_result[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_valid; + u_valid.base = 0; + u_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->valid = u_valid.real; + offset += sizeof(this->valid); + uint32_t contacts_lengthT = ((uint32_t) (*(inbuffer + offset))); + contacts_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + contacts_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + contacts_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->contacts_length); + if(contacts_lengthT > contacts_length) + this->contacts = (moveit_msgs::ContactInformation*)realloc(this->contacts, contacts_lengthT * sizeof(moveit_msgs::ContactInformation)); + contacts_length = contacts_lengthT; + for( uint32_t i = 0; i < contacts_length; i++){ + offset += this->st_contacts.deserialize(inbuffer + offset); + memcpy( &(this->contacts[i]), &(this->st_contacts), sizeof(moveit_msgs::ContactInformation)); + } + uint32_t cost_sources_lengthT = ((uint32_t) (*(inbuffer + offset))); + cost_sources_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cost_sources_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cost_sources_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cost_sources_length); + if(cost_sources_lengthT > cost_sources_length) + this->cost_sources = (moveit_msgs::CostSource*)realloc(this->cost_sources, cost_sources_lengthT * sizeof(moveit_msgs::CostSource)); + cost_sources_length = cost_sources_lengthT; + for( uint32_t i = 0; i < cost_sources_length; i++){ + offset += this->st_cost_sources.deserialize(inbuffer + offset); + memcpy( &(this->cost_sources[i]), &(this->st_cost_sources), sizeof(moveit_msgs::CostSource)); + } + uint32_t constraint_result_lengthT = ((uint32_t) (*(inbuffer + offset))); + constraint_result_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + constraint_result_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + constraint_result_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->constraint_result_length); + if(constraint_result_lengthT > constraint_result_length) + this->constraint_result = (moveit_msgs::ConstraintEvalResult*)realloc(this->constraint_result, constraint_result_lengthT * sizeof(moveit_msgs::ConstraintEvalResult)); + constraint_result_length = constraint_result_lengthT; + for( uint32_t i = 0; i < constraint_result_length; i++){ + offset += this->st_constraint_result.deserialize(inbuffer + offset); + memcpy( &(this->constraint_result[i]), &(this->st_constraint_result), sizeof(moveit_msgs::ConstraintEvalResult)); + } + return offset; + } + + virtual const char * getType() override { return GETSTATEVALIDITY; }; + virtual const char * getMD5() override { return "e326fb22b7448f29c0e726d9270d9929"; }; + + }; + + class GetStateValidity { + public: + typedef GetStateValidityRequest Request; + typedef GetStateValidityResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/Grasp.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/Grasp.h new file mode 100644 index 000000000..f12cf1785 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/Grasp.h @@ -0,0 +1,154 @@ +#ifndef _ROS_moveit_msgs_Grasp_h +#define _ROS_moveit_msgs_Grasp_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "geometry_msgs/PoseStamped.h" +#include "moveit_msgs/GripperTranslation.h" + +namespace moveit_msgs +{ + + class Grasp : public ros::Msg + { + public: + typedef const char* _id_type; + _id_type id; + typedef trajectory_msgs::JointTrajectory _pre_grasp_posture_type; + _pre_grasp_posture_type pre_grasp_posture; + typedef trajectory_msgs::JointTrajectory _grasp_posture_type; + _grasp_posture_type grasp_posture; + typedef geometry_msgs::PoseStamped _grasp_pose_type; + _grasp_pose_type grasp_pose; + typedef float _grasp_quality_type; + _grasp_quality_type grasp_quality; + typedef moveit_msgs::GripperTranslation _pre_grasp_approach_type; + _pre_grasp_approach_type pre_grasp_approach; + typedef moveit_msgs::GripperTranslation _post_grasp_retreat_type; + _post_grasp_retreat_type post_grasp_retreat; + typedef moveit_msgs::GripperTranslation _post_place_retreat_type; + _post_place_retreat_type post_place_retreat; + typedef float _max_contact_force_type; + _max_contact_force_type max_contact_force; + uint32_t allowed_touch_objects_length; + typedef char* _allowed_touch_objects_type; + _allowed_touch_objects_type st_allowed_touch_objects; + _allowed_touch_objects_type * allowed_touch_objects; + + Grasp(): + id(""), + pre_grasp_posture(), + grasp_posture(), + grasp_pose(), + grasp_quality(0), + pre_grasp_approach(), + post_grasp_retreat(), + post_place_retreat(), + max_contact_force(0), + allowed_touch_objects_length(0), st_allowed_touch_objects(), allowed_touch_objects(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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 += this->pre_grasp_posture.serialize(outbuffer + offset); + offset += this->grasp_posture.serialize(outbuffer + offset); + offset += this->grasp_pose.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->grasp_quality); + offset += this->pre_grasp_approach.serialize(outbuffer + offset); + offset += this->post_grasp_retreat.serialize(outbuffer + offset); + offset += this->post_place_retreat.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_max_contact_force; + u_max_contact_force.real = this->max_contact_force; + *(outbuffer + offset + 0) = (u_max_contact_force.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_contact_force.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_contact_force.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_contact_force.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_contact_force); + *(outbuffer + offset + 0) = (this->allowed_touch_objects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->allowed_touch_objects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->allowed_touch_objects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->allowed_touch_objects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->allowed_touch_objects_length); + for( uint32_t i = 0; i < allowed_touch_objects_length; i++){ + uint32_t length_allowed_touch_objectsi = strlen(this->allowed_touch_objects[i]); + varToArr(outbuffer + offset, length_allowed_touch_objectsi); + offset += 4; + memcpy(outbuffer + offset, this->allowed_touch_objects[i], length_allowed_touch_objectsi); + offset += length_allowed_touch_objectsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 += this->pre_grasp_posture.deserialize(inbuffer + offset); + offset += this->grasp_posture.deserialize(inbuffer + offset); + offset += this->grasp_pose.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->grasp_quality)); + offset += this->pre_grasp_approach.deserialize(inbuffer + offset); + offset += this->post_grasp_retreat.deserialize(inbuffer + offset); + offset += this->post_place_retreat.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_max_contact_force; + u_max_contact_force.base = 0; + u_max_contact_force.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_contact_force.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_contact_force.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_contact_force.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_contact_force = u_max_contact_force.real; + offset += sizeof(this->max_contact_force); + uint32_t allowed_touch_objects_lengthT = ((uint32_t) (*(inbuffer + offset))); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->allowed_touch_objects_length); + if(allowed_touch_objects_lengthT > allowed_touch_objects_length) + this->allowed_touch_objects = (char**)realloc(this->allowed_touch_objects, allowed_touch_objects_lengthT * sizeof(char*)); + allowed_touch_objects_length = allowed_touch_objects_lengthT; + for( uint32_t i = 0; i < allowed_touch_objects_length; i++){ + uint32_t length_st_allowed_touch_objects; + arrToVar(length_st_allowed_touch_objects, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_allowed_touch_objects; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_allowed_touch_objects-1]=0; + this->st_allowed_touch_objects = (char *)(inbuffer + offset-1); + offset += length_st_allowed_touch_objects; + memcpy( &(this->allowed_touch_objects[i]), &(this->st_allowed_touch_objects), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/Grasp"; }; + virtual const char * getMD5() override { return "e26c8fb64f589c33c5d5e54bd7b5e4cb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GraspPlanning.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GraspPlanning.h new file mode 100644 index 000000000..357dc58a3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GraspPlanning.h @@ -0,0 +1,212 @@ +#ifndef _ROS_SERVICE_GraspPlanning_h +#define _ROS_SERVICE_GraspPlanning_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/CollisionObject.h" +#include "moveit_msgs/Grasp.h" +#include "moveit_msgs/MoveItErrorCodes.h" + +namespace moveit_msgs +{ + +static const char GRASPPLANNING[] = "moveit_msgs/GraspPlanning"; + + class GraspPlanningRequest : public ros::Msg + { + public: + typedef const char* _group_name_type; + _group_name_type group_name; + typedef moveit_msgs::CollisionObject _target_type; + _target_type target; + uint32_t support_surfaces_length; + typedef char* _support_surfaces_type; + _support_surfaces_type st_support_surfaces; + _support_surfaces_type * support_surfaces; + uint32_t candidate_grasps_length; + typedef moveit_msgs::Grasp _candidate_grasps_type; + _candidate_grasps_type st_candidate_grasps; + _candidate_grasps_type * candidate_grasps; + uint32_t movable_obstacles_length; + typedef moveit_msgs::CollisionObject _movable_obstacles_type; + _movable_obstacles_type st_movable_obstacles; + _movable_obstacles_type * movable_obstacles; + + GraspPlanningRequest(): + group_name(""), + target(), + support_surfaces_length(0), st_support_surfaces(), support_surfaces(nullptr), + candidate_grasps_length(0), st_candidate_grasps(), candidate_grasps(nullptr), + movable_obstacles_length(0), st_movable_obstacles(), movable_obstacles(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_group_name = strlen(this->group_name); + varToArr(outbuffer + offset, length_group_name); + offset += 4; + memcpy(outbuffer + offset, this->group_name, length_group_name); + offset += length_group_name; + offset += this->target.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->support_surfaces_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->support_surfaces_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->support_surfaces_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->support_surfaces_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->support_surfaces_length); + for( uint32_t i = 0; i < support_surfaces_length; i++){ + uint32_t length_support_surfacesi = strlen(this->support_surfaces[i]); + varToArr(outbuffer + offset, length_support_surfacesi); + offset += 4; + memcpy(outbuffer + offset, this->support_surfaces[i], length_support_surfacesi); + offset += length_support_surfacesi; + } + *(outbuffer + offset + 0) = (this->candidate_grasps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->candidate_grasps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->candidate_grasps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->candidate_grasps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->candidate_grasps_length); + for( uint32_t i = 0; i < candidate_grasps_length; i++){ + offset += this->candidate_grasps[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->movable_obstacles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->movable_obstacles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->movable_obstacles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->movable_obstacles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->movable_obstacles_length); + for( uint32_t i = 0; i < movable_obstacles_length; i++){ + offset += this->movable_obstacles[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_group_name; + arrToVar(length_group_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group_name-1]=0; + this->group_name = (char *)(inbuffer + offset-1); + offset += length_group_name; + offset += this->target.deserialize(inbuffer + offset); + uint32_t support_surfaces_lengthT = ((uint32_t) (*(inbuffer + offset))); + support_surfaces_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + support_surfaces_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + support_surfaces_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->support_surfaces_length); + if(support_surfaces_lengthT > support_surfaces_length) + this->support_surfaces = (char**)realloc(this->support_surfaces, support_surfaces_lengthT * sizeof(char*)); + support_surfaces_length = support_surfaces_lengthT; + for( uint32_t i = 0; i < support_surfaces_length; i++){ + uint32_t length_st_support_surfaces; + arrToVar(length_st_support_surfaces, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_support_surfaces; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_support_surfaces-1]=0; + this->st_support_surfaces = (char *)(inbuffer + offset-1); + offset += length_st_support_surfaces; + memcpy( &(this->support_surfaces[i]), &(this->st_support_surfaces), sizeof(char*)); + } + uint32_t candidate_grasps_lengthT = ((uint32_t) (*(inbuffer + offset))); + candidate_grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + candidate_grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + candidate_grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->candidate_grasps_length); + if(candidate_grasps_lengthT > candidate_grasps_length) + this->candidate_grasps = (moveit_msgs::Grasp*)realloc(this->candidate_grasps, candidate_grasps_lengthT * sizeof(moveit_msgs::Grasp)); + candidate_grasps_length = candidate_grasps_lengthT; + for( uint32_t i = 0; i < candidate_grasps_length; i++){ + offset += this->st_candidate_grasps.deserialize(inbuffer + offset); + memcpy( &(this->candidate_grasps[i]), &(this->st_candidate_grasps), sizeof(moveit_msgs::Grasp)); + } + uint32_t movable_obstacles_lengthT = ((uint32_t) (*(inbuffer + offset))); + movable_obstacles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + movable_obstacles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + movable_obstacles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->movable_obstacles_length); + if(movable_obstacles_lengthT > movable_obstacles_length) + this->movable_obstacles = (moveit_msgs::CollisionObject*)realloc(this->movable_obstacles, movable_obstacles_lengthT * sizeof(moveit_msgs::CollisionObject)); + movable_obstacles_length = movable_obstacles_lengthT; + for( uint32_t i = 0; i < movable_obstacles_length; i++){ + offset += this->st_movable_obstacles.deserialize(inbuffer + offset); + memcpy( &(this->movable_obstacles[i]), &(this->st_movable_obstacles), sizeof(moveit_msgs::CollisionObject)); + } + return offset; + } + + virtual const char * getType() override { return GRASPPLANNING; }; + virtual const char * getMD5() override { return "213bcb2a85f6f966990ab629958810a1"; }; + + }; + + class GraspPlanningResponse : public ros::Msg + { + public: + uint32_t grasps_length; + typedef moveit_msgs::Grasp _grasps_type; + _grasps_type st_grasps; + _grasps_type * grasps; + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + + GraspPlanningResponse(): + grasps_length(0), st_grasps(), grasps(nullptr), + error_code() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->grasps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->grasps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->grasps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->grasps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->grasps_length); + for( uint32_t i = 0; i < grasps_length; i++){ + offset += this->grasps[i].serialize(outbuffer + offset); + } + offset += this->error_code.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t grasps_lengthT = ((uint32_t) (*(inbuffer + offset))); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->grasps_length); + if(grasps_lengthT > grasps_length) + this->grasps = (moveit_msgs::Grasp*)realloc(this->grasps, grasps_lengthT * sizeof(moveit_msgs::Grasp)); + grasps_length = grasps_lengthT; + for( uint32_t i = 0; i < grasps_length; i++){ + offset += this->st_grasps.deserialize(inbuffer + offset); + memcpy( &(this->grasps[i]), &(this->st_grasps), sizeof(moveit_msgs::Grasp)); + } + offset += this->error_code.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GRASPPLANNING; }; + virtual const char * getMD5() override { return "b49a22b3918a7c0273d5d32f0149ae9f"; }; + + }; + + class GraspPlanning { + public: + typedef GraspPlanningRequest Request; + typedef GraspPlanningResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GripperTranslation.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GripperTranslation.h new file mode 100644 index 000000000..f577fcaca --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/GripperTranslation.h @@ -0,0 +1,92 @@ +#ifndef _ROS_moveit_msgs_GripperTranslation_h +#define _ROS_moveit_msgs_GripperTranslation_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3Stamped.h" + +namespace moveit_msgs +{ + + class GripperTranslation : public ros::Msg + { + public: + typedef geometry_msgs::Vector3Stamped _direction_type; + _direction_type direction; + typedef float _desired_distance_type; + _desired_distance_type desired_distance; + typedef float _min_distance_type; + _min_distance_type min_distance; + + GripperTranslation(): + direction(), + desired_distance(0), + min_distance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->direction.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_desired_distance; + u_desired_distance.real = this->desired_distance; + *(outbuffer + offset + 0) = (u_desired_distance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_desired_distance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_desired_distance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_desired_distance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->desired_distance); + union { + float real; + uint32_t base; + } u_min_distance; + u_min_distance.real = this->min_distance; + *(outbuffer + offset + 0) = (u_min_distance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_distance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_distance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_distance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_distance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->direction.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_desired_distance; + u_desired_distance.base = 0; + u_desired_distance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_desired_distance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_desired_distance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_desired_distance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->desired_distance = u_desired_distance.real; + offset += sizeof(this->desired_distance); + union { + float real; + uint32_t base; + } u_min_distance; + u_min_distance.base = 0; + u_min_distance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_distance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_distance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_distance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_distance = u_min_distance.real; + offset += sizeof(this->min_distance); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/GripperTranslation"; }; + virtual const char * getMD5() override { return "b53bc0ad0f717cdec3b0e42dec300121"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/JointConstraint.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/JointConstraint.h new file mode 100644 index 000000000..3a3d1b69c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/JointConstraint.h @@ -0,0 +1,75 @@ +#ifndef _ROS_moveit_msgs_JointConstraint_h +#define _ROS_moveit_msgs_JointConstraint_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class JointConstraint : public ros::Msg + { + public: + typedef const char* _joint_name_type; + _joint_name_type joint_name; + typedef float _position_type; + _position_type position; + typedef float _tolerance_above_type; + _tolerance_above_type tolerance_above; + typedef float _tolerance_below_type; + _tolerance_below_type tolerance_below; + typedef float _weight_type; + _weight_type weight; + + JointConstraint(): + joint_name(""), + position(0), + tolerance_above(0), + tolerance_below(0), + weight(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + varToArr(outbuffer + offset, length_joint_name); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->tolerance_above); + offset += serializeAvrFloat64(outbuffer + offset, this->tolerance_below); + offset += serializeAvrFloat64(outbuffer + offset, this->weight); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_joint_name; + arrToVar(length_joint_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->tolerance_above)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->tolerance_below)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->weight)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/JointConstraint"; }; + virtual const char * getMD5() override { return "c02a15146bec0ce13564807805b008f0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/JointLimits.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/JointLimits.h new file mode 100644 index 000000000..d55bb1972 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/JointLimits.h @@ -0,0 +1,129 @@ +#ifndef _ROS_moveit_msgs_JointLimits_h +#define _ROS_moveit_msgs_JointLimits_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class JointLimits : public ros::Msg + { + public: + typedef const char* _joint_name_type; + _joint_name_type joint_name; + typedef bool _has_position_limits_type; + _has_position_limits_type has_position_limits; + typedef float _min_position_type; + _min_position_type min_position; + typedef float _max_position_type; + _max_position_type max_position; + typedef bool _has_velocity_limits_type; + _has_velocity_limits_type has_velocity_limits; + typedef float _max_velocity_type; + _max_velocity_type max_velocity; + typedef bool _has_acceleration_limits_type; + _has_acceleration_limits_type has_acceleration_limits; + typedef float _max_acceleration_type; + _max_acceleration_type max_acceleration; + + JointLimits(): + joint_name(""), + has_position_limits(0), + min_position(0), + max_position(0), + has_velocity_limits(0), + max_velocity(0), + has_acceleration_limits(0), + max_acceleration(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + varToArr(outbuffer + offset, length_joint_name); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + union { + bool real; + uint8_t base; + } u_has_position_limits; + u_has_position_limits.real = this->has_position_limits; + *(outbuffer + offset + 0) = (u_has_position_limits.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->has_position_limits); + offset += serializeAvrFloat64(outbuffer + offset, this->min_position); + offset += serializeAvrFloat64(outbuffer + offset, this->max_position); + union { + bool real; + uint8_t base; + } u_has_velocity_limits; + u_has_velocity_limits.real = this->has_velocity_limits; + *(outbuffer + offset + 0) = (u_has_velocity_limits.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->has_velocity_limits); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + union { + bool real; + uint8_t base; + } u_has_acceleration_limits; + u_has_acceleration_limits.real = this->has_acceleration_limits; + *(outbuffer + offset + 0) = (u_has_acceleration_limits.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->has_acceleration_limits); + offset += serializeAvrFloat64(outbuffer + offset, this->max_acceleration); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_joint_name; + arrToVar(length_joint_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + union { + bool real; + uint8_t base; + } u_has_position_limits; + u_has_position_limits.base = 0; + u_has_position_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->has_position_limits = u_has_position_limits.real; + offset += sizeof(this->has_position_limits); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_position)); + union { + bool real; + uint8_t base; + } u_has_velocity_limits; + u_has_velocity_limits.base = 0; + u_has_velocity_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->has_velocity_limits = u_has_velocity_limits.real; + offset += sizeof(this->has_velocity_limits); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + union { + bool real; + uint8_t base; + } u_has_acceleration_limits; + u_has_acceleration_limits.base = 0; + u_has_acceleration_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->has_acceleration_limits = u_has_acceleration_limits.real; + offset += sizeof(this->has_acceleration_limits); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_acceleration)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/JointLimits"; }; + virtual const char * getMD5() override { return "8ca618c7329ea46142cbc864a2efe856"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/KinematicSolverInfo.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/KinematicSolverInfo.h new file mode 100644 index 000000000..a71cf4f84 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/KinematicSolverInfo.h @@ -0,0 +1,138 @@ +#ifndef _ROS_moveit_msgs_KinematicSolverInfo_h +#define _ROS_moveit_msgs_KinematicSolverInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/JointLimits.h" + +namespace moveit_msgs +{ + + class KinematicSolverInfo : public ros::Msg + { + public: + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t limits_length; + typedef moveit_msgs::JointLimits _limits_type; + _limits_type st_limits; + _limits_type * limits; + uint32_t link_names_length; + typedef char* _link_names_type; + _link_names_type st_link_names; + _link_names_type * link_names; + + KinematicSolverInfo(): + joint_names_length(0), st_joint_names(), joint_names(nullptr), + limits_length(0), st_limits(), limits(nullptr), + link_names_length(0), st_link_names(), link_names(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset + 0) = (this->limits_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->limits_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->limits_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->limits_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->limits_length); + for( uint32_t i = 0; i < limits_length; i++){ + offset += this->limits[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->link_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->link_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->link_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->link_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->link_names_length); + for( uint32_t i = 0; i < link_names_length; i++){ + uint32_t length_link_namesi = strlen(this->link_names[i]); + varToArr(outbuffer + offset, length_link_namesi); + offset += 4; + memcpy(outbuffer + offset, this->link_names[i], length_link_namesi); + offset += length_link_namesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint32_t limits_lengthT = ((uint32_t) (*(inbuffer + offset))); + limits_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + limits_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + limits_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->limits_length); + if(limits_lengthT > limits_length) + this->limits = (moveit_msgs::JointLimits*)realloc(this->limits, limits_lengthT * sizeof(moveit_msgs::JointLimits)); + limits_length = limits_lengthT; + for( uint32_t i = 0; i < limits_length; i++){ + offset += this->st_limits.deserialize(inbuffer + offset); + memcpy( &(this->limits[i]), &(this->st_limits), sizeof(moveit_msgs::JointLimits)); + } + uint32_t link_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->link_names_length); + if(link_names_lengthT > link_names_length) + this->link_names = (char**)realloc(this->link_names, link_names_lengthT * sizeof(char*)); + link_names_length = link_names_lengthT; + for( uint32_t i = 0; i < link_names_length; i++){ + uint32_t length_st_link_names; + arrToVar(length_st_link_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_link_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_link_names-1]=0; + this->st_link_names = (char *)(inbuffer + offset-1); + offset += length_st_link_names; + memcpy( &(this->link_names[i]), &(this->st_link_names), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/KinematicSolverInfo"; }; + virtual const char * getMD5() override { return "cc048557c0f9795c392dd80f8bb00489"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LinkPadding.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LinkPadding.h new file mode 100644 index 000000000..29632a09c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LinkPadding.h @@ -0,0 +1,60 @@ +#ifndef _ROS_moveit_msgs_LinkPadding_h +#define _ROS_moveit_msgs_LinkPadding_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class LinkPadding : public ros::Msg + { + public: + typedef const char* _link_name_type; + _link_name_type link_name; + typedef float _padding_type; + _padding_type padding; + + LinkPadding(): + link_name(""), + padding(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += serializeAvrFloat64(outbuffer + offset, this->padding); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->padding)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/LinkPadding"; }; + virtual const char * getMD5() override { return "b3ea75670df55c696fedee97774d5947"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LinkScale.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LinkScale.h new file mode 100644 index 000000000..f7d02a16d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LinkScale.h @@ -0,0 +1,60 @@ +#ifndef _ROS_moveit_msgs_LinkScale_h +#define _ROS_moveit_msgs_LinkScale_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class LinkScale : public ros::Msg + { + public: + typedef const char* _link_name_type; + _link_name_type link_name; + typedef float _scale_type; + _scale_type scale; + + LinkScale(): + link_name(""), + scale(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += serializeAvrFloat64(outbuffer + offset, this->scale); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->scale)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/LinkScale"; }; + virtual const char * getMD5() override { return "19faf226446bfb2f645a4da6f2a56166"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ListRobotStatesInWarehouse.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ListRobotStatesInWarehouse.h new file mode 100644 index 000000000..367ddbc2d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ListRobotStatesInWarehouse.h @@ -0,0 +1,141 @@ +#ifndef _ROS_SERVICE_ListRobotStatesInWarehouse_h +#define _ROS_SERVICE_ListRobotStatesInWarehouse_h +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + +static const char LISTROBOTSTATESINWAREHOUSE[] = "moveit_msgs/ListRobotStatesInWarehouse"; + + class ListRobotStatesInWarehouseRequest : public ros::Msg + { + public: + typedef const char* _regex_type; + _regex_type regex; + typedef const char* _robot_type; + _robot_type robot; + + ListRobotStatesInWarehouseRequest(): + regex(""), + robot("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_regex = strlen(this->regex); + varToArr(outbuffer + offset, length_regex); + offset += 4; + memcpy(outbuffer + offset, this->regex, length_regex); + offset += length_regex; + uint32_t length_robot = strlen(this->robot); + varToArr(outbuffer + offset, length_robot); + offset += 4; + memcpy(outbuffer + offset, this->robot, length_robot); + offset += length_robot; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_regex; + arrToVar(length_regex, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_regex; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_regex-1]=0; + this->regex = (char *)(inbuffer + offset-1); + offset += length_regex; + uint32_t length_robot; + arrToVar(length_robot, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot-1]=0; + this->robot = (char *)(inbuffer + offset-1); + offset += length_robot; + return offset; + } + + virtual const char * getType() override { return LISTROBOTSTATESINWAREHOUSE; }; + virtual const char * getMD5() override { return "6f0970a3ca837e2fc3ed63e314b44b42"; }; + + }; + + class ListRobotStatesInWarehouseResponse : public ros::Msg + { + public: + uint32_t states_length; + typedef char* _states_type; + _states_type st_states; + _states_type * states; + + ListRobotStatesInWarehouseResponse(): + states_length(0), st_states(), states(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->states_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->states_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->states_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->states_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->states_length); + for( uint32_t i = 0; i < states_length; i++){ + uint32_t length_statesi = strlen(this->states[i]); + varToArr(outbuffer + offset, length_statesi); + offset += 4; + memcpy(outbuffer + offset, this->states[i], length_statesi); + offset += length_statesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t states_lengthT = ((uint32_t) (*(inbuffer + offset))); + states_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + states_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + states_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->states_length); + if(states_lengthT > states_length) + this->states = (char**)realloc(this->states, states_lengthT * sizeof(char*)); + states_length = states_lengthT; + for( uint32_t i = 0; i < states_length; i++){ + uint32_t length_st_states; + arrToVar(length_st_states, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_states-1]=0; + this->st_states = (char *)(inbuffer + offset-1); + offset += length_st_states; + memcpy( &(this->states[i]), &(this->st_states), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return LISTROBOTSTATESINWAREHOUSE; }; + virtual const char * getMD5() override { return "a8656b247c0429bb79afe0ddb88eb2f5"; }; + + }; + + class ListRobotStatesInWarehouse { + public: + typedef ListRobotStatesInWarehouseRequest Request; + typedef ListRobotStatesInWarehouseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LoadMap.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LoadMap.h new file mode 100644 index 000000000..d6051570e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/LoadMap.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_LoadMap_h +#define _ROS_SERVICE_LoadMap_h +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + +static const char LOADMAP[] = "moveit_msgs/LoadMap"; + + class LoadMapRequest : public ros::Msg + { + public: + typedef const char* _filename_type; + _filename_type filename; + + LoadMapRequest(): + filename("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_filename = strlen(this->filename); + varToArr(outbuffer + offset, length_filename); + offset += 4; + memcpy(outbuffer + offset, this->filename, length_filename); + offset += length_filename; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_filename; + arrToVar(length_filename, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_filename; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_filename-1]=0; + this->filename = (char *)(inbuffer + offset-1); + offset += length_filename; + return offset; + } + + virtual const char * getType() override { return LOADMAP; }; + virtual const char * getMD5() override { return "030824f52a0628ead956fb9d67e66ae9"; }; + + }; + + class LoadMapResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + LoadMapResponse(): + 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 LOADMAP; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class LoadMap { + public: + typedef LoadMapRequest Request; + typedef LoadMapResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanDetailedResponse.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanDetailedResponse.h new file mode 100644 index 000000000..78c93d77b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanDetailedResponse.h @@ -0,0 +1,155 @@ +#ifndef _ROS_moveit_msgs_MotionPlanDetailedResponse_h +#define _ROS_moveit_msgs_MotionPlanDetailedResponse_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/RobotTrajectory.h" +#include "moveit_msgs/MoveItErrorCodes.h" + +namespace moveit_msgs +{ + + class MotionPlanDetailedResponse : public ros::Msg + { + public: + typedef moveit_msgs::RobotState _trajectory_start_type; + _trajectory_start_type trajectory_start; + typedef const char* _group_name_type; + _group_name_type group_name; + uint32_t trajectory_length; + typedef moveit_msgs::RobotTrajectory _trajectory_type; + _trajectory_type st_trajectory; + _trajectory_type * trajectory; + uint32_t description_length; + typedef char* _description_type; + _description_type st_description; + _description_type * description; + uint32_t processing_time_length; + typedef float _processing_time_type; + _processing_time_type st_processing_time; + _processing_time_type * processing_time; + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + + MotionPlanDetailedResponse(): + trajectory_start(), + group_name(""), + trajectory_length(0), st_trajectory(), trajectory(nullptr), + description_length(0), st_description(), description(nullptr), + processing_time_length(0), st_processing_time(), processing_time(nullptr), + error_code() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->trajectory_start.serialize(outbuffer + offset); + uint32_t length_group_name = strlen(this->group_name); + varToArr(outbuffer + offset, length_group_name); + offset += 4; + memcpy(outbuffer + offset, this->group_name, length_group_name); + offset += length_group_name; + *(outbuffer + offset + 0) = (this->trajectory_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->trajectory_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->trajectory_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->trajectory_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->trajectory_length); + for( uint32_t i = 0; i < trajectory_length; i++){ + offset += this->trajectory[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->description_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->description_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->description_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->description_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->description_length); + for( uint32_t i = 0; i < description_length; i++){ + uint32_t length_descriptioni = strlen(this->description[i]); + varToArr(outbuffer + offset, length_descriptioni); + offset += 4; + memcpy(outbuffer + offset, this->description[i], length_descriptioni); + offset += length_descriptioni; + } + *(outbuffer + offset + 0) = (this->processing_time_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->processing_time_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->processing_time_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->processing_time_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->processing_time_length); + for( uint32_t i = 0; i < processing_time_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->processing_time[i]); + } + offset += this->error_code.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->trajectory_start.deserialize(inbuffer + offset); + uint32_t length_group_name; + arrToVar(length_group_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group_name-1]=0; + this->group_name = (char *)(inbuffer + offset-1); + offset += length_group_name; + uint32_t trajectory_lengthT = ((uint32_t) (*(inbuffer + offset))); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->trajectory_length); + if(trajectory_lengthT > trajectory_length) + this->trajectory = (moveit_msgs::RobotTrajectory*)realloc(this->trajectory, trajectory_lengthT * sizeof(moveit_msgs::RobotTrajectory)); + trajectory_length = trajectory_lengthT; + for( uint32_t i = 0; i < trajectory_length; i++){ + offset += this->st_trajectory.deserialize(inbuffer + offset); + memcpy( &(this->trajectory[i]), &(this->st_trajectory), sizeof(moveit_msgs::RobotTrajectory)); + } + uint32_t description_lengthT = ((uint32_t) (*(inbuffer + offset))); + description_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + description_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + description_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->description_length); + if(description_lengthT > description_length) + this->description = (char**)realloc(this->description, description_lengthT * sizeof(char*)); + description_length = description_lengthT; + for( uint32_t i = 0; i < description_length; i++){ + uint32_t length_st_description; + arrToVar(length_st_description, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_description-1]=0; + this->st_description = (char *)(inbuffer + offset-1); + offset += length_st_description; + memcpy( &(this->description[i]), &(this->st_description), sizeof(char*)); + } + uint32_t processing_time_lengthT = ((uint32_t) (*(inbuffer + offset))); + processing_time_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + processing_time_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + processing_time_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->processing_time_length); + if(processing_time_lengthT > processing_time_length) + this->processing_time = (float*)realloc(this->processing_time, processing_time_lengthT * sizeof(float)); + processing_time_length = processing_time_lengthT; + for( uint32_t i = 0; i < processing_time_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_processing_time)); + memcpy( &(this->processing_time[i]), &(this->st_processing_time), sizeof(float)); + } + offset += this->error_code.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MotionPlanDetailedResponse"; }; + virtual const char * getMD5() override { return "af67c260a61067b3866c6bbc624021cc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanRequest.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanRequest.h new file mode 100644 index 000000000..70850e50e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanRequest.h @@ -0,0 +1,225 @@ +#ifndef _ROS_moveit_msgs_MotionPlanRequest_h +#define _ROS_moveit_msgs_MotionPlanRequest_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/WorkspaceParameters.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/Constraints.h" +#include "moveit_msgs/TrajectoryConstraints.h" +#include "moveit_msgs/GenericTrajectory.h" + +namespace moveit_msgs +{ + + class MotionPlanRequest : public ros::Msg + { + public: + typedef moveit_msgs::WorkspaceParameters _workspace_parameters_type; + _workspace_parameters_type workspace_parameters; + typedef moveit_msgs::RobotState _start_state_type; + _start_state_type start_state; + uint32_t goal_constraints_length; + typedef moveit_msgs::Constraints _goal_constraints_type; + _goal_constraints_type st_goal_constraints; + _goal_constraints_type * goal_constraints; + typedef moveit_msgs::Constraints _path_constraints_type; + _path_constraints_type path_constraints; + typedef moveit_msgs::TrajectoryConstraints _trajectory_constraints_type; + _trajectory_constraints_type trajectory_constraints; + uint32_t reference_trajectories_length; + typedef moveit_msgs::GenericTrajectory _reference_trajectories_type; + _reference_trajectories_type st_reference_trajectories; + _reference_trajectories_type * reference_trajectories; + typedef const char* _pipeline_id_type; + _pipeline_id_type pipeline_id; + typedef const char* _planner_id_type; + _planner_id_type planner_id; + typedef const char* _group_name_type; + _group_name_type group_name; + typedef int32_t _num_planning_attempts_type; + _num_planning_attempts_type num_planning_attempts; + typedef float _allowed_planning_time_type; + _allowed_planning_time_type allowed_planning_time; + typedef float _max_velocity_scaling_factor_type; + _max_velocity_scaling_factor_type max_velocity_scaling_factor; + typedef float _max_acceleration_scaling_factor_type; + _max_acceleration_scaling_factor_type max_acceleration_scaling_factor; + typedef const char* _cartesian_speed_limited_link_type; + _cartesian_speed_limited_link_type cartesian_speed_limited_link; + typedef float _max_cartesian_speed_type; + _max_cartesian_speed_type max_cartesian_speed; + + MotionPlanRequest(): + workspace_parameters(), + start_state(), + goal_constraints_length(0), st_goal_constraints(), goal_constraints(nullptr), + path_constraints(), + trajectory_constraints(), + reference_trajectories_length(0), st_reference_trajectories(), reference_trajectories(nullptr), + pipeline_id(""), + planner_id(""), + group_name(""), + num_planning_attempts(0), + allowed_planning_time(0), + max_velocity_scaling_factor(0), + max_acceleration_scaling_factor(0), + cartesian_speed_limited_link(""), + max_cartesian_speed(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->workspace_parameters.serialize(outbuffer + offset); + offset += this->start_state.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->goal_constraints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_constraints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_constraints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_constraints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_constraints_length); + for( uint32_t i = 0; i < goal_constraints_length; i++){ + offset += this->goal_constraints[i].serialize(outbuffer + offset); + } + offset += this->path_constraints.serialize(outbuffer + offset); + offset += this->trajectory_constraints.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->reference_trajectories_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->reference_trajectories_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->reference_trajectories_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->reference_trajectories_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->reference_trajectories_length); + for( uint32_t i = 0; i < reference_trajectories_length; i++){ + offset += this->reference_trajectories[i].serialize(outbuffer + offset); + } + uint32_t length_pipeline_id = strlen(this->pipeline_id); + varToArr(outbuffer + offset, length_pipeline_id); + offset += 4; + memcpy(outbuffer + offset, this->pipeline_id, length_pipeline_id); + offset += length_pipeline_id; + uint32_t length_planner_id = strlen(this->planner_id); + varToArr(outbuffer + offset, length_planner_id); + offset += 4; + memcpy(outbuffer + offset, this->planner_id, length_planner_id); + offset += length_planner_id; + uint32_t length_group_name = strlen(this->group_name); + varToArr(outbuffer + offset, length_group_name); + offset += 4; + memcpy(outbuffer + offset, this->group_name, length_group_name); + offset += length_group_name; + union { + int32_t real; + uint32_t base; + } u_num_planning_attempts; + u_num_planning_attempts.real = this->num_planning_attempts; + *(outbuffer + offset + 0) = (u_num_planning_attempts.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_num_planning_attempts.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_num_planning_attempts.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_num_planning_attempts.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->num_planning_attempts); + offset += serializeAvrFloat64(outbuffer + offset, this->allowed_planning_time); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity_scaling_factor); + offset += serializeAvrFloat64(outbuffer + offset, this->max_acceleration_scaling_factor); + uint32_t length_cartesian_speed_limited_link = strlen(this->cartesian_speed_limited_link); + varToArr(outbuffer + offset, length_cartesian_speed_limited_link); + offset += 4; + memcpy(outbuffer + offset, this->cartesian_speed_limited_link, length_cartesian_speed_limited_link); + offset += length_cartesian_speed_limited_link; + offset += serializeAvrFloat64(outbuffer + offset, this->max_cartesian_speed); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->workspace_parameters.deserialize(inbuffer + offset); + offset += this->start_state.deserialize(inbuffer + offset); + uint32_t goal_constraints_lengthT = ((uint32_t) (*(inbuffer + offset))); + goal_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + goal_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + goal_constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_constraints_length); + if(goal_constraints_lengthT > goal_constraints_length) + this->goal_constraints = (moveit_msgs::Constraints*)realloc(this->goal_constraints, goal_constraints_lengthT * sizeof(moveit_msgs::Constraints)); + goal_constraints_length = goal_constraints_lengthT; + for( uint32_t i = 0; i < goal_constraints_length; i++){ + offset += this->st_goal_constraints.deserialize(inbuffer + offset); + memcpy( &(this->goal_constraints[i]), &(this->st_goal_constraints), sizeof(moveit_msgs::Constraints)); + } + offset += this->path_constraints.deserialize(inbuffer + offset); + offset += this->trajectory_constraints.deserialize(inbuffer + offset); + uint32_t reference_trajectories_lengthT = ((uint32_t) (*(inbuffer + offset))); + reference_trajectories_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + reference_trajectories_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + reference_trajectories_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->reference_trajectories_length); + if(reference_trajectories_lengthT > reference_trajectories_length) + this->reference_trajectories = (moveit_msgs::GenericTrajectory*)realloc(this->reference_trajectories, reference_trajectories_lengthT * sizeof(moveit_msgs::GenericTrajectory)); + reference_trajectories_length = reference_trajectories_lengthT; + for( uint32_t i = 0; i < reference_trajectories_length; i++){ + offset += this->st_reference_trajectories.deserialize(inbuffer + offset); + memcpy( &(this->reference_trajectories[i]), &(this->st_reference_trajectories), sizeof(moveit_msgs::GenericTrajectory)); + } + uint32_t length_pipeline_id; + arrToVar(length_pipeline_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pipeline_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pipeline_id-1]=0; + this->pipeline_id = (char *)(inbuffer + offset-1); + offset += length_pipeline_id; + uint32_t length_planner_id; + arrToVar(length_planner_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_planner_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_planner_id-1]=0; + this->planner_id = (char *)(inbuffer + offset-1); + offset += length_planner_id; + uint32_t length_group_name; + arrToVar(length_group_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group_name-1]=0; + this->group_name = (char *)(inbuffer + offset-1); + offset += length_group_name; + union { + int32_t real; + uint32_t base; + } u_num_planning_attempts; + u_num_planning_attempts.base = 0; + u_num_planning_attempts.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_num_planning_attempts.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_num_planning_attempts.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_num_planning_attempts.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->num_planning_attempts = u_num_planning_attempts.real; + offset += sizeof(this->num_planning_attempts); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->allowed_planning_time)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity_scaling_factor)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_acceleration_scaling_factor)); + uint32_t length_cartesian_speed_limited_link; + arrToVar(length_cartesian_speed_limited_link, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_cartesian_speed_limited_link; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_cartesian_speed_limited_link-1]=0; + this->cartesian_speed_limited_link = (char *)(inbuffer + offset-1); + offset += length_cartesian_speed_limited_link; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_cartesian_speed)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MotionPlanRequest"; }; + virtual const char * getMD5() override { return "83f3d7b1d47a538f7659e0de9dae7980"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanResponse.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanResponse.h new file mode 100644 index 000000000..cce864d39 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionPlanResponse.h @@ -0,0 +1,78 @@ +#ifndef _ROS_moveit_msgs_MotionPlanResponse_h +#define _ROS_moveit_msgs_MotionPlanResponse_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/RobotTrajectory.h" +#include "moveit_msgs/MoveItErrorCodes.h" + +namespace moveit_msgs +{ + + class MotionPlanResponse : public ros::Msg + { + public: + typedef moveit_msgs::RobotState _trajectory_start_type; + _trajectory_start_type trajectory_start; + typedef const char* _group_name_type; + _group_name_type group_name; + typedef moveit_msgs::RobotTrajectory _trajectory_type; + _trajectory_type trajectory; + typedef float _planning_time_type; + _planning_time_type planning_time; + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + + MotionPlanResponse(): + trajectory_start(), + group_name(""), + trajectory(), + planning_time(0), + error_code() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->trajectory_start.serialize(outbuffer + offset); + uint32_t length_group_name = strlen(this->group_name); + varToArr(outbuffer + offset, length_group_name); + offset += 4; + memcpy(outbuffer + offset, this->group_name, length_group_name); + offset += length_group_name; + offset += this->trajectory.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->planning_time); + offset += this->error_code.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->trajectory_start.deserialize(inbuffer + offset); + uint32_t length_group_name; + arrToVar(length_group_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group_name-1]=0; + this->group_name = (char *)(inbuffer + offset-1); + offset += length_group_name; + offset += this->trajectory.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->planning_time)); + offset += this->error_code.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MotionPlanResponse"; }; + virtual const char * getMD5() override { return "a70717537b7bfcf24e0dbd4d2ab1fd34"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceItem.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceItem.h new file mode 100644 index 000000000..ed51d249b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceItem.h @@ -0,0 +1,49 @@ +#ifndef _ROS_moveit_msgs_MotionSequenceItem_h +#define _ROS_moveit_msgs_MotionSequenceItem_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MotionPlanRequest.h" + +namespace moveit_msgs +{ + + class MotionSequenceItem : public ros::Msg + { + public: + typedef moveit_msgs::MotionPlanRequest _req_type; + _req_type req; + typedef float _blend_radius_type; + _blend_radius_type blend_radius; + + MotionSequenceItem(): + req(), + blend_radius(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->req.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->blend_radius); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->req.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->blend_radius)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MotionSequenceItem"; }; + virtual const char * getMD5() override { return "605a152161827d49a0abacf6c6544d1e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceRequest.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceRequest.h new file mode 100644 index 000000000..681919d27 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceRequest.h @@ -0,0 +1,64 @@ +#ifndef _ROS_moveit_msgs_MotionSequenceRequest_h +#define _ROS_moveit_msgs_MotionSequenceRequest_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MotionSequenceItem.h" + +namespace moveit_msgs +{ + + class MotionSequenceRequest : public ros::Msg + { + public: + uint32_t items_length; + typedef moveit_msgs::MotionSequenceItem _items_type; + _items_type st_items; + _items_type * items; + + MotionSequenceRequest(): + items_length(0), st_items(), items(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->items_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->items_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->items_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->items_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->items_length); + for( uint32_t i = 0; i < items_length; i++){ + offset += this->items[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t items_lengthT = ((uint32_t) (*(inbuffer + offset))); + items_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + items_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + items_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->items_length); + if(items_lengthT > items_length) + this->items = (moveit_msgs::MotionSequenceItem*)realloc(this->items, items_lengthT * sizeof(moveit_msgs::MotionSequenceItem)); + items_length = items_lengthT; + for( uint32_t i = 0; i < items_length; i++){ + offset += this->st_items.deserialize(inbuffer + offset); + memcpy( &(this->items[i]), &(this->st_items), sizeof(moveit_msgs::MotionSequenceItem)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MotionSequenceRequest"; }; + virtual const char * getMD5() override { return "5a79e4928bfada4fbc57882982ac6e58"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceResponse.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceResponse.h new file mode 100644 index 000000000..71644c4eb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MotionSequenceResponse.h @@ -0,0 +1,81 @@ +#ifndef _ROS_moveit_msgs_MotionSequenceResponse_h +#define _ROS_moveit_msgs_MotionSequenceResponse_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MoveItErrorCodes.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/RobotTrajectory.h" + +namespace moveit_msgs +{ + + class MotionSequenceResponse : public ros::Msg + { + public: + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + typedef moveit_msgs::RobotState _sequence_start_type; + _sequence_start_type sequence_start; + uint32_t planned_trajectories_length; + typedef moveit_msgs::RobotTrajectory _planned_trajectories_type; + _planned_trajectories_type st_planned_trajectories; + _planned_trajectories_type * planned_trajectories; + typedef float _planning_time_type; + _planning_time_type planning_time; + + MotionSequenceResponse(): + error_code(), + sequence_start(), + planned_trajectories_length(0), st_planned_trajectories(), planned_trajectories(nullptr), + planning_time(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->error_code.serialize(outbuffer + offset); + offset += this->sequence_start.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->planned_trajectories_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->planned_trajectories_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->planned_trajectories_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->planned_trajectories_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->planned_trajectories_length); + for( uint32_t i = 0; i < planned_trajectories_length; i++){ + offset += this->planned_trajectories[i].serialize(outbuffer + offset); + } + offset += serializeAvrFloat64(outbuffer + offset, this->planning_time); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->error_code.deserialize(inbuffer + offset); + offset += this->sequence_start.deserialize(inbuffer + offset); + uint32_t planned_trajectories_lengthT = ((uint32_t) (*(inbuffer + offset))); + planned_trajectories_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + planned_trajectories_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + planned_trajectories_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->planned_trajectories_length); + if(planned_trajectories_lengthT > planned_trajectories_length) + this->planned_trajectories = (moveit_msgs::RobotTrajectory*)realloc(this->planned_trajectories, planned_trajectories_lengthT * sizeof(moveit_msgs::RobotTrajectory)); + planned_trajectories_length = planned_trajectories_lengthT; + for( uint32_t i = 0; i < planned_trajectories_length; i++){ + offset += this->st_planned_trajectories.deserialize(inbuffer + offset); + memcpy( &(this->planned_trajectories[i]), &(this->st_planned_trajectories), sizeof(moveit_msgs::RobotTrajectory)); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->planning_time)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MotionSequenceResponse"; }; + virtual const char * getMD5() override { return "6c3d81f7909577545c3c382f38a163e2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupAction.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupAction.h new file mode 100644 index 000000000..cb9c7b1b3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_MoveGroupAction_h +#define _ROS_moveit_msgs_MoveGroupAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MoveGroupActionGoal.h" +#include "moveit_msgs/MoveGroupActionResult.h" +#include "moveit_msgs/MoveGroupActionFeedback.h" + +namespace moveit_msgs +{ + + class MoveGroupAction : public ros::Msg + { + public: + typedef moveit_msgs::MoveGroupActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef moveit_msgs::MoveGroupActionResult _action_result_type; + _action_result_type action_result; + typedef moveit_msgs::MoveGroupActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + MoveGroupAction(): + 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 "moveit_msgs/MoveGroupAction"; }; + virtual const char * getMD5() override { return "33225407c32b189345eec6893a5a0da3"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionFeedback.h new file mode 100644 index 000000000..667b6b7ea --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_MoveGroupActionFeedback_h +#define _ROS_moveit_msgs_MoveGroupActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "moveit_msgs/MoveGroupFeedback.h" + +namespace moveit_msgs +{ + + class MoveGroupActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef moveit_msgs::MoveGroupFeedback _feedback_type; + _feedback_type feedback; + + MoveGroupActionFeedback(): + 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 "moveit_msgs/MoveGroupActionFeedback"; }; + virtual const char * getMD5() override { return "12232ef97486c7962f264c105aae2958"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionGoal.h new file mode 100644 index 000000000..6e2c4a8b0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_MoveGroupActionGoal_h +#define _ROS_moveit_msgs_MoveGroupActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "moveit_msgs/MoveGroupGoal.h" + +namespace moveit_msgs +{ + + class MoveGroupActionGoal : 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 moveit_msgs::MoveGroupGoal _goal_type; + _goal_type goal; + + MoveGroupActionGoal(): + 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 "moveit_msgs/MoveGroupActionGoal"; }; + virtual const char * getMD5() override { return "b7138704cefd43a8dd9758d697350b85"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionResult.h new file mode 100644 index 000000000..518e25075 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_MoveGroupActionResult_h +#define _ROS_moveit_msgs_MoveGroupActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "moveit_msgs/MoveGroupResult.h" + +namespace moveit_msgs +{ + + class MoveGroupActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef moveit_msgs::MoveGroupResult _result_type; + _result_type result; + + MoveGroupActionResult(): + 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 "moveit_msgs/MoveGroupActionResult"; }; + virtual const char * getMD5() override { return "7f1341e9f8cc6a2ed67dc4bd2603cf59"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupFeedback.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupFeedback.h new file mode 100644 index 000000000..13763a5a0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupFeedback.h @@ -0,0 +1,55 @@ +#ifndef _ROS_moveit_msgs_MoveGroupFeedback_h +#define _ROS_moveit_msgs_MoveGroupFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class MoveGroupFeedback : public ros::Msg + { + public: + typedef const char* _state_type; + _state_type state; + + MoveGroupFeedback(): + state("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_state = strlen(this->state); + varToArr(outbuffer + offset, length_state); + offset += 4; + memcpy(outbuffer + offset, this->state, length_state); + offset += length_state; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MoveGroupFeedback"; }; + virtual const char * getMD5() override { return "af6d3a99f0fbeb66d3248fa4b3e675fb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupGoal.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupGoal.h new file mode 100644 index 000000000..9d50f20d3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupGoal.h @@ -0,0 +1,50 @@ +#ifndef _ROS_moveit_msgs_MoveGroupGoal_h +#define _ROS_moveit_msgs_MoveGroupGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MotionPlanRequest.h" +#include "moveit_msgs/PlanningOptions.h" + +namespace moveit_msgs +{ + + class MoveGroupGoal : public ros::Msg + { + public: + typedef moveit_msgs::MotionPlanRequest _request_type; + _request_type request; + typedef moveit_msgs::PlanningOptions _planning_options_type; + _planning_options_type planning_options; + + MoveGroupGoal(): + request(), + planning_options() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->request.serialize(outbuffer + offset); + offset += this->planning_options.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->request.deserialize(inbuffer + offset); + offset += this->planning_options.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MoveGroupGoal"; }; + virtual const char * getMD5() override { return "ce7f9820670af166b2faa14c475891b0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupResult.h new file mode 100644 index 000000000..878af2c46 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupResult.h @@ -0,0 +1,66 @@ +#ifndef _ROS_moveit_msgs_MoveGroupResult_h +#define _ROS_moveit_msgs_MoveGroupResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MoveItErrorCodes.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/RobotTrajectory.h" + +namespace moveit_msgs +{ + + class MoveGroupResult : public ros::Msg + { + public: + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + typedef moveit_msgs::RobotState _trajectory_start_type; + _trajectory_start_type trajectory_start; + typedef moveit_msgs::RobotTrajectory _planned_trajectory_type; + _planned_trajectory_type planned_trajectory; + typedef moveit_msgs::RobotTrajectory _executed_trajectory_type; + _executed_trajectory_type executed_trajectory; + typedef float _planning_time_type; + _planning_time_type planning_time; + + MoveGroupResult(): + error_code(), + trajectory_start(), + planned_trajectory(), + executed_trajectory(), + planning_time(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->error_code.serialize(outbuffer + offset); + offset += this->trajectory_start.serialize(outbuffer + offset); + offset += this->planned_trajectory.serialize(outbuffer + offset); + offset += this->executed_trajectory.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->planning_time); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->error_code.deserialize(inbuffer + offset); + offset += this->trajectory_start.deserialize(inbuffer + offset); + offset += this->planned_trajectory.deserialize(inbuffer + offset); + offset += this->executed_trajectory.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->planning_time)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MoveGroupResult"; }; + virtual const char * getMD5() override { return "ac331f62a649edf9d73f5f8b656cec65"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceAction.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceAction.h new file mode 100644 index 000000000..923f7e2bb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_MoveGroupSequenceAction_h +#define _ROS_moveit_msgs_MoveGroupSequenceAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MoveGroupSequenceActionGoal.h" +#include "moveit_msgs/MoveGroupSequenceActionResult.h" +#include "moveit_msgs/MoveGroupSequenceActionFeedback.h" + +namespace moveit_msgs +{ + + class MoveGroupSequenceAction : public ros::Msg + { + public: + typedef moveit_msgs::MoveGroupSequenceActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef moveit_msgs::MoveGroupSequenceActionResult _action_result_type; + _action_result_type action_result; + typedef moveit_msgs::MoveGroupSequenceActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + MoveGroupSequenceAction(): + 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 "moveit_msgs/MoveGroupSequenceAction"; }; + virtual const char * getMD5() override { return "0d3375f4fb59ed3ba86fa746e5d8e219"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionFeedback.h new file mode 100644 index 000000000..ea2cb78c3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_MoveGroupSequenceActionFeedback_h +#define _ROS_moveit_msgs_MoveGroupSequenceActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "moveit_msgs/MoveGroupSequenceFeedback.h" + +namespace moveit_msgs +{ + + class MoveGroupSequenceActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef moveit_msgs::MoveGroupSequenceFeedback _feedback_type; + _feedback_type feedback; + + MoveGroupSequenceActionFeedback(): + 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 "moveit_msgs/MoveGroupSequenceActionFeedback"; }; + virtual const char * getMD5() override { return "12232ef97486c7962f264c105aae2958"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionGoal.h new file mode 100644 index 000000000..3c8725f19 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_MoveGroupSequenceActionGoal_h +#define _ROS_moveit_msgs_MoveGroupSequenceActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "moveit_msgs/MoveGroupSequenceGoal.h" + +namespace moveit_msgs +{ + + class MoveGroupSequenceActionGoal : 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 moveit_msgs::MoveGroupSequenceGoal _goal_type; + _goal_type goal; + + MoveGroupSequenceActionGoal(): + 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 "moveit_msgs/MoveGroupSequenceActionGoal"; }; + virtual const char * getMD5() override { return "d7913633827d440f696e171ce1c63e4a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionResult.h new file mode 100644 index 000000000..d2bb9a3b3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_MoveGroupSequenceActionResult_h +#define _ROS_moveit_msgs_MoveGroupSequenceActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "moveit_msgs/MoveGroupSequenceResult.h" + +namespace moveit_msgs +{ + + class MoveGroupSequenceActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef moveit_msgs::MoveGroupSequenceResult _result_type; + _result_type result; + + MoveGroupSequenceActionResult(): + 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 "moveit_msgs/MoveGroupSequenceActionResult"; }; + virtual const char * getMD5() override { return "fcc171c506bf19ef72745d79ea2511bc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceFeedback.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceFeedback.h new file mode 100644 index 000000000..4c218377a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceFeedback.h @@ -0,0 +1,55 @@ +#ifndef _ROS_moveit_msgs_MoveGroupSequenceFeedback_h +#define _ROS_moveit_msgs_MoveGroupSequenceFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class MoveGroupSequenceFeedback : public ros::Msg + { + public: + typedef const char* _state_type; + _state_type state; + + MoveGroupSequenceFeedback(): + state("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_state = strlen(this->state); + varToArr(outbuffer + offset, length_state); + offset += 4; + memcpy(outbuffer + offset, this->state, length_state); + offset += length_state; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MoveGroupSequenceFeedback"; }; + virtual const char * getMD5() override { return "af6d3a99f0fbeb66d3248fa4b3e675fb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceGoal.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceGoal.h new file mode 100644 index 000000000..236bba0c0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceGoal.h @@ -0,0 +1,50 @@ +#ifndef _ROS_moveit_msgs_MoveGroupSequenceGoal_h +#define _ROS_moveit_msgs_MoveGroupSequenceGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MotionSequenceRequest.h" +#include "moveit_msgs/PlanningOptions.h" + +namespace moveit_msgs +{ + + class MoveGroupSequenceGoal : public ros::Msg + { + public: + typedef moveit_msgs::MotionSequenceRequest _request_type; + _request_type request; + typedef moveit_msgs::PlanningOptions _planning_options_type; + _planning_options_type planning_options; + + MoveGroupSequenceGoal(): + request(), + planning_options() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->request.serialize(outbuffer + offset); + offset += this->planning_options.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->request.deserialize(inbuffer + offset); + offset += this->planning_options.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MoveGroupSequenceGoal"; }; + virtual const char * getMD5() override { return "18fa4c5968e8aa606b4722c12ab25cca"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceResult.h new file mode 100644 index 000000000..8d0427286 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveGroupSequenceResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_moveit_msgs_MoveGroupSequenceResult_h +#define _ROS_moveit_msgs_MoveGroupSequenceResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MotionSequenceResponse.h" + +namespace moveit_msgs +{ + + class MoveGroupSequenceResult : public ros::Msg + { + public: + typedef moveit_msgs::MotionSequenceResponse _response_type; + _response_type response; + + MoveGroupSequenceResult(): + response() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->response.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->response.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MoveGroupSequenceResult"; }; + virtual const char * getMD5() override { return "3e3d83067566e443fa885c9428941f17"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveItErrorCodes.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveItErrorCodes.h new file mode 100644 index 000000000..2584cc179 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/MoveItErrorCodes.h @@ -0,0 +1,92 @@ +#ifndef _ROS_moveit_msgs_MoveItErrorCodes_h +#define _ROS_moveit_msgs_MoveItErrorCodes_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class MoveItErrorCodes : public ros::Msg + { + public: + typedef int32_t _val_type; + _val_type val; + enum { SUCCESS = 1 }; + enum { FAILURE = 99999 }; + enum { PLANNING_FAILED = -1 }; + enum { INVALID_MOTION_PLAN = -2 }; + enum { MOTION_PLAN_INVALIDATED_BY_ENVIRONMENT_CHANGE = -3 }; + enum { CONTROL_FAILED = -4 }; + enum { UNABLE_TO_AQUIRE_SENSOR_DATA = -5 }; + enum { TIMED_OUT = -6 }; + enum { PREEMPTED = -7 }; + enum { START_STATE_IN_COLLISION = -10 }; + enum { START_STATE_VIOLATES_PATH_CONSTRAINTS = -11 }; + enum { START_STATE_INVALID = -26 }; + enum { GOAL_IN_COLLISION = -12 }; + enum { GOAL_VIOLATES_PATH_CONSTRAINTS = -13 }; + enum { GOAL_CONSTRAINTS_VIOLATED = -14 }; + enum { GOAL_STATE_INVALID = -27 }; + enum { UNRECOGNIZED_GOAL_TYPE = -28 }; + enum { INVALID_GROUP_NAME = -15 }; + enum { INVALID_GOAL_CONSTRAINTS = -16 }; + enum { INVALID_ROBOT_STATE = -17 }; + enum { INVALID_LINK_NAME = -18 }; + enum { INVALID_OBJECT_NAME = -19 }; + enum { FRAME_TRANSFORM_FAILURE = -21 }; + enum { COLLISION_CHECKING_UNAVAILABLE = -22 }; + enum { ROBOT_STATE_STALE = -23 }; + enum { SENSOR_INFO_STALE = -24 }; + enum { COMMUNICATION_FAILURE = -25 }; + enum { CRASH = -29 }; + enum { ABORT = -30 }; + enum { NO_IK_SOLUTION = -31 }; + + MoveItErrorCodes(): + val(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_val; + u_val.real = this->val; + *(outbuffer + offset + 0) = (u_val.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_val.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_val.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_val.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->val); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_val; + u_val.base = 0; + u_val.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_val.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_val.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_val.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->val = u_val.real; + offset += sizeof(this->val); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/MoveItErrorCodes"; }; + virtual const char * getMD5() override { return "d6cfe51b76ea17850d7116c666a7d0f1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ObjectColor.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ObjectColor.h new file mode 100644 index 000000000..13df24632 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/ObjectColor.h @@ -0,0 +1,61 @@ +#ifndef _ROS_moveit_msgs_ObjectColor_h +#define _ROS_moveit_msgs_ObjectColor_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/ColorRGBA.h" + +namespace moveit_msgs +{ + + class ObjectColor : public ros::Msg + { + public: + typedef const char* _id_type; + _id_type id; + typedef std_msgs::ColorRGBA _color_type; + _color_type color; + + ObjectColor(): + id(""), + color() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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 += this->color.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 += this->color.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/ObjectColor"; }; + virtual const char * getMD5() override { return "ec3bd6f103430e64b2ae706a67d8488e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/OrientationConstraint.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/OrientationConstraint.h new file mode 100644 index 000000000..e2e2dc1cc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/OrientationConstraint.h @@ -0,0 +1,96 @@ +#ifndef _ROS_moveit_msgs_OrientationConstraint_h +#define _ROS_moveit_msgs_OrientationConstraint_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" + +namespace moveit_msgs +{ + + class OrientationConstraint : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Quaternion _orientation_type; + _orientation_type orientation; + typedef const char* _link_name_type; + _link_name_type link_name; + typedef float _absolute_x_axis_tolerance_type; + _absolute_x_axis_tolerance_type absolute_x_axis_tolerance; + typedef float _absolute_y_axis_tolerance_type; + _absolute_y_axis_tolerance_type absolute_y_axis_tolerance; + typedef float _absolute_z_axis_tolerance_type; + _absolute_z_axis_tolerance_type absolute_z_axis_tolerance; + typedef uint8_t _parameterization_type; + _parameterization_type parameterization; + typedef float _weight_type; + _weight_type weight; + enum { XYZ_EULER_ANGLES = 0 }; + enum { ROTATION_VECTOR = 1 }; + + OrientationConstraint(): + header(), + orientation(), + link_name(""), + absolute_x_axis_tolerance(0), + absolute_y_axis_tolerance(0), + absolute_z_axis_tolerance(0), + parameterization(0), + weight(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += serializeAvrFloat64(outbuffer + offset, this->absolute_x_axis_tolerance); + offset += serializeAvrFloat64(outbuffer + offset, this->absolute_y_axis_tolerance); + offset += serializeAvrFloat64(outbuffer + offset, this->absolute_z_axis_tolerance); + *(outbuffer + offset + 0) = (this->parameterization >> (8 * 0)) & 0xFF; + offset += sizeof(this->parameterization); + offset += serializeAvrFloat64(outbuffer + offset, this->weight); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->absolute_x_axis_tolerance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->absolute_y_axis_tolerance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->absolute_z_axis_tolerance)); + this->parameterization = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->parameterization); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->weight)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/OrientationConstraint"; }; + virtual const char * getMD5() override { return "183479d9281e5b4f23dc584f711d8a64"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/OrientedBoundingBox.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/OrientedBoundingBox.h new file mode 100644 index 000000000..8a2f3f400 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/OrientedBoundingBox.h @@ -0,0 +1,50 @@ +#ifndef _ROS_moveit_msgs_OrientedBoundingBox_h +#define _ROS_moveit_msgs_OrientedBoundingBox_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Point32.h" + +namespace moveit_msgs +{ + + class OrientedBoundingBox : public ros::Msg + { + public: + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef geometry_msgs::Point32 _extents_type; + _extents_type extents; + + OrientedBoundingBox(): + pose(), + extents() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + offset += this->extents.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->extents.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/OrientedBoundingBox"; }; + virtual const char * getMD5() override { return "da3bd98e7cb14efa4141367a9d886ee7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupAction.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupAction.h new file mode 100644 index 000000000..3c56d77bc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_PickupAction_h +#define _ROS_moveit_msgs_PickupAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/PickupActionGoal.h" +#include "moveit_msgs/PickupActionResult.h" +#include "moveit_msgs/PickupActionFeedback.h" + +namespace moveit_msgs +{ + + class PickupAction : public ros::Msg + { + public: + typedef moveit_msgs::PickupActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef moveit_msgs::PickupActionResult _action_result_type; + _action_result_type action_result; + typedef moveit_msgs::PickupActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PickupAction(): + 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 "moveit_msgs/PickupAction"; }; + virtual const char * getMD5() override { return "8ade6f7e811da205c80db4348b91b199"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionFeedback.h new file mode 100644 index 000000000..e3307a22a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_PickupActionFeedback_h +#define _ROS_moveit_msgs_PickupActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "moveit_msgs/PickupFeedback.h" + +namespace moveit_msgs +{ + + class PickupActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef moveit_msgs::PickupFeedback _feedback_type; + _feedback_type feedback; + + PickupActionFeedback(): + 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 "moveit_msgs/PickupActionFeedback"; }; + virtual const char * getMD5() override { return "12232ef97486c7962f264c105aae2958"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionGoal.h new file mode 100644 index 000000000..dc56f60d0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_PickupActionGoal_h +#define _ROS_moveit_msgs_PickupActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "moveit_msgs/PickupGoal.h" + +namespace moveit_msgs +{ + + class PickupActionGoal : 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 moveit_msgs::PickupGoal _goal_type; + _goal_type goal; + + PickupActionGoal(): + 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 "moveit_msgs/PickupActionGoal"; }; + virtual const char * getMD5() override { return "83bb430d120a16fadf2ea3aad239f1d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionResult.h new file mode 100644 index 000000000..c412d7af0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_PickupActionResult_h +#define _ROS_moveit_msgs_PickupActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "moveit_msgs/PickupResult.h" + +namespace moveit_msgs +{ + + class PickupActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef moveit_msgs::PickupResult _result_type; + _result_type result; + + PickupActionResult(): + 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 "moveit_msgs/PickupActionResult"; }; + virtual const char * getMD5() override { return "189540b296d28419d294a1ba0f5dde17"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupFeedback.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupFeedback.h new file mode 100644 index 000000000..5364df7b1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupFeedback.h @@ -0,0 +1,55 @@ +#ifndef _ROS_moveit_msgs_PickupFeedback_h +#define _ROS_moveit_msgs_PickupFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class PickupFeedback : public ros::Msg + { + public: + typedef const char* _state_type; + _state_type state; + + PickupFeedback(): + state("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_state = strlen(this->state); + varToArr(outbuffer + offset, length_state); + offset += 4; + memcpy(outbuffer + offset, this->state, length_state); + offset += length_state; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PickupFeedback"; }; + virtual const char * getMD5() override { return "af6d3a99f0fbeb66d3248fa4b3e675fb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupGoal.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupGoal.h new file mode 100644 index 000000000..6f86c3868 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupGoal.h @@ -0,0 +1,276 @@ +#ifndef _ROS_moveit_msgs_PickupGoal_h +#define _ROS_moveit_msgs_PickupGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/Grasp.h" +#include "moveit_msgs/Constraints.h" +#include "moveit_msgs/PlanningOptions.h" + +namespace moveit_msgs +{ + + class PickupGoal : public ros::Msg + { + public: + typedef const char* _target_name_type; + _target_name_type target_name; + typedef const char* _group_name_type; + _group_name_type group_name; + typedef const char* _end_effector_type; + _end_effector_type end_effector; + uint32_t possible_grasps_length; + typedef moveit_msgs::Grasp _possible_grasps_type; + _possible_grasps_type st_possible_grasps; + _possible_grasps_type * possible_grasps; + typedef const char* _support_surface_name_type; + _support_surface_name_type support_surface_name; + typedef bool _allow_gripper_support_collision_type; + _allow_gripper_support_collision_type allow_gripper_support_collision; + uint32_t attached_object_touch_links_length; + typedef char* _attached_object_touch_links_type; + _attached_object_touch_links_type st_attached_object_touch_links; + _attached_object_touch_links_type * attached_object_touch_links; + typedef bool _minimize_object_distance_type; + _minimize_object_distance_type minimize_object_distance; + typedef moveit_msgs::Constraints _path_constraints_type; + _path_constraints_type path_constraints; + typedef const char* _planner_id_type; + _planner_id_type planner_id; + uint32_t allowed_touch_objects_length; + typedef char* _allowed_touch_objects_type; + _allowed_touch_objects_type st_allowed_touch_objects; + _allowed_touch_objects_type * allowed_touch_objects; + typedef float _allowed_planning_time_type; + _allowed_planning_time_type allowed_planning_time; + typedef moveit_msgs::PlanningOptions _planning_options_type; + _planning_options_type planning_options; + + PickupGoal(): + target_name(""), + group_name(""), + end_effector(""), + possible_grasps_length(0), st_possible_grasps(), possible_grasps(nullptr), + support_surface_name(""), + allow_gripper_support_collision(0), + attached_object_touch_links_length(0), st_attached_object_touch_links(), attached_object_touch_links(nullptr), + minimize_object_distance(0), + path_constraints(), + planner_id(""), + allowed_touch_objects_length(0), st_allowed_touch_objects(), allowed_touch_objects(nullptr), + allowed_planning_time(0), + planning_options() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_name = strlen(this->target_name); + varToArr(outbuffer + offset, length_target_name); + offset += 4; + memcpy(outbuffer + offset, this->target_name, length_target_name); + offset += length_target_name; + uint32_t length_group_name = strlen(this->group_name); + varToArr(outbuffer + offset, length_group_name); + offset += 4; + memcpy(outbuffer + offset, this->group_name, length_group_name); + offset += length_group_name; + uint32_t length_end_effector = strlen(this->end_effector); + varToArr(outbuffer + offset, length_end_effector); + offset += 4; + memcpy(outbuffer + offset, this->end_effector, length_end_effector); + offset += length_end_effector; + *(outbuffer + offset + 0) = (this->possible_grasps_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->possible_grasps_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->possible_grasps_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->possible_grasps_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->possible_grasps_length); + for( uint32_t i = 0; i < possible_grasps_length; i++){ + offset += this->possible_grasps[i].serialize(outbuffer + offset); + } + uint32_t length_support_surface_name = strlen(this->support_surface_name); + varToArr(outbuffer + offset, length_support_surface_name); + offset += 4; + memcpy(outbuffer + offset, this->support_surface_name, length_support_surface_name); + offset += length_support_surface_name; + union { + bool real; + uint8_t base; + } u_allow_gripper_support_collision; + u_allow_gripper_support_collision.real = this->allow_gripper_support_collision; + *(outbuffer + offset + 0) = (u_allow_gripper_support_collision.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->allow_gripper_support_collision); + *(outbuffer + offset + 0) = (this->attached_object_touch_links_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->attached_object_touch_links_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->attached_object_touch_links_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->attached_object_touch_links_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->attached_object_touch_links_length); + for( uint32_t i = 0; i < attached_object_touch_links_length; i++){ + uint32_t length_attached_object_touch_linksi = strlen(this->attached_object_touch_links[i]); + varToArr(outbuffer + offset, length_attached_object_touch_linksi); + offset += 4; + memcpy(outbuffer + offset, this->attached_object_touch_links[i], length_attached_object_touch_linksi); + offset += length_attached_object_touch_linksi; + } + union { + bool real; + uint8_t base; + } u_minimize_object_distance; + u_minimize_object_distance.real = this->minimize_object_distance; + *(outbuffer + offset + 0) = (u_minimize_object_distance.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->minimize_object_distance); + offset += this->path_constraints.serialize(outbuffer + offset); + uint32_t length_planner_id = strlen(this->planner_id); + varToArr(outbuffer + offset, length_planner_id); + offset += 4; + memcpy(outbuffer + offset, this->planner_id, length_planner_id); + offset += length_planner_id; + *(outbuffer + offset + 0) = (this->allowed_touch_objects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->allowed_touch_objects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->allowed_touch_objects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->allowed_touch_objects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->allowed_touch_objects_length); + for( uint32_t i = 0; i < allowed_touch_objects_length; i++){ + uint32_t length_allowed_touch_objectsi = strlen(this->allowed_touch_objects[i]); + varToArr(outbuffer + offset, length_allowed_touch_objectsi); + offset += 4; + memcpy(outbuffer + offset, this->allowed_touch_objects[i], length_allowed_touch_objectsi); + offset += length_allowed_touch_objectsi; + } + offset += serializeAvrFloat64(outbuffer + offset, this->allowed_planning_time); + offset += this->planning_options.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_name; + arrToVar(length_target_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_name-1]=0; + this->target_name = (char *)(inbuffer + offset-1); + offset += length_target_name; + uint32_t length_group_name; + arrToVar(length_group_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group_name-1]=0; + this->group_name = (char *)(inbuffer + offset-1); + offset += length_group_name; + uint32_t length_end_effector; + arrToVar(length_end_effector, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_end_effector; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_end_effector-1]=0; + this->end_effector = (char *)(inbuffer + offset-1); + offset += length_end_effector; + uint32_t possible_grasps_lengthT = ((uint32_t) (*(inbuffer + offset))); + possible_grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + possible_grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + possible_grasps_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->possible_grasps_length); + if(possible_grasps_lengthT > possible_grasps_length) + this->possible_grasps = (moveit_msgs::Grasp*)realloc(this->possible_grasps, possible_grasps_lengthT * sizeof(moveit_msgs::Grasp)); + possible_grasps_length = possible_grasps_lengthT; + for( uint32_t i = 0; i < possible_grasps_length; i++){ + offset += this->st_possible_grasps.deserialize(inbuffer + offset); + memcpy( &(this->possible_grasps[i]), &(this->st_possible_grasps), sizeof(moveit_msgs::Grasp)); + } + uint32_t length_support_surface_name; + arrToVar(length_support_surface_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_support_surface_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_support_surface_name-1]=0; + this->support_surface_name = (char *)(inbuffer + offset-1); + offset += length_support_surface_name; + union { + bool real; + uint8_t base; + } u_allow_gripper_support_collision; + u_allow_gripper_support_collision.base = 0; + u_allow_gripper_support_collision.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->allow_gripper_support_collision = u_allow_gripper_support_collision.real; + offset += sizeof(this->allow_gripper_support_collision); + uint32_t attached_object_touch_links_lengthT = ((uint32_t) (*(inbuffer + offset))); + attached_object_touch_links_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + attached_object_touch_links_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + attached_object_touch_links_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->attached_object_touch_links_length); + if(attached_object_touch_links_lengthT > attached_object_touch_links_length) + this->attached_object_touch_links = (char**)realloc(this->attached_object_touch_links, attached_object_touch_links_lengthT * sizeof(char*)); + attached_object_touch_links_length = attached_object_touch_links_lengthT; + for( uint32_t i = 0; i < attached_object_touch_links_length; i++){ + uint32_t length_st_attached_object_touch_links; + arrToVar(length_st_attached_object_touch_links, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_attached_object_touch_links; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_attached_object_touch_links-1]=0; + this->st_attached_object_touch_links = (char *)(inbuffer + offset-1); + offset += length_st_attached_object_touch_links; + memcpy( &(this->attached_object_touch_links[i]), &(this->st_attached_object_touch_links), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_minimize_object_distance; + u_minimize_object_distance.base = 0; + u_minimize_object_distance.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->minimize_object_distance = u_minimize_object_distance.real; + offset += sizeof(this->minimize_object_distance); + offset += this->path_constraints.deserialize(inbuffer + offset); + uint32_t length_planner_id; + arrToVar(length_planner_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_planner_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_planner_id-1]=0; + this->planner_id = (char *)(inbuffer + offset-1); + offset += length_planner_id; + uint32_t allowed_touch_objects_lengthT = ((uint32_t) (*(inbuffer + offset))); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->allowed_touch_objects_length); + if(allowed_touch_objects_lengthT > allowed_touch_objects_length) + this->allowed_touch_objects = (char**)realloc(this->allowed_touch_objects, allowed_touch_objects_lengthT * sizeof(char*)); + allowed_touch_objects_length = allowed_touch_objects_lengthT; + for( uint32_t i = 0; i < allowed_touch_objects_length; i++){ + uint32_t length_st_allowed_touch_objects; + arrToVar(length_st_allowed_touch_objects, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_allowed_touch_objects; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_allowed_touch_objects-1]=0; + this->st_allowed_touch_objects = (char *)(inbuffer + offset-1); + offset += length_st_allowed_touch_objects; + memcpy( &(this->allowed_touch_objects[i]), &(this->st_allowed_touch_objects), sizeof(char*)); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->allowed_planning_time)); + offset += this->planning_options.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PickupGoal"; }; + virtual const char * getMD5() override { return "3a71f6f9bc6e640594ce6a411ccfe764"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupResult.h new file mode 100644 index 000000000..174800cd2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PickupResult.h @@ -0,0 +1,124 @@ +#ifndef _ROS_moveit_msgs_PickupResult_h +#define _ROS_moveit_msgs_PickupResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MoveItErrorCodes.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/RobotTrajectory.h" +#include "moveit_msgs/Grasp.h" + +namespace moveit_msgs +{ + + class PickupResult : public ros::Msg + { + public: + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + typedef moveit_msgs::RobotState _trajectory_start_type; + _trajectory_start_type trajectory_start; + uint32_t trajectory_stages_length; + typedef moveit_msgs::RobotTrajectory _trajectory_stages_type; + _trajectory_stages_type st_trajectory_stages; + _trajectory_stages_type * trajectory_stages; + uint32_t trajectory_descriptions_length; + typedef char* _trajectory_descriptions_type; + _trajectory_descriptions_type st_trajectory_descriptions; + _trajectory_descriptions_type * trajectory_descriptions; + typedef moveit_msgs::Grasp _grasp_type; + _grasp_type grasp; + typedef float _planning_time_type; + _planning_time_type planning_time; + + PickupResult(): + error_code(), + trajectory_start(), + trajectory_stages_length(0), st_trajectory_stages(), trajectory_stages(nullptr), + trajectory_descriptions_length(0), st_trajectory_descriptions(), trajectory_descriptions(nullptr), + grasp(), + planning_time(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->error_code.serialize(outbuffer + offset); + offset += this->trajectory_start.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->trajectory_stages_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->trajectory_stages_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->trajectory_stages_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->trajectory_stages_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->trajectory_stages_length); + for( uint32_t i = 0; i < trajectory_stages_length; i++){ + offset += this->trajectory_stages[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->trajectory_descriptions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->trajectory_descriptions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->trajectory_descriptions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->trajectory_descriptions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->trajectory_descriptions_length); + for( uint32_t i = 0; i < trajectory_descriptions_length; i++){ + uint32_t length_trajectory_descriptionsi = strlen(this->trajectory_descriptions[i]); + varToArr(outbuffer + offset, length_trajectory_descriptionsi); + offset += 4; + memcpy(outbuffer + offset, this->trajectory_descriptions[i], length_trajectory_descriptionsi); + offset += length_trajectory_descriptionsi; + } + offset += this->grasp.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->planning_time); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->error_code.deserialize(inbuffer + offset); + offset += this->trajectory_start.deserialize(inbuffer + offset); + uint32_t trajectory_stages_lengthT = ((uint32_t) (*(inbuffer + offset))); + trajectory_stages_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + trajectory_stages_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + trajectory_stages_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->trajectory_stages_length); + if(trajectory_stages_lengthT > trajectory_stages_length) + this->trajectory_stages = (moveit_msgs::RobotTrajectory*)realloc(this->trajectory_stages, trajectory_stages_lengthT * sizeof(moveit_msgs::RobotTrajectory)); + trajectory_stages_length = trajectory_stages_lengthT; + for( uint32_t i = 0; i < trajectory_stages_length; i++){ + offset += this->st_trajectory_stages.deserialize(inbuffer + offset); + memcpy( &(this->trajectory_stages[i]), &(this->st_trajectory_stages), sizeof(moveit_msgs::RobotTrajectory)); + } + uint32_t trajectory_descriptions_lengthT = ((uint32_t) (*(inbuffer + offset))); + trajectory_descriptions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + trajectory_descriptions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + trajectory_descriptions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->trajectory_descriptions_length); + if(trajectory_descriptions_lengthT > trajectory_descriptions_length) + this->trajectory_descriptions = (char**)realloc(this->trajectory_descriptions, trajectory_descriptions_lengthT * sizeof(char*)); + trajectory_descriptions_length = trajectory_descriptions_lengthT; + for( uint32_t i = 0; i < trajectory_descriptions_length; i++){ + uint32_t length_st_trajectory_descriptions; + arrToVar(length_st_trajectory_descriptions, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_trajectory_descriptions; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_trajectory_descriptions-1]=0; + this->st_trajectory_descriptions = (char *)(inbuffer + offset-1); + offset += length_st_trajectory_descriptions; + memcpy( &(this->trajectory_descriptions[i]), &(this->st_trajectory_descriptions), sizeof(char*)); + } + offset += this->grasp.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->planning_time)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PickupResult"; }; + virtual const char * getMD5() override { return "703f433082edbf20e2dc7aa026df9abf"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceAction.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceAction.h new file mode 100644 index 000000000..2ed63f808 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_PlaceAction_h +#define _ROS_moveit_msgs_PlaceAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/PlaceActionGoal.h" +#include "moveit_msgs/PlaceActionResult.h" +#include "moveit_msgs/PlaceActionFeedback.h" + +namespace moveit_msgs +{ + + class PlaceAction : public ros::Msg + { + public: + typedef moveit_msgs::PlaceActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef moveit_msgs::PlaceActionResult _action_result_type; + _action_result_type action_result; + typedef moveit_msgs::PlaceActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PlaceAction(): + 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 "moveit_msgs/PlaceAction"; }; + virtual const char * getMD5() override { return "a251d4a0c56193b6e1b76a1ca20de499"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionFeedback.h new file mode 100644 index 000000000..f2ac57a69 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_PlaceActionFeedback_h +#define _ROS_moveit_msgs_PlaceActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "moveit_msgs/PlaceFeedback.h" + +namespace moveit_msgs +{ + + class PlaceActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef moveit_msgs::PlaceFeedback _feedback_type; + _feedback_type feedback; + + PlaceActionFeedback(): + 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 "moveit_msgs/PlaceActionFeedback"; }; + virtual const char * getMD5() override { return "12232ef97486c7962f264c105aae2958"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionGoal.h new file mode 100644 index 000000000..a3574d0f7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_PlaceActionGoal_h +#define _ROS_moveit_msgs_PlaceActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "moveit_msgs/PlaceGoal.h" + +namespace moveit_msgs +{ + + class PlaceActionGoal : 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 moveit_msgs::PlaceGoal _goal_type; + _goal_type goal; + + PlaceActionGoal(): + 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 "moveit_msgs/PlaceActionGoal"; }; + virtual const char * getMD5() override { return "3f3419319ea8d2af4e18a600962d0cf5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionResult.h new file mode 100644 index 000000000..20ead2742 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_moveit_msgs_PlaceActionResult_h +#define _ROS_moveit_msgs_PlaceActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "moveit_msgs/PlaceResult.h" + +namespace moveit_msgs +{ + + class PlaceActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef moveit_msgs::PlaceResult _result_type; + _result_type result; + + PlaceActionResult(): + 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 "moveit_msgs/PlaceActionResult"; }; + virtual const char * getMD5() override { return "4fbc563d1316531e4a08f29bf6b7ba2c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceFeedback.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceFeedback.h new file mode 100644 index 000000000..2ec92dd0d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceFeedback.h @@ -0,0 +1,55 @@ +#ifndef _ROS_moveit_msgs_PlaceFeedback_h +#define _ROS_moveit_msgs_PlaceFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class PlaceFeedback : public ros::Msg + { + public: + typedef const char* _state_type; + _state_type state; + + PlaceFeedback(): + state("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_state = strlen(this->state); + varToArr(outbuffer + offset, length_state); + offset += 4; + memcpy(outbuffer + offset, this->state, length_state); + offset += length_state; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PlaceFeedback"; }; + virtual const char * getMD5() override { return "af6d3a99f0fbeb66d3248fa4b3e675fb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceGoal.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceGoal.h new file mode 100644 index 000000000..55b544698 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceGoal.h @@ -0,0 +1,222 @@ +#ifndef _ROS_moveit_msgs_PlaceGoal_h +#define _ROS_moveit_msgs_PlaceGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/PlaceLocation.h" +#include "moveit_msgs/Constraints.h" +#include "moveit_msgs/PlanningOptions.h" + +namespace moveit_msgs +{ + + class PlaceGoal : public ros::Msg + { + public: + typedef const char* _group_name_type; + _group_name_type group_name; + typedef const char* _attached_object_name_type; + _attached_object_name_type attached_object_name; + uint32_t place_locations_length; + typedef moveit_msgs::PlaceLocation _place_locations_type; + _place_locations_type st_place_locations; + _place_locations_type * place_locations; + typedef bool _place_eef_type; + _place_eef_type place_eef; + typedef const char* _support_surface_name_type; + _support_surface_name_type support_surface_name; + typedef bool _allow_gripper_support_collision_type; + _allow_gripper_support_collision_type allow_gripper_support_collision; + typedef moveit_msgs::Constraints _path_constraints_type; + _path_constraints_type path_constraints; + typedef const char* _planner_id_type; + _planner_id_type planner_id; + uint32_t allowed_touch_objects_length; + typedef char* _allowed_touch_objects_type; + _allowed_touch_objects_type st_allowed_touch_objects; + _allowed_touch_objects_type * allowed_touch_objects; + typedef float _allowed_planning_time_type; + _allowed_planning_time_type allowed_planning_time; + typedef moveit_msgs::PlanningOptions _planning_options_type; + _planning_options_type planning_options; + + PlaceGoal(): + group_name(""), + attached_object_name(""), + place_locations_length(0), st_place_locations(), place_locations(nullptr), + place_eef(0), + support_surface_name(""), + allow_gripper_support_collision(0), + path_constraints(), + planner_id(""), + allowed_touch_objects_length(0), st_allowed_touch_objects(), allowed_touch_objects(nullptr), + allowed_planning_time(0), + planning_options() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_group_name = strlen(this->group_name); + varToArr(outbuffer + offset, length_group_name); + offset += 4; + memcpy(outbuffer + offset, this->group_name, length_group_name); + offset += length_group_name; + uint32_t length_attached_object_name = strlen(this->attached_object_name); + varToArr(outbuffer + offset, length_attached_object_name); + offset += 4; + memcpy(outbuffer + offset, this->attached_object_name, length_attached_object_name); + offset += length_attached_object_name; + *(outbuffer + offset + 0) = (this->place_locations_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->place_locations_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->place_locations_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->place_locations_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->place_locations_length); + for( uint32_t i = 0; i < place_locations_length; i++){ + offset += this->place_locations[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_place_eef; + u_place_eef.real = this->place_eef; + *(outbuffer + offset + 0) = (u_place_eef.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->place_eef); + uint32_t length_support_surface_name = strlen(this->support_surface_name); + varToArr(outbuffer + offset, length_support_surface_name); + offset += 4; + memcpy(outbuffer + offset, this->support_surface_name, length_support_surface_name); + offset += length_support_surface_name; + union { + bool real; + uint8_t base; + } u_allow_gripper_support_collision; + u_allow_gripper_support_collision.real = this->allow_gripper_support_collision; + *(outbuffer + offset + 0) = (u_allow_gripper_support_collision.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->allow_gripper_support_collision); + offset += this->path_constraints.serialize(outbuffer + offset); + uint32_t length_planner_id = strlen(this->planner_id); + varToArr(outbuffer + offset, length_planner_id); + offset += 4; + memcpy(outbuffer + offset, this->planner_id, length_planner_id); + offset += length_planner_id; + *(outbuffer + offset + 0) = (this->allowed_touch_objects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->allowed_touch_objects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->allowed_touch_objects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->allowed_touch_objects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->allowed_touch_objects_length); + for( uint32_t i = 0; i < allowed_touch_objects_length; i++){ + uint32_t length_allowed_touch_objectsi = strlen(this->allowed_touch_objects[i]); + varToArr(outbuffer + offset, length_allowed_touch_objectsi); + offset += 4; + memcpy(outbuffer + offset, this->allowed_touch_objects[i], length_allowed_touch_objectsi); + offset += length_allowed_touch_objectsi; + } + offset += serializeAvrFloat64(outbuffer + offset, this->allowed_planning_time); + offset += this->planning_options.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_group_name; + arrToVar(length_group_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group_name-1]=0; + this->group_name = (char *)(inbuffer + offset-1); + offset += length_group_name; + uint32_t length_attached_object_name; + arrToVar(length_attached_object_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_attached_object_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_attached_object_name-1]=0; + this->attached_object_name = (char *)(inbuffer + offset-1); + offset += length_attached_object_name; + uint32_t place_locations_lengthT = ((uint32_t) (*(inbuffer + offset))); + place_locations_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + place_locations_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + place_locations_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->place_locations_length); + if(place_locations_lengthT > place_locations_length) + this->place_locations = (moveit_msgs::PlaceLocation*)realloc(this->place_locations, place_locations_lengthT * sizeof(moveit_msgs::PlaceLocation)); + place_locations_length = place_locations_lengthT; + for( uint32_t i = 0; i < place_locations_length; i++){ + offset += this->st_place_locations.deserialize(inbuffer + offset); + memcpy( &(this->place_locations[i]), &(this->st_place_locations), sizeof(moveit_msgs::PlaceLocation)); + } + union { + bool real; + uint8_t base; + } u_place_eef; + u_place_eef.base = 0; + u_place_eef.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->place_eef = u_place_eef.real; + offset += sizeof(this->place_eef); + uint32_t length_support_surface_name; + arrToVar(length_support_surface_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_support_surface_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_support_surface_name-1]=0; + this->support_surface_name = (char *)(inbuffer + offset-1); + offset += length_support_surface_name; + union { + bool real; + uint8_t base; + } u_allow_gripper_support_collision; + u_allow_gripper_support_collision.base = 0; + u_allow_gripper_support_collision.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->allow_gripper_support_collision = u_allow_gripper_support_collision.real; + offset += sizeof(this->allow_gripper_support_collision); + offset += this->path_constraints.deserialize(inbuffer + offset); + uint32_t length_planner_id; + arrToVar(length_planner_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_planner_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_planner_id-1]=0; + this->planner_id = (char *)(inbuffer + offset-1); + offset += length_planner_id; + uint32_t allowed_touch_objects_lengthT = ((uint32_t) (*(inbuffer + offset))); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->allowed_touch_objects_length); + if(allowed_touch_objects_lengthT > allowed_touch_objects_length) + this->allowed_touch_objects = (char**)realloc(this->allowed_touch_objects, allowed_touch_objects_lengthT * sizeof(char*)); + allowed_touch_objects_length = allowed_touch_objects_lengthT; + for( uint32_t i = 0; i < allowed_touch_objects_length; i++){ + uint32_t length_st_allowed_touch_objects; + arrToVar(length_st_allowed_touch_objects, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_allowed_touch_objects; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_allowed_touch_objects-1]=0; + this->st_allowed_touch_objects = (char *)(inbuffer + offset-1); + offset += length_st_allowed_touch_objects; + memcpy( &(this->allowed_touch_objects[i]), &(this->st_allowed_touch_objects), sizeof(char*)); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->allowed_planning_time)); + offset += this->planning_options.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PlaceGoal"; }; + virtual const char * getMD5() override { return "b5ff24625cebec440c18cd2e1d833764"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceLocation.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceLocation.h new file mode 100644 index 000000000..d816c99ca --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceLocation.h @@ -0,0 +1,120 @@ +#ifndef _ROS_moveit_msgs_PlaceLocation_h +#define _ROS_moveit_msgs_PlaceLocation_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "geometry_msgs/PoseStamped.h" +#include "moveit_msgs/GripperTranslation.h" + +namespace moveit_msgs +{ + + class PlaceLocation : public ros::Msg + { + public: + typedef const char* _id_type; + _id_type id; + typedef trajectory_msgs::JointTrajectory _post_place_posture_type; + _post_place_posture_type post_place_posture; + typedef geometry_msgs::PoseStamped _place_pose_type; + _place_pose_type place_pose; + typedef float _quality_type; + _quality_type quality; + typedef moveit_msgs::GripperTranslation _pre_place_approach_type; + _pre_place_approach_type pre_place_approach; + typedef moveit_msgs::GripperTranslation _post_place_retreat_type; + _post_place_retreat_type post_place_retreat; + uint32_t allowed_touch_objects_length; + typedef char* _allowed_touch_objects_type; + _allowed_touch_objects_type st_allowed_touch_objects; + _allowed_touch_objects_type * allowed_touch_objects; + + PlaceLocation(): + id(""), + post_place_posture(), + place_pose(), + quality(0), + pre_place_approach(), + post_place_retreat(), + allowed_touch_objects_length(0), st_allowed_touch_objects(), allowed_touch_objects(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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 += this->post_place_posture.serialize(outbuffer + offset); + offset += this->place_pose.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->quality); + offset += this->pre_place_approach.serialize(outbuffer + offset); + offset += this->post_place_retreat.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->allowed_touch_objects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->allowed_touch_objects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->allowed_touch_objects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->allowed_touch_objects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->allowed_touch_objects_length); + for( uint32_t i = 0; i < allowed_touch_objects_length; i++){ + uint32_t length_allowed_touch_objectsi = strlen(this->allowed_touch_objects[i]); + varToArr(outbuffer + offset, length_allowed_touch_objectsi); + offset += 4; + memcpy(outbuffer + offset, this->allowed_touch_objects[i], length_allowed_touch_objectsi); + offset += length_allowed_touch_objectsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 += this->post_place_posture.deserialize(inbuffer + offset); + offset += this->place_pose.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->quality)); + offset += this->pre_place_approach.deserialize(inbuffer + offset); + offset += this->post_place_retreat.deserialize(inbuffer + offset); + uint32_t allowed_touch_objects_lengthT = ((uint32_t) (*(inbuffer + offset))); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + allowed_touch_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->allowed_touch_objects_length); + if(allowed_touch_objects_lengthT > allowed_touch_objects_length) + this->allowed_touch_objects = (char**)realloc(this->allowed_touch_objects, allowed_touch_objects_lengthT * sizeof(char*)); + allowed_touch_objects_length = allowed_touch_objects_lengthT; + for( uint32_t i = 0; i < allowed_touch_objects_length; i++){ + uint32_t length_st_allowed_touch_objects; + arrToVar(length_st_allowed_touch_objects, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_allowed_touch_objects; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_allowed_touch_objects-1]=0; + this->st_allowed_touch_objects = (char *)(inbuffer + offset-1); + offset += length_st_allowed_touch_objects; + memcpy( &(this->allowed_touch_objects[i]), &(this->st_allowed_touch_objects), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PlaceLocation"; }; + virtual const char * getMD5() override { return "7b53f032c68481686026c3e9223d0713"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceResult.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceResult.h new file mode 100644 index 000000000..53f5a6f72 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlaceResult.h @@ -0,0 +1,124 @@ +#ifndef _ROS_moveit_msgs_PlaceResult_h +#define _ROS_moveit_msgs_PlaceResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/MoveItErrorCodes.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/RobotTrajectory.h" +#include "moveit_msgs/PlaceLocation.h" + +namespace moveit_msgs +{ + + class PlaceResult : public ros::Msg + { + public: + typedef moveit_msgs::MoveItErrorCodes _error_code_type; + _error_code_type error_code; + typedef moveit_msgs::RobotState _trajectory_start_type; + _trajectory_start_type trajectory_start; + uint32_t trajectory_stages_length; + typedef moveit_msgs::RobotTrajectory _trajectory_stages_type; + _trajectory_stages_type st_trajectory_stages; + _trajectory_stages_type * trajectory_stages; + uint32_t trajectory_descriptions_length; + typedef char* _trajectory_descriptions_type; + _trajectory_descriptions_type st_trajectory_descriptions; + _trajectory_descriptions_type * trajectory_descriptions; + typedef moveit_msgs::PlaceLocation _place_location_type; + _place_location_type place_location; + typedef float _planning_time_type; + _planning_time_type planning_time; + + PlaceResult(): + error_code(), + trajectory_start(), + trajectory_stages_length(0), st_trajectory_stages(), trajectory_stages(nullptr), + trajectory_descriptions_length(0), st_trajectory_descriptions(), trajectory_descriptions(nullptr), + place_location(), + planning_time(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->error_code.serialize(outbuffer + offset); + offset += this->trajectory_start.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->trajectory_stages_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->trajectory_stages_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->trajectory_stages_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->trajectory_stages_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->trajectory_stages_length); + for( uint32_t i = 0; i < trajectory_stages_length; i++){ + offset += this->trajectory_stages[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->trajectory_descriptions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->trajectory_descriptions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->trajectory_descriptions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->trajectory_descriptions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->trajectory_descriptions_length); + for( uint32_t i = 0; i < trajectory_descriptions_length; i++){ + uint32_t length_trajectory_descriptionsi = strlen(this->trajectory_descriptions[i]); + varToArr(outbuffer + offset, length_trajectory_descriptionsi); + offset += 4; + memcpy(outbuffer + offset, this->trajectory_descriptions[i], length_trajectory_descriptionsi); + offset += length_trajectory_descriptionsi; + } + offset += this->place_location.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->planning_time); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->error_code.deserialize(inbuffer + offset); + offset += this->trajectory_start.deserialize(inbuffer + offset); + uint32_t trajectory_stages_lengthT = ((uint32_t) (*(inbuffer + offset))); + trajectory_stages_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + trajectory_stages_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + trajectory_stages_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->trajectory_stages_length); + if(trajectory_stages_lengthT > trajectory_stages_length) + this->trajectory_stages = (moveit_msgs::RobotTrajectory*)realloc(this->trajectory_stages, trajectory_stages_lengthT * sizeof(moveit_msgs::RobotTrajectory)); + trajectory_stages_length = trajectory_stages_lengthT; + for( uint32_t i = 0; i < trajectory_stages_length; i++){ + offset += this->st_trajectory_stages.deserialize(inbuffer + offset); + memcpy( &(this->trajectory_stages[i]), &(this->st_trajectory_stages), sizeof(moveit_msgs::RobotTrajectory)); + } + uint32_t trajectory_descriptions_lengthT = ((uint32_t) (*(inbuffer + offset))); + trajectory_descriptions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + trajectory_descriptions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + trajectory_descriptions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->trajectory_descriptions_length); + if(trajectory_descriptions_lengthT > trajectory_descriptions_length) + this->trajectory_descriptions = (char**)realloc(this->trajectory_descriptions, trajectory_descriptions_lengthT * sizeof(char*)); + trajectory_descriptions_length = trajectory_descriptions_lengthT; + for( uint32_t i = 0; i < trajectory_descriptions_length; i++){ + uint32_t length_st_trajectory_descriptions; + arrToVar(length_st_trajectory_descriptions, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_trajectory_descriptions; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_trajectory_descriptions-1]=0; + this->st_trajectory_descriptions = (char *)(inbuffer + offset-1); + offset += length_st_trajectory_descriptions; + memcpy( &(this->trajectory_descriptions[i]), &(this->st_trajectory_descriptions), sizeof(char*)); + } + offset += this->place_location.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->planning_time)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PlaceResult"; }; + virtual const char * getMD5() override { return "7f9bf644e9dcd62bf446decc8d1a556c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlannerInterfaceDescription.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlannerInterfaceDescription.h new file mode 100644 index 000000000..c075fc28a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlannerInterfaceDescription.h @@ -0,0 +1,109 @@ +#ifndef _ROS_moveit_msgs_PlannerInterfaceDescription_h +#define _ROS_moveit_msgs_PlannerInterfaceDescription_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class PlannerInterfaceDescription : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _pipeline_id_type; + _pipeline_id_type pipeline_id; + uint32_t planner_ids_length; + typedef char* _planner_ids_type; + _planner_ids_type st_planner_ids; + _planner_ids_type * planner_ids; + + PlannerInterfaceDescription(): + name(""), + pipeline_id(""), + planner_ids_length(0), st_planner_ids(), planner_ids(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_pipeline_id = strlen(this->pipeline_id); + varToArr(outbuffer + offset, length_pipeline_id); + offset += 4; + memcpy(outbuffer + offset, this->pipeline_id, length_pipeline_id); + offset += length_pipeline_id; + *(outbuffer + offset + 0) = (this->planner_ids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->planner_ids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->planner_ids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->planner_ids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->planner_ids_length); + for( uint32_t i = 0; i < planner_ids_length; i++){ + uint32_t length_planner_idsi = strlen(this->planner_ids[i]); + varToArr(outbuffer + offset, length_planner_idsi); + offset += 4; + memcpy(outbuffer + offset, this->planner_ids[i], length_planner_idsi); + offset += length_planner_idsi; + } + 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_pipeline_id; + arrToVar(length_pipeline_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pipeline_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pipeline_id-1]=0; + this->pipeline_id = (char *)(inbuffer + offset-1); + offset += length_pipeline_id; + uint32_t planner_ids_lengthT = ((uint32_t) (*(inbuffer + offset))); + planner_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + planner_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + planner_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->planner_ids_length); + if(planner_ids_lengthT > planner_ids_length) + this->planner_ids = (char**)realloc(this->planner_ids, planner_ids_lengthT * sizeof(char*)); + planner_ids_length = planner_ids_lengthT; + for( uint32_t i = 0; i < planner_ids_length; i++){ + uint32_t length_st_planner_ids; + arrToVar(length_st_planner_ids, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_planner_ids; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_planner_ids-1]=0; + this->st_planner_ids = (char *)(inbuffer + offset-1); + offset += length_st_planner_ids; + memcpy( &(this->planner_ids[i]), &(this->st_planner_ids), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PlannerInterfaceDescription"; }; + virtual const char * getMD5() override { return "3b93afb00ba165a83730c4eb03cd1ab7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlannerParams.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlannerParams.h new file mode 100644 index 000000000..eb297bf38 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlannerParams.h @@ -0,0 +1,149 @@ +#ifndef _ROS_moveit_msgs_PlannerParams_h +#define _ROS_moveit_msgs_PlannerParams_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class PlannerParams : public ros::Msg + { + public: + uint32_t keys_length; + typedef char* _keys_type; + _keys_type st_keys; + _keys_type * keys; + uint32_t values_length; + typedef char* _values_type; + _values_type st_values; + _values_type * values; + uint32_t descriptions_length; + typedef char* _descriptions_type; + _descriptions_type st_descriptions; + _descriptions_type * descriptions; + + PlannerParams(): + keys_length(0), st_keys(), keys(nullptr), + values_length(0), st_values(), values(nullptr), + descriptions_length(0), st_descriptions(), descriptions(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->keys_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->keys_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->keys_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->keys_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->keys_length); + for( uint32_t i = 0; i < keys_length; i++){ + uint32_t length_keysi = strlen(this->keys[i]); + varToArr(outbuffer + offset, length_keysi); + offset += 4; + memcpy(outbuffer + offset, this->keys[i], length_keysi); + offset += length_keysi; + } + *(outbuffer + offset + 0) = (this->values_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->values_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->values_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->values_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->values_length); + for( uint32_t i = 0; i < values_length; i++){ + uint32_t length_valuesi = strlen(this->values[i]); + varToArr(outbuffer + offset, length_valuesi); + offset += 4; + memcpy(outbuffer + offset, this->values[i], length_valuesi); + offset += length_valuesi; + } + *(outbuffer + offset + 0) = (this->descriptions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->descriptions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->descriptions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->descriptions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->descriptions_length); + for( uint32_t i = 0; i < descriptions_length; i++){ + uint32_t length_descriptionsi = strlen(this->descriptions[i]); + varToArr(outbuffer + offset, length_descriptionsi); + offset += 4; + memcpy(outbuffer + offset, this->descriptions[i], length_descriptionsi); + offset += length_descriptionsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t keys_lengthT = ((uint32_t) (*(inbuffer + offset))); + keys_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + keys_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + keys_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->keys_length); + if(keys_lengthT > keys_length) + this->keys = (char**)realloc(this->keys, keys_lengthT * sizeof(char*)); + keys_length = keys_lengthT; + for( uint32_t i = 0; i < keys_length; i++){ + uint32_t length_st_keys; + arrToVar(length_st_keys, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_keys; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_keys-1]=0; + this->st_keys = (char *)(inbuffer + offset-1); + offset += length_st_keys; + memcpy( &(this->keys[i]), &(this->st_keys), sizeof(char*)); + } + uint32_t values_lengthT = ((uint32_t) (*(inbuffer + offset))); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->values_length); + if(values_lengthT > values_length) + this->values = (char**)realloc(this->values, values_lengthT * sizeof(char*)); + values_length = values_lengthT; + for( uint32_t i = 0; i < values_length; i++){ + uint32_t length_st_values; + arrToVar(length_st_values, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_values; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_values-1]=0; + this->st_values = (char *)(inbuffer + offset-1); + offset += length_st_values; + memcpy( &(this->values[i]), &(this->st_values), sizeof(char*)); + } + uint32_t descriptions_lengthT = ((uint32_t) (*(inbuffer + offset))); + descriptions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + descriptions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + descriptions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->descriptions_length); + if(descriptions_lengthT > descriptions_length) + this->descriptions = (char**)realloc(this->descriptions, descriptions_lengthT * sizeof(char*)); + descriptions_length = descriptions_lengthT; + for( uint32_t i = 0; i < descriptions_length; i++){ + uint32_t length_st_descriptions; + arrToVar(length_st_descriptions, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_descriptions; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_descriptions-1]=0; + this->st_descriptions = (char *)(inbuffer + offset-1); + offset += length_st_descriptions; + memcpy( &(this->descriptions[i]), &(this->st_descriptions), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PlannerParams"; }; + virtual const char * getMD5() override { return "cebdf4927996b9026bcf59a160d64145"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningOptions.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningOptions.h new file mode 100644 index 000000000..397b85957 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningOptions.h @@ -0,0 +1,156 @@ +#ifndef _ROS_moveit_msgs_PlanningOptions_h +#define _ROS_moveit_msgs_PlanningOptions_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/PlanningScene.h" + +namespace moveit_msgs +{ + + class PlanningOptions : public ros::Msg + { + public: + typedef moveit_msgs::PlanningScene _planning_scene_diff_type; + _planning_scene_diff_type planning_scene_diff; + typedef bool _plan_only_type; + _plan_only_type plan_only; + typedef bool _look_around_type; + _look_around_type look_around; + typedef int32_t _look_around_attempts_type; + _look_around_attempts_type look_around_attempts; + typedef float _max_safe_execution_cost_type; + _max_safe_execution_cost_type max_safe_execution_cost; + typedef bool _replan_type; + _replan_type replan; + typedef int32_t _replan_attempts_type; + _replan_attempts_type replan_attempts; + typedef float _replan_delay_type; + _replan_delay_type replan_delay; + + PlanningOptions(): + planning_scene_diff(), + plan_only(0), + look_around(0), + look_around_attempts(0), + max_safe_execution_cost(0), + replan(0), + replan_attempts(0), + replan_delay(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->planning_scene_diff.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_plan_only; + u_plan_only.real = this->plan_only; + *(outbuffer + offset + 0) = (u_plan_only.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->plan_only); + union { + bool real; + uint8_t base; + } u_look_around; + u_look_around.real = this->look_around; + *(outbuffer + offset + 0) = (u_look_around.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->look_around); + union { + int32_t real; + uint32_t base; + } u_look_around_attempts; + u_look_around_attempts.real = this->look_around_attempts; + *(outbuffer + offset + 0) = (u_look_around_attempts.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_look_around_attempts.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_look_around_attempts.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_look_around_attempts.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->look_around_attempts); + offset += serializeAvrFloat64(outbuffer + offset, this->max_safe_execution_cost); + union { + bool real; + uint8_t base; + } u_replan; + u_replan.real = this->replan; + *(outbuffer + offset + 0) = (u_replan.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->replan); + union { + int32_t real; + uint32_t base; + } u_replan_attempts; + u_replan_attempts.real = this->replan_attempts; + *(outbuffer + offset + 0) = (u_replan_attempts.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_replan_attempts.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_replan_attempts.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_replan_attempts.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->replan_attempts); + offset += serializeAvrFloat64(outbuffer + offset, this->replan_delay); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->planning_scene_diff.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_plan_only; + u_plan_only.base = 0; + u_plan_only.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->plan_only = u_plan_only.real; + offset += sizeof(this->plan_only); + union { + bool real; + uint8_t base; + } u_look_around; + u_look_around.base = 0; + u_look_around.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->look_around = u_look_around.real; + offset += sizeof(this->look_around); + union { + int32_t real; + uint32_t base; + } u_look_around_attempts; + u_look_around_attempts.base = 0; + u_look_around_attempts.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_look_around_attempts.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_look_around_attempts.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_look_around_attempts.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->look_around_attempts = u_look_around_attempts.real; + offset += sizeof(this->look_around_attempts); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_safe_execution_cost)); + union { + bool real; + uint8_t base; + } u_replan; + u_replan.base = 0; + u_replan.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->replan = u_replan.real; + offset += sizeof(this->replan); + union { + int32_t real; + uint32_t base; + } u_replan_attempts; + u_replan_attempts.base = 0; + u_replan_attempts.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_replan_attempts.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_replan_attempts.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_replan_attempts.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->replan_attempts = u_replan_attempts.real; + offset += sizeof(this->replan_attempts); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->replan_delay)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PlanningOptions"; }; + virtual const char * getMD5() override { return "3134e041c806c7c2ff59948db4d57835"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningScene.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningScene.h new file mode 100644 index 000000000..8d123b5bd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningScene.h @@ -0,0 +1,212 @@ +#ifndef _ROS_moveit_msgs_PlanningScene_h +#define _ROS_moveit_msgs_PlanningScene_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/RobotState.h" +#include "geometry_msgs/TransformStamped.h" +#include "moveit_msgs/AllowedCollisionMatrix.h" +#include "moveit_msgs/LinkPadding.h" +#include "moveit_msgs/LinkScale.h" +#include "moveit_msgs/ObjectColor.h" +#include "moveit_msgs/PlanningSceneWorld.h" + +namespace moveit_msgs +{ + + class PlanningScene : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef moveit_msgs::RobotState _robot_state_type; + _robot_state_type robot_state; + typedef const char* _robot_model_name_type; + _robot_model_name_type robot_model_name; + uint32_t fixed_frame_transforms_length; + typedef geometry_msgs::TransformStamped _fixed_frame_transforms_type; + _fixed_frame_transforms_type st_fixed_frame_transforms; + _fixed_frame_transforms_type * fixed_frame_transforms; + typedef moveit_msgs::AllowedCollisionMatrix _allowed_collision_matrix_type; + _allowed_collision_matrix_type allowed_collision_matrix; + uint32_t link_padding_length; + typedef moveit_msgs::LinkPadding _link_padding_type; + _link_padding_type st_link_padding; + _link_padding_type * link_padding; + uint32_t link_scale_length; + typedef moveit_msgs::LinkScale _link_scale_type; + _link_scale_type st_link_scale; + _link_scale_type * link_scale; + uint32_t object_colors_length; + typedef moveit_msgs::ObjectColor _object_colors_type; + _object_colors_type st_object_colors; + _object_colors_type * object_colors; + typedef moveit_msgs::PlanningSceneWorld _world_type; + _world_type world; + typedef bool _is_diff_type; + _is_diff_type is_diff; + + PlanningScene(): + name(""), + robot_state(), + robot_model_name(""), + fixed_frame_transforms_length(0), st_fixed_frame_transforms(), fixed_frame_transforms(nullptr), + allowed_collision_matrix(), + link_padding_length(0), st_link_padding(), link_padding(nullptr), + link_scale_length(0), st_link_scale(), link_scale(nullptr), + object_colors_length(0), st_object_colors(), object_colors(nullptr), + world(), + is_diff(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; + offset += this->robot_state.serialize(outbuffer + offset); + uint32_t length_robot_model_name = strlen(this->robot_model_name); + varToArr(outbuffer + offset, length_robot_model_name); + offset += 4; + memcpy(outbuffer + offset, this->robot_model_name, length_robot_model_name); + offset += length_robot_model_name; + *(outbuffer + offset + 0) = (this->fixed_frame_transforms_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fixed_frame_transforms_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fixed_frame_transforms_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fixed_frame_transforms_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->fixed_frame_transforms_length); + for( uint32_t i = 0; i < fixed_frame_transforms_length; i++){ + offset += this->fixed_frame_transforms[i].serialize(outbuffer + offset); + } + offset += this->allowed_collision_matrix.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->link_padding_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->link_padding_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->link_padding_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->link_padding_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->link_padding_length); + for( uint32_t i = 0; i < link_padding_length; i++){ + offset += this->link_padding[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->link_scale_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->link_scale_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->link_scale_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->link_scale_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->link_scale_length); + for( uint32_t i = 0; i < link_scale_length; i++){ + offset += this->link_scale[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->object_colors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->object_colors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->object_colors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->object_colors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->object_colors_length); + for( uint32_t i = 0; i < object_colors_length; i++){ + offset += this->object_colors[i].serialize(outbuffer + offset); + } + offset += this->world.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_is_diff; + u_is_diff.real = this->is_diff; + *(outbuffer + offset + 0) = (u_is_diff.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_diff); + 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; + offset += this->robot_state.deserialize(inbuffer + offset); + uint32_t length_robot_model_name; + arrToVar(length_robot_model_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot_model_name-1]=0; + this->robot_model_name = (char *)(inbuffer + offset-1); + offset += length_robot_model_name; + uint32_t fixed_frame_transforms_lengthT = ((uint32_t) (*(inbuffer + offset))); + fixed_frame_transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + fixed_frame_transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + fixed_frame_transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fixed_frame_transforms_length); + if(fixed_frame_transforms_lengthT > fixed_frame_transforms_length) + this->fixed_frame_transforms = (geometry_msgs::TransformStamped*)realloc(this->fixed_frame_transforms, fixed_frame_transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + fixed_frame_transforms_length = fixed_frame_transforms_lengthT; + for( uint32_t i = 0; i < fixed_frame_transforms_length; i++){ + offset += this->st_fixed_frame_transforms.deserialize(inbuffer + offset); + memcpy( &(this->fixed_frame_transforms[i]), &(this->st_fixed_frame_transforms), sizeof(geometry_msgs::TransformStamped)); + } + offset += this->allowed_collision_matrix.deserialize(inbuffer + offset); + uint32_t link_padding_lengthT = ((uint32_t) (*(inbuffer + offset))); + link_padding_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + link_padding_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + link_padding_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->link_padding_length); + if(link_padding_lengthT > link_padding_length) + this->link_padding = (moveit_msgs::LinkPadding*)realloc(this->link_padding, link_padding_lengthT * sizeof(moveit_msgs::LinkPadding)); + link_padding_length = link_padding_lengthT; + for( uint32_t i = 0; i < link_padding_length; i++){ + offset += this->st_link_padding.deserialize(inbuffer + offset); + memcpy( &(this->link_padding[i]), &(this->st_link_padding), sizeof(moveit_msgs::LinkPadding)); + } + uint32_t link_scale_lengthT = ((uint32_t) (*(inbuffer + offset))); + link_scale_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + link_scale_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + link_scale_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->link_scale_length); + if(link_scale_lengthT > link_scale_length) + this->link_scale = (moveit_msgs::LinkScale*)realloc(this->link_scale, link_scale_lengthT * sizeof(moveit_msgs::LinkScale)); + link_scale_length = link_scale_lengthT; + for( uint32_t i = 0; i < link_scale_length; i++){ + offset += this->st_link_scale.deserialize(inbuffer + offset); + memcpy( &(this->link_scale[i]), &(this->st_link_scale), sizeof(moveit_msgs::LinkScale)); + } + uint32_t object_colors_lengthT = ((uint32_t) (*(inbuffer + offset))); + object_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + object_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + object_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->object_colors_length); + if(object_colors_lengthT > object_colors_length) + this->object_colors = (moveit_msgs::ObjectColor*)realloc(this->object_colors, object_colors_lengthT * sizeof(moveit_msgs::ObjectColor)); + object_colors_length = object_colors_lengthT; + for( uint32_t i = 0; i < object_colors_length; i++){ + offset += this->st_object_colors.deserialize(inbuffer + offset); + memcpy( &(this->object_colors[i]), &(this->st_object_colors), sizeof(moveit_msgs::ObjectColor)); + } + offset += this->world.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_is_diff; + u_is_diff.base = 0; + u_is_diff.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_diff = u_is_diff.real; + offset += sizeof(this->is_diff); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PlanningScene"; }; + virtual const char * getMD5() override { return "acfc50bcfd6c7b978066bfa7c786002c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningSceneComponents.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningSceneComponents.h new file mode 100644 index 000000000..80a3c9adb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningSceneComponents.h @@ -0,0 +1,61 @@ +#ifndef _ROS_moveit_msgs_PlanningSceneComponents_h +#define _ROS_moveit_msgs_PlanningSceneComponents_h + +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + + class PlanningSceneComponents : public ros::Msg + { + public: + typedef uint32_t _components_type; + _components_type components; + enum { SCENE_SETTINGS = 1 }; + enum { ROBOT_STATE = 2 }; + enum { ROBOT_STATE_ATTACHED_OBJECTS = 4 }; + enum { WORLD_OBJECT_NAMES = 8 }; + enum { WORLD_OBJECT_GEOMETRY = 16 }; + enum { OCTOMAP = 32 }; + enum { TRANSFORMS = 64 }; + enum { ALLOWED_COLLISION_MATRIX = 128 }; + enum { LINK_PADDING_AND_SCALING = 256 }; + enum { OBJECT_COLORS = 512 }; + + PlanningSceneComponents(): + components(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->components >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->components >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->components >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->components >> (8 * 3)) & 0xFF; + offset += sizeof(this->components); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->components = ((uint32_t) (*(inbuffer + offset))); + this->components |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->components |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->components |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->components); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PlanningSceneComponents"; }; + virtual const char * getMD5() override { return "bc993e784476960b918b6e7ad5bb58ce"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningSceneWorld.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningSceneWorld.h new file mode 100644 index 000000000..12184bc56 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PlanningSceneWorld.h @@ -0,0 +1,70 @@ +#ifndef _ROS_moveit_msgs_PlanningSceneWorld_h +#define _ROS_moveit_msgs_PlanningSceneWorld_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/CollisionObject.h" +#include "octomap_msgs/OctomapWithPose.h" + +namespace moveit_msgs +{ + + class PlanningSceneWorld : public ros::Msg + { + public: + uint32_t collision_objects_length; + typedef moveit_msgs::CollisionObject _collision_objects_type; + _collision_objects_type st_collision_objects; + _collision_objects_type * collision_objects; + typedef octomap_msgs::OctomapWithPose _octomap_type; + _octomap_type octomap; + + PlanningSceneWorld(): + collision_objects_length(0), st_collision_objects(), collision_objects(nullptr), + octomap() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->collision_objects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->collision_objects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->collision_objects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->collision_objects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->collision_objects_length); + for( uint32_t i = 0; i < collision_objects_length; i++){ + offset += this->collision_objects[i].serialize(outbuffer + offset); + } + offset += this->octomap.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t collision_objects_lengthT = ((uint32_t) (*(inbuffer + offset))); + collision_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + collision_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + collision_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->collision_objects_length); + if(collision_objects_lengthT > collision_objects_length) + this->collision_objects = (moveit_msgs::CollisionObject*)realloc(this->collision_objects, collision_objects_lengthT * sizeof(moveit_msgs::CollisionObject)); + collision_objects_length = collision_objects_lengthT; + for( uint32_t i = 0; i < collision_objects_length; i++){ + offset += this->st_collision_objects.deserialize(inbuffer + offset); + memcpy( &(this->collision_objects[i]), &(this->st_collision_objects), sizeof(moveit_msgs::CollisionObject)); + } + offset += this->octomap.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PlanningSceneWorld"; }; + virtual const char * getMD5() override { return "79457311445f53d410ab4e3781de8447"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PositionConstraint.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PositionConstraint.h new file mode 100644 index 000000000..34b73a661 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PositionConstraint.h @@ -0,0 +1,78 @@ +#ifndef _ROS_moveit_msgs_PositionConstraint_h +#define _ROS_moveit_msgs_PositionConstraint_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" +#include "moveit_msgs/BoundingVolume.h" + +namespace moveit_msgs +{ + + class PositionConstraint : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _link_name_type; + _link_name_type link_name; + typedef geometry_msgs::Vector3 _target_point_offset_type; + _target_point_offset_type target_point_offset; + typedef moveit_msgs::BoundingVolume _constraint_region_type; + _constraint_region_type constraint_region; + typedef float _weight_type; + _weight_type weight; + + PositionConstraint(): + header(), + link_name(""), + target_point_offset(), + constraint_region(), + weight(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->target_point_offset.serialize(outbuffer + offset); + offset += this->constraint_region.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->weight); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->target_point_offset.deserialize(inbuffer + offset); + offset += this->constraint_region.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->weight)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PositionConstraint"; }; + virtual const char * getMD5() override { return "c83edf208d87d3aa3169f47775a58e6a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PositionIKRequest.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PositionIKRequest.h new file mode 100644 index 000000000..f15ab3f35 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/PositionIKRequest.h @@ -0,0 +1,194 @@ +#ifndef _ROS_moveit_msgs_PositionIKRequest_h +#define _ROS_moveit_msgs_PositionIKRequest_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/RobotState.h" +#include "moveit_msgs/Constraints.h" +#include "geometry_msgs/PoseStamped.h" +#include "ros/duration.h" + +namespace moveit_msgs +{ + + class PositionIKRequest : public ros::Msg + { + public: + typedef const char* _group_name_type; + _group_name_type group_name; + typedef moveit_msgs::RobotState _robot_state_type; + _robot_state_type robot_state; + typedef moveit_msgs::Constraints _constraints_type; + _constraints_type constraints; + typedef bool _avoid_collisions_type; + _avoid_collisions_type avoid_collisions; + typedef const char* _ik_link_name_type; + _ik_link_name_type ik_link_name; + typedef geometry_msgs::PoseStamped _pose_stamped_type; + _pose_stamped_type pose_stamped; + uint32_t ik_link_names_length; + typedef char* _ik_link_names_type; + _ik_link_names_type st_ik_link_names; + _ik_link_names_type * ik_link_names; + uint32_t pose_stamped_vector_length; + typedef geometry_msgs::PoseStamped _pose_stamped_vector_type; + _pose_stamped_vector_type st_pose_stamped_vector; + _pose_stamped_vector_type * pose_stamped_vector; + typedef ros::Duration _timeout_type; + _timeout_type timeout; + + PositionIKRequest(): + group_name(""), + robot_state(), + constraints(), + avoid_collisions(0), + ik_link_name(""), + pose_stamped(), + ik_link_names_length(0), st_ik_link_names(), ik_link_names(nullptr), + pose_stamped_vector_length(0), st_pose_stamped_vector(), pose_stamped_vector(nullptr), + timeout() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_group_name = strlen(this->group_name); + varToArr(outbuffer + offset, length_group_name); + offset += 4; + memcpy(outbuffer + offset, this->group_name, length_group_name); + offset += length_group_name; + offset += this->robot_state.serialize(outbuffer + offset); + offset += this->constraints.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_avoid_collisions; + u_avoid_collisions.real = this->avoid_collisions; + *(outbuffer + offset + 0) = (u_avoid_collisions.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->avoid_collisions); + uint32_t length_ik_link_name = strlen(this->ik_link_name); + varToArr(outbuffer + offset, length_ik_link_name); + offset += 4; + memcpy(outbuffer + offset, this->ik_link_name, length_ik_link_name); + offset += length_ik_link_name; + offset += this->pose_stamped.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->ik_link_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ik_link_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ik_link_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ik_link_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ik_link_names_length); + for( uint32_t i = 0; i < ik_link_names_length; i++){ + uint32_t length_ik_link_namesi = strlen(this->ik_link_names[i]); + varToArr(outbuffer + offset, length_ik_link_namesi); + offset += 4; + memcpy(outbuffer + offset, this->ik_link_names[i], length_ik_link_namesi); + offset += length_ik_link_namesi; + } + *(outbuffer + offset + 0) = (this->pose_stamped_vector_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pose_stamped_vector_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pose_stamped_vector_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pose_stamped_vector_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->pose_stamped_vector_length); + for( uint32_t i = 0; i < pose_stamped_vector_length; i++){ + offset += this->pose_stamped_vector[i].serialize(outbuffer + offset); + } + *(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); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_group_name; + arrToVar(length_group_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group_name-1]=0; + this->group_name = (char *)(inbuffer + offset-1); + offset += length_group_name; + offset += this->robot_state.deserialize(inbuffer + offset); + offset += this->constraints.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_avoid_collisions; + u_avoid_collisions.base = 0; + u_avoid_collisions.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->avoid_collisions = u_avoid_collisions.real; + offset += sizeof(this->avoid_collisions); + uint32_t length_ik_link_name; + arrToVar(length_ik_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ik_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ik_link_name-1]=0; + this->ik_link_name = (char *)(inbuffer + offset-1); + offset += length_ik_link_name; + offset += this->pose_stamped.deserialize(inbuffer + offset); + uint32_t ik_link_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + ik_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ik_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ik_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ik_link_names_length); + if(ik_link_names_lengthT > ik_link_names_length) + this->ik_link_names = (char**)realloc(this->ik_link_names, ik_link_names_lengthT * sizeof(char*)); + ik_link_names_length = ik_link_names_lengthT; + for( uint32_t i = 0; i < ik_link_names_length; i++){ + uint32_t length_st_ik_link_names; + arrToVar(length_st_ik_link_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_ik_link_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_ik_link_names-1]=0; + this->st_ik_link_names = (char *)(inbuffer + offset-1); + offset += length_st_ik_link_names; + memcpy( &(this->ik_link_names[i]), &(this->st_ik_link_names), sizeof(char*)); + } + uint32_t pose_stamped_vector_lengthT = ((uint32_t) (*(inbuffer + offset))); + pose_stamped_vector_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + pose_stamped_vector_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + pose_stamped_vector_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pose_stamped_vector_length); + if(pose_stamped_vector_lengthT > pose_stamped_vector_length) + this->pose_stamped_vector = (geometry_msgs::PoseStamped*)realloc(this->pose_stamped_vector, pose_stamped_vector_lengthT * sizeof(geometry_msgs::PoseStamped)); + pose_stamped_vector_length = pose_stamped_vector_lengthT; + for( uint32_t i = 0; i < pose_stamped_vector_length; i++){ + offset += this->st_pose_stamped_vector.deserialize(inbuffer + offset); + memcpy( &(this->pose_stamped_vector[i]), &(this->st_pose_stamped_vector), sizeof(geometry_msgs::PoseStamped)); + } + 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); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/PositionIKRequest"; }; + virtual const char * getMD5() override { return "cb7c3615ee4d29d023dfdc5950af0504"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/QueryPlannerInterfaces.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/QueryPlannerInterfaces.h new file mode 100644 index 000000000..078d5dfba --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/QueryPlannerInterfaces.h @@ -0,0 +1,96 @@ +#ifndef _ROS_SERVICE_QueryPlannerInterfaces_h +#define _ROS_SERVICE_QueryPlannerInterfaces_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/PlannerInterfaceDescription.h" + +namespace moveit_msgs +{ + +static const char QUERYPLANNERINTERFACES[] = "moveit_msgs/QueryPlannerInterfaces"; + + class QueryPlannerInterfacesRequest : public ros::Msg + { + public: + + QueryPlannerInterfacesRequest() + { + } + + 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 QUERYPLANNERINTERFACES; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class QueryPlannerInterfacesResponse : public ros::Msg + { + public: + uint32_t planner_interfaces_length; + typedef moveit_msgs::PlannerInterfaceDescription _planner_interfaces_type; + _planner_interfaces_type st_planner_interfaces; + _planner_interfaces_type * planner_interfaces; + + QueryPlannerInterfacesResponse(): + planner_interfaces_length(0), st_planner_interfaces(), planner_interfaces(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->planner_interfaces_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->planner_interfaces_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->planner_interfaces_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->planner_interfaces_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->planner_interfaces_length); + for( uint32_t i = 0; i < planner_interfaces_length; i++){ + offset += this->planner_interfaces[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t planner_interfaces_lengthT = ((uint32_t) (*(inbuffer + offset))); + planner_interfaces_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + planner_interfaces_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + planner_interfaces_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->planner_interfaces_length); + if(planner_interfaces_lengthT > planner_interfaces_length) + this->planner_interfaces = (moveit_msgs::PlannerInterfaceDescription*)realloc(this->planner_interfaces, planner_interfaces_lengthT * sizeof(moveit_msgs::PlannerInterfaceDescription)); + planner_interfaces_length = planner_interfaces_lengthT; + for( uint32_t i = 0; i < planner_interfaces_length; i++){ + offset += this->st_planner_interfaces.deserialize(inbuffer + offset); + memcpy( &(this->planner_interfaces[i]), &(this->st_planner_interfaces), sizeof(moveit_msgs::PlannerInterfaceDescription)); + } + return offset; + } + + virtual const char * getType() override { return QUERYPLANNERINTERFACES; }; + virtual const char * getMD5() override { return "5876081117e7cad85cc165e937798753"; }; + + }; + + class QueryPlannerInterfaces { + public: + typedef QueryPlannerInterfacesRequest Request; + typedef QueryPlannerInterfacesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RenameRobotStateInWarehouse.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RenameRobotStateInWarehouse.h new file mode 100644 index 000000000..441a20a3c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RenameRobotStateInWarehouse.h @@ -0,0 +1,121 @@ +#ifndef _ROS_SERVICE_RenameRobotStateInWarehouse_h +#define _ROS_SERVICE_RenameRobotStateInWarehouse_h +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + +static const char RENAMEROBOTSTATEINWAREHOUSE[] = "moveit_msgs/RenameRobotStateInWarehouse"; + + class RenameRobotStateInWarehouseRequest : public ros::Msg + { + public: + typedef const char* _old_name_type; + _old_name_type old_name; + typedef const char* _new_name_type; + _new_name_type new_name; + typedef const char* _robot_type; + _robot_type robot; + + RenameRobotStateInWarehouseRequest(): + old_name(""), + new_name(""), + robot("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_old_name = strlen(this->old_name); + varToArr(outbuffer + offset, length_old_name); + offset += 4; + memcpy(outbuffer + offset, this->old_name, length_old_name); + offset += length_old_name; + uint32_t length_new_name = strlen(this->new_name); + varToArr(outbuffer + offset, length_new_name); + offset += 4; + memcpy(outbuffer + offset, this->new_name, length_new_name); + offset += length_new_name; + uint32_t length_robot = strlen(this->robot); + varToArr(outbuffer + offset, length_robot); + offset += 4; + memcpy(outbuffer + offset, this->robot, length_robot); + offset += length_robot; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_old_name; + arrToVar(length_old_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_old_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_old_name-1]=0; + this->old_name = (char *)(inbuffer + offset-1); + offset += length_old_name; + uint32_t length_new_name; + arrToVar(length_new_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_new_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_new_name-1]=0; + this->new_name = (char *)(inbuffer + offset-1); + offset += length_new_name; + uint32_t length_robot; + arrToVar(length_robot, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot-1]=0; + this->robot = (char *)(inbuffer + offset-1); + offset += length_robot; + return offset; + } + + virtual const char * getType() override { return RENAMEROBOTSTATEINWAREHOUSE; }; + virtual const char * getMD5() override { return "073dc05c3fd313b947cea483c25c46b0"; }; + + }; + + class RenameRobotStateInWarehouseResponse : public ros::Msg + { + public: + + RenameRobotStateInWarehouseResponse() + { + } + + 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 RENAMEROBOTSTATEINWAREHOUSE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class RenameRobotStateInWarehouse { + public: + typedef RenameRobotStateInWarehouseRequest Request; + typedef RenameRobotStateInWarehouseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RobotState.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RobotState.h new file mode 100644 index 000000000..eac74a410 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RobotState.h @@ -0,0 +1,94 @@ +#ifndef _ROS_moveit_msgs_RobotState_h +#define _ROS_moveit_msgs_RobotState_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JointState.h" +#include "sensor_msgs/MultiDOFJointState.h" +#include "moveit_msgs/AttachedCollisionObject.h" + +namespace moveit_msgs +{ + + class RobotState : public ros::Msg + { + public: + typedef sensor_msgs::JointState _joint_state_type; + _joint_state_type joint_state; + typedef sensor_msgs::MultiDOFJointState _multi_dof_joint_state_type; + _multi_dof_joint_state_type multi_dof_joint_state; + uint32_t attached_collision_objects_length; + typedef moveit_msgs::AttachedCollisionObject _attached_collision_objects_type; + _attached_collision_objects_type st_attached_collision_objects; + _attached_collision_objects_type * attached_collision_objects; + typedef bool _is_diff_type; + _is_diff_type is_diff; + + RobotState(): + joint_state(), + multi_dof_joint_state(), + attached_collision_objects_length(0), st_attached_collision_objects(), attached_collision_objects(nullptr), + is_diff(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->joint_state.serialize(outbuffer + offset); + offset += this->multi_dof_joint_state.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->attached_collision_objects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->attached_collision_objects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->attached_collision_objects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->attached_collision_objects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->attached_collision_objects_length); + for( uint32_t i = 0; i < attached_collision_objects_length; i++){ + offset += this->attached_collision_objects[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_is_diff; + u_is_diff.real = this->is_diff; + *(outbuffer + offset + 0) = (u_is_diff.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_diff); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->joint_state.deserialize(inbuffer + offset); + offset += this->multi_dof_joint_state.deserialize(inbuffer + offset); + uint32_t attached_collision_objects_lengthT = ((uint32_t) (*(inbuffer + offset))); + attached_collision_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + attached_collision_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + attached_collision_objects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->attached_collision_objects_length); + if(attached_collision_objects_lengthT > attached_collision_objects_length) + this->attached_collision_objects = (moveit_msgs::AttachedCollisionObject*)realloc(this->attached_collision_objects, attached_collision_objects_lengthT * sizeof(moveit_msgs::AttachedCollisionObject)); + attached_collision_objects_length = attached_collision_objects_lengthT; + for( uint32_t i = 0; i < attached_collision_objects_length; i++){ + offset += this->st_attached_collision_objects.deserialize(inbuffer + offset); + memcpy( &(this->attached_collision_objects[i]), &(this->st_attached_collision_objects), sizeof(moveit_msgs::AttachedCollisionObject)); + } + union { + bool real; + uint8_t base; + } u_is_diff; + u_is_diff.base = 0; + u_is_diff.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_diff = u_is_diff.real; + offset += sizeof(this->is_diff); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/RobotState"; }; + virtual const char * getMD5() override { return "968156f4aa4cb4018f1f2293eebcea8f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RobotTrajectory.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RobotTrajectory.h new file mode 100644 index 000000000..66a00c00c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/RobotTrajectory.h @@ -0,0 +1,50 @@ +#ifndef _ROS_moveit_msgs_RobotTrajectory_h +#define _ROS_moveit_msgs_RobotTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "trajectory_msgs/MultiDOFJointTrajectory.h" + +namespace moveit_msgs +{ + + class RobotTrajectory : public ros::Msg + { + public: + typedef trajectory_msgs::JointTrajectory _joint_trajectory_type; + _joint_trajectory_type joint_trajectory; + typedef trajectory_msgs::MultiDOFJointTrajectory _multi_dof_joint_trajectory_type; + _multi_dof_joint_trajectory_type multi_dof_joint_trajectory; + + RobotTrajectory(): + joint_trajectory(), + multi_dof_joint_trajectory() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->joint_trajectory.serialize(outbuffer + offset); + offset += this->multi_dof_joint_trajectory.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->joint_trajectory.deserialize(inbuffer + offset); + offset += this->multi_dof_joint_trajectory.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/RobotTrajectory"; }; + virtual const char * getMD5() override { return "dfa9556423d709a3729bcef664bddf67"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SaveMap.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SaveMap.h new file mode 100644 index 000000000..aedae8b10 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SaveMap.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_SaveMap_h +#define _ROS_SERVICE_SaveMap_h +#include +#include +#include +#include "ros/msg.h" + +namespace moveit_msgs +{ + +static const char SAVEMAP[] = "moveit_msgs/SaveMap"; + + class SaveMapRequest : public ros::Msg + { + public: + typedef const char* _filename_type; + _filename_type filename; + + SaveMapRequest(): + filename("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_filename = strlen(this->filename); + varToArr(outbuffer + offset, length_filename); + offset += 4; + memcpy(outbuffer + offset, this->filename, length_filename); + offset += length_filename; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_filename; + arrToVar(length_filename, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_filename; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_filename-1]=0; + this->filename = (char *)(inbuffer + offset-1); + offset += length_filename; + return offset; + } + + virtual const char * getType() override { return SAVEMAP; }; + virtual const char * getMD5() override { return "030824f52a0628ead956fb9d67e66ae9"; }; + + }; + + class SaveMapResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + SaveMapResponse(): + 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 SAVEMAP; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SaveMap { + public: + typedef SaveMapRequest Request; + typedef SaveMapResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SaveRobotStateToWarehouse.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SaveRobotStateToWarehouse.h new file mode 100644 index 000000000..423b40f54 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SaveRobotStateToWarehouse.h @@ -0,0 +1,128 @@ +#ifndef _ROS_SERVICE_SaveRobotStateToWarehouse_h +#define _ROS_SERVICE_SaveRobotStateToWarehouse_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/RobotState.h" + +namespace moveit_msgs +{ + +static const char SAVEROBOTSTATETOWAREHOUSE[] = "moveit_msgs/SaveRobotStateToWarehouse"; + + class SaveRobotStateToWarehouseRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _robot_type; + _robot_type robot; + typedef moveit_msgs::RobotState _state_type; + _state_type state; + + SaveRobotStateToWarehouseRequest(): + name(""), + robot(""), + state() + { + } + + 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_robot = strlen(this->robot); + varToArr(outbuffer + offset, length_robot); + offset += 4; + memcpy(outbuffer + offset, this->robot, length_robot); + offset += length_robot; + offset += this->state.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_robot; + arrToVar(length_robot, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot-1]=0; + this->robot = (char *)(inbuffer + offset-1); + offset += length_robot; + offset += this->state.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SAVEROBOTSTATETOWAREHOUSE; }; + virtual const char * getMD5() override { return "0d6079a7122f47626b926754a46037d9"; }; + + }; + + class SaveRobotStateToWarehouseResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + SaveRobotStateToWarehouseResponse(): + 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 SAVEROBOTSTATETOWAREHOUSE; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SaveRobotStateToWarehouse { + public: + typedef SaveRobotStateToWarehouseRequest Request; + typedef SaveRobotStateToWarehouseResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SetPlannerParams.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SetPlannerParams.h new file mode 100644 index 000000000..58a22735c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/SetPlannerParams.h @@ -0,0 +1,145 @@ +#ifndef _ROS_SERVICE_SetPlannerParams_h +#define _ROS_SERVICE_SetPlannerParams_h +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/PlannerParams.h" + +namespace moveit_msgs +{ + +static const char SETPLANNERPARAMS[] = "moveit_msgs/SetPlannerParams"; + + class SetPlannerParamsRequest : public ros::Msg + { + public: + typedef const char* _pipeline_id_type; + _pipeline_id_type pipeline_id; + typedef const char* _planner_config_type; + _planner_config_type planner_config; + typedef const char* _group_type; + _group_type group; + typedef moveit_msgs::PlannerParams _params_type; + _params_type params; + typedef bool _replace_type; + _replace_type replace; + + SetPlannerParamsRequest(): + pipeline_id(""), + planner_config(""), + group(""), + params(), + replace(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_pipeline_id = strlen(this->pipeline_id); + varToArr(outbuffer + offset, length_pipeline_id); + offset += 4; + memcpy(outbuffer + offset, this->pipeline_id, length_pipeline_id); + offset += length_pipeline_id; + uint32_t length_planner_config = strlen(this->planner_config); + varToArr(outbuffer + offset, length_planner_config); + offset += 4; + memcpy(outbuffer + offset, this->planner_config, length_planner_config); + offset += length_planner_config; + uint32_t length_group = strlen(this->group); + varToArr(outbuffer + offset, length_group); + offset += 4; + memcpy(outbuffer + offset, this->group, length_group); + offset += length_group; + offset += this->params.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_replace; + u_replace.real = this->replace; + *(outbuffer + offset + 0) = (u_replace.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->replace); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_pipeline_id; + arrToVar(length_pipeline_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pipeline_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pipeline_id-1]=0; + this->pipeline_id = (char *)(inbuffer + offset-1); + offset += length_pipeline_id; + uint32_t length_planner_config; + arrToVar(length_planner_config, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_planner_config; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_planner_config-1]=0; + this->planner_config = (char *)(inbuffer + offset-1); + offset += length_planner_config; + uint32_t length_group; + arrToVar(length_group, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_group; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_group-1]=0; + this->group = (char *)(inbuffer + offset-1); + offset += length_group; + offset += this->params.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_replace; + u_replace.base = 0; + u_replace.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->replace = u_replace.real; + offset += sizeof(this->replace); + return offset; + } + + virtual const char * getType() override { return SETPLANNERPARAMS; }; + virtual const char * getMD5() override { return "14bebee5d4d53a2df94b7f146d3eb2ff"; }; + + }; + + class SetPlannerParamsResponse : public ros::Msg + { + public: + + SetPlannerParamsResponse() + { + } + + 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 SETPLANNERPARAMS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetPlannerParams { + public: + typedef SetPlannerParamsRequest Request; + typedef SetPlannerParamsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/TrajectoryConstraints.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/TrajectoryConstraints.h new file mode 100644 index 000000000..730e8c747 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/TrajectoryConstraints.h @@ -0,0 +1,64 @@ +#ifndef _ROS_moveit_msgs_TrajectoryConstraints_h +#define _ROS_moveit_msgs_TrajectoryConstraints_h + +#include +#include +#include +#include "ros/msg.h" +#include "moveit_msgs/Constraints.h" + +namespace moveit_msgs +{ + + class TrajectoryConstraints : public ros::Msg + { + public: + uint32_t constraints_length; + typedef moveit_msgs::Constraints _constraints_type; + _constraints_type st_constraints; + _constraints_type * constraints; + + TrajectoryConstraints(): + constraints_length(0), st_constraints(), constraints(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->constraints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->constraints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->constraints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->constraints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->constraints_length); + for( uint32_t i = 0; i < constraints_length; i++){ + offset += this->constraints[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t constraints_lengthT = ((uint32_t) (*(inbuffer + offset))); + constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + constraints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->constraints_length); + if(constraints_lengthT > constraints_length) + this->constraints = (moveit_msgs::Constraints*)realloc(this->constraints, constraints_lengthT * sizeof(moveit_msgs::Constraints)); + constraints_length = constraints_lengthT; + for( uint32_t i = 0; i < constraints_length; i++){ + offset += this->st_constraints.deserialize(inbuffer + offset); + memcpy( &(this->constraints[i]), &(this->st_constraints), sizeof(moveit_msgs::Constraints)); + } + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/TrajectoryConstraints"; }; + virtual const char * getMD5() override { return "a8fd55b45c3918e857080ca125d29e9c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/UpdatePointcloudOctomap.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/UpdatePointcloudOctomap.h new file mode 100644 index 000000000..07135b029 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/UpdatePointcloudOctomap.h @@ -0,0 +1,94 @@ +#ifndef _ROS_SERVICE_UpdatePointcloudOctomap_h +#define _ROS_SERVICE_UpdatePointcloudOctomap_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace moveit_msgs +{ + +static const char UPDATEPOINTCLOUDOCTOMAP[] = "moveit_msgs/UpdatePointcloudOctomap"; + + class UpdatePointcloudOctomapRequest : public ros::Msg + { + public: + typedef sensor_msgs::PointCloud2 _cloud_type; + _cloud_type cloud; + + UpdatePointcloudOctomapRequest(): + 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 UPDATEPOINTCLOUDOCTOMAP; }; + virtual const char * getMD5() override { return "96cec5374164b3b3d1d7ef5d7628a7ed"; }; + + }; + + class UpdatePointcloudOctomapResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + UpdatePointcloudOctomapResponse(): + 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 UPDATEPOINTCLOUDOCTOMAP; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class UpdatePointcloudOctomap { + public: + typedef UpdatePointcloudOctomapRequest Request; + typedef UpdatePointcloudOctomapResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/VisibilityConstraint.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/VisibilityConstraint.h new file mode 100644 index 000000000..b6e1e34f0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/VisibilityConstraint.h @@ -0,0 +1,103 @@ +#ifndef _ROS_moveit_msgs_VisibilityConstraint_h +#define _ROS_moveit_msgs_VisibilityConstraint_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace moveit_msgs +{ + + class VisibilityConstraint : public ros::Msg + { + public: + typedef float _target_radius_type; + _target_radius_type target_radius; + typedef geometry_msgs::PoseStamped _target_pose_type; + _target_pose_type target_pose; + typedef int32_t _cone_sides_type; + _cone_sides_type cone_sides; + typedef geometry_msgs::PoseStamped _sensor_pose_type; + _sensor_pose_type sensor_pose; + typedef float _max_view_angle_type; + _max_view_angle_type max_view_angle; + typedef float _max_range_angle_type; + _max_range_angle_type max_range_angle; + typedef uint8_t _sensor_view_direction_type; + _sensor_view_direction_type sensor_view_direction; + typedef float _weight_type; + _weight_type weight; + enum { SENSOR_Z = 0 }; + enum { SENSOR_Y = 1 }; + enum { SENSOR_X = 2 }; + + VisibilityConstraint(): + target_radius(0), + target_pose(), + cone_sides(0), + sensor_pose(), + max_view_angle(0), + max_range_angle(0), + sensor_view_direction(0), + weight(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->target_radius); + offset += this->target_pose.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_cone_sides; + u_cone_sides.real = this->cone_sides; + *(outbuffer + offset + 0) = (u_cone_sides.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cone_sides.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cone_sides.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cone_sides.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cone_sides); + offset += this->sensor_pose.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->max_view_angle); + offset += serializeAvrFloat64(outbuffer + offset, this->max_range_angle); + *(outbuffer + offset + 0) = (this->sensor_view_direction >> (8 * 0)) & 0xFF; + offset += sizeof(this->sensor_view_direction); + offset += serializeAvrFloat64(outbuffer + offset, this->weight); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->target_radius)); + offset += this->target_pose.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_cone_sides; + u_cone_sides.base = 0; + u_cone_sides.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cone_sides.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cone_sides.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cone_sides.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cone_sides = u_cone_sides.real; + offset += sizeof(this->cone_sides); + offset += this->sensor_pose.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_view_angle)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_range_angle)); + this->sensor_view_direction = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->sensor_view_direction); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->weight)); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/VisibilityConstraint"; }; + virtual const char * getMD5() override { return "62cda903bfe31ff2e5fcdc3810d577ad"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/WorkspaceParameters.h b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/WorkspaceParameters.h new file mode 100644 index 000000000..1f2918895 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/moveit_msgs/WorkspaceParameters.h @@ -0,0 +1,55 @@ +#ifndef _ROS_moveit_msgs_WorkspaceParameters_h +#define _ROS_moveit_msgs_WorkspaceParameters_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace moveit_msgs +{ + + class WorkspaceParameters : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Vector3 _min_corner_type; + _min_corner_type min_corner; + typedef geometry_msgs::Vector3 _max_corner_type; + _max_corner_type max_corner; + + WorkspaceParameters(): + header(), + min_corner(), + max_corner() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->min_corner.serialize(outbuffer + offset); + offset += this->max_corner.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->min_corner.deserialize(inbuffer + offset); + offset += this->max_corner.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "moveit_msgs/WorkspaceParameters"; }; + virtual const char * getMD5() override { return "d639a834e7b1f927e9f1d6c30e920016"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/AudioBuffer.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/AudioBuffer.h new file mode 100644 index 000000000..3e3c12631 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/AudioBuffer.h @@ -0,0 +1,130 @@ +#ifndef _ROS_naoqi_bridge_msgs_AudioBuffer_h +#define _ROS_naoqi_bridge_msgs_AudioBuffer_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace naoqi_bridge_msgs +{ + + class AudioBuffer : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint16_t _frequency_type; + _frequency_type frequency; + uint32_t channelMap_length; + typedef uint8_t _channelMap_type; + _channelMap_type st_channelMap; + _channelMap_type * channelMap; + uint32_t data_length; + typedef int16_t _data_type; + _data_type st_data; + _data_type * data; + enum { CHANNEL_FRONT_LEFT = 0 }; + enum { CHANNEL_FRONT_CENTER = 1 }; + enum { CHANNEL_FRONT_RIGHT = 2 }; + enum { CHANNEL_REAR_LEFT = 3 }; + enum { CHANNEL_REAR_CENTER = 4 }; + enum { CHANNEL_REAR_RIGHT = 5 }; + enum { CHANNEL_SURROUND_LEFT = 6 }; + enum { CHANNEL_SURROUND_RIGHT = 7 }; + enum { CHANNEL_SUBWOOFER = 8 }; + enum { CHANNEL_LFE = 9 }; + + AudioBuffer(): + header(), + frequency(0), + channelMap_length(0), st_channelMap(), channelMap(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); + *(outbuffer + offset + 0) = (this->frequency >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->frequency >> (8 * 1)) & 0xFF; + offset += sizeof(this->frequency); + *(outbuffer + offset + 0) = (this->channelMap_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->channelMap_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->channelMap_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->channelMap_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->channelMap_length); + for( uint32_t i = 0; i < channelMap_length; i++){ + *(outbuffer + offset + 0) = (this->channelMap[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->channelMap[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++){ + union { + int16_t real; + uint16_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; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->frequency = ((uint16_t) (*(inbuffer + offset))); + this->frequency |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->frequency); + uint32_t channelMap_lengthT = ((uint32_t) (*(inbuffer + offset))); + channelMap_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + channelMap_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + channelMap_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->channelMap_length); + if(channelMap_lengthT > channelMap_length) + this->channelMap = (uint8_t*)realloc(this->channelMap, channelMap_lengthT * sizeof(uint8_t)); + channelMap_length = channelMap_lengthT; + for( uint32_t i = 0; i < channelMap_length; i++){ + this->st_channelMap = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_channelMap); + memcpy( &(this->channelMap[i]), &(this->st_channelMap), 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 = (int16_t*)realloc(this->data, data_lengthT * sizeof(int16_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int16_t)); + } + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/AudioBuffer"; }; + virtual const char * getMD5() override { return "50f300aa63f3c1b2f3d3173329165316"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkAction.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkAction.h new file mode 100644 index 000000000..bed0de02a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BlinkAction_h +#define _ROS_naoqi_bridge_msgs_BlinkAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/BlinkActionGoal.h" +#include "naoqi_bridge_msgs/BlinkActionResult.h" +#include "naoqi_bridge_msgs/BlinkActionFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class BlinkAction : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::BlinkActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef naoqi_bridge_msgs::BlinkActionResult _action_result_type; + _action_result_type action_result; + typedef naoqi_bridge_msgs::BlinkActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + BlinkAction(): + 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 "naoqi_bridge_msgs/BlinkAction"; }; + virtual const char * getMD5() override { return "c03ab9992d56528894da7d19c515fc49"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionFeedback.h new file mode 100644 index 000000000..a45f5dfca --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BlinkActionFeedback_h +#define _ROS_naoqi_bridge_msgs_BlinkActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/BlinkFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class BlinkActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::BlinkFeedback _feedback_type; + _feedback_type feedback; + + BlinkActionFeedback(): + 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 "naoqi_bridge_msgs/BlinkActionFeedback"; }; + virtual const char * getMD5() override { return "b4761017d2f70a859c914a9306034255"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionGoal.h new file mode 100644 index 000000000..a7775c399 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BlinkActionGoal_h +#define _ROS_naoqi_bridge_msgs_BlinkActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "naoqi_bridge_msgs/BlinkGoal.h" + +namespace naoqi_bridge_msgs +{ + + class BlinkActionGoal : 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 naoqi_bridge_msgs::BlinkGoal _goal_type; + _goal_type goal; + + BlinkActionGoal(): + 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 "naoqi_bridge_msgs/BlinkActionGoal"; }; + virtual const char * getMD5() override { return "8fb9f71a23feed1923381dc04a3cab38"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionResult.h new file mode 100644 index 000000000..201184dfd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BlinkActionResult_h +#define _ROS_naoqi_bridge_msgs_BlinkActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/BlinkResult.h" + +namespace naoqi_bridge_msgs +{ + + class BlinkActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::BlinkResult _result_type; + _result_type result; + + BlinkActionResult(): + 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 "naoqi_bridge_msgs/BlinkActionResult"; }; + virtual const char * getMD5() override { return "fe746b44525013bd3727f2dfa6bf4019"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkFeedback.h new file mode 100644 index 000000000..a172d41fd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkFeedback.h @@ -0,0 +1,44 @@ +#ifndef _ROS_naoqi_bridge_msgs_BlinkFeedback_h +#define _ROS_naoqi_bridge_msgs_BlinkFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/ColorRGBA.h" + +namespace naoqi_bridge_msgs +{ + + class BlinkFeedback : public ros::Msg + { + public: + typedef std_msgs::ColorRGBA _last_color_type; + _last_color_type last_color; + + BlinkFeedback(): + last_color() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->last_color.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->last_color.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/BlinkFeedback"; }; + virtual const char * getMD5() override { return "6f1f94fb3eb06412264f6e0c5e72cfab"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkGoal.h new file mode 100644 index 000000000..0d2d42945 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkGoal.h @@ -0,0 +1,141 @@ +#ifndef _ROS_naoqi_bridge_msgs_BlinkGoal_h +#define _ROS_naoqi_bridge_msgs_BlinkGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" + +namespace naoqi_bridge_msgs +{ + + class BlinkGoal : public ros::Msg + { + public: + uint32_t colors_length; + typedef std_msgs::ColorRGBA _colors_type; + _colors_type st_colors; + _colors_type * colors; + typedef std_msgs::ColorRGBA _bg_color_type; + _bg_color_type bg_color; + typedef ros::Duration _blink_duration_type; + _blink_duration_type blink_duration; + typedef float _blink_rate_mean_type; + _blink_rate_mean_type blink_rate_mean; + typedef float _blink_rate_sd_type; + _blink_rate_sd_type blink_rate_sd; + + BlinkGoal(): + colors_length(0), st_colors(), colors(nullptr), + bg_color(), + blink_duration(), + blink_rate_mean(0), + blink_rate_sd(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->colors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->colors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->colors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->colors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->colors_length); + for( uint32_t i = 0; i < colors_length; i++){ + offset += this->colors[i].serialize(outbuffer + offset); + } + offset += this->bg_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->blink_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->blink_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->blink_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->blink_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->blink_duration.sec); + *(outbuffer + offset + 0) = (this->blink_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->blink_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->blink_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->blink_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->blink_duration.nsec); + union { + float real; + uint32_t base; + } u_blink_rate_mean; + u_blink_rate_mean.real = this->blink_rate_mean; + *(outbuffer + offset + 0) = (u_blink_rate_mean.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_blink_rate_mean.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_blink_rate_mean.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_blink_rate_mean.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->blink_rate_mean); + union { + float real; + uint32_t base; + } u_blink_rate_sd; + u_blink_rate_sd.real = this->blink_rate_sd; + *(outbuffer + offset + 0) = (u_blink_rate_sd.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_blink_rate_sd.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_blink_rate_sd.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_blink_rate_sd.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->blink_rate_sd); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t colors_lengthT = ((uint32_t) (*(inbuffer + offset))); + colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->colors_length); + if(colors_lengthT > colors_length) + this->colors = (std_msgs::ColorRGBA*)realloc(this->colors, colors_lengthT * sizeof(std_msgs::ColorRGBA)); + colors_length = colors_lengthT; + for( uint32_t i = 0; i < colors_length; i++){ + offset += this->st_colors.deserialize(inbuffer + offset); + memcpy( &(this->colors[i]), &(this->st_colors), sizeof(std_msgs::ColorRGBA)); + } + offset += this->bg_color.deserialize(inbuffer + offset); + this->blink_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->blink_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->blink_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->blink_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->blink_duration.sec); + this->blink_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->blink_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->blink_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->blink_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->blink_duration.nsec); + union { + float real; + uint32_t base; + } u_blink_rate_mean; + u_blink_rate_mean.base = 0; + u_blink_rate_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_blink_rate_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_blink_rate_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_blink_rate_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->blink_rate_mean = u_blink_rate_mean.real; + offset += sizeof(this->blink_rate_mean); + union { + float real; + uint32_t base; + } u_blink_rate_sd; + u_blink_rate_sd.base = 0; + u_blink_rate_sd.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_blink_rate_sd.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_blink_rate_sd.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_blink_rate_sd.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->blink_rate_sd = u_blink_rate_sd.real; + offset += sizeof(this->blink_rate_sd); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/BlinkGoal"; }; + virtual const char * getMD5() override { return "5e5d3c2ba9976dc121a0bb6ef7c66d79"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkResult.h new file mode 100644 index 000000000..bb003f146 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BlinkResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BlinkResult_h +#define _ROS_naoqi_bridge_msgs_BlinkResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class BlinkResult : public ros::Msg + { + public: + typedef bool _still_blinking_type; + _still_blinking_type still_blinking; + + BlinkResult(): + still_blinking(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_still_blinking; + u_still_blinking.real = this->still_blinking; + *(outbuffer + offset + 0) = (u_still_blinking.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->still_blinking); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_still_blinking; + u_still_blinking.base = 0; + u_still_blinking.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->still_blinking = u_still_blinking.real; + offset += sizeof(this->still_blinking); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/BlinkResult"; }; + virtual const char * getMD5() override { return "53e041b81450f9247036f13b3c0bf822"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseAction.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseAction.h new file mode 100644 index 000000000..d0efaefdb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseAction_h +#define _ROS_naoqi_bridge_msgs_BodyPoseAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/BodyPoseActionGoal.h" +#include "naoqi_bridge_msgs/BodyPoseActionResult.h" +#include "naoqi_bridge_msgs/BodyPoseActionFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseAction : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::BodyPoseActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef naoqi_bridge_msgs::BodyPoseActionResult _action_result_type; + _action_result_type action_result; + typedef naoqi_bridge_msgs::BodyPoseActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + BodyPoseAction(): + 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 "naoqi_bridge_msgs/BodyPoseAction"; }; + virtual const char * getMD5() override { return "bc58fd1218bb64624b76dca7ad8a5a81"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionFeedback.h new file mode 100644 index 000000000..a58c7cee8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseActionFeedback_h +#define _ROS_naoqi_bridge_msgs_BodyPoseActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/BodyPoseFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::BodyPoseFeedback _feedback_type; + _feedback_type feedback; + + BodyPoseActionFeedback(): + 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 "naoqi_bridge_msgs/BodyPoseActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionGoal.h new file mode 100644 index 000000000..19e4a2eb9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseActionGoal_h +#define _ROS_naoqi_bridge_msgs_BodyPoseActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "naoqi_bridge_msgs/BodyPoseGoal.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseActionGoal : 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 naoqi_bridge_msgs::BodyPoseGoal _goal_type; + _goal_type goal; + + BodyPoseActionGoal(): + 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 "naoqi_bridge_msgs/BodyPoseActionGoal"; }; + virtual const char * getMD5() override { return "0c4ae1487ff4d033a7fa048a0b31509c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionResult.h new file mode 100644 index 000000000..4b03314a7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseActionResult_h +#define _ROS_naoqi_bridge_msgs_BodyPoseActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/BodyPoseResult.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::BodyPoseResult _result_type; + _result_type result; + + BodyPoseActionResult(): + 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 "naoqi_bridge_msgs/BodyPoseActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseFeedback.h new file mode 100644 index 000000000..2b7639f5f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseFeedback_h +#define _ROS_naoqi_bridge_msgs_BodyPoseFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseFeedback : public ros::Msg + { + public: + + BodyPoseFeedback() + { + } + + 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 "naoqi_bridge_msgs/BodyPoseFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseGoal.h new file mode 100644 index 000000000..a84ee4409 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseGoal.h @@ -0,0 +1,55 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseGoal_h +#define _ROS_naoqi_bridge_msgs_BodyPoseGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseGoal : public ros::Msg + { + public: + typedef const char* _pose_name_type; + _pose_name_type pose_name; + + BodyPoseGoal(): + pose_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_pose_name = strlen(this->pose_name); + varToArr(outbuffer + offset, length_pose_name); + offset += 4; + memcpy(outbuffer + offset, this->pose_name, length_pose_name); + offset += length_pose_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_pose_name; + arrToVar(length_pose_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pose_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pose_name-1]=0; + this->pose_name = (char *)(inbuffer + offset-1); + offset += length_pose_name; + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/BodyPoseGoal"; }; + virtual const char * getMD5() override { return "e6184073e8e665fb2bf0be194fc36541"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseResult.h new file mode 100644 index 000000000..b68464e9c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseResult_h +#define _ROS_naoqi_bridge_msgs_BodyPoseResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseResult : public ros::Msg + { + public: + + BodyPoseResult() + { + } + + 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 "naoqi_bridge_msgs/BodyPoseResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedAction.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedAction.h new file mode 100644 index 000000000..966157da5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedAction_h +#define _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/BodyPoseWithSpeedActionGoal.h" +#include "naoqi_bridge_msgs/BodyPoseWithSpeedActionResult.h" +#include "naoqi_bridge_msgs/BodyPoseWithSpeedActionFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseWithSpeedAction : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::BodyPoseWithSpeedActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef naoqi_bridge_msgs::BodyPoseWithSpeedActionResult _action_result_type; + _action_result_type action_result; + typedef naoqi_bridge_msgs::BodyPoseWithSpeedActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + BodyPoseWithSpeedAction(): + 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 "naoqi_bridge_msgs/BodyPoseWithSpeedAction"; }; + virtual const char * getMD5() override { return "8843d4cb535c2767e978466b886561fb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionFeedback.h new file mode 100644 index 000000000..cb6c35949 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedActionFeedback_h +#define _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/BodyPoseWithSpeedFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseWithSpeedActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::BodyPoseWithSpeedFeedback _feedback_type; + _feedback_type feedback; + + BodyPoseWithSpeedActionFeedback(): + 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 "naoqi_bridge_msgs/BodyPoseWithSpeedActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionGoal.h new file mode 100644 index 000000000..7da1daa94 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedActionGoal_h +#define _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "naoqi_bridge_msgs/BodyPoseWithSpeedGoal.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseWithSpeedActionGoal : 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 naoqi_bridge_msgs::BodyPoseWithSpeedGoal _goal_type; + _goal_type goal; + + BodyPoseWithSpeedActionGoal(): + 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 "naoqi_bridge_msgs/BodyPoseWithSpeedActionGoal"; }; + virtual const char * getMD5() override { return "32a7ec65212f19c6ff6a3defe7418661"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionResult.h new file mode 100644 index 000000000..e0f4a3f28 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedActionResult_h +#define _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/BodyPoseWithSpeedResult.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseWithSpeedActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::BodyPoseWithSpeedResult _result_type; + _result_type result; + + BodyPoseWithSpeedActionResult(): + 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 "naoqi_bridge_msgs/BodyPoseWithSpeedActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedFeedback.h new file mode 100644 index 000000000..60fdb617c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedFeedback_h +#define _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseWithSpeedFeedback : public ros::Msg + { + public: + + BodyPoseWithSpeedFeedback() + { + } + + 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 "naoqi_bridge_msgs/BodyPoseWithSpeedFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedGoal.h new file mode 100644 index 000000000..7b7e0a834 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedGoal.h @@ -0,0 +1,79 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedGoal_h +#define _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseWithSpeedGoal : public ros::Msg + { + public: + typedef const char* _posture_name_type; + _posture_name_type posture_name; + typedef float _speed_type; + _speed_type speed; + + BodyPoseWithSpeedGoal(): + posture_name(""), + speed(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_posture_name = strlen(this->posture_name); + varToArr(outbuffer + offset, length_posture_name); + offset += 4; + memcpy(outbuffer + offset, this->posture_name, length_posture_name); + offset += length_posture_name; + union { + float real; + uint32_t base; + } u_speed; + u_speed.real = this->speed; + *(outbuffer + offset + 0) = (u_speed.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_speed.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_speed.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_speed.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->speed); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_posture_name; + arrToVar(length_posture_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_posture_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_posture_name-1]=0; + this->posture_name = (char *)(inbuffer + offset-1); + offset += length_posture_name; + union { + float real; + uint32_t base; + } u_speed; + u_speed.base = 0; + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->speed = u_speed.real; + offset += sizeof(this->speed); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/BodyPoseWithSpeedGoal"; }; + virtual const char * getMD5() override { return "6c5f7bd37d2a5befe00383fa440a8f6e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedResult.h new file mode 100644 index 000000000..839863999 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyPoseWithSpeedResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedResult_h +#define _ROS_naoqi_bridge_msgs_BodyPoseWithSpeedResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class BodyPoseWithSpeedResult : public ros::Msg + { + public: + + BodyPoseWithSpeedResult() + { + } + + 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 "naoqi_bridge_msgs/BodyPoseWithSpeedResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyROI.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyROI.h new file mode 100644 index 000000000..429e1cbdb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BodyROI.h @@ -0,0 +1,182 @@ +#ifndef _ROS_naoqi_bridge_msgs_BodyROI_h +#define _ROS_naoqi_bridge_msgs_BodyROI_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class BodyROI : public ros::Msg + { + public: + typedef float _angle_type; + _angle_type angle; + typedef float _cx_type; + _cx_type cx; + typedef float _cy_type; + _cy_type cy; + typedef float _height_type; + _height_type height; + typedef float _width_type; + _width_type width; + typedef float _confidence_type; + _confidence_type confidence; + + BodyROI(): + angle(0), + cx(0), + cy(0), + height(0), + width(0), + confidence(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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_cx; + u_cx.real = this->cx; + *(outbuffer + offset + 0) = (u_cx.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cx.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cx.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cx.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cx); + union { + float real; + uint32_t base; + } u_cy; + u_cy.real = this->cy; + *(outbuffer + offset + 0) = (u_cy.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cy.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cy.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cy.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cy); + union { + float real; + uint32_t base; + } u_height; + u_height.real = this->height; + *(outbuffer + offset + 0) = (u_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + union { + float real; + uint32_t base; + } u_width; + u_width.real = this->width; + *(outbuffer + offset + 0) = (u_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + 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; + 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_cx; + u_cx.base = 0; + u_cx.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cx.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cx.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cx.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cx = u_cx.real; + offset += sizeof(this->cx); + union { + float real; + uint32_t base; + } u_cy; + u_cy.base = 0; + u_cy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cy = u_cy.real; + offset += sizeof(this->cy); + union { + float real; + uint32_t base; + } u_height; + u_height.base = 0; + u_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->height = u_height.real; + offset += sizeof(this->height); + union { + float real; + uint32_t base; + } u_width; + u_width.base = 0; + u_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->width = u_width.real; + offset += sizeof(this->width); + 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 "naoqi_bridge_msgs/BodyROI"; }; + virtual const char * getMD5() override { return "a9f6bf2f53b2585ecc0ff57bd4a21df4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BoolStamped.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BoolStamped.h new file mode 100644 index 000000000..92be75638 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/BoolStamped.h @@ -0,0 +1,62 @@ +#ifndef _ROS_naoqi_bridge_msgs_BoolStamped_h +#define _ROS_naoqi_bridge_msgs_BoolStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace naoqi_bridge_msgs +{ + + class BoolStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef bool _data_type; + _data_type data; + + BoolStamped(): + header(), + data(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_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + 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_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/BoolStamped"; }; + virtual const char * getMD5() override { return "542e22b190dc8e6eb476d50dda88feb7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/Bumper.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/Bumper.h new file mode 100644 index 000000000..2e2cefa5a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/Bumper.h @@ -0,0 +1,57 @@ +#ifndef _ROS_naoqi_bridge_msgs_Bumper_h +#define _ROS_naoqi_bridge_msgs_Bumper_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class Bumper : public ros::Msg + { + public: + typedef uint8_t _bumper_type; + _bumper_type bumper; + typedef uint8_t _state_type; + _state_type state; + enum { right = 0 }; + enum { left = 1 }; + enum { back = 2 }; + enum { stateReleased = 0 }; + enum { statePressed = 1 }; + + Bumper(): + bumper(0), + state(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->bumper >> (8 * 0)) & 0xFF; + offset += sizeof(this->bumper); + *(outbuffer + offset + 0) = (this->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->bumper = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->bumper); + this->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/Bumper"; }; + virtual const char * getMD5() override { return "89965a81ab868825f18d59365e28ddaf"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/CmdPoseService.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/CmdPoseService.h new file mode 100644 index 000000000..396c2a838 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/CmdPoseService.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_CmdPoseService_h +#define _ROS_SERVICE_CmdPoseService_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose2D.h" + +namespace naoqi_bridge_msgs +{ + +static const char CMDPOSESERVICE[] = "naoqi_bridge_msgs/CmdPoseService"; + + class CmdPoseServiceRequest : public ros::Msg + { + public: + typedef geometry_msgs::Pose2D _pose_type; + _pose_type pose; + + CmdPoseServiceRequest(): + 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 CMDPOSESERVICE; }; + virtual const char * getMD5() override { return "271cb12677c4cd9bccbc642cd9258d1f"; }; + + }; + + class CmdPoseServiceResponse : public ros::Msg + { + public: + + CmdPoseServiceResponse() + { + } + + 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 CMDPOSESERVICE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class CmdPoseService { + public: + typedef CmdPoseServiceRequest Request; + typedef CmdPoseServiceResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/CmdVelService.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/CmdVelService.h new file mode 100644 index 000000000..41b4ff6ff --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/CmdVelService.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_CmdVelService_h +#define _ROS_SERVICE_CmdVelService_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Twist.h" + +namespace naoqi_bridge_msgs +{ + +static const char CMDVELSERVICE[] = "naoqi_bridge_msgs/CmdVelService"; + + class CmdVelServiceRequest : public ros::Msg + { + public: + typedef geometry_msgs::Twist _twist_type; + _twist_type twist; + + CmdVelServiceRequest(): + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return CMDVELSERVICE; }; + virtual const char * getMD5() override { return "a787b2802160dcc7fe02d089e10afe56"; }; + + }; + + class CmdVelServiceResponse : public ros::Msg + { + public: + + CmdVelServiceResponse() + { + } + + 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 CMDVELSERVICE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class CmdVelService { + public: + typedef CmdVelServiceRequest Request; + typedef CmdVelServiceResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/EventStamped.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/EventStamped.h new file mode 100644 index 000000000..ffb1f37b6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/EventStamped.h @@ -0,0 +1,55 @@ +#ifndef _ROS_naoqi_bridge_msgs_EventStamped_h +#define _ROS_naoqi_bridge_msgs_EventStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "std_msgs/String.h" + +namespace naoqi_bridge_msgs +{ + + class EventStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef std_msgs::String _name_type; + _name_type name; + typedef std_msgs::String _data_type; + _data_type data; + + EventStamped(): + header(), + name(), + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->name.serialize(outbuffer + offset); + offset += this->data.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->name.deserialize(inbuffer + offset); + offset += this->data.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/EventStamped"; }; + virtual const char * getMD5() override { return "da9da7dab2e8376f0a588b6d053ac972"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FaceROI.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FaceROI.h new file mode 100644 index 000000000..02b145f99 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FaceROI.h @@ -0,0 +1,182 @@ +#ifndef _ROS_naoqi_bridge_msgs_FaceROI_h +#define _ROS_naoqi_bridge_msgs_FaceROI_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class FaceROI : public ros::Msg + { + public: + typedef float _angle_type; + _angle_type angle; + typedef float _cx_type; + _cx_type cx; + typedef float _cy_type; + _cy_type cy; + typedef float _height_type; + _height_type height; + typedef float _width_type; + _width_type width; + typedef float _confidence_type; + _confidence_type confidence; + + FaceROI(): + angle(0), + cx(0), + cy(0), + height(0), + width(0), + confidence(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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_cx; + u_cx.real = this->cx; + *(outbuffer + offset + 0) = (u_cx.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cx.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cx.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cx.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cx); + union { + float real; + uint32_t base; + } u_cy; + u_cy.real = this->cy; + *(outbuffer + offset + 0) = (u_cy.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cy.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cy.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cy.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cy); + union { + float real; + uint32_t base; + } u_height; + u_height.real = this->height; + *(outbuffer + offset + 0) = (u_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + union { + float real; + uint32_t base; + } u_width; + u_width.real = this->width; + *(outbuffer + offset + 0) = (u_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + 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; + 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_cx; + u_cx.base = 0; + u_cx.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cx.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cx.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cx.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cx = u_cx.real; + offset += sizeof(this->cx); + union { + float real; + uint32_t base; + } u_cy; + u_cy.base = 0; + u_cy.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cy.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cy.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cy.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cy = u_cy.real; + offset += sizeof(this->cy); + union { + float real; + uint32_t base; + } u_height; + u_height.base = 0; + u_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->height = u_height.real; + offset += sizeof(this->height); + union { + float real; + uint32_t base; + } u_width; + u_width.base = 0; + u_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->width = u_width.real; + offset += sizeof(this->width); + 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 "naoqi_bridge_msgs/FaceROI"; }; + virtual const char * getMD5() override { return "a9f6bf2f53b2585ecc0ff57bd4a21df4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FadeRGB.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FadeRGB.h new file mode 100644 index 000000000..b432be636 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FadeRGB.h @@ -0,0 +1,85 @@ +#ifndef _ROS_naoqi_bridge_msgs_FadeRGB_h +#define _ROS_naoqi_bridge_msgs_FadeRGB_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" + +namespace naoqi_bridge_msgs +{ + + class FadeRGB : public ros::Msg + { + public: + typedef const char* _led_name_type; + _led_name_type led_name; + typedef std_msgs::ColorRGBA _color_type; + _color_type color; + typedef ros::Duration _fade_duration_type; + _fade_duration_type fade_duration; + + FadeRGB(): + led_name(""), + color(), + fade_duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_led_name = strlen(this->led_name); + varToArr(outbuffer + offset, length_led_name); + offset += 4; + memcpy(outbuffer + offset, this->led_name, length_led_name); + offset += length_led_name; + offset += this->color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->fade_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fade_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fade_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fade_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->fade_duration.sec); + *(outbuffer + offset + 0) = (this->fade_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fade_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fade_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fade_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->fade_duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_led_name; + arrToVar(length_led_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_led_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_led_name-1]=0; + this->led_name = (char *)(inbuffer + offset-1); + offset += length_led_name; + offset += this->color.deserialize(inbuffer + offset); + this->fade_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->fade_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->fade_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->fade_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fade_duration.sec); + this->fade_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->fade_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->fade_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->fade_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fade_duration.nsec); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/FadeRGB"; }; + virtual const char * getMD5() override { return "0df8c8fbe7f1de5f2168d6117ffced08"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FloatArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FloatArrayStamped.h new file mode 100644 index 000000000..992e50475 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FloatArrayStamped.h @@ -0,0 +1,88 @@ +#ifndef _ROS_naoqi_bridge_msgs_FloatArrayStamped_h +#define _ROS_naoqi_bridge_msgs_FloatArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace naoqi_bridge_msgs +{ + + class FloatArrayStamped : 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; + + FloatArrayStamped(): + 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++){ + 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]); + } + 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 = (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)); + } + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/FloatArrayStamped"; }; + virtual const char * getMD5() override { return "a120344537a3b099cc9ec9957d4619fc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FloatStamped.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FloatStamped.h new file mode 100644 index 000000000..fdda5671f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FloatStamped.h @@ -0,0 +1,68 @@ +#ifndef _ROS_naoqi_bridge_msgs_FloatStamped_h +#define _ROS_naoqi_bridge_msgs_FloatStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace naoqi_bridge_msgs +{ + + class FloatStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _data_type; + _data_type data; + + FloatStamped(): + header(), + data(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_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); + 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_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); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/FloatStamped"; }; + virtual const char * getMD5() override { return "ef848af8cf12f6df11682cc76fba477b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathAction.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathAction.h new file mode 100644 index 000000000..ba76816fc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_FollowPathAction_h +#define _ROS_naoqi_bridge_msgs_FollowPathAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/FollowPathActionGoal.h" +#include "naoqi_bridge_msgs/FollowPathActionResult.h" +#include "naoqi_bridge_msgs/FollowPathActionFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class FollowPathAction : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::FollowPathActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef naoqi_bridge_msgs::FollowPathActionResult _action_result_type; + _action_result_type action_result; + typedef naoqi_bridge_msgs::FollowPathActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + FollowPathAction(): + 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 "naoqi_bridge_msgs/FollowPathAction"; }; + virtual const char * getMD5() override { return "98958d560f45913f6e3143ad99e2fcf0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionFeedback.h new file mode 100644 index 000000000..880fb7f75 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_FollowPathActionFeedback_h +#define _ROS_naoqi_bridge_msgs_FollowPathActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/FollowPathFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class FollowPathActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::FollowPathFeedback _feedback_type; + _feedback_type feedback; + + FollowPathActionFeedback(): + 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 "naoqi_bridge_msgs/FollowPathActionFeedback"; }; + virtual const char * getMD5() override { return "dfaee912e03af794d99d2a72e37fc3e5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionGoal.h new file mode 100644 index 000000000..d5790226d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_FollowPathActionGoal_h +#define _ROS_naoqi_bridge_msgs_FollowPathActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "naoqi_bridge_msgs/FollowPathGoal.h" + +namespace naoqi_bridge_msgs +{ + + class FollowPathActionGoal : 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 naoqi_bridge_msgs::FollowPathGoal _goal_type; + _goal_type goal; + + FollowPathActionGoal(): + 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 "naoqi_bridge_msgs/FollowPathActionGoal"; }; + virtual const char * getMD5() override { return "fd6a86de9a61df23ce19e20d45649f18"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionResult.h new file mode 100644 index 000000000..90e44e850 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_FollowPathActionResult_h +#define _ROS_naoqi_bridge_msgs_FollowPathActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/FollowPathResult.h" + +namespace naoqi_bridge_msgs +{ + + class FollowPathActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::FollowPathResult _result_type; + _result_type result; + + FollowPathActionResult(): + 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 "naoqi_bridge_msgs/FollowPathActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathFeedback.h new file mode 100644 index 000000000..eb2f9c7ab --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathFeedback.h @@ -0,0 +1,51 @@ +#ifndef _ROS_naoqi_bridge_msgs_FollowPathFeedback_h +#define _ROS_naoqi_bridge_msgs_FollowPathFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class FollowPathFeedback : public ros::Msg + { + public: + typedef uint32_t _index_type; + _index_type index; + + FollowPathFeedback(): + index(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->index >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->index >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->index >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->index >> (8 * 3)) & 0xFF; + offset += sizeof(this->index); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->index = ((uint32_t) (*(inbuffer + offset))); + this->index |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->index |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->index |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->index); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/FollowPathFeedback"; }; + virtual const char * getMD5() override { return "ad7b979103dbd563a352ef5270716728"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathGoal.h new file mode 100644 index 000000000..cbd41fab6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_naoqi_bridge_msgs_FollowPathGoal_h +#define _ROS_naoqi_bridge_msgs_FollowPathGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/Path.h" + +namespace naoqi_bridge_msgs +{ + + class FollowPathGoal : public ros::Msg + { + public: + typedef nav_msgs::Path _path_type; + _path_type path; + + FollowPathGoal(): + path() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->path.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->path.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/FollowPathGoal"; }; + virtual const char * getMD5() override { return "58d6f138c7de7ef47c75d4b7e5df5472"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathResult.h new file mode 100644 index 000000000..6a31c4163 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/FollowPathResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_FollowPathResult_h +#define _ROS_naoqi_bridge_msgs_FollowPathResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class FollowPathResult : public ros::Msg + { + public: + + FollowPathResult() + { + } + + 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 "naoqi_bridge_msgs/FollowPathResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetBodyROI.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetBodyROI.h new file mode 100644 index 000000000..9c5962be1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetBodyROI.h @@ -0,0 +1,96 @@ +#ifndef _ROS_SERVICE_GetBodyROI_h +#define _ROS_SERVICE_GetBodyROI_h +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/BodyROI.h" + +namespace naoqi_bridge_msgs +{ + +static const char GETBODYROI[] = "naoqi_bridge_msgs/GetBodyROI"; + + class GetBodyROIRequest : public ros::Msg + { + public: + + GetBodyROIRequest() + { + } + + 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 GETBODYROI; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetBodyROIResponse : public ros::Msg + { + public: + uint32_t bodies_length; + typedef naoqi_bridge_msgs::BodyROI _bodies_type; + _bodies_type st_bodies; + _bodies_type * bodies; + + GetBodyROIResponse(): + bodies_length(0), st_bodies(), bodies(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->bodies_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->bodies_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->bodies_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->bodies_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->bodies_length); + for( uint32_t i = 0; i < bodies_length; i++){ + offset += this->bodies[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t bodies_lengthT = ((uint32_t) (*(inbuffer + offset))); + bodies_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + bodies_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + bodies_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->bodies_length); + if(bodies_lengthT > bodies_length) + this->bodies = (naoqi_bridge_msgs::BodyROI*)realloc(this->bodies, bodies_lengthT * sizeof(naoqi_bridge_msgs::BodyROI)); + bodies_length = bodies_lengthT; + for( uint32_t i = 0; i < bodies_length; i++){ + offset += this->st_bodies.deserialize(inbuffer + offset); + memcpy( &(this->bodies[i]), &(this->st_bodies), sizeof(naoqi_bridge_msgs::BodyROI)); + } + return offset; + } + + virtual const char * getType() override { return GETBODYROI; }; + virtual const char * getMD5() override { return "ecc2963facbb989a955948135b6e21fd"; }; + + }; + + class GetBodyROI { + public: + typedef GetBodyROIRequest Request; + typedef GetBodyROIResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetFacesROI.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetFacesROI.h new file mode 100644 index 000000000..1a6fc5034 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetFacesROI.h @@ -0,0 +1,96 @@ +#ifndef _ROS_SERVICE_GetFacesROI_h +#define _ROS_SERVICE_GetFacesROI_h +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/FaceROI.h" + +namespace naoqi_bridge_msgs +{ + +static const char GETFACESROI[] = "naoqi_bridge_msgs/GetFacesROI"; + + class GetFacesROIRequest : public ros::Msg + { + public: + + GetFacesROIRequest() + { + } + + 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 GETFACESROI; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetFacesROIResponse : public ros::Msg + { + public: + uint32_t faces_length; + typedef naoqi_bridge_msgs::FaceROI _faces_type; + _faces_type st_faces; + _faces_type * faces; + + GetFacesROIResponse(): + faces_length(0), st_faces(), faces(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->faces_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->faces_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->faces_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->faces_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->faces_length); + for( uint32_t i = 0; i < faces_length; i++){ + offset += this->faces[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t faces_lengthT = ((uint32_t) (*(inbuffer + offset))); + faces_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + faces_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + faces_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->faces_length); + if(faces_lengthT > faces_length) + this->faces = (naoqi_bridge_msgs::FaceROI*)realloc(this->faces, faces_lengthT * sizeof(naoqi_bridge_msgs::FaceROI)); + faces_length = faces_lengthT; + for( uint32_t i = 0; i < faces_length; i++){ + offset += this->st_faces.deserialize(inbuffer + offset); + memcpy( &(this->faces[i]), &(this->st_faces), sizeof(naoqi_bridge_msgs::FaceROI)); + } + return offset; + } + + virtual const char * getType() override { return GETFACESROI; }; + virtual const char * getMD5() override { return "7123975ed3d5d1cde8b35e6736592769"; }; + + }; + + class GetFacesROI { + public: + typedef GetFacesROIRequest Request; + typedef GetFacesROIResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetFloat.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetFloat.h new file mode 100644 index 000000000..e08d50601 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetFloat.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_GetFloat_h +#define _ROS_SERVICE_GetFloat_h +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + +static const char GETFLOAT[] = "naoqi_bridge_msgs/GetFloat"; + + class GetFloatRequest : public ros::Msg + { + public: + + GetFloatRequest() + { + } + + 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 GETFLOAT; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetFloatResponse : public ros::Msg + { + public: + typedef float _data_type; + _data_type data; + typedef const char* _message_type; + _message_type message; + + GetFloatResponse(): + data(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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); + 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 { + 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); + 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 GETFLOAT; }; + virtual const char * getMD5() override { return "3cf398eaca21304d20b13c76cecbddea"; }; + + }; + + class GetFloat { + public: + typedef GetFloatRequest Request; + typedef GetFloatResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetInstalledBehaviors.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetInstalledBehaviors.h new file mode 100644 index 000000000..579c63718 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetInstalledBehaviors.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_GetInstalledBehaviors_h +#define _ROS_SERVICE_GetInstalledBehaviors_h +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + +static const char GETINSTALLEDBEHAVIORS[] = "naoqi_bridge_msgs/GetInstalledBehaviors"; + + class GetInstalledBehaviorsRequest : public ros::Msg + { + public: + + GetInstalledBehaviorsRequest() + { + } + + 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 GETINSTALLEDBEHAVIORS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetInstalledBehaviorsResponse : public ros::Msg + { + public: + uint32_t behaviors_length; + typedef char* _behaviors_type; + _behaviors_type st_behaviors; + _behaviors_type * behaviors; + + GetInstalledBehaviorsResponse(): + behaviors_length(0), st_behaviors(), behaviors(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->behaviors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->behaviors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->behaviors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->behaviors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->behaviors_length); + for( uint32_t i = 0; i < behaviors_length; i++){ + uint32_t length_behaviorsi = strlen(this->behaviors[i]); + varToArr(outbuffer + offset, length_behaviorsi); + offset += 4; + memcpy(outbuffer + offset, this->behaviors[i], length_behaviorsi); + offset += length_behaviorsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t behaviors_lengthT = ((uint32_t) (*(inbuffer + offset))); + behaviors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + behaviors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + behaviors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->behaviors_length); + if(behaviors_lengthT > behaviors_length) + this->behaviors = (char**)realloc(this->behaviors, behaviors_lengthT * sizeof(char*)); + behaviors_length = behaviors_lengthT; + for( uint32_t i = 0; i < behaviors_length; i++){ + uint32_t length_st_behaviors; + arrToVar(length_st_behaviors, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_behaviors; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_behaviors-1]=0; + this->st_behaviors = (char *)(inbuffer + offset-1); + offset += length_st_behaviors; + memcpy( &(this->behaviors[i]), &(this->st_behaviors), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return GETINSTALLEDBEHAVIORS; }; + virtual const char * getMD5() override { return "715783c8c6eb28fc2e1c05184add75ec"; }; + + }; + + class GetInstalledBehaviors { + public: + typedef GetInstalledBehaviorsRequest Request; + typedef GetInstalledBehaviorsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetRobotInfo.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetRobotInfo.h new file mode 100644 index 000000000..01243def7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetRobotInfo.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_GetRobotInfo_h +#define _ROS_SERVICE_GetRobotInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/RobotInfo.h" + +namespace naoqi_bridge_msgs +{ + +static const char GETROBOTINFO[] = "naoqi_bridge_msgs/GetRobotInfo"; + + class GetRobotInfoRequest : public ros::Msg + { + public: + + GetRobotInfoRequest() + { + } + + 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 GETROBOTINFO; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetRobotInfoResponse : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::RobotInfo _info_type; + _info_type info; + + GetRobotInfoResponse(): + 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 GETROBOTINFO; }; + virtual const char * getMD5() override { return "6a705e4ea65692d6e21188b3537da43d"; }; + + }; + + class GetRobotInfo { + public: + typedef GetRobotInfoRequest Request; + typedef GetRobotInfoResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetString.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetString.h new file mode 100644 index 000000000..127930faf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetString.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_GetString_h +#define _ROS_SERVICE_GetString_h +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + +static const char GETSTRING[] = "naoqi_bridge_msgs/GetString"; + + class GetStringRequest : public ros::Msg + { + public: + + GetStringRequest() + { + } + + 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 GETSTRING; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetStringResponse : public ros::Msg + { + public: + typedef const char* _data_type; + _data_type data; + + GetStringResponse(): + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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; + 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 GETSTRING; }; + virtual const char * getMD5() override { return "992ce8a1687cec8c8bd883ec73ca41d1"; }; + + }; + + class GetString { + public: + typedef GetStringRequest Request; + typedef GetStringResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetTruepose.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetTruepose.h new file mode 100644 index 000000000..e8fc7b2dd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/GetTruepose.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_GetTruepose_h +#define _ROS_SERVICE_GetTruepose_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseWithCovarianceStamped.h" + +namespace naoqi_bridge_msgs +{ + +static const char GETTRUEPOSE[] = "naoqi_bridge_msgs/GetTruepose"; + + class GetTrueposeRequest : public ros::Msg + { + public: + + GetTrueposeRequest() + { + } + + 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 GETTRUEPOSE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetTrueposeResponse : public ros::Msg + { + public: + typedef geometry_msgs::PoseWithCovarianceStamped _pose_type; + _pose_type pose; + + GetTrueposeResponse(): + 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 GETTRUEPOSE; }; + virtual const char * getMD5() override { return "4f3e0bbe7a24e1f929488cd1970222d3"; }; + + }; + + class GetTruepose { + public: + typedef GetTrueposeRequest Request; + typedef GetTrueposeResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/HandTouch.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/HandTouch.h new file mode 100644 index 000000000..84b5571a0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/HandTouch.h @@ -0,0 +1,60 @@ +#ifndef _ROS_naoqi_bridge_msgs_HandTouch_h +#define _ROS_naoqi_bridge_msgs_HandTouch_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class HandTouch : public ros::Msg + { + public: + typedef uint8_t _hand_type; + _hand_type hand; + typedef uint8_t _state_type; + _state_type state; + enum { RIGHT_BACK = 0 }; + enum { RIGHT_LEFT = 1 }; + enum { RIGHT_RIGHT = 2 }; + enum { LEFT_BACK = 3 }; + enum { LEFT_LEFT = 4 }; + enum { LEFT_RIGHT = 5 }; + enum { stateReleased = 0 }; + enum { statePressed = 1 }; + + HandTouch(): + hand(0), + state(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->hand >> (8 * 0)) & 0xFF; + offset += sizeof(this->hand); + *(outbuffer + offset + 0) = (this->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->hand = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->hand); + this->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/HandTouch"; }; + virtual const char * getMD5() override { return "d8d5c81c96dbe6a9e8e5d80beb70299d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/HeadTouch.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/HeadTouch.h new file mode 100644 index 000000000..d018102f0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/HeadTouch.h @@ -0,0 +1,57 @@ +#ifndef _ROS_naoqi_bridge_msgs_HeadTouch_h +#define _ROS_naoqi_bridge_msgs_HeadTouch_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class HeadTouch : public ros::Msg + { + public: + typedef uint8_t _button_type; + _button_type button; + typedef uint8_t _state_type; + _state_type state; + enum { buttonFront = 1 }; + enum { buttonMiddle = 2 }; + enum { buttonRear = 3 }; + enum { stateReleased = 0 }; + enum { statePressed = 1 }; + + HeadTouch(): + button(0), + state(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->button >> (8 * 0)) & 0xFF; + offset += sizeof(this->button); + *(outbuffer + offset + 0) = (this->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->button = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->button); + this->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/HeadTouch"; }; + virtual const char * getMD5() override { return "b75165bf9dfed26d50ad4e3162304225"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/IntArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/IntArrayStamped.h new file mode 100644 index 000000000..5e97d77ad --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/IntArrayStamped.h @@ -0,0 +1,88 @@ +#ifndef _ROS_naoqi_bridge_msgs_IntArrayStamped_h +#define _ROS_naoqi_bridge_msgs_IntArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace naoqi_bridge_msgs +{ + + class IntArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t data_length; + typedef int32_t _data_type; + _data_type st_data; + _data_type * data; + + IntArrayStamped(): + 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++){ + union { + int32_t 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]); + } + 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 = (int32_t*)realloc(this->data, data_lengthT * sizeof(int32_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + union { + int32_t 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(int32_t)); + } + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/IntArrayStamped"; }; + virtual const char * getMD5() override { return "1ce4762ce13f3d9e1f17586acc253067"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/IntStamped.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/IntStamped.h new file mode 100644 index 000000000..28530c3eb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/IntStamped.h @@ -0,0 +1,68 @@ +#ifndef _ROS_naoqi_bridge_msgs_IntStamped_h +#define _ROS_naoqi_bridge_msgs_IntStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace naoqi_bridge_msgs +{ + + class IntStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _data_type; + _data_type data; + + IntStamped(): + header(), + data(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_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); + 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_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); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/IntStamped"; }; + virtual const char * getMD5() override { return "e7344a45486eefa24d2f337265df37ce"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAngleTrajectory.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAngleTrajectory.h new file mode 100644 index 000000000..26f28d0af --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAngleTrajectory.h @@ -0,0 +1,176 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointAngleTrajectory_h +#define _ROS_naoqi_bridge_msgs_JointAngleTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace naoqi_bridge_msgs +{ + + class JointAngleTrajectory : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t joint_angles_length; + typedef float _joint_angles_type; + _joint_angles_type st_joint_angles; + _joint_angles_type * joint_angles; + uint32_t times_length; + typedef float _times_type; + _times_type st_times; + _times_type * times; + typedef uint8_t _relative_type; + _relative_type relative; + + JointAngleTrajectory(): + header(), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + joint_angles_length(0), st_joint_angles(), joint_angles(nullptr), + times_length(0), st_times(), times(nullptr), + relative(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset + 0) = (this->joint_angles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_angles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_angles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_angles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_angles_length); + for( uint32_t i = 0; i < joint_angles_length; i++){ + union { + float real; + uint32_t base; + } u_joint_anglesi; + u_joint_anglesi.real = this->joint_angles[i]; + *(outbuffer + offset + 0) = (u_joint_anglesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_joint_anglesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_joint_anglesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_joint_anglesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_angles[i]); + } + *(outbuffer + offset + 0) = (this->times_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->times_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->times_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->times_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->times_length); + for( uint32_t i = 0; i < times_length; i++){ + union { + float real; + uint32_t base; + } u_timesi; + u_timesi.real = this->times[i]; + *(outbuffer + offset + 0) = (u_timesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_timesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_timesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_timesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->times[i]); + } + *(outbuffer + offset + 0) = (this->relative >> (8 * 0)) & 0xFF; + offset += sizeof(this->relative); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint32_t joint_angles_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_angles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_angles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_angles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_angles_length); + if(joint_angles_lengthT > joint_angles_length) + this->joint_angles = (float*)realloc(this->joint_angles, joint_angles_lengthT * sizeof(float)); + joint_angles_length = joint_angles_lengthT; + for( uint32_t i = 0; i < joint_angles_length; i++){ + union { + float real; + uint32_t base; + } u_st_joint_angles; + u_st_joint_angles.base = 0; + u_st_joint_angles.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_joint_angles.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_joint_angles.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_joint_angles.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_joint_angles = u_st_joint_angles.real; + offset += sizeof(this->st_joint_angles); + memcpy( &(this->joint_angles[i]), &(this->st_joint_angles), sizeof(float)); + } + uint32_t times_lengthT = ((uint32_t) (*(inbuffer + offset))); + times_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + times_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + times_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->times_length); + if(times_lengthT > times_length) + this->times = (float*)realloc(this->times, times_lengthT * sizeof(float)); + times_length = times_lengthT; + for( uint32_t i = 0; i < times_length; i++){ + union { + float real; + uint32_t base; + } u_st_times; + u_st_times.base = 0; + u_st_times.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_times.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_times.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_times.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_times = u_st_times.real; + offset += sizeof(this->st_times); + memcpy( &(this->times[i]), &(this->st_times), sizeof(float)); + } + this->relative = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->relative); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/JointAngleTrajectory"; }; + virtual const char * getMD5() override { return "5ec9aa90e61498421ea53db10da7f8dd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeed.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeed.h new file mode 100644 index 000000000..8dd4f474a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeed.h @@ -0,0 +1,156 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointAnglesWithSpeed_h +#define _ROS_naoqi_bridge_msgs_JointAnglesWithSpeed_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace naoqi_bridge_msgs +{ + + class JointAnglesWithSpeed : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t joint_angles_length; + typedef float _joint_angles_type; + _joint_angles_type st_joint_angles; + _joint_angles_type * joint_angles; + typedef float _speed_type; + _speed_type speed; + typedef uint8_t _relative_type; + _relative_type relative; + + JointAnglesWithSpeed(): + header(), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + joint_angles_length(0), st_joint_angles(), joint_angles(nullptr), + speed(0), + relative(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset + 0) = (this->joint_angles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_angles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_angles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_angles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_angles_length); + for( uint32_t i = 0; i < joint_angles_length; i++){ + union { + float real; + uint32_t base; + } u_joint_anglesi; + u_joint_anglesi.real = this->joint_angles[i]; + *(outbuffer + offset + 0) = (u_joint_anglesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_joint_anglesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_joint_anglesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_joint_anglesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_angles[i]); + } + union { + float real; + uint32_t base; + } u_speed; + u_speed.real = this->speed; + *(outbuffer + offset + 0) = (u_speed.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_speed.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_speed.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_speed.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->speed); + *(outbuffer + offset + 0) = (this->relative >> (8 * 0)) & 0xFF; + offset += sizeof(this->relative); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint32_t joint_angles_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_angles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_angles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_angles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_angles_length); + if(joint_angles_lengthT > joint_angles_length) + this->joint_angles = (float*)realloc(this->joint_angles, joint_angles_lengthT * sizeof(float)); + joint_angles_length = joint_angles_lengthT; + for( uint32_t i = 0; i < joint_angles_length; i++){ + union { + float real; + uint32_t base; + } u_st_joint_angles; + u_st_joint_angles.base = 0; + u_st_joint_angles.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_joint_angles.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_joint_angles.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_joint_angles.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_joint_angles = u_st_joint_angles.real; + offset += sizeof(this->st_joint_angles); + memcpy( &(this->joint_angles[i]), &(this->st_joint_angles), sizeof(float)); + } + union { + float real; + uint32_t base; + } u_speed; + u_speed.base = 0; + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->speed = u_speed.real; + offset += sizeof(this->speed); + this->relative = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->relative); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/JointAnglesWithSpeed"; }; + virtual const char * getMD5() override { return "052ca11f74a00ad6745dfff6ebc2b4d8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedAction.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedAction.h new file mode 100644 index 000000000..ee37ed645 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedAction_h +#define _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/JointAnglesWithSpeedActionGoal.h" +#include "naoqi_bridge_msgs/JointAnglesWithSpeedActionResult.h" +#include "naoqi_bridge_msgs/JointAnglesWithSpeedActionFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class JointAnglesWithSpeedAction : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::JointAnglesWithSpeedActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef naoqi_bridge_msgs::JointAnglesWithSpeedActionResult _action_result_type; + _action_result_type action_result; + typedef naoqi_bridge_msgs::JointAnglesWithSpeedActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + JointAnglesWithSpeedAction(): + 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 "naoqi_bridge_msgs/JointAnglesWithSpeedAction"; }; + virtual const char * getMD5() override { return "efd2f7ac88847414fd26aacf32f993a5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionFeedback.h new file mode 100644 index 000000000..47af90676 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedActionFeedback_h +#define _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/JointAnglesWithSpeedFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class JointAnglesWithSpeedActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::JointAnglesWithSpeedFeedback _feedback_type; + _feedback_type feedback; + + JointAnglesWithSpeedActionFeedback(): + 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 "naoqi_bridge_msgs/JointAnglesWithSpeedActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionGoal.h new file mode 100644 index 000000000..26ed248aa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedActionGoal_h +#define _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "naoqi_bridge_msgs/JointAnglesWithSpeedGoal.h" + +namespace naoqi_bridge_msgs +{ + + class JointAnglesWithSpeedActionGoal : 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 naoqi_bridge_msgs::JointAnglesWithSpeedGoal _goal_type; + _goal_type goal; + + JointAnglesWithSpeedActionGoal(): + 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 "naoqi_bridge_msgs/JointAnglesWithSpeedActionGoal"; }; + virtual const char * getMD5() override { return "9b722e9749aa53fc0e8ca7aa12e95efb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionResult.h new file mode 100644 index 000000000..5a2d14121 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedActionResult_h +#define _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/JointAnglesWithSpeedResult.h" + +namespace naoqi_bridge_msgs +{ + + class JointAnglesWithSpeedActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::JointAnglesWithSpeedResult _result_type; + _result_type result; + + JointAnglesWithSpeedActionResult(): + 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 "naoqi_bridge_msgs/JointAnglesWithSpeedActionResult"; }; + virtual const char * getMD5() override { return "8863b007f420d5f94fcdaa0f865d1767"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedFeedback.h new file mode 100644 index 000000000..accd786f8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedFeedback_h +#define _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class JointAnglesWithSpeedFeedback : public ros::Msg + { + public: + + JointAnglesWithSpeedFeedback() + { + } + + 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 "naoqi_bridge_msgs/JointAnglesWithSpeedFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedGoal.h new file mode 100644 index 000000000..1b3a2cccf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedGoal_h +#define _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/JointAnglesWithSpeed.h" + +namespace naoqi_bridge_msgs +{ + + class JointAnglesWithSpeedGoal : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::JointAnglesWithSpeed _joint_angles_type; + _joint_angles_type joint_angles; + + JointAnglesWithSpeedGoal(): + joint_angles() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->joint_angles.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->joint_angles.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/JointAnglesWithSpeedGoal"; }; + virtual const char * getMD5() override { return "d19a898a40aae87b37b0f91c9e90f46c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedResult.h new file mode 100644 index 000000000..5b8053c85 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointAnglesWithSpeedResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedResult_h +#define _ROS_naoqi_bridge_msgs_JointAnglesWithSpeedResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JointState.h" + +namespace naoqi_bridge_msgs +{ + + class JointAnglesWithSpeedResult : public ros::Msg + { + public: + typedef sensor_msgs::JointState _goal_position_type; + _goal_position_type goal_position; + + JointAnglesWithSpeedResult(): + goal_position() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->goal_position.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->goal_position.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/JointAnglesWithSpeedResult"; }; + virtual const char * getMD5() override { return "1c77b3d9dc137611510fd16c3b792046"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryAction.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryAction.h new file mode 100644 index 000000000..95a345d4b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointTrajectoryAction_h +#define _ROS_naoqi_bridge_msgs_JointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/JointTrajectoryActionGoal.h" +#include "naoqi_bridge_msgs/JointTrajectoryActionResult.h" +#include "naoqi_bridge_msgs/JointTrajectoryActionFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class JointTrajectoryAction : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::JointTrajectoryActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef naoqi_bridge_msgs::JointTrajectoryActionResult _action_result_type; + _action_result_type action_result; + typedef naoqi_bridge_msgs::JointTrajectoryActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + JointTrajectoryAction(): + 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 "naoqi_bridge_msgs/JointTrajectoryAction"; }; + virtual const char * getMD5() override { return "a88e50dd366fa304954dd433b5706bd8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionFeedback.h new file mode 100644 index 000000000..4d6fdf3d2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointTrajectoryActionFeedback_h +#define _ROS_naoqi_bridge_msgs_JointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/JointTrajectoryFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class JointTrajectoryActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::JointTrajectoryFeedback _feedback_type; + _feedback_type feedback; + + JointTrajectoryActionFeedback(): + 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 "naoqi_bridge_msgs/JointTrajectoryActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionGoal.h new file mode 100644 index 000000000..4eeb74cd5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointTrajectoryActionGoal_h +#define _ROS_naoqi_bridge_msgs_JointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "naoqi_bridge_msgs/JointTrajectoryGoal.h" + +namespace naoqi_bridge_msgs +{ + + class JointTrajectoryActionGoal : 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 naoqi_bridge_msgs::JointTrajectoryGoal _goal_type; + _goal_type goal; + + JointTrajectoryActionGoal(): + 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 "naoqi_bridge_msgs/JointTrajectoryActionGoal"; }; + virtual const char * getMD5() override { return "01c0441c9496ef36b8677931c016db7f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionResult.h new file mode 100644 index 000000000..38b13f2ac --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointTrajectoryActionResult_h +#define _ROS_naoqi_bridge_msgs_JointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/JointTrajectoryResult.h" + +namespace naoqi_bridge_msgs +{ + + class JointTrajectoryActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::JointTrajectoryResult _result_type; + _result_type result; + + JointTrajectoryActionResult(): + 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 "naoqi_bridge_msgs/JointTrajectoryActionResult"; }; + virtual const char * getMD5() override { return "8863b007f420d5f94fcdaa0f865d1767"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryFeedback.h new file mode 100644 index 000000000..17a2b2a31 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointTrajectoryFeedback_h +#define _ROS_naoqi_bridge_msgs_JointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class JointTrajectoryFeedback : public ros::Msg + { + public: + + JointTrajectoryFeedback() + { + } + + 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 "naoqi_bridge_msgs/JointTrajectoryFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryGoal.h new file mode 100644 index 000000000..a69ddfefa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryGoal.h @@ -0,0 +1,51 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointTrajectoryGoal_h +#define _ROS_naoqi_bridge_msgs_JointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" + +namespace naoqi_bridge_msgs +{ + + class JointTrajectoryGoal : public ros::Msg + { + public: + typedef trajectory_msgs::JointTrajectory _trajectory_type; + _trajectory_type trajectory; + typedef uint8_t _relative_type; + _relative_type relative; + + JointTrajectoryGoal(): + trajectory(), + relative(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->relative >> (8 * 0)) & 0xFF; + offset += sizeof(this->relative); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + this->relative = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->relative); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/JointTrajectoryGoal"; }; + virtual const char * getMD5() override { return "7ecdd56459ac4b8e2c210a74dbb66523"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryResult.h new file mode 100644 index 000000000..ef1390741 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/JointTrajectoryResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_naoqi_bridge_msgs_JointTrajectoryResult_h +#define _ROS_naoqi_bridge_msgs_JointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JointState.h" + +namespace naoqi_bridge_msgs +{ + + class JointTrajectoryResult : public ros::Msg + { + public: + typedef sensor_msgs::JointState _goal_position_type; + _goal_position_type goal_position; + + JointTrajectoryResult(): + goal_position() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->goal_position.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->goal_position.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/JointTrajectoryResult"; }; + virtual const char * getMD5() override { return "1c77b3d9dc137611510fd16c3b792046"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryList.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryList.h new file mode 100644 index 000000000..eb40487b1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryList.h @@ -0,0 +1,122 @@ +#ifndef _ROS_naoqi_bridge_msgs_MemoryList_h +#define _ROS_naoqi_bridge_msgs_MemoryList_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "naoqi_bridge_msgs/MemoryPairString.h" +#include "naoqi_bridge_msgs/MemoryPairInt.h" +#include "naoqi_bridge_msgs/MemoryPairFloat.h" + +namespace naoqi_bridge_msgs +{ + + class MemoryList : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t strings_length; + typedef naoqi_bridge_msgs::MemoryPairString _strings_type; + _strings_type st_strings; + _strings_type * strings; + uint32_t ints_length; + typedef naoqi_bridge_msgs::MemoryPairInt _ints_type; + _ints_type st_ints; + _ints_type * ints; + uint32_t floats_length; + typedef naoqi_bridge_msgs::MemoryPairFloat _floats_type; + _floats_type st_floats; + _floats_type * floats; + + MemoryList(): + header(), + strings_length(0), st_strings(), strings(nullptr), + ints_length(0), st_ints(), ints(nullptr), + floats_length(0), st_floats(), floats(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->strings_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->strings_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->strings_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->strings_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->strings_length); + for( uint32_t i = 0; i < strings_length; i++){ + offset += this->strings[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->ints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ints_length); + for( uint32_t i = 0; i < ints_length; i++){ + offset += this->ints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->floats_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->floats_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->floats_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->floats_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->floats_length); + for( uint32_t i = 0; i < floats_length; i++){ + offset += this->floats[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t strings_lengthT = ((uint32_t) (*(inbuffer + offset))); + strings_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + strings_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + strings_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->strings_length); + if(strings_lengthT > strings_length) + this->strings = (naoqi_bridge_msgs::MemoryPairString*)realloc(this->strings, strings_lengthT * sizeof(naoqi_bridge_msgs::MemoryPairString)); + strings_length = strings_lengthT; + for( uint32_t i = 0; i < strings_length; i++){ + offset += this->st_strings.deserialize(inbuffer + offset); + memcpy( &(this->strings[i]), &(this->st_strings), sizeof(naoqi_bridge_msgs::MemoryPairString)); + } + uint32_t ints_lengthT = ((uint32_t) (*(inbuffer + offset))); + ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ints_length); + if(ints_lengthT > ints_length) + this->ints = (naoqi_bridge_msgs::MemoryPairInt*)realloc(this->ints, ints_lengthT * sizeof(naoqi_bridge_msgs::MemoryPairInt)); + ints_length = ints_lengthT; + for( uint32_t i = 0; i < ints_length; i++){ + offset += this->st_ints.deserialize(inbuffer + offset); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(naoqi_bridge_msgs::MemoryPairInt)); + } + uint32_t floats_lengthT = ((uint32_t) (*(inbuffer + offset))); + floats_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + floats_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + floats_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->floats_length); + if(floats_lengthT > floats_length) + this->floats = (naoqi_bridge_msgs::MemoryPairFloat*)realloc(this->floats, floats_lengthT * sizeof(naoqi_bridge_msgs::MemoryPairFloat)); + floats_length = floats_lengthT; + for( uint32_t i = 0; i < floats_length; i++){ + offset += this->st_floats.deserialize(inbuffer + offset); + memcpy( &(this->floats[i]), &(this->st_floats), sizeof(naoqi_bridge_msgs::MemoryPairFloat)); + } + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/MemoryList"; }; + virtual const char * getMD5() override { return "7222936d1c205b51fbfdb13e468998ad"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairFloat.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairFloat.h new file mode 100644 index 000000000..ef64f72e5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairFloat.h @@ -0,0 +1,79 @@ +#ifndef _ROS_naoqi_bridge_msgs_MemoryPairFloat_h +#define _ROS_naoqi_bridge_msgs_MemoryPairFloat_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class MemoryPairFloat : public ros::Msg + { + public: + typedef const char* _memoryKey_type; + _memoryKey_type memoryKey; + typedef float _data_type; + _data_type data; + + MemoryPairFloat(): + memoryKey(""), + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_memoryKey = strlen(this->memoryKey); + varToArr(outbuffer + offset, length_memoryKey); + offset += 4; + memcpy(outbuffer + offset, this->memoryKey, length_memoryKey); + offset += length_memoryKey; + 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); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_memoryKey; + arrToVar(length_memoryKey, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_memoryKey; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_memoryKey-1]=0; + this->memoryKey = (char *)(inbuffer + offset-1); + offset += length_memoryKey; + 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); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/MemoryPairFloat"; }; + virtual const char * getMD5() override { return "92d055a3f1d6bfad2125c6cb81fe007f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairInt.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairInt.h new file mode 100644 index 000000000..b304d4657 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairInt.h @@ -0,0 +1,79 @@ +#ifndef _ROS_naoqi_bridge_msgs_MemoryPairInt_h +#define _ROS_naoqi_bridge_msgs_MemoryPairInt_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class MemoryPairInt : public ros::Msg + { + public: + typedef const char* _memoryKey_type; + _memoryKey_type memoryKey; + typedef int32_t _data_type; + _data_type data; + + MemoryPairInt(): + memoryKey(""), + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_memoryKey = strlen(this->memoryKey); + varToArr(outbuffer + offset, length_memoryKey); + offset += 4; + memcpy(outbuffer + offset, this->memoryKey, length_memoryKey); + offset += length_memoryKey; + union { + int32_t 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); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_memoryKey; + arrToVar(length_memoryKey, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_memoryKey; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_memoryKey-1]=0; + this->memoryKey = (char *)(inbuffer + offset-1); + offset += length_memoryKey; + union { + int32_t 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); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/MemoryPairInt"; }; + virtual const char * getMD5() override { return "22045fae148fc28af04280556676c5b8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairString.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairString.h new file mode 100644 index 000000000..6f9cf347f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/MemoryPairString.h @@ -0,0 +1,72 @@ +#ifndef _ROS_naoqi_bridge_msgs_MemoryPairString_h +#define _ROS_naoqi_bridge_msgs_MemoryPairString_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class MemoryPairString : public ros::Msg + { + public: + typedef const char* _memoryKey_type; + _memoryKey_type memoryKey; + typedef const char* _data_type; + _data_type data; + + MemoryPairString(): + memoryKey(""), + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_memoryKey = strlen(this->memoryKey); + varToArr(outbuffer + offset, length_memoryKey); + offset += 4; + memcpy(outbuffer + offset, this->memoryKey, length_memoryKey); + offset += length_memoryKey; + 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; + uint32_t length_memoryKey; + arrToVar(length_memoryKey, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_memoryKey; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_memoryKey-1]=0; + this->memoryKey = (char *)(inbuffer + offset-1); + offset += length_memoryKey; + 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 "naoqi_bridge_msgs/MemoryPairString"; }; + virtual const char * getMD5() override { return "b6046f2881035869712dcfeda0628929"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/OrthogonalSecurityDistance.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/OrthogonalSecurityDistance.h new file mode 100644 index 000000000..ed1c2ea63 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/OrthogonalSecurityDistance.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_OrthogonalSecurityDistance_h +#define _ROS_SERVICE_OrthogonalSecurityDistance_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Float32.h" + +namespace naoqi_bridge_msgs +{ + +static const char ORTHOGONALSECURITYDISTANCE[] = "naoqi_bridge_msgs/OrthogonalSecurityDistance"; + + class OrthogonalSecurityDistanceRequest : public ros::Msg + { + public: + typedef std_msgs::Float32 _orthogonal_distance_type; + _orthogonal_distance_type orthogonal_distance; + + OrthogonalSecurityDistanceRequest(): + orthogonal_distance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->orthogonal_distance.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->orthogonal_distance.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return ORTHOGONALSECURITYDISTANCE; }; + virtual const char * getMD5() override { return "69e9b81707b13ae1b2bceacbb0d41137"; }; + + }; + + class OrthogonalSecurityDistanceResponse : public ros::Msg + { + public: + + OrthogonalSecurityDistanceResponse() + { + } + + 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 ORTHOGONALSECURITYDISTANCE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class OrthogonalSecurityDistance { + public: + typedef OrthogonalSecurityDistanceRequest Request; + typedef OrthogonalSecurityDistanceResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/PoseWithConfidenceStamped.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/PoseWithConfidenceStamped.h new file mode 100644 index 000000000..2cb363b66 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/PoseWithConfidenceStamped.h @@ -0,0 +1,74 @@ +#ifndef _ROS_naoqi_bridge_msgs_PoseWithConfidenceStamped_h +#define _ROS_naoqi_bridge_msgs_PoseWithConfidenceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace naoqi_bridge_msgs +{ + + class PoseWithConfidenceStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef float _confidence_index_type; + _confidence_index_type confidence_index; + + PoseWithConfidenceStamped(): + header(), + pose(), + confidence_index(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_confidence_index; + u_confidence_index.real = this->confidence_index; + *(outbuffer + offset + 0) = (u_confidence_index.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_confidence_index.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_confidence_index.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_confidence_index.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidence_index); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_confidence_index; + u_confidence_index.base = 0; + u_confidence_index.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_confidence_index.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_confidence_index.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_confidence_index.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->confidence_index = u_confidence_index.real; + offset += sizeof(this->confidence_index); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/PoseWithConfidenceStamped"; }; + virtual const char * getMD5() override { return "7503bfd0de35644d373258ab08dd1e84"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RobotInfo.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RobotInfo.h new file mode 100644 index 000000000..9c705be4f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RobotInfo.h @@ -0,0 +1,224 @@ +#ifndef _ROS_naoqi_bridge_msgs_RobotInfo_h +#define _ROS_naoqi_bridge_msgs_RobotInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class RobotInfo : public ros::Msg + { + public: + typedef uint8_t _type_type; + _type_type type; + typedef const char* _model_type; + _model_type model; + typedef const char* _head_version_type; + _head_version_type head_version; + typedef const char* _body_version_type; + _body_version_type body_version; + typedef const char* _arm_version_type; + _arm_version_type arm_version; + typedef bool _has_laser_type; + _has_laser_type has_laser; + typedef bool _has_extended_arms_type; + _has_extended_arms_type has_extended_arms; + typedef int32_t _number_of_legs_type; + _number_of_legs_type number_of_legs; + typedef int32_t _number_of_arms_type; + _number_of_arms_type number_of_arms; + typedef int32_t _number_of_hands_type; + _number_of_hands_type number_of_hands; + enum { NAO = 0 }; + enum { ROMEO = 1 }; + enum { PEPPER = 2 }; + + RobotInfo(): + type(0), + model(""), + head_version(""), + body_version(""), + arm_version(""), + has_laser(0), + has_extended_arms(0), + number_of_legs(0), + number_of_arms(0), + number_of_hands(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + uint32_t length_model = strlen(this->model); + varToArr(outbuffer + offset, length_model); + offset += 4; + memcpy(outbuffer + offset, this->model, length_model); + offset += length_model; + uint32_t length_head_version = strlen(this->head_version); + varToArr(outbuffer + offset, length_head_version); + offset += 4; + memcpy(outbuffer + offset, this->head_version, length_head_version); + offset += length_head_version; + uint32_t length_body_version = strlen(this->body_version); + varToArr(outbuffer + offset, length_body_version); + offset += 4; + memcpy(outbuffer + offset, this->body_version, length_body_version); + offset += length_body_version; + uint32_t length_arm_version = strlen(this->arm_version); + varToArr(outbuffer + offset, length_arm_version); + offset += 4; + memcpy(outbuffer + offset, this->arm_version, length_arm_version); + offset += length_arm_version; + union { + bool real; + uint8_t base; + } u_has_laser; + u_has_laser.real = this->has_laser; + *(outbuffer + offset + 0) = (u_has_laser.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->has_laser); + union { + bool real; + uint8_t base; + } u_has_extended_arms; + u_has_extended_arms.real = this->has_extended_arms; + *(outbuffer + offset + 0) = (u_has_extended_arms.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->has_extended_arms); + union { + int32_t real; + uint32_t base; + } u_number_of_legs; + u_number_of_legs.real = this->number_of_legs; + *(outbuffer + offset + 0) = (u_number_of_legs.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_number_of_legs.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_number_of_legs.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_number_of_legs.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->number_of_legs); + union { + int32_t real; + uint32_t base; + } u_number_of_arms; + u_number_of_arms.real = this->number_of_arms; + *(outbuffer + offset + 0) = (u_number_of_arms.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_number_of_arms.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_number_of_arms.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_number_of_arms.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->number_of_arms); + union { + int32_t real; + uint32_t base; + } u_number_of_hands; + u_number_of_hands.real = this->number_of_hands; + *(outbuffer + offset + 0) = (u_number_of_hands.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_number_of_hands.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_number_of_hands.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_number_of_hands.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->number_of_hands); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint32_t length_model; + arrToVar(length_model, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model-1]=0; + this->model = (char *)(inbuffer + offset-1); + offset += length_model; + uint32_t length_head_version; + arrToVar(length_head_version, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_head_version; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_head_version-1]=0; + this->head_version = (char *)(inbuffer + offset-1); + offset += length_head_version; + uint32_t length_body_version; + arrToVar(length_body_version, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_version; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_version-1]=0; + this->body_version = (char *)(inbuffer + offset-1); + offset += length_body_version; + uint32_t length_arm_version; + arrToVar(length_arm_version, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_arm_version; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_arm_version-1]=0; + this->arm_version = (char *)(inbuffer + offset-1); + offset += length_arm_version; + union { + bool real; + uint8_t base; + } u_has_laser; + u_has_laser.base = 0; + u_has_laser.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->has_laser = u_has_laser.real; + offset += sizeof(this->has_laser); + union { + bool real; + uint8_t base; + } u_has_extended_arms; + u_has_extended_arms.base = 0; + u_has_extended_arms.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->has_extended_arms = u_has_extended_arms.real; + offset += sizeof(this->has_extended_arms); + union { + int32_t real; + uint32_t base; + } u_number_of_legs; + u_number_of_legs.base = 0; + u_number_of_legs.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_number_of_legs.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_number_of_legs.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_number_of_legs.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->number_of_legs = u_number_of_legs.real; + offset += sizeof(this->number_of_legs); + union { + int32_t real; + uint32_t base; + } u_number_of_arms; + u_number_of_arms.base = 0; + u_number_of_arms.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_number_of_arms.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_number_of_arms.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_number_of_arms.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->number_of_arms = u_number_of_arms.real; + offset += sizeof(this->number_of_arms); + union { + int32_t real; + uint32_t base; + } u_number_of_hands; + u_number_of_hands.base = 0; + u_number_of_hands.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_number_of_hands.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_number_of_hands.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_number_of_hands.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->number_of_hands = u_number_of_hands.real; + offset += sizeof(this->number_of_hands); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/RobotInfo"; }; + virtual const char * getMD5() override { return "cc8c56c1600e9f458ce3f2626800e77f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorAction.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorAction.h new file mode 100644 index 000000000..a7c0216c6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_RunBehaviorAction_h +#define _ROS_naoqi_bridge_msgs_RunBehaviorAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/RunBehaviorActionGoal.h" +#include "naoqi_bridge_msgs/RunBehaviorActionResult.h" +#include "naoqi_bridge_msgs/RunBehaviorActionFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class RunBehaviorAction : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::RunBehaviorActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef naoqi_bridge_msgs::RunBehaviorActionResult _action_result_type; + _action_result_type action_result; + typedef naoqi_bridge_msgs::RunBehaviorActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + RunBehaviorAction(): + 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 "naoqi_bridge_msgs/RunBehaviorAction"; }; + virtual const char * getMD5() override { return "a6a26afb8ff0902c5587c8bfbdc46892"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionFeedback.h new file mode 100644 index 000000000..958ea09ec --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_RunBehaviorActionFeedback_h +#define _ROS_naoqi_bridge_msgs_RunBehaviorActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/RunBehaviorFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class RunBehaviorActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::RunBehaviorFeedback _feedback_type; + _feedback_type feedback; + + RunBehaviorActionFeedback(): + 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 "naoqi_bridge_msgs/RunBehaviorActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionGoal.h new file mode 100644 index 000000000..c26a26faf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_RunBehaviorActionGoal_h +#define _ROS_naoqi_bridge_msgs_RunBehaviorActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "naoqi_bridge_msgs/RunBehaviorGoal.h" + +namespace naoqi_bridge_msgs +{ + + class RunBehaviorActionGoal : 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 naoqi_bridge_msgs::RunBehaviorGoal _goal_type; + _goal_type goal; + + RunBehaviorActionGoal(): + 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 "naoqi_bridge_msgs/RunBehaviorActionGoal"; }; + virtual const char * getMD5() override { return "75f2114406eede7b6b30792461853435"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionResult.h new file mode 100644 index 000000000..ed897814e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_RunBehaviorActionResult_h +#define _ROS_naoqi_bridge_msgs_RunBehaviorActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/RunBehaviorResult.h" + +namespace naoqi_bridge_msgs +{ + + class RunBehaviorActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::RunBehaviorResult _result_type; + _result_type result; + + RunBehaviorActionResult(): + 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 "naoqi_bridge_msgs/RunBehaviorActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorFeedback.h new file mode 100644 index 000000000..455d17a8c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_RunBehaviorFeedback_h +#define _ROS_naoqi_bridge_msgs_RunBehaviorFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class RunBehaviorFeedback : public ros::Msg + { + public: + + RunBehaviorFeedback() + { + } + + 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 "naoqi_bridge_msgs/RunBehaviorFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorGoal.h new file mode 100644 index 000000000..827a628ff --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorGoal.h @@ -0,0 +1,55 @@ +#ifndef _ROS_naoqi_bridge_msgs_RunBehaviorGoal_h +#define _ROS_naoqi_bridge_msgs_RunBehaviorGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class RunBehaviorGoal : public ros::Msg + { + public: + typedef const char* _behavior_type; + _behavior_type behavior; + + RunBehaviorGoal(): + behavior("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_behavior = strlen(this->behavior); + varToArr(outbuffer + offset, length_behavior); + offset += 4; + memcpy(outbuffer + offset, this->behavior, length_behavior); + offset += length_behavior; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_behavior; + arrToVar(length_behavior, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_behavior; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_behavior-1]=0; + this->behavior = (char *)(inbuffer + offset-1); + offset += length_behavior; + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/RunBehaviorGoal"; }; + virtual const char * getMD5() override { return "03729983c4b9be7a4f2b56846a7ccbdc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorResult.h new file mode 100644 index 000000000..523ddc5ee --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/RunBehaviorResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_RunBehaviorResult_h +#define _ROS_naoqi_bridge_msgs_RunBehaviorResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class RunBehaviorResult : public ros::Msg + { + public: + + RunBehaviorResult() + { + } + + 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 "naoqi_bridge_msgs/RunBehaviorResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetArmsEnabled.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetArmsEnabled.h new file mode 100644 index 000000000..f438fec68 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetArmsEnabled.h @@ -0,0 +1,106 @@ +#ifndef _ROS_SERVICE_SetArmsEnabled_h +#define _ROS_SERVICE_SetArmsEnabled_h +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + +static const char SETARMSENABLED[] = "naoqi_bridge_msgs/SetArmsEnabled"; + + class SetArmsEnabledRequest : public ros::Msg + { + public: + typedef bool _left_arm_type; + _left_arm_type left_arm; + typedef bool _right_arm_type; + _right_arm_type right_arm; + + SetArmsEnabledRequest(): + left_arm(0), + right_arm(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_left_arm; + u_left_arm.real = this->left_arm; + *(outbuffer + offset + 0) = (u_left_arm.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->left_arm); + union { + bool real; + uint8_t base; + } u_right_arm; + u_right_arm.real = this->right_arm; + *(outbuffer + offset + 0) = (u_right_arm.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->right_arm); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_left_arm; + u_left_arm.base = 0; + u_left_arm.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->left_arm = u_left_arm.real; + offset += sizeof(this->left_arm); + union { + bool real; + uint8_t base; + } u_right_arm; + u_right_arm.base = 0; + u_right_arm.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->right_arm = u_right_arm.real; + offset += sizeof(this->right_arm); + return offset; + } + + virtual const char * getType() override { return SETARMSENABLED; }; + virtual const char * getMD5() override { return "4da9069facca935244c3405e288ba555"; }; + + }; + + class SetArmsEnabledResponse : public ros::Msg + { + public: + + SetArmsEnabledResponse() + { + } + + 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 SETARMSENABLED; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetArmsEnabled { + public: + typedef SetArmsEnabledRequest Request; + typedef SetArmsEnabledResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetFloat.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetFloat.h new file mode 100644 index 000000000..bc803f5ea --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetFloat.h @@ -0,0 +1,129 @@ +#ifndef _ROS_SERVICE_SetFloat_h +#define _ROS_SERVICE_SetFloat_h +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + +static const char SETFLOAT[] = "naoqi_bridge_msgs/SetFloat"; + + class SetFloatRequest : public ros::Msg + { + public: + typedef float _data_type; + _data_type data; + + SetFloatRequest(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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); + return offset; + } + + virtual const char * getType() override { return SETFLOAT; }; + virtual const char * getMD5() override { return "73fcbf46b49191e672908e50842a83d4"; }; + + }; + + class SetFloatResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _message_type; + _message_type message; + + SetFloatResponse(): + 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 SETFLOAT; }; + virtual const char * getMD5() override { return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class SetFloat { + public: + typedef SetFloatRequest Request; + typedef SetFloatResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyAction.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyAction.h new file mode 100644 index 000000000..d19958ebb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_SetSpeechVocabularyAction_h +#define _ROS_naoqi_bridge_msgs_SetSpeechVocabularyAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/SetSpeechVocabularyActionGoal.h" +#include "naoqi_bridge_msgs/SetSpeechVocabularyActionResult.h" +#include "naoqi_bridge_msgs/SetSpeechVocabularyActionFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class SetSpeechVocabularyAction : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::SetSpeechVocabularyActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef naoqi_bridge_msgs::SetSpeechVocabularyActionResult _action_result_type; + _action_result_type action_result; + typedef naoqi_bridge_msgs::SetSpeechVocabularyActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + SetSpeechVocabularyAction(): + 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 "naoqi_bridge_msgs/SetSpeechVocabularyAction"; }; + virtual const char * getMD5() override { return "737441a71b3375ccf5219f84239ade13"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionFeedback.h new file mode 100644 index 000000000..7837f7e2e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_SetSpeechVocabularyActionFeedback_h +#define _ROS_naoqi_bridge_msgs_SetSpeechVocabularyActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/SetSpeechVocabularyFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class SetSpeechVocabularyActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::SetSpeechVocabularyFeedback _feedback_type; + _feedback_type feedback; + + SetSpeechVocabularyActionFeedback(): + 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 "naoqi_bridge_msgs/SetSpeechVocabularyActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionGoal.h new file mode 100644 index 000000000..a5eb70d51 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_SetSpeechVocabularyActionGoal_h +#define _ROS_naoqi_bridge_msgs_SetSpeechVocabularyActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "naoqi_bridge_msgs/SetSpeechVocabularyGoal.h" + +namespace naoqi_bridge_msgs +{ + + class SetSpeechVocabularyActionGoal : 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 naoqi_bridge_msgs::SetSpeechVocabularyGoal _goal_type; + _goal_type goal; + + SetSpeechVocabularyActionGoal(): + 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 "naoqi_bridge_msgs/SetSpeechVocabularyActionGoal"; }; + virtual const char * getMD5() override { return "f93300199bb500a3e511fde0b0394ddb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionResult.h new file mode 100644 index 000000000..e98ec04f2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_SetSpeechVocabularyActionResult_h +#define _ROS_naoqi_bridge_msgs_SetSpeechVocabularyActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/SetSpeechVocabularyResult.h" + +namespace naoqi_bridge_msgs +{ + + class SetSpeechVocabularyActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::SetSpeechVocabularyResult _result_type; + _result_type result; + + SetSpeechVocabularyActionResult(): + 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 "naoqi_bridge_msgs/SetSpeechVocabularyActionResult"; }; + virtual const char * getMD5() override { return "0698ce25b2d595b82357c010557e935f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyFeedback.h new file mode 100644 index 000000000..66e0ce14a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_SetSpeechVocabularyFeedback_h +#define _ROS_naoqi_bridge_msgs_SetSpeechVocabularyFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class SetSpeechVocabularyFeedback : public ros::Msg + { + public: + + SetSpeechVocabularyFeedback() + { + } + + 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 "naoqi_bridge_msgs/SetSpeechVocabularyFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyGoal.h new file mode 100644 index 000000000..8bc8624e4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyGoal.h @@ -0,0 +1,75 @@ +#ifndef _ROS_naoqi_bridge_msgs_SetSpeechVocabularyGoal_h +#define _ROS_naoqi_bridge_msgs_SetSpeechVocabularyGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class SetSpeechVocabularyGoal : public ros::Msg + { + public: + uint32_t words_length; + typedef char* _words_type; + _words_type st_words; + _words_type * words; + + SetSpeechVocabularyGoal(): + words_length(0), st_words(), words(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->words_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->words_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->words_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->words_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->words_length); + for( uint32_t i = 0; i < words_length; i++){ + uint32_t length_wordsi = strlen(this->words[i]); + varToArr(outbuffer + offset, length_wordsi); + offset += 4; + memcpy(outbuffer + offset, this->words[i], length_wordsi); + offset += length_wordsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t words_lengthT = ((uint32_t) (*(inbuffer + offset))); + words_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + words_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + words_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->words_length); + if(words_lengthT > words_length) + this->words = (char**)realloc(this->words, words_lengthT * sizeof(char*)); + words_length = words_lengthT; + for( uint32_t i = 0; i < words_length; i++){ + uint32_t length_st_words; + arrToVar(length_st_words, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_words; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_words-1]=0; + this->st_words = (char *)(inbuffer + offset-1); + offset += length_st_words; + memcpy( &(this->words[i]), &(this->st_words), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/SetSpeechVocabularyGoal"; }; + virtual const char * getMD5() override { return "2bd0e7dd008cf8f52a5113ba090403b7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyResult.h new file mode 100644 index 000000000..2b9ea8878 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetSpeechVocabularyResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_SetSpeechVocabularyResult_h +#define _ROS_naoqi_bridge_msgs_SetSpeechVocabularyResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class SetSpeechVocabularyResult : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + SetSpeechVocabularyResult(): + 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 "naoqi_bridge_msgs/SetSpeechVocabularyResult"; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetString.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetString.h new file mode 100644 index 000000000..02c430ddb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetString.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_SetString_h +#define _ROS_SERVICE_SetString_h +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + +static const char SETSTRING[] = "naoqi_bridge_msgs/SetString"; + + class SetStringRequest : public ros::Msg + { + public: + typedef const char* _data_type; + _data_type data; + + SetStringRequest(): + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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; + 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 SETSTRING; }; + virtual const char * getMD5() override { return "992ce8a1687cec8c8bd883ec73ca41d1"; }; + + }; + + class SetStringResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + SetStringResponse(): + 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 SETSTRING; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SetString { + public: + typedef SetStringRequest Request; + typedef SetStringResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetTransform.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetTransform.h new file mode 100644 index 000000000..64902da06 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SetTransform.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_SetTransform_h +#define _ROS_SERVICE_SetTransform_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Transform.h" + +namespace naoqi_bridge_msgs +{ + +static const char SETTRANSFORM[] = "naoqi_bridge_msgs/SetTransform"; + + class SetTransformRequest : public ros::Msg + { + public: + typedef geometry_msgs::Transform _offset_type; + _offset_type offset; + + SetTransformRequest(): + offset() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->offset.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->offset.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETTRANSFORM; }; + virtual const char * getMD5() override { return "67035ddf415a9bb64191f0e45b060e35"; }; + + }; + + class SetTransformResponse : public ros::Msg + { + public: + + SetTransformResponse() + { + } + + 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 SETTRANSFORM; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetTransform { + public: + typedef SetTransformRequest Request; + typedef SetTransformResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SoundLocated.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SoundLocated.h new file mode 100644 index 000000000..f560c12c9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SoundLocated.h @@ -0,0 +1,75 @@ +#ifndef _ROS_naoqi_bridge_msgs_SoundLocated_h +#define _ROS_naoqi_bridge_msgs_SoundLocated_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Twist.h" + +namespace naoqi_bridge_msgs +{ + + class SoundLocated : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _azimuth_type; + _azimuth_type azimuth; + typedef float _elevation_type; + _elevation_type elevation; + typedef float _confidence_type; + _confidence_type confidence; + typedef float _energy_type; + _energy_type energy; + typedef geometry_msgs::Twist _head_position_frame_torso_type; + _head_position_frame_torso_type head_position_frame_torso; + typedef geometry_msgs::Twist _head_position_frame_robot_type; + _head_position_frame_robot_type head_position_frame_robot; + + SoundLocated(): + header(), + azimuth(0), + elevation(0), + confidence(0), + energy(0), + head_position_frame_torso(), + head_position_frame_robot() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->azimuth); + offset += serializeAvrFloat64(outbuffer + offset, this->elevation); + offset += serializeAvrFloat64(outbuffer + offset, this->confidence); + offset += serializeAvrFloat64(outbuffer + offset, this->energy); + offset += this->head_position_frame_torso.serialize(outbuffer + offset); + offset += this->head_position_frame_robot.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->azimuth)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->elevation)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->confidence)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->energy)); + offset += this->head_position_frame_torso.deserialize(inbuffer + offset); + offset += this->head_position_frame_robot.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/SoundLocated"; }; + virtual const char * getMD5() override { return "884a2810157403bbdabfb1011c851b42"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackAction.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackAction.h new file mode 100644 index 000000000..e68af6903 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_SpeechWithFeedbackAction_h +#define _ROS_naoqi_bridge_msgs_SpeechWithFeedbackAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "naoqi_bridge_msgs/SpeechWithFeedbackActionGoal.h" +#include "naoqi_bridge_msgs/SpeechWithFeedbackActionResult.h" +#include "naoqi_bridge_msgs/SpeechWithFeedbackActionFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class SpeechWithFeedbackAction : public ros::Msg + { + public: + typedef naoqi_bridge_msgs::SpeechWithFeedbackActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef naoqi_bridge_msgs::SpeechWithFeedbackActionResult _action_result_type; + _action_result_type action_result; + typedef naoqi_bridge_msgs::SpeechWithFeedbackActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + SpeechWithFeedbackAction(): + 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 "naoqi_bridge_msgs/SpeechWithFeedbackAction"; }; + virtual const char * getMD5() override { return "3a7530648ec5a63553b8765e8b88e951"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionFeedback.h new file mode 100644 index 000000000..c9bebe5d5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_SpeechWithFeedbackActionFeedback_h +#define _ROS_naoqi_bridge_msgs_SpeechWithFeedbackActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/SpeechWithFeedbackFeedback.h" + +namespace naoqi_bridge_msgs +{ + + class SpeechWithFeedbackActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::SpeechWithFeedbackFeedback _feedback_type; + _feedback_type feedback; + + SpeechWithFeedbackActionFeedback(): + 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 "naoqi_bridge_msgs/SpeechWithFeedbackActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionGoal.h new file mode 100644 index 000000000..ad241bbc5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_SpeechWithFeedbackActionGoal_h +#define _ROS_naoqi_bridge_msgs_SpeechWithFeedbackActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "naoqi_bridge_msgs/SpeechWithFeedbackGoal.h" + +namespace naoqi_bridge_msgs +{ + + class SpeechWithFeedbackActionGoal : 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 naoqi_bridge_msgs::SpeechWithFeedbackGoal _goal_type; + _goal_type goal; + + SpeechWithFeedbackActionGoal(): + 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 "naoqi_bridge_msgs/SpeechWithFeedbackActionGoal"; }; + virtual const char * getMD5() override { return "5d34431dc14f96985d41d1835bc895fe"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionResult.h new file mode 100644 index 000000000..87afbc6ec --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_naoqi_bridge_msgs_SpeechWithFeedbackActionResult_h +#define _ROS_naoqi_bridge_msgs_SpeechWithFeedbackActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "naoqi_bridge_msgs/SpeechWithFeedbackResult.h" + +namespace naoqi_bridge_msgs +{ + + class SpeechWithFeedbackActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef naoqi_bridge_msgs::SpeechWithFeedbackResult _result_type; + _result_type result; + + SpeechWithFeedbackActionResult(): + 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 "naoqi_bridge_msgs/SpeechWithFeedbackActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackFeedback.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackFeedback.h new file mode 100644 index 000000000..3127bbf19 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_SpeechWithFeedbackFeedback_h +#define _ROS_naoqi_bridge_msgs_SpeechWithFeedbackFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class SpeechWithFeedbackFeedback : public ros::Msg + { + public: + + SpeechWithFeedbackFeedback() + { + } + + 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 "naoqi_bridge_msgs/SpeechWithFeedbackFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackGoal.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackGoal.h new file mode 100644 index 000000000..b49d3d540 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackGoal.h @@ -0,0 +1,55 @@ +#ifndef _ROS_naoqi_bridge_msgs_SpeechWithFeedbackGoal_h +#define _ROS_naoqi_bridge_msgs_SpeechWithFeedbackGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class SpeechWithFeedbackGoal : public ros::Msg + { + public: + typedef const char* _say_type; + _say_type say; + + SpeechWithFeedbackGoal(): + say("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_say = strlen(this->say); + varToArr(outbuffer + offset, length_say); + offset += 4; + memcpy(outbuffer + offset, this->say, length_say); + offset += length_say; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_say; + arrToVar(length_say, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_say; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_say-1]=0; + this->say = (char *)(inbuffer + offset-1); + offset += length_say; + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/SpeechWithFeedbackGoal"; }; + virtual const char * getMD5() override { return "331898fd34308d7c3706d43ca7f6e377"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackResult.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackResult.h new file mode 100644 index 000000000..e24d5aed9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/SpeechWithFeedbackResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_naoqi_bridge_msgs_SpeechWithFeedbackResult_h +#define _ROS_naoqi_bridge_msgs_SpeechWithFeedbackResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class SpeechWithFeedbackResult : public ros::Msg + { + public: + + SpeechWithFeedbackResult() + { + } + + 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 "naoqi_bridge_msgs/SpeechWithFeedbackResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StatusChangeStamped.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StatusChangeStamped.h new file mode 100644 index 000000000..375717826 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StatusChangeStamped.h @@ -0,0 +1,75 @@ +#ifndef _ROS_naoqi_bridge_msgs_StatusChangeStamped_h +#define _ROS_naoqi_bridge_msgs_StatusChangeStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "std_msgs/String.h" + +namespace naoqi_bridge_msgs +{ + + class StatusChangeStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int16_t _recharge_type_type; + _recharge_type_type recharge_type; + typedef std_msgs::String _old_status_type; + _old_status_type old_status; + typedef std_msgs::String _new_status_type; + _new_status_type new_status; + + StatusChangeStamped(): + header(), + recharge_type(0), + old_status(), + new_status() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int16_t real; + uint16_t base; + } u_recharge_type; + u_recharge_type.real = this->recharge_type; + *(outbuffer + offset + 0) = (u_recharge_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_recharge_type.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->recharge_type); + offset += this->old_status.serialize(outbuffer + offset); + offset += this->new_status.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int16_t real; + uint16_t base; + } u_recharge_type; + u_recharge_type.base = 0; + u_recharge_type.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_recharge_type.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->recharge_type = u_recharge_type.real; + offset += sizeof(this->recharge_type); + offset += this->old_status.deserialize(inbuffer + offset); + offset += this->new_status.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/StatusChangeStamped"; }; + virtual const char * getMD5() override { return "631ab2246eca82d839e3a99b76567775"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StringArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StringArrayStamped.h new file mode 100644 index 000000000..dd14aee15 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StringArrayStamped.h @@ -0,0 +1,81 @@ +#ifndef _ROS_naoqi_bridge_msgs_StringArrayStamped_h +#define _ROS_naoqi_bridge_msgs_StringArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace naoqi_bridge_msgs +{ + + class StringArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t data_length; + typedef char* _data_type; + _data_type st_data; + _data_type * data; + + StringArrayStamped(): + 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++){ + uint32_t length_datai = strlen(this->data[i]); + varToArr(outbuffer + offset, length_datai); + offset += 4; + memcpy(outbuffer + offset, this->data[i], length_datai); + offset += length_datai; + } + 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 = (char**)realloc(this->data, data_lengthT * sizeof(char*)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + uint32_t length_st_data; + arrToVar(length_st_data, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_data-1]=0; + this->st_data = (char *)(inbuffer + offset-1); + offset += length_st_data; + memcpy( &(this->data[i]), &(this->st_data), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/StringArrayStamped"; }; + virtual const char * getMD5() override { return "17b6e4aa81015d95bcd2b08039bd6bda"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StringStamped.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StringStamped.h new file mode 100644 index 000000000..4f7331252 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/StringStamped.h @@ -0,0 +1,61 @@ +#ifndef _ROS_naoqi_bridge_msgs_StringStamped_h +#define _ROS_naoqi_bridge_msgs_StringStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace naoqi_bridge_msgs +{ + + class StringStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _data_type; + _data_type data; + + StringStamped(): + 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 "naoqi_bridge_msgs/StringStamped"; }; + virtual const char * getMD5() override { return "c99a9440709e4d4a9716d55b8270d5e7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/TangentialSecurityDistance.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/TangentialSecurityDistance.h new file mode 100644 index 000000000..355b2f417 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/TangentialSecurityDistance.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_TangentialSecurityDistance_h +#define _ROS_SERVICE_TangentialSecurityDistance_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Float32.h" + +namespace naoqi_bridge_msgs +{ + +static const char TANGENTIALSECURITYDISTANCE[] = "naoqi_bridge_msgs/TangentialSecurityDistance"; + + class TangentialSecurityDistanceRequest : public ros::Msg + { + public: + typedef std_msgs::Float32 _tangential_distance_type; + _tangential_distance_type tangential_distance; + + TangentialSecurityDistanceRequest(): + tangential_distance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->tangential_distance.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->tangential_distance.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return TANGENTIALSECURITYDISTANCE; }; + virtual const char * getMD5() override { return "b07653f2626a354d4219619fffc76403"; }; + + }; + + class TangentialSecurityDistanceResponse : public ros::Msg + { + public: + + TangentialSecurityDistanceResponse() + { + } + + 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 TANGENTIALSECURITYDISTANCE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TangentialSecurityDistance { + public: + typedef TangentialSecurityDistanceRequest Request; + typedef TangentialSecurityDistanceResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/WordRecognized.h b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/WordRecognized.h new file mode 100644 index 000000000..8778a8a9e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/naoqi_bridge_msgs/WordRecognized.h @@ -0,0 +1,119 @@ +#ifndef _ROS_naoqi_bridge_msgs_WordRecognized_h +#define _ROS_naoqi_bridge_msgs_WordRecognized_h + +#include +#include +#include +#include "ros/msg.h" + +namespace naoqi_bridge_msgs +{ + + class WordRecognized : public ros::Msg + { + public: + uint32_t words_length; + typedef char* _words_type; + _words_type st_words; + _words_type * words; + uint32_t confidence_values_length; + typedef float _confidence_values_type; + _confidence_values_type st_confidence_values; + _confidence_values_type * confidence_values; + + WordRecognized(): + words_length(0), st_words(), words(nullptr), + confidence_values_length(0), st_confidence_values(), confidence_values(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->words_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->words_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->words_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->words_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->words_length); + for( uint32_t i = 0; i < words_length; i++){ + uint32_t length_wordsi = strlen(this->words[i]); + varToArr(outbuffer + offset, length_wordsi); + offset += 4; + memcpy(outbuffer + offset, this->words[i], length_wordsi); + offset += length_wordsi; + } + *(outbuffer + offset + 0) = (this->confidence_values_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->confidence_values_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->confidence_values_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->confidence_values_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidence_values_length); + for( uint32_t i = 0; i < confidence_values_length; i++){ + union { + float real; + uint32_t base; + } u_confidence_valuesi; + u_confidence_valuesi.real = this->confidence_values[i]; + *(outbuffer + offset + 0) = (u_confidence_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_confidence_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_confidence_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_confidence_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidence_values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t words_lengthT = ((uint32_t) (*(inbuffer + offset))); + words_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + words_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + words_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->words_length); + if(words_lengthT > words_length) + this->words = (char**)realloc(this->words, words_lengthT * sizeof(char*)); + words_length = words_lengthT; + for( uint32_t i = 0; i < words_length; i++){ + uint32_t length_st_words; + arrToVar(length_st_words, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_words; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_words-1]=0; + this->st_words = (char *)(inbuffer + offset-1); + offset += length_st_words; + memcpy( &(this->words[i]), &(this->st_words), sizeof(char*)); + } + uint32_t confidence_values_lengthT = ((uint32_t) (*(inbuffer + offset))); + confidence_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + confidence_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + confidence_values_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->confidence_values_length); + if(confidence_values_lengthT > confidence_values_length) + this->confidence_values = (float*)realloc(this->confidence_values, confidence_values_lengthT * sizeof(float)); + confidence_values_length = confidence_values_lengthT; + for( uint32_t i = 0; i < confidence_values_length; i++){ + union { + float real; + uint32_t base; + } u_st_confidence_values; + u_st_confidence_values.base = 0; + u_st_confidence_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_confidence_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_confidence_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_confidence_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_confidence_values = u_st_confidence_values.real; + offset += sizeof(this->st_confidence_values); + memcpy( &(this->confidence_values[i]), &(this->st_confidence_values), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "naoqi_bridge_msgs/WordRecognized"; }; + virtual const char * getMD5() override { return "29134437cd61021f75f35f21b72b7eab"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMap.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMap.h new file mode 100644 index 000000000..8b67e9223 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMap.h @@ -0,0 +1,76 @@ +#ifndef _ROS_SERVICE_GetMap_h +#define _ROS_SERVICE_GetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + +static const char GETMAP[] = "nav_msgs/GetMap"; + + class GetMapRequest : public ros::Msg + { + public: + + GetMapRequest() + { + } + + 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 GETMAP; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetMapResponse : public ros::Msg + { + public: + typedef nav_msgs::OccupancyGrid _map_type; + _map_type map; + + GetMapResponse(): + 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 GETMAP; }; + virtual const char * getMD5() override { return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + + class GetMap { + public: + typedef GetMapRequest Request; + typedef GetMapResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapAction.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapAction.h new file mode 100644 index 000000000..2d43e0fdd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_nav_msgs_GetMapAction_h +#define _ROS_nav_msgs_GetMapAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/GetMapActionGoal.h" +#include "nav_msgs/GetMapActionResult.h" +#include "nav_msgs/GetMapActionFeedback.h" + +namespace nav_msgs +{ + + class GetMapAction : public ros::Msg + { + public: + typedef nav_msgs::GetMapActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef nav_msgs::GetMapActionResult _action_result_type; + _action_result_type action_result; + typedef nav_msgs::GetMapActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + GetMapAction(): + 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 "nav_msgs/GetMapAction"; }; + virtual const char * getMD5() override { return "e611ad23fbf237c031b7536416dc7cd7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionFeedback.h new file mode 100644 index 000000000..4c9d50978 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_nav_msgs_GetMapActionFeedback_h +#define _ROS_nav_msgs_GetMapActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "nav_msgs/GetMapFeedback.h" + +namespace nav_msgs +{ + + class GetMapActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef nav_msgs::GetMapFeedback _feedback_type; + _feedback_type feedback; + + GetMapActionFeedback(): + 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 "nav_msgs/GetMapActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionGoal.h new file mode 100644 index 000000000..e5295fcae --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_nav_msgs_GetMapActionGoal_h +#define _ROS_nav_msgs_GetMapActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "nav_msgs/GetMapGoal.h" + +namespace nav_msgs +{ + + class GetMapActionGoal : 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 nav_msgs::GetMapGoal _goal_type; + _goal_type goal; + + GetMapActionGoal(): + 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 "nav_msgs/GetMapActionGoal"; }; + virtual const char * getMD5() override { return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionResult.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionResult.h new file mode 100644 index 000000000..6bc705abd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_nav_msgs_GetMapActionResult_h +#define _ROS_nav_msgs_GetMapActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "nav_msgs/GetMapResult.h" + +namespace nav_msgs +{ + + class GetMapActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef nav_msgs::GetMapResult _result_type; + _result_type result; + + GetMapActionResult(): + 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 "nav_msgs/GetMapActionResult"; }; + virtual const char * getMD5() override { return "ac66e5b9a79bb4bbd33dab245236c892"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapFeedback.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapFeedback.h new file mode 100644 index 000000000..1c01027d7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_nav_msgs_GetMapFeedback_h +#define _ROS_nav_msgs_GetMapFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nav_msgs +{ + + class GetMapFeedback : public ros::Msg + { + public: + + GetMapFeedback() + { + } + + 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 "nav_msgs/GetMapFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapGoal.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapGoal.h new file mode 100644 index 000000000..322c3aaaf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_nav_msgs_GetMapGoal_h +#define _ROS_nav_msgs_GetMapGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nav_msgs +{ + + class GetMapGoal : public ros::Msg + { + public: + + GetMapGoal() + { + } + + 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 "nav_msgs/GetMapGoal"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapResult.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapResult.h new file mode 100644 index 000000000..8648d8856 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetMapResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_nav_msgs_GetMapResult_h +#define _ROS_nav_msgs_GetMapResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + + class GetMapResult : public ros::Msg + { + public: + typedef nav_msgs::OccupancyGrid _map_type; + _map_type map; + + GetMapResult(): + 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 "nav_msgs/GetMapResult"; }; + virtual const char * getMD5() override { return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetPlan.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetPlan.h new file mode 100644 index 000000000..7a15207ba --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GetPlan.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_GetPlan_h +#define _ROS_SERVICE_GetPlan_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "nav_msgs/Path.h" + +namespace nav_msgs +{ + +static const char GETPLAN[] = "nav_msgs/GetPlan"; + + class GetPlanRequest : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _start_type; + _start_type start; + typedef geometry_msgs::PoseStamped _goal_type; + _goal_type goal; + typedef float _tolerance_type; + _tolerance_type tolerance; + + GetPlanRequest(): + start(), + goal(), + tolerance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->start.serialize(outbuffer + offset); + 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; + offset += this->start.deserialize(inbuffer + offset); + 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 "e25a43e0752bcca599a8c2eef8282df8"; }; + + }; + + class GetPlanResponse : public ros::Msg + { + public: + typedef nav_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 "0002bc113c0259d71f6cf8cbc9430e18"; }; + + }; + + class GetPlan { + public: + typedef GetPlanRequest Request; + typedef GetPlanResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GridCells.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GridCells.h new file mode 100644 index 000000000..fee31c11e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/GridCells.h @@ -0,0 +1,118 @@ +#ifndef _ROS_nav_msgs_GridCells_h +#define _ROS_nav_msgs_GridCells_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace nav_msgs +{ + + class GridCells : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _cell_width_type; + _cell_width_type cell_width; + typedef float _cell_height_type; + _cell_height_type cell_height; + uint32_t cells_length; + typedef geometry_msgs::Point _cells_type; + _cells_type st_cells; + _cells_type * cells; + + GridCells(): + header(), + cell_width(0), + cell_height(0), + cells_length(0), st_cells(), cells(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_cell_width; + u_cell_width.real = this->cell_width; + *(outbuffer + offset + 0) = (u_cell_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_width); + union { + float real; + uint32_t base; + } u_cell_height; + u_cell_height.real = this->cell_height; + *(outbuffer + offset + 0) = (u_cell_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_height); + *(outbuffer + offset + 0) = (this->cells_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cells_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cells_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cells_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cells_length); + for( uint32_t i = 0; i < cells_length; i++){ + offset += this->cells[i].serialize(outbuffer + offset); + } + 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_cell_width; + u_cell_width.base = 0; + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cell_width = u_cell_width.real; + offset += sizeof(this->cell_width); + union { + float real; + uint32_t base; + } u_cell_height; + u_cell_height.base = 0; + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cell_height = u_cell_height.real; + offset += sizeof(this->cell_height); + uint32_t cells_lengthT = ((uint32_t) (*(inbuffer + offset))); + cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cells_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cells_length); + if(cells_lengthT > cells_length) + this->cells = (geometry_msgs::Point*)realloc(this->cells, cells_lengthT * sizeof(geometry_msgs::Point)); + cells_length = cells_lengthT; + for( uint32_t i = 0; i < cells_length; i++){ + offset += this->st_cells.deserialize(inbuffer + offset); + memcpy( &(this->cells[i]), &(this->st_cells), sizeof(geometry_msgs::Point)); + } + return offset; + } + + virtual const char * getType() override { return "nav_msgs/GridCells"; }; + virtual const char * getMD5() override { return "b9e4f5df6d28e272ebde00a3994830f5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/LoadMap.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/LoadMap.h new file mode 100644 index 000000000..db1827948 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/LoadMap.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_LoadMap_h +#define _ROS_SERVICE_LoadMap_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + +static const char LOADMAP[] = "nav_msgs/LoadMap"; + + class LoadMapRequest : public ros::Msg + { + public: + typedef const char* _map_url_type; + _map_url_type map_url; + + LoadMapRequest(): + map_url("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_map_url = strlen(this->map_url); + varToArr(outbuffer + offset, length_map_url); + offset += 4; + memcpy(outbuffer + offset, this->map_url, length_map_url); + offset += length_map_url; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_map_url; + arrToVar(length_map_url, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_map_url; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_map_url-1]=0; + this->map_url = (char *)(inbuffer + offset-1); + offset += length_map_url; + return offset; + } + + virtual const char * getType() override { return LOADMAP; }; + virtual const char * getMD5() override { return "3813ba1ae85fbcd4dc88c90f1426b90b"; }; + + }; + + class LoadMapResponse : public ros::Msg + { + public: + typedef nav_msgs::OccupancyGrid _map_type; + _map_type map; + typedef uint8_t _result_type; + _result_type result; + enum { RESULT_SUCCESS = 0 }; + enum { RESULT_MAP_DOES_NOT_EXIST = 1 }; + enum { RESULT_INVALID_MAP_DATA = 2 }; + enum { RESULT_INVALID_MAP_METADATA = 3 }; + enum { RESULT_UNDEFINED_FAILURE = 255 }; + + LoadMapResponse(): + map(), + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->result >> (8 * 0)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + this->result = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->result); + return offset; + } + + virtual const char * getType() override { return LOADMAP; }; + virtual const char * getMD5() override { return "079b9c828e9f7c1918bf86932fd7267e"; }; + + }; + + class LoadMap { + public: + typedef LoadMapRequest Request; + typedef LoadMapResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/MapMetaData.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/MapMetaData.h new file mode 100644 index 000000000..77f6ff947 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/MapMetaData.h @@ -0,0 +1,118 @@ +#ifndef _ROS_nav_msgs_MapMetaData_h +#define _ROS_nav_msgs_MapMetaData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "geometry_msgs/Pose.h" + +namespace nav_msgs +{ + + class MapMetaData : public ros::Msg + { + public: + typedef ros::Time _map_load_time_type; + _map_load_time_type map_load_time; + typedef float _resolution_type; + _resolution_type resolution; + typedef uint32_t _width_type; + _width_type width; + typedef uint32_t _height_type; + _height_type height; + typedef geometry_msgs::Pose _origin_type; + _origin_type origin; + + MapMetaData(): + map_load_time(), + resolution(0), + width(0), + height(0), + origin() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->map_load_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->map_load_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->map_load_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->map_load_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.sec); + *(outbuffer + offset + 0) = (this->map_load_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->map_load_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->map_load_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->map_load_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.nsec); + 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); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + offset += this->origin.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->map_load_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->map_load_time.sec); + this->map_load_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->map_load_time.nsec); + 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); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + offset += this->origin.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "nav_msgs/MapMetaData"; }; + virtual const char * getMD5() override { return "10cfc8a2818024d3248802c00c95f11b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/OccupancyGrid.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/OccupancyGrid.h new file mode 100644 index 000000000..3f74f70dc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/OccupancyGrid.h @@ -0,0 +1,88 @@ +#ifndef _ROS_nav_msgs_OccupancyGrid_h +#define _ROS_nav_msgs_OccupancyGrid_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "nav_msgs/MapMetaData.h" + +namespace nav_msgs +{ + + class OccupancyGrid : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef nav_msgs::MapMetaData _info_type; + _info_type info; + uint32_t data_length; + typedef int8_t _data_type; + _data_type st_data; + _data_type * data; + + OccupancyGrid(): + header(), + info(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->info.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 { + 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); + offset += this->info.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 = (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 "nav_msgs/OccupancyGrid"; }; + virtual const char * getMD5() override { return "3381f2d731d4076ec5c71b0759edbe4e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/Odometry.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/Odometry.h new file mode 100644 index 000000000..d013330c5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/Odometry.h @@ -0,0 +1,73 @@ +#ifndef _ROS_nav_msgs_Odometry_h +#define _ROS_nav_msgs_Odometry_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace nav_msgs +{ + + class Odometry : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _child_frame_id_type; + _child_frame_id_type child_frame_id; + typedef geometry_msgs::PoseWithCovariance _pose_type; + _pose_type pose; + typedef geometry_msgs::TwistWithCovariance _twist_type; + _twist_type twist; + + Odometry(): + header(), + child_frame_id(""), + pose(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen(this->child_frame_id); + varToArr(outbuffer + offset, length_child_frame_id); + offset += 4; + memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id); + offset += length_child_frame_id; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + arrToVar(length_child_frame_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame_id-1]=0; + this->child_frame_id = (char *)(inbuffer + offset-1); + offset += length_child_frame_id; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "nav_msgs/Odometry"; }; + virtual const char * getMD5() override { return "cd5e73d190d741a2f92e81eda573aca7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/Path.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/Path.h new file mode 100644 index 000000000..32313545b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/Path.h @@ -0,0 +1,70 @@ +#ifndef _ROS_nav_msgs_Path_h +#define _ROS_nav_msgs_Path_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseStamped.h" + +namespace nav_msgs +{ + + class Path : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t poses_length; + typedef geometry_msgs::PoseStamped _poses_type; + _poses_type st_poses; + _poses_type * poses; + + Path(): + 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 = (geometry_msgs::PoseStamped*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::PoseStamped)); + 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::PoseStamped)); + } + return offset; + } + + virtual const char * getType() override { return "nav_msgs/Path"; }; + virtual const char * getMD5() override { return "6227e2b7e9cce15051f669a5e197bbf7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nav_msgs/SetMap.h b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/SetMap.h new file mode 100644 index 000000000..f829f8c64 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nav_msgs/SetMap.h @@ -0,0 +1,100 @@ +#ifndef _ROS_SERVICE_SetMap_h +#define _ROS_SERVICE_SetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseWithCovarianceStamped.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + +static const char SETMAP[] = "nav_msgs/SetMap"; + + class SetMapRequest : public ros::Msg + { + public: + typedef nav_msgs::OccupancyGrid _map_type; + _map_type map; + typedef geometry_msgs::PoseWithCovarianceStamped _initial_pose_type; + _initial_pose_type initial_pose; + + SetMapRequest(): + map(), + initial_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + offset += this->initial_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + offset += this->initial_pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETMAP; }; + virtual const char * getMD5() override { return "91149a20d7be299b87c340df8cc94fd4"; }; + + }; + + class SetMapResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + SetMapResponse(): + 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 SETMAP; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SetMap { + public: + typedef SetMapRequest Request; + typedef SetMapResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/navfn/MakeNavPlan.h b/smart_device_protocol/ros_lib/ros_lib/navfn/MakeNavPlan.h new file mode 100644 index 000000000..fe9661c83 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/navfn/SetCostmap.h b/smart_device_protocol/ros_lib/ros_lib/navfn/SetCostmap.h new file mode 100644 index 000000000..7646f6efe --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgga.h b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgga.h new file mode 100644 index 000000000..01efb6ddd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgga.h @@ -0,0 +1,272 @@ +#ifndef _ROS_nmea_msgs_Gpgga_h +#define _ROS_nmea_msgs_Gpgga_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace nmea_msgs +{ + + class Gpgga : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _message_id_type; + _message_id_type message_id; + typedef float _utc_seconds_type; + _utc_seconds_type utc_seconds; + typedef float _lat_type; + _lat_type lat; + typedef float _lon_type; + _lon_type lon; + typedef const char* _lat_dir_type; + _lat_dir_type lat_dir; + typedef const char* _lon_dir_type; + _lon_dir_type lon_dir; + typedef uint32_t _gps_qual_type; + _gps_qual_type gps_qual; + typedef uint32_t _num_sats_type; + _num_sats_type num_sats; + typedef float _hdop_type; + _hdop_type hdop; + typedef float _alt_type; + _alt_type alt; + typedef const char* _altitude_units_type; + _altitude_units_type altitude_units; + typedef float _undulation_type; + _undulation_type undulation; + typedef const char* _undulation_units_type; + _undulation_units_type undulation_units; + typedef uint32_t _diff_age_type; + _diff_age_type diff_age; + typedef const char* _station_id_type; + _station_id_type station_id; + + Gpgga(): + header(), + message_id(""), + utc_seconds(0), + lat(0), + lon(0), + lat_dir(""), + lon_dir(""), + gps_qual(0), + num_sats(0), + hdop(0), + alt(0), + altitude_units(""), + undulation(0), + undulation_units(""), + diff_age(0), + station_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_message_id = strlen(this->message_id); + varToArr(outbuffer + offset, length_message_id); + offset += 4; + memcpy(outbuffer + offset, this->message_id, length_message_id); + offset += length_message_id; + offset += serializeAvrFloat64(outbuffer + offset, this->utc_seconds); + offset += serializeAvrFloat64(outbuffer + offset, this->lat); + offset += serializeAvrFloat64(outbuffer + offset, this->lon); + uint32_t length_lat_dir = strlen(this->lat_dir); + varToArr(outbuffer + offset, length_lat_dir); + offset += 4; + memcpy(outbuffer + offset, this->lat_dir, length_lat_dir); + offset += length_lat_dir; + uint32_t length_lon_dir = strlen(this->lon_dir); + varToArr(outbuffer + offset, length_lon_dir); + offset += 4; + memcpy(outbuffer + offset, this->lon_dir, length_lon_dir); + offset += length_lon_dir; + *(outbuffer + offset + 0) = (this->gps_qual >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->gps_qual >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->gps_qual >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->gps_qual >> (8 * 3)) & 0xFF; + offset += sizeof(this->gps_qual); + *(outbuffer + offset + 0) = (this->num_sats >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->num_sats >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->num_sats >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->num_sats >> (8 * 3)) & 0xFF; + offset += sizeof(this->num_sats); + 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_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); + uint32_t length_altitude_units = strlen(this->altitude_units); + varToArr(outbuffer + offset, length_altitude_units); + offset += 4; + memcpy(outbuffer + offset, this->altitude_units, length_altitude_units); + offset += length_altitude_units; + union { + float real; + uint32_t base; + } u_undulation; + u_undulation.real = this->undulation; + *(outbuffer + offset + 0) = (u_undulation.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_undulation.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_undulation.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_undulation.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->undulation); + uint32_t length_undulation_units = strlen(this->undulation_units); + varToArr(outbuffer + offset, length_undulation_units); + offset += 4; + memcpy(outbuffer + offset, this->undulation_units, length_undulation_units); + offset += length_undulation_units; + *(outbuffer + offset + 0) = (this->diff_age >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->diff_age >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->diff_age >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->diff_age >> (8 * 3)) & 0xFF; + offset += sizeof(this->diff_age); + uint32_t length_station_id = strlen(this->station_id); + varToArr(outbuffer + offset, length_station_id); + offset += 4; + memcpy(outbuffer + offset, this->station_id, length_station_id); + offset += length_station_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_message_id; + arrToVar(length_message_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message_id-1]=0; + this->message_id = (char *)(inbuffer + offset-1); + offset += length_message_id; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->utc_seconds)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lat)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lon)); + uint32_t length_lat_dir; + arrToVar(length_lat_dir, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_lat_dir; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_lat_dir-1]=0; + this->lat_dir = (char *)(inbuffer + offset-1); + offset += length_lat_dir; + uint32_t length_lon_dir; + arrToVar(length_lon_dir, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_lon_dir; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_lon_dir-1]=0; + this->lon_dir = (char *)(inbuffer + offset-1); + offset += length_lon_dir; + this->gps_qual = ((uint32_t) (*(inbuffer + offset))); + this->gps_qual |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->gps_qual |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->gps_qual |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->gps_qual); + this->num_sats = ((uint32_t) (*(inbuffer + offset))); + this->num_sats |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->num_sats |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->num_sats |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->num_sats); + 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_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); + uint32_t length_altitude_units; + arrToVar(length_altitude_units, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_altitude_units; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_altitude_units-1]=0; + this->altitude_units = (char *)(inbuffer + offset-1); + offset += length_altitude_units; + union { + float real; + uint32_t base; + } u_undulation; + u_undulation.base = 0; + u_undulation.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_undulation.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_undulation.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_undulation.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->undulation = u_undulation.real; + offset += sizeof(this->undulation); + uint32_t length_undulation_units; + arrToVar(length_undulation_units, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_undulation_units; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_undulation_units-1]=0; + this->undulation_units = (char *)(inbuffer + offset-1); + offset += length_undulation_units; + this->diff_age = ((uint32_t) (*(inbuffer + offset))); + this->diff_age |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->diff_age |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->diff_age |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->diff_age); + uint32_t length_station_id; + arrToVar(length_station_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_station_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_station_id-1]=0; + this->station_id = (char *)(inbuffer + offset-1); + offset += length_station_id; + return offset; + } + + virtual const char * getType() override { return "nmea_msgs/Gpgga"; }; + virtual const char * getMD5() override { return "8f51cb504898f39d8ad9f698f0b6f9cd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgsa.h b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgsa.h new file mode 100644 index 000000000..cc9b0cdb1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgsa.h @@ -0,0 +1,184 @@ +#ifndef _ROS_nmea_msgs_Gpgsa_h +#define _ROS_nmea_msgs_Gpgsa_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace nmea_msgs +{ + + class Gpgsa : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _message_id_type; + _message_id_type message_id; + typedef const char* _auto_manual_mode_type; + _auto_manual_mode_type auto_manual_mode; + typedef uint8_t _fix_mode_type; + _fix_mode_type fix_mode; + uint32_t sv_ids_length; + typedef uint8_t _sv_ids_type; + _sv_ids_type st_sv_ids; + _sv_ids_type * sv_ids; + typedef float _pdop_type; + _pdop_type pdop; + typedef float _hdop_type; + _hdop_type hdop; + typedef float _vdop_type; + _vdop_type vdop; + + Gpgsa(): + header(), + message_id(""), + auto_manual_mode(""), + fix_mode(0), + sv_ids_length(0), st_sv_ids(), sv_ids(nullptr), + pdop(0), + hdop(0), + vdop(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_message_id = strlen(this->message_id); + varToArr(outbuffer + offset, length_message_id); + offset += 4; + memcpy(outbuffer + offset, this->message_id, length_message_id); + offset += length_message_id; + uint32_t length_auto_manual_mode = strlen(this->auto_manual_mode); + varToArr(outbuffer + offset, length_auto_manual_mode); + offset += 4; + memcpy(outbuffer + offset, this->auto_manual_mode, length_auto_manual_mode); + offset += length_auto_manual_mode; + *(outbuffer + offset + 0) = (this->fix_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->fix_mode); + *(outbuffer + offset + 0) = (this->sv_ids_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sv_ids_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sv_ids_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sv_ids_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->sv_ids_length); + for( uint32_t i = 0; i < sv_ids_length; i++){ + *(outbuffer + offset + 0) = (this->sv_ids[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->sv_ids[i]); + } + union { + float real; + uint32_t base; + } u_pdop; + u_pdop.real = this->pdop; + *(outbuffer + offset + 0) = (u_pdop.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_pdop.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_pdop.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_pdop.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->pdop); + 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); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_message_id; + arrToVar(length_message_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message_id-1]=0; + this->message_id = (char *)(inbuffer + offset-1); + offset += length_message_id; + uint32_t length_auto_manual_mode; + arrToVar(length_auto_manual_mode, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_auto_manual_mode; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_auto_manual_mode-1]=0; + this->auto_manual_mode = (char *)(inbuffer + offset-1); + offset += length_auto_manual_mode; + this->fix_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->fix_mode); + uint32_t sv_ids_lengthT = ((uint32_t) (*(inbuffer + offset))); + sv_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + sv_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + sv_ids_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sv_ids_length); + if(sv_ids_lengthT > sv_ids_length) + this->sv_ids = (uint8_t*)realloc(this->sv_ids, sv_ids_lengthT * sizeof(uint8_t)); + sv_ids_length = sv_ids_lengthT; + for( uint32_t i = 0; i < sv_ids_length; i++){ + this->st_sv_ids = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_sv_ids); + memcpy( &(this->sv_ids[i]), &(this->st_sv_ids), sizeof(uint8_t)); + } + union { + float real; + uint32_t base; + } u_pdop; + u_pdop.base = 0; + u_pdop.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_pdop.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_pdop.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_pdop.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->pdop = u_pdop.real; + offset += sizeof(this->pdop); + 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); + return offset; + } + + virtual const char * getType() override { return "nmea_msgs/Gpgsa"; }; + virtual const char * getMD5() override { return "94a6ef4a36d322374b16097a5d03433e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgsv.h b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgsv.h new file mode 100644 index 000000000..2163fa90d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gpgsv.h @@ -0,0 +1,108 @@ +#ifndef _ROS_nmea_msgs_Gpgsv_h +#define _ROS_nmea_msgs_Gpgsv_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "nmea_msgs/GpgsvSatellite.h" + +namespace nmea_msgs +{ + + class Gpgsv : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _message_id_type; + _message_id_type message_id; + typedef uint8_t _n_msgs_type; + _n_msgs_type n_msgs; + typedef uint8_t _msg_number_type; + _msg_number_type msg_number; + typedef uint8_t _n_satellites_type; + _n_satellites_type n_satellites; + uint32_t satellites_length; + typedef nmea_msgs::GpgsvSatellite _satellites_type; + _satellites_type st_satellites; + _satellites_type * satellites; + + Gpgsv(): + header(), + message_id(""), + n_msgs(0), + msg_number(0), + n_satellites(0), + satellites_length(0), st_satellites(), satellites(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_message_id = strlen(this->message_id); + varToArr(outbuffer + offset, length_message_id); + offset += 4; + memcpy(outbuffer + offset, this->message_id, length_message_id); + offset += length_message_id; + *(outbuffer + offset + 0) = (this->n_msgs >> (8 * 0)) & 0xFF; + offset += sizeof(this->n_msgs); + *(outbuffer + offset + 0) = (this->msg_number >> (8 * 0)) & 0xFF; + offset += sizeof(this->msg_number); + *(outbuffer + offset + 0) = (this->n_satellites >> (8 * 0)) & 0xFF; + offset += sizeof(this->n_satellites); + *(outbuffer + offset + 0) = (this->satellites_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->satellites_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->satellites_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->satellites_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->satellites_length); + for( uint32_t i = 0; i < satellites_length; i++){ + offset += this->satellites[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_message_id; + arrToVar(length_message_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message_id-1]=0; + this->message_id = (char *)(inbuffer + offset-1); + offset += length_message_id; + this->n_msgs = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->n_msgs); + this->msg_number = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->msg_number); + this->n_satellites = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->n_satellites); + uint32_t satellites_lengthT = ((uint32_t) (*(inbuffer + offset))); + satellites_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + satellites_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + satellites_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->satellites_length); + if(satellites_lengthT > satellites_length) + this->satellites = (nmea_msgs::GpgsvSatellite*)realloc(this->satellites, satellites_lengthT * sizeof(nmea_msgs::GpgsvSatellite)); + satellites_length = satellites_lengthT; + for( uint32_t i = 0; i < satellites_length; i++){ + offset += this->st_satellites.deserialize(inbuffer + offset); + memcpy( &(this->satellites[i]), &(this->st_satellites), sizeof(nmea_msgs::GpgsvSatellite)); + } + return offset; + } + + virtual const char * getType() override { return "nmea_msgs/Gpgsv"; }; + virtual const char * getMD5() override { return "6f34bebc32fe085313c942a96fd39c77"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/GpgsvSatellite.h b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/GpgsvSatellite.h new file mode 100644 index 000000000..d94b19e0b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/GpgsvSatellite.h @@ -0,0 +1,79 @@ +#ifndef _ROS_nmea_msgs_GpgsvSatellite_h +#define _ROS_nmea_msgs_GpgsvSatellite_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nmea_msgs +{ + + class GpgsvSatellite : public ros::Msg + { + public: + typedef uint8_t _prn_type; + _prn_type prn; + typedef uint8_t _elevation_type; + _elevation_type elevation; + typedef uint16_t _azimuth_type; + _azimuth_type azimuth; + typedef int8_t _snr_type; + _snr_type snr; + + GpgsvSatellite(): + prn(0), + elevation(0), + azimuth(0), + snr(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->prn >> (8 * 0)) & 0xFF; + offset += sizeof(this->prn); + *(outbuffer + offset + 0) = (this->elevation >> (8 * 0)) & 0xFF; + offset += sizeof(this->elevation); + *(outbuffer + offset + 0) = (this->azimuth >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->azimuth >> (8 * 1)) & 0xFF; + offset += sizeof(this->azimuth); + union { + int8_t real; + uint8_t base; + } u_snr; + u_snr.real = this->snr; + *(outbuffer + offset + 0) = (u_snr.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->snr); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->prn = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->prn); + this->elevation = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->elevation); + this->azimuth = ((uint16_t) (*(inbuffer + offset))); + this->azimuth |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->azimuth); + union { + int8_t real; + uint8_t base; + } u_snr; + u_snr.base = 0; + u_snr.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->snr = u_snr.real; + offset += sizeof(this->snr); + return offset; + } + + virtual const char * getType() override { return "nmea_msgs/GpgsvSatellite"; }; + virtual const char * getMD5() override { return "d862f2ce05a26a83264a8add99c7b668"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gprmc.h b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gprmc.h new file mode 100644 index 000000000..5c866584e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Gprmc.h @@ -0,0 +1,250 @@ +#ifndef _ROS_nmea_msgs_Gprmc_h +#define _ROS_nmea_msgs_Gprmc_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace nmea_msgs +{ + + class Gprmc : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _message_id_type; + _message_id_type message_id; + typedef float _utc_seconds_type; + _utc_seconds_type utc_seconds; + typedef const char* _position_status_type; + _position_status_type position_status; + typedef float _lat_type; + _lat_type lat; + typedef float _lon_type; + _lon_type lon; + typedef const char* _lat_dir_type; + _lat_dir_type lat_dir; + typedef const char* _lon_dir_type; + _lon_dir_type lon_dir; + typedef float _speed_type; + _speed_type speed; + typedef float _track_type; + _track_type track; + typedef const char* _date_type; + _date_type date; + typedef float _mag_var_type; + _mag_var_type mag_var; + typedef const char* _mag_var_direction_type; + _mag_var_direction_type mag_var_direction; + typedef const char* _mode_indicator_type; + _mode_indicator_type mode_indicator; + + Gprmc(): + header(), + message_id(""), + utc_seconds(0), + position_status(""), + lat(0), + lon(0), + lat_dir(""), + lon_dir(""), + speed(0), + track(0), + date(""), + mag_var(0), + mag_var_direction(""), + mode_indicator("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_message_id = strlen(this->message_id); + varToArr(outbuffer + offset, length_message_id); + offset += 4; + memcpy(outbuffer + offset, this->message_id, length_message_id); + offset += length_message_id; + offset += serializeAvrFloat64(outbuffer + offset, this->utc_seconds); + uint32_t length_position_status = strlen(this->position_status); + varToArr(outbuffer + offset, length_position_status); + offset += 4; + memcpy(outbuffer + offset, this->position_status, length_position_status); + offset += length_position_status; + offset += serializeAvrFloat64(outbuffer + offset, this->lat); + offset += serializeAvrFloat64(outbuffer + offset, this->lon); + uint32_t length_lat_dir = strlen(this->lat_dir); + varToArr(outbuffer + offset, length_lat_dir); + offset += 4; + memcpy(outbuffer + offset, this->lat_dir, length_lat_dir); + offset += length_lat_dir; + uint32_t length_lon_dir = strlen(this->lon_dir); + varToArr(outbuffer + offset, length_lon_dir); + offset += 4; + memcpy(outbuffer + offset, this->lon_dir, length_lon_dir); + offset += length_lon_dir; + union { + float real; + uint32_t base; + } u_speed; + u_speed.real = this->speed; + *(outbuffer + offset + 0) = (u_speed.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_speed.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_speed.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_speed.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->speed); + union { + float real; + uint32_t base; + } u_track; + u_track.real = this->track; + *(outbuffer + offset + 0) = (u_track.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_track.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_track.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_track.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->track); + uint32_t length_date = strlen(this->date); + varToArr(outbuffer + offset, length_date); + offset += 4; + memcpy(outbuffer + offset, this->date, length_date); + offset += length_date; + union { + float real; + uint32_t base; + } u_mag_var; + u_mag_var.real = this->mag_var; + *(outbuffer + offset + 0) = (u_mag_var.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_mag_var.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_mag_var.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_mag_var.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->mag_var); + uint32_t length_mag_var_direction = strlen(this->mag_var_direction); + varToArr(outbuffer + offset, length_mag_var_direction); + offset += 4; + memcpy(outbuffer + offset, this->mag_var_direction, length_mag_var_direction); + offset += length_mag_var_direction; + uint32_t length_mode_indicator = strlen(this->mode_indicator); + varToArr(outbuffer + offset, length_mode_indicator); + offset += 4; + memcpy(outbuffer + offset, this->mode_indicator, length_mode_indicator); + offset += length_mode_indicator; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_message_id; + arrToVar(length_message_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message_id-1]=0; + this->message_id = (char *)(inbuffer + offset-1); + offset += length_message_id; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->utc_seconds)); + uint32_t length_position_status; + arrToVar(length_position_status, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_position_status; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_position_status-1]=0; + this->position_status = (char *)(inbuffer + offset-1); + offset += length_position_status; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lat)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lon)); + uint32_t length_lat_dir; + arrToVar(length_lat_dir, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_lat_dir; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_lat_dir-1]=0; + this->lat_dir = (char *)(inbuffer + offset-1); + offset += length_lat_dir; + uint32_t length_lon_dir; + arrToVar(length_lon_dir, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_lon_dir; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_lon_dir-1]=0; + this->lon_dir = (char *)(inbuffer + offset-1); + offset += length_lon_dir; + union { + float real; + uint32_t base; + } u_speed; + u_speed.base = 0; + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_speed.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->speed = u_speed.real; + offset += sizeof(this->speed); + union { + float real; + uint32_t base; + } u_track; + u_track.base = 0; + u_track.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_track.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_track.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_track.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->track = u_track.real; + offset += sizeof(this->track); + uint32_t length_date; + arrToVar(length_date, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_date; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_date-1]=0; + this->date = (char *)(inbuffer + offset-1); + offset += length_date; + union { + float real; + uint32_t base; + } u_mag_var; + u_mag_var.base = 0; + u_mag_var.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_mag_var.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_mag_var.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_mag_var.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->mag_var = u_mag_var.real; + offset += sizeof(this->mag_var); + uint32_t length_mag_var_direction; + arrToVar(length_mag_var_direction, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mag_var_direction; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mag_var_direction-1]=0; + this->mag_var_direction = (char *)(inbuffer + offset-1); + offset += length_mag_var_direction; + uint32_t length_mode_indicator; + arrToVar(length_mode_indicator, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mode_indicator; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mode_indicator-1]=0; + this->mode_indicator = (char *)(inbuffer + offset-1); + offset += length_mode_indicator; + return offset; + } + + virtual const char * getType() override { return "nmea_msgs/Gprmc"; }; + virtual const char * getMD5() override { return "02533bac67f17457b2e3538525ba1aae"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Sentence.h b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Sentence.h new file mode 100644 index 000000000..c81e8ea44 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nmea_msgs/Sentence.h @@ -0,0 +1,61 @@ +#ifndef _ROS_nmea_msgs_Sentence_h +#define _ROS_nmea_msgs_Sentence_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace nmea_msgs +{ + + class Sentence : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _sentence_type; + _sentence_type sentence; + + Sentence(): + header(), + sentence("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_sentence = strlen(this->sentence); + varToArr(outbuffer + offset, length_sentence); + offset += 4; + memcpy(outbuffer + offset, this->sentence, length_sentence); + offset += length_sentence; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_sentence; + arrToVar(length_sentence, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_sentence; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_sentence-1]=0; + this->sentence = (char *)(inbuffer + offset-1); + offset += length_sentence; + return offset; + } + + virtual const char * getType() override { return "nmea_msgs/Sentence"; }; + virtual const char * getMD5() override { return "9f221efc5f4b3bac7ce4af102b32308b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletList.h b/smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletList.h new file mode 100644 index 000000000..5e57b501f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletList.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_NodeletList_h +#define _ROS_SERVICE_NodeletList_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETLIST[] = "nodelet/NodeletList"; + + class NodeletListRequest : public ros::Msg + { + public: + + NodeletListRequest() + { + } + + 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 NODELETLIST; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class NodeletListResponse : public ros::Msg + { + public: + uint32_t nodelets_length; + typedef char* _nodelets_type; + _nodelets_type st_nodelets; + _nodelets_type * nodelets; + + NodeletListResponse(): + nodelets_length(0), st_nodelets(), nodelets(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->nodelets_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->nodelets_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->nodelets_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->nodelets_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->nodelets_length); + for( uint32_t i = 0; i < nodelets_length; i++){ + uint32_t length_nodeletsi = strlen(this->nodelets[i]); + varToArr(outbuffer + offset, length_nodeletsi); + offset += 4; + memcpy(outbuffer + offset, this->nodelets[i], length_nodeletsi); + offset += length_nodeletsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t nodelets_lengthT = ((uint32_t) (*(inbuffer + offset))); + nodelets_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + nodelets_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + nodelets_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->nodelets_length); + if(nodelets_lengthT > nodelets_length) + this->nodelets = (char**)realloc(this->nodelets, nodelets_lengthT * sizeof(char*)); + nodelets_length = nodelets_lengthT; + for( uint32_t i = 0; i < nodelets_length; i++){ + uint32_t length_st_nodelets; + arrToVar(length_st_nodelets, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_nodelets; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_nodelets-1]=0; + this->st_nodelets = (char *)(inbuffer + offset-1); + offset += length_st_nodelets; + memcpy( &(this->nodelets[i]), &(this->st_nodelets), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return NODELETLIST; }; + virtual const char * getMD5() override { return "99c7b10e794f5600b8030e697e946ca7"; }; + + }; + + class NodeletList { + public: + typedef NodeletListRequest Request; + typedef NodeletListResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletLoad.h b/smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletLoad.h new file mode 100644 index 000000000..832aa3c30 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletLoad.h @@ -0,0 +1,250 @@ +#ifndef _ROS_SERVICE_NodeletLoad_h +#define _ROS_SERVICE_NodeletLoad_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETLOAD[] = "nodelet/NodeletLoad"; + + class NodeletLoadRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _type_type; + _type_type type; + uint32_t remap_source_args_length; + typedef char* _remap_source_args_type; + _remap_source_args_type st_remap_source_args; + _remap_source_args_type * remap_source_args; + uint32_t remap_target_args_length; + typedef char* _remap_target_args_type; + _remap_target_args_type st_remap_target_args; + _remap_target_args_type * remap_target_args; + uint32_t my_argv_length; + typedef char* _my_argv_type; + _my_argv_type st_my_argv; + _my_argv_type * my_argv; + typedef const char* _bond_id_type; + _bond_id_type bond_id; + + NodeletLoadRequest(): + name(""), + type(""), + remap_source_args_length(0), st_remap_source_args(), remap_source_args(nullptr), + remap_target_args_length(0), st_remap_target_args(), remap_target_args(nullptr), + my_argv_length(0), st_my_argv(), my_argv(nullptr), + bond_id("") + { + } + + 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->remap_source_args_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->remap_source_args_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->remap_source_args_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->remap_source_args_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->remap_source_args_length); + for( uint32_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_remap_source_argsi = strlen(this->remap_source_args[i]); + varToArr(outbuffer + offset, length_remap_source_argsi); + offset += 4; + memcpy(outbuffer + offset, this->remap_source_args[i], length_remap_source_argsi); + offset += length_remap_source_argsi; + } + *(outbuffer + offset + 0) = (this->remap_target_args_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->remap_target_args_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->remap_target_args_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->remap_target_args_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->remap_target_args_length); + for( uint32_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_remap_target_argsi = strlen(this->remap_target_args[i]); + varToArr(outbuffer + offset, length_remap_target_argsi); + offset += 4; + memcpy(outbuffer + offset, this->remap_target_args[i], length_remap_target_argsi); + offset += length_remap_target_argsi; + } + *(outbuffer + offset + 0) = (this->my_argv_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->my_argv_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->my_argv_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->my_argv_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->my_argv_length); + for( uint32_t i = 0; i < my_argv_length; i++){ + uint32_t length_my_argvi = strlen(this->my_argv[i]); + varToArr(outbuffer + offset, length_my_argvi); + offset += 4; + memcpy(outbuffer + offset, this->my_argv[i], length_my_argvi); + offset += length_my_argvi; + } + uint32_t length_bond_id = strlen(this->bond_id); + varToArr(outbuffer + offset, length_bond_id); + offset += 4; + memcpy(outbuffer + offset, this->bond_id, length_bond_id); + offset += length_bond_id; + 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; + uint32_t remap_source_args_lengthT = ((uint32_t) (*(inbuffer + offset))); + remap_source_args_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + remap_source_args_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + remap_source_args_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->remap_source_args_length); + if(remap_source_args_lengthT > remap_source_args_length) + this->remap_source_args = (char**)realloc(this->remap_source_args, remap_source_args_lengthT * sizeof(char*)); + remap_source_args_length = remap_source_args_lengthT; + for( uint32_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_st_remap_source_args; + arrToVar(length_st_remap_source_args, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_remap_source_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_remap_source_args-1]=0; + this->st_remap_source_args = (char *)(inbuffer + offset-1); + offset += length_st_remap_source_args; + memcpy( &(this->remap_source_args[i]), &(this->st_remap_source_args), sizeof(char*)); + } + uint32_t remap_target_args_lengthT = ((uint32_t) (*(inbuffer + offset))); + remap_target_args_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + remap_target_args_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + remap_target_args_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->remap_target_args_length); + if(remap_target_args_lengthT > remap_target_args_length) + this->remap_target_args = (char**)realloc(this->remap_target_args, remap_target_args_lengthT * sizeof(char*)); + remap_target_args_length = remap_target_args_lengthT; + for( uint32_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_st_remap_target_args; + arrToVar(length_st_remap_target_args, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_remap_target_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_remap_target_args-1]=0; + this->st_remap_target_args = (char *)(inbuffer + offset-1); + offset += length_st_remap_target_args; + memcpy( &(this->remap_target_args[i]), &(this->st_remap_target_args), sizeof(char*)); + } + uint32_t my_argv_lengthT = ((uint32_t) (*(inbuffer + offset))); + my_argv_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + my_argv_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + my_argv_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->my_argv_length); + if(my_argv_lengthT > my_argv_length) + this->my_argv = (char**)realloc(this->my_argv, my_argv_lengthT * sizeof(char*)); + my_argv_length = my_argv_lengthT; + for( uint32_t i = 0; i < my_argv_length; i++){ + uint32_t length_st_my_argv; + arrToVar(length_st_my_argv, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_my_argv; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_my_argv-1]=0; + this->st_my_argv = (char *)(inbuffer + offset-1); + offset += length_st_my_argv; + memcpy( &(this->my_argv[i]), &(this->st_my_argv), sizeof(char*)); + } + uint32_t length_bond_id; + arrToVar(length_bond_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_bond_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_bond_id-1]=0; + this->bond_id = (char *)(inbuffer + offset-1); + offset += length_bond_id; + return offset; + } + + virtual const char * getType() override { return NODELETLOAD; }; + virtual const char * getMD5() override { return "c6e28cc4d2e259249d96cfb50658fbec"; }; + + }; + + class NodeletLoadResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + NodeletLoadResponse(): + 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 NODELETLOAD; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletLoad { + public: + typedef NodeletLoadRequest Request; + typedef NodeletLoadResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletUnload.h b/smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletUnload.h new file mode 100644 index 000000000..dc964ff8e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/nodelet/NodeletUnload.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_NodeletUnload_h +#define _ROS_SERVICE_NodeletUnload_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETUNLOAD[] = "nodelet/NodeletUnload"; + + class NodeletUnloadRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + + NodeletUnloadRequest(): + 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 NODELETUNLOAD; }; + virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class NodeletUnloadResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + NodeletUnloadResponse(): + 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 NODELETUNLOAD; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletUnload { + public: + typedef NodeletUnloadRequest Request; + typedef NodeletUnloadResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/GetObjectInformation.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/GetObjectInformation.h new file mode 100644 index 000000000..5ab015336 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/GetObjectInformation.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_GetObjectInformation_h +#define _ROS_SERVICE_GetObjectInformation_h +#include +#include +#include +#include "ros/msg.h" +#include "object_recognition_msgs/ObjectType.h" +#include "object_recognition_msgs/ObjectInformation.h" + +namespace object_recognition_msgs +{ + +static const char GETOBJECTINFORMATION[] = "object_recognition_msgs/GetObjectInformation"; + + class GetObjectInformationRequest : public ros::Msg + { + public: + typedef object_recognition_msgs::ObjectType _type_type; + _type_type type; + + GetObjectInformationRequest(): + type() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->type.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->type.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETOBJECTINFORMATION; }; + virtual const char * getMD5() override { return "0d72b69e80da0fe473b0bdcdd7a28d4d"; }; + + }; + + class GetObjectInformationResponse : public ros::Msg + { + public: + typedef object_recognition_msgs::ObjectInformation _information_type; + _information_type information; + + GetObjectInformationResponse(): + information() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->information.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->information.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return GETOBJECTINFORMATION; }; + virtual const char * getMD5() override { return "a62c5d1c41e250373b3e8e912a13a9cb"; }; + + }; + + class GetObjectInformation { + public: + typedef GetObjectInformationRequest Request; + typedef GetObjectInformationResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectInformation.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectInformation.h new file mode 100644 index 000000000..ffb4b19aa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectInformation.h @@ -0,0 +1,67 @@ +#ifndef _ROS_object_recognition_msgs_ObjectInformation_h +#define _ROS_object_recognition_msgs_ObjectInformation_h + +#include +#include +#include +#include "ros/msg.h" +#include "shape_msgs/Mesh.h" +#include "sensor_msgs/PointCloud2.h" + +namespace object_recognition_msgs +{ + + class ObjectInformation : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef shape_msgs::Mesh _ground_truth_mesh_type; + _ground_truth_mesh_type ground_truth_mesh; + typedef sensor_msgs::PointCloud2 _ground_truth_point_cloud_type; + _ground_truth_point_cloud_type ground_truth_point_cloud; + + ObjectInformation(): + name(""), + ground_truth_mesh(), + ground_truth_point_cloud() + { + } + + 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; + offset += this->ground_truth_mesh.serialize(outbuffer + offset); + offset += this->ground_truth_point_cloud.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; + offset += this->ground_truth_mesh.deserialize(inbuffer + offset); + offset += this->ground_truth_point_cloud.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "object_recognition_msgs/ObjectInformation"; }; + virtual const char * getMD5() override { return "921ec39f51c7b927902059cf3300ecde"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionAction.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionAction.h new file mode 100644 index 000000000..2d9d57b76 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_object_recognition_msgs_ObjectRecognitionAction_h +#define _ROS_object_recognition_msgs_ObjectRecognitionAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "object_recognition_msgs/ObjectRecognitionActionGoal.h" +#include "object_recognition_msgs/ObjectRecognitionActionResult.h" +#include "object_recognition_msgs/ObjectRecognitionActionFeedback.h" + +namespace object_recognition_msgs +{ + + class ObjectRecognitionAction : public ros::Msg + { + public: + typedef object_recognition_msgs::ObjectRecognitionActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef object_recognition_msgs::ObjectRecognitionActionResult _action_result_type; + _action_result_type action_result; + typedef object_recognition_msgs::ObjectRecognitionActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + ObjectRecognitionAction(): + 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 "object_recognition_msgs/ObjectRecognitionAction"; }; + virtual const char * getMD5() override { return "7d8979a0cf97e5078553ee3efee047d2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionFeedback.h new file mode 100644 index 000000000..85bf13be4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_object_recognition_msgs_ObjectRecognitionActionFeedback_h +#define _ROS_object_recognition_msgs_ObjectRecognitionActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "object_recognition_msgs/ObjectRecognitionFeedback.h" + +namespace object_recognition_msgs +{ + + class ObjectRecognitionActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef object_recognition_msgs::ObjectRecognitionFeedback _feedback_type; + _feedback_type feedback; + + ObjectRecognitionActionFeedback(): + 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 "object_recognition_msgs/ObjectRecognitionActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionGoal.h new file mode 100644 index 000000000..e52fa9a95 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_object_recognition_msgs_ObjectRecognitionActionGoal_h +#define _ROS_object_recognition_msgs_ObjectRecognitionActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "object_recognition_msgs/ObjectRecognitionGoal.h" + +namespace object_recognition_msgs +{ + + class ObjectRecognitionActionGoal : 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 object_recognition_msgs::ObjectRecognitionGoal _goal_type; + _goal_type goal; + + ObjectRecognitionActionGoal(): + 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 "object_recognition_msgs/ObjectRecognitionActionGoal"; }; + virtual const char * getMD5() override { return "195eff91387a5f42dbd13be53431366b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionResult.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionResult.h new file mode 100644 index 000000000..82652a186 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_object_recognition_msgs_ObjectRecognitionActionResult_h +#define _ROS_object_recognition_msgs_ObjectRecognitionActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "object_recognition_msgs/ObjectRecognitionResult.h" + +namespace object_recognition_msgs +{ + + class ObjectRecognitionActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef object_recognition_msgs::ObjectRecognitionResult _result_type; + _result_type result; + + ObjectRecognitionActionResult(): + 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 "object_recognition_msgs/ObjectRecognitionActionResult"; }; + virtual const char * getMD5() override { return "1ef766aeca50bc1bb70773fc73d4471d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionFeedback.h new file mode 100644 index 000000000..d569c41b8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_object_recognition_msgs_ObjectRecognitionFeedback_h +#define _ROS_object_recognition_msgs_ObjectRecognitionFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace object_recognition_msgs +{ + + class ObjectRecognitionFeedback : public ros::Msg + { + public: + + ObjectRecognitionFeedback() + { + } + + 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 "object_recognition_msgs/ObjectRecognitionFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionGoal.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionGoal.h new file mode 100644 index 000000000..610a76d9a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionGoal.h @@ -0,0 +1,100 @@ +#ifndef _ROS_object_recognition_msgs_ObjectRecognitionGoal_h +#define _ROS_object_recognition_msgs_ObjectRecognitionGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace object_recognition_msgs +{ + + class ObjectRecognitionGoal : public ros::Msg + { + public: + typedef bool _use_roi_type; + _use_roi_type use_roi; + uint32_t filter_limits_length; + typedef float _filter_limits_type; + _filter_limits_type st_filter_limits; + _filter_limits_type * filter_limits; + + ObjectRecognitionGoal(): + use_roi(0), + filter_limits_length(0), st_filter_limits(), filter_limits(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_use_roi; + u_use_roi.real = this->use_roi; + *(outbuffer + offset + 0) = (u_use_roi.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->use_roi); + *(outbuffer + offset + 0) = (this->filter_limits_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->filter_limits_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->filter_limits_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->filter_limits_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->filter_limits_length); + for( uint32_t i = 0; i < filter_limits_length; i++){ + union { + float real; + uint32_t base; + } u_filter_limitsi; + u_filter_limitsi.real = this->filter_limits[i]; + *(outbuffer + offset + 0) = (u_filter_limitsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_filter_limitsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_filter_limitsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_filter_limitsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->filter_limits[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_use_roi; + u_use_roi.base = 0; + u_use_roi.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->use_roi = u_use_roi.real; + offset += sizeof(this->use_roi); + uint32_t filter_limits_lengthT = ((uint32_t) (*(inbuffer + offset))); + filter_limits_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + filter_limits_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + filter_limits_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->filter_limits_length); + if(filter_limits_lengthT > filter_limits_length) + this->filter_limits = (float*)realloc(this->filter_limits, filter_limits_lengthT * sizeof(float)); + filter_limits_length = filter_limits_lengthT; + for( uint32_t i = 0; i < filter_limits_length; i++){ + union { + float real; + uint32_t base; + } u_st_filter_limits; + u_st_filter_limits.base = 0; + u_st_filter_limits.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_filter_limits.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_filter_limits.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_filter_limits.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_filter_limits = u_st_filter_limits.real; + offset += sizeof(this->st_filter_limits); + memcpy( &(this->filter_limits[i]), &(this->st_filter_limits), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "object_recognition_msgs/ObjectRecognitionGoal"; }; + virtual const char * getMD5() override { return "49bea2f03a1bba0ad05926e01e3525fa"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionResult.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionResult.h new file mode 100644 index 000000000..bdfbf7673 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectRecognitionResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_object_recognition_msgs_ObjectRecognitionResult_h +#define _ROS_object_recognition_msgs_ObjectRecognitionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "object_recognition_msgs/RecognizedObjectArray.h" + +namespace object_recognition_msgs +{ + + class ObjectRecognitionResult : public ros::Msg + { + public: + typedef object_recognition_msgs::RecognizedObjectArray _recognized_objects_type; + _recognized_objects_type recognized_objects; + + ObjectRecognitionResult(): + recognized_objects() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->recognized_objects.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->recognized_objects.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "object_recognition_msgs/ObjectRecognitionResult"; }; + virtual const char * getMD5() override { return "868e41288f9f8636e2b6c51f1af6aa9c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectType.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectType.h new file mode 100644 index 000000000..a6a80443e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/ObjectType.h @@ -0,0 +1,72 @@ +#ifndef _ROS_object_recognition_msgs_ObjectType_h +#define _ROS_object_recognition_msgs_ObjectType_h + +#include +#include +#include +#include "ros/msg.h" + +namespace object_recognition_msgs +{ + + class ObjectType : public ros::Msg + { + public: + typedef const char* _key_type; + _key_type key; + typedef const char* _db_type; + _db_type db; + + ObjectType(): + key(""), + db("") + { + } + + 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_db = strlen(this->db); + varToArr(outbuffer + offset, length_db); + offset += 4; + memcpy(outbuffer + offset, this->db, length_db); + offset += length_db; + 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_db; + arrToVar(length_db, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_db; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_db-1]=0; + this->db = (char *)(inbuffer + offset-1); + offset += length_db; + return offset; + } + + virtual const char * getType() override { return "object_recognition_msgs/ObjectType"; }; + virtual const char * getMD5() override { return "ac757ec5be1998b0167e7efcda79e3cf"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/RecognizedObject.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/RecognizedObject.h new file mode 100644 index 000000000..86f18d793 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/RecognizedObject.h @@ -0,0 +1,138 @@ +#ifndef _ROS_object_recognition_msgs_RecognizedObject_h +#define _ROS_object_recognition_msgs_RecognizedObject_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "object_recognition_msgs/ObjectType.h" +#include "sensor_msgs/PointCloud2.h" +#include "shape_msgs/Mesh.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/PoseWithCovarianceStamped.h" + +namespace object_recognition_msgs +{ + + class RecognizedObject : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef object_recognition_msgs::ObjectType _type_type; + _type_type type; + typedef float _confidence_type; + _confidence_type confidence; + uint32_t point_clouds_length; + typedef sensor_msgs::PointCloud2 _point_clouds_type; + _point_clouds_type st_point_clouds; + _point_clouds_type * point_clouds; + typedef shape_msgs::Mesh _bounding_mesh_type; + _bounding_mesh_type bounding_mesh; + uint32_t bounding_contours_length; + typedef geometry_msgs::Point _bounding_contours_type; + _bounding_contours_type st_bounding_contours; + _bounding_contours_type * bounding_contours; + typedef geometry_msgs::PoseWithCovarianceStamped _pose_type; + _pose_type pose; + + RecognizedObject(): + header(), + type(), + confidence(0), + point_clouds_length(0), st_point_clouds(), point_clouds(nullptr), + bounding_mesh(), + bounding_contours_length(0), st_bounding_contours(), bounding_contours(nullptr), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->type.serialize(outbuffer + offset); + 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); + *(outbuffer + offset + 0) = (this->point_clouds_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->point_clouds_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->point_clouds_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->point_clouds_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->point_clouds_length); + for( uint32_t i = 0; i < point_clouds_length; i++){ + offset += this->point_clouds[i].serialize(outbuffer + offset); + } + offset += this->bounding_mesh.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->bounding_contours_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->bounding_contours_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->bounding_contours_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->bounding_contours_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->bounding_contours_length); + for( uint32_t i = 0; i < bounding_contours_length; i++){ + offset += this->bounding_contours[i].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->type.deserialize(inbuffer + offset); + 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); + uint32_t point_clouds_lengthT = ((uint32_t) (*(inbuffer + offset))); + point_clouds_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + point_clouds_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + point_clouds_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->point_clouds_length); + if(point_clouds_lengthT > point_clouds_length) + this->point_clouds = (sensor_msgs::PointCloud2*)realloc(this->point_clouds, point_clouds_lengthT * sizeof(sensor_msgs::PointCloud2)); + point_clouds_length = point_clouds_lengthT; + for( uint32_t i = 0; i < point_clouds_length; i++){ + offset += this->st_point_clouds.deserialize(inbuffer + offset); + memcpy( &(this->point_clouds[i]), &(this->st_point_clouds), sizeof(sensor_msgs::PointCloud2)); + } + offset += this->bounding_mesh.deserialize(inbuffer + offset); + uint32_t bounding_contours_lengthT = ((uint32_t) (*(inbuffer + offset))); + bounding_contours_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + bounding_contours_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + bounding_contours_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->bounding_contours_length); + if(bounding_contours_lengthT > bounding_contours_length) + this->bounding_contours = (geometry_msgs::Point*)realloc(this->bounding_contours, bounding_contours_lengthT * sizeof(geometry_msgs::Point)); + bounding_contours_length = bounding_contours_lengthT; + for( uint32_t i = 0; i < bounding_contours_length; i++){ + offset += this->st_bounding_contours.deserialize(inbuffer + offset); + memcpy( &(this->bounding_contours[i]), &(this->st_bounding_contours), sizeof(geometry_msgs::Point)); + } + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "object_recognition_msgs/RecognizedObject"; }; + virtual const char * getMD5() override { return "f92c4cb29ba11f26c5f7219de97e900d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/RecognizedObjectArray.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/RecognizedObjectArray.h new file mode 100644 index 000000000..9c3411c35 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/RecognizedObjectArray.h @@ -0,0 +1,114 @@ +#ifndef _ROS_object_recognition_msgs_RecognizedObjectArray_h +#define _ROS_object_recognition_msgs_RecognizedObjectArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "object_recognition_msgs/RecognizedObject.h" + +namespace object_recognition_msgs +{ + + class RecognizedObjectArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t objects_length; + typedef object_recognition_msgs::RecognizedObject _objects_type; + _objects_type st_objects; + _objects_type * objects; + uint32_t cooccurrence_length; + typedef float _cooccurrence_type; + _cooccurrence_type st_cooccurrence; + _cooccurrence_type * cooccurrence; + + RecognizedObjectArray(): + header(), + objects_length(0), st_objects(), objects(nullptr), + cooccurrence_length(0), st_cooccurrence(), cooccurrence(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); + } + *(outbuffer + offset + 0) = (this->cooccurrence_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cooccurrence_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cooccurrence_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cooccurrence_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cooccurrence_length); + for( uint32_t i = 0; i < cooccurrence_length; i++){ + union { + float real; + uint32_t base; + } u_cooccurrencei; + u_cooccurrencei.real = this->cooccurrence[i]; + *(outbuffer + offset + 0) = (u_cooccurrencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cooccurrencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cooccurrencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cooccurrencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cooccurrence[i]); + } + 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 = (object_recognition_msgs::RecognizedObject*)realloc(this->objects, objects_lengthT * sizeof(object_recognition_msgs::RecognizedObject)); + 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(object_recognition_msgs::RecognizedObject)); + } + uint32_t cooccurrence_lengthT = ((uint32_t) (*(inbuffer + offset))); + cooccurrence_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cooccurrence_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cooccurrence_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cooccurrence_length); + if(cooccurrence_lengthT > cooccurrence_length) + this->cooccurrence = (float*)realloc(this->cooccurrence, cooccurrence_lengthT * sizeof(float)); + cooccurrence_length = cooccurrence_lengthT; + for( uint32_t i = 0; i < cooccurrence_length; i++){ + union { + float real; + uint32_t base; + } u_st_cooccurrence; + u_st_cooccurrence.base = 0; + u_st_cooccurrence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_cooccurrence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_cooccurrence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_cooccurrence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_cooccurrence = u_st_cooccurrence.real; + offset += sizeof(this->st_cooccurrence); + memcpy( &(this->cooccurrence[i]), &(this->st_cooccurrence), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "object_recognition_msgs/RecognizedObjectArray"; }; + virtual const char * getMD5() override { return "bad6b1546b9ebcabb49fb3b858d78964"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/Table.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/Table.h new file mode 100644 index 000000000..23f61f887 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/Table.h @@ -0,0 +1,76 @@ +#ifndef _ROS_object_recognition_msgs_Table_h +#define _ROS_object_recognition_msgs_Table_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Point.h" + +namespace object_recognition_msgs +{ + + class Table : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + uint32_t convex_hull_length; + typedef geometry_msgs::Point _convex_hull_type; + _convex_hull_type st_convex_hull; + _convex_hull_type * convex_hull; + + Table(): + header(), + pose(), + convex_hull_length(0), st_convex_hull(), convex_hull(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->convex_hull_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->convex_hull_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->convex_hull_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->convex_hull_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->convex_hull_length); + for( uint32_t i = 0; i < convex_hull_length; i++){ + offset += this->convex_hull[i].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); + uint32_t convex_hull_lengthT = ((uint32_t) (*(inbuffer + offset))); + convex_hull_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + convex_hull_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + convex_hull_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->convex_hull_length); + if(convex_hull_lengthT > convex_hull_length) + this->convex_hull = (geometry_msgs::Point*)realloc(this->convex_hull, convex_hull_lengthT * sizeof(geometry_msgs::Point)); + convex_hull_length = convex_hull_lengthT; + for( uint32_t i = 0; i < convex_hull_length; i++){ + offset += this->st_convex_hull.deserialize(inbuffer + offset); + memcpy( &(this->convex_hull[i]), &(this->st_convex_hull), sizeof(geometry_msgs::Point)); + } + return offset; + } + + virtual const char * getType() override { return "object_recognition_msgs/Table"; }; + virtual const char * getMD5() override { return "39efebc7d51e44bd2d72f2df6c7823a2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/TableArray.h b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/TableArray.h new file mode 100644 index 000000000..d2a6d010f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/object_recognition_msgs/TableArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_object_recognition_msgs_TableArray_h +#define _ROS_object_recognition_msgs_TableArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "object_recognition_msgs/Table.h" + +namespace object_recognition_msgs +{ + + class TableArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t tables_length; + typedef object_recognition_msgs::Table _tables_type; + _tables_type st_tables; + _tables_type * tables; + + TableArray(): + header(), + tables_length(0), st_tables(), tables(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->tables_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->tables_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->tables_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->tables_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->tables_length); + for( uint32_t i = 0; i < tables_length; i++){ + offset += this->tables[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t tables_lengthT = ((uint32_t) (*(inbuffer + offset))); + tables_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + tables_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + tables_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->tables_length); + if(tables_lengthT > tables_length) + this->tables = (object_recognition_msgs::Table*)realloc(this->tables, tables_lengthT * sizeof(object_recognition_msgs::Table)); + tables_length = tables_lengthT; + for( uint32_t i = 0; i < tables_length; i++){ + offset += this->st_tables.deserialize(inbuffer + offset); + memcpy( &(this->tables[i]), &(this->st_tables), sizeof(object_recognition_msgs::Table)); + } + return offset; + } + + virtual const char * getType() override { return "object_recognition_msgs/TableArray"; }; + virtual const char * getMD5() override { return "d1c853e5acd0ed273eb6682dc01ab428"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/octomap_msgs/BoundingBoxQuery.h b/smart_device_protocol/ros_lib/ros_lib/octomap_msgs/BoundingBoxQuery.h new file mode 100644 index 000000000..c4e618a09 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/octomap_msgs/GetOctomap.h b/smart_device_protocol/ros_lib/ros_lib/octomap_msgs/GetOctomap.h new file mode 100644 index 000000000..593032114 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/octomap_msgs/Octomap.h b/smart_device_protocol/ros_lib/ros_lib/octomap_msgs/Octomap.h new file mode 100644 index 000000000..09242b7d7 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/octomap_msgs/OctomapWithPose.h b/smart_device_protocol/ros_lib/ros_lib/octomap_msgs/OctomapWithPose.h new file mode 100644 index 000000000..5799ea4df --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Circle.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Circle.h new file mode 100644 index 000000000..d57c8a6fc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Circle.h @@ -0,0 +1,49 @@ +#ifndef _ROS_opencv_apps_Circle_h +#define _ROS_opencv_apps_Circle_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Point2D.h" + +namespace opencv_apps +{ + + class Circle : public ros::Msg + { + public: + typedef opencv_apps::Point2D _center_type; + _center_type center; + typedef float _radius_type; + _radius_type radius; + + Circle(): + center(), + radius(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->center.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->radius); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->center.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->radius)); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Circle"; }; + virtual const char * getMD5() override { return "4f6847051b4fe493b5af8caad66201d5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/CircleArray.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/CircleArray.h new file mode 100644 index 000000000..edfd4f8e1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/CircleArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_opencv_apps_CircleArray_h +#define _ROS_opencv_apps_CircleArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Circle.h" + +namespace opencv_apps +{ + + class CircleArray : public ros::Msg + { + public: + uint32_t circles_length; + typedef opencv_apps::Circle _circles_type; + _circles_type st_circles; + _circles_type * circles; + + CircleArray(): + circles_length(0), st_circles(), circles(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->circles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->circles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->circles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->circles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->circles_length); + for( uint32_t i = 0; i < circles_length; i++){ + offset += this->circles[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t circles_lengthT = ((uint32_t) (*(inbuffer + offset))); + circles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + circles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + circles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->circles_length); + if(circles_lengthT > circles_length) + this->circles = (opencv_apps::Circle*)realloc(this->circles, circles_lengthT * sizeof(opencv_apps::Circle)); + circles_length = circles_lengthT; + for( uint32_t i = 0; i < circles_length; i++){ + offset += this->st_circles.deserialize(inbuffer + offset); + memcpy( &(this->circles[i]), &(this->st_circles), sizeof(opencv_apps::Circle)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/CircleArray"; }; + virtual const char * getMD5() override { return "1970b146e338dd024c765e522039a727"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/CircleArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/CircleArrayStamped.h new file mode 100644 index 000000000..ac2198b46 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/CircleArrayStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_opencv_apps_CircleArrayStamped_h +#define _ROS_opencv_apps_CircleArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/Circle.h" + +namespace opencv_apps +{ + + class CircleArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t circles_length; + typedef opencv_apps::Circle _circles_type; + _circles_type st_circles; + _circles_type * circles; + + CircleArrayStamped(): + header(), + circles_length(0), st_circles(), circles(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->circles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->circles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->circles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->circles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->circles_length); + for( uint32_t i = 0; i < circles_length; i++){ + offset += this->circles[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t circles_lengthT = ((uint32_t) (*(inbuffer + offset))); + circles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + circles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + circles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->circles_length); + if(circles_lengthT > circles_length) + this->circles = (opencv_apps::Circle*)realloc(this->circles, circles_lengthT * sizeof(opencv_apps::Circle)); + circles_length = circles_lengthT; + for( uint32_t i = 0; i < circles_length; i++){ + offset += this->st_circles.deserialize(inbuffer + offset); + memcpy( &(this->circles[i]), &(this->st_circles), sizeof(opencv_apps::Circle)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/CircleArrayStamped"; }; + virtual const char * getMD5() override { return "430ffa6c2b0a36b7e81feff1ce79c3c4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Contour.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Contour.h new file mode 100644 index 000000000..7facfec88 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Contour.h @@ -0,0 +1,64 @@ +#ifndef _ROS_opencv_apps_Contour_h +#define _ROS_opencv_apps_Contour_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Point2D.h" + +namespace opencv_apps +{ + + class Contour : public ros::Msg + { + public: + uint32_t points_length; + typedef opencv_apps::Point2D _points_type; + _points_type st_points; + _points_type * points; + + Contour(): + points_length(0), st_points(), points(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 = (opencv_apps::Point2D*)realloc(this->points, points_lengthT * sizeof(opencv_apps::Point2D)); + 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(opencv_apps::Point2D)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Contour"; }; + virtual const char * getMD5() override { return "8f02263beef99aa03117a577a3eb879d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/ContourArray.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/ContourArray.h new file mode 100644 index 000000000..f03dd629c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/ContourArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_opencv_apps_ContourArray_h +#define _ROS_opencv_apps_ContourArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Contour.h" + +namespace opencv_apps +{ + + class ContourArray : public ros::Msg + { + public: + uint32_t contours_length; + typedef opencv_apps::Contour _contours_type; + _contours_type st_contours; + _contours_type * contours; + + ContourArray(): + contours_length(0), st_contours(), contours(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->contours_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->contours_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->contours_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->contours_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->contours_length); + for( uint32_t i = 0; i < contours_length; i++){ + offset += this->contours[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t contours_lengthT = ((uint32_t) (*(inbuffer + offset))); + contours_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + contours_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + contours_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->contours_length); + if(contours_lengthT > contours_length) + this->contours = (opencv_apps::Contour*)realloc(this->contours, contours_lengthT * sizeof(opencv_apps::Contour)); + contours_length = contours_lengthT; + for( uint32_t i = 0; i < contours_length; i++){ + offset += this->st_contours.deserialize(inbuffer + offset); + memcpy( &(this->contours[i]), &(this->st_contours), sizeof(opencv_apps::Contour)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/ContourArray"; }; + virtual const char * getMD5() override { return "fc54374f45559dfed248b316ccf9181d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/ContourArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/ContourArrayStamped.h new file mode 100644 index 000000000..7cb5a47f1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/ContourArrayStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_opencv_apps_ContourArrayStamped_h +#define _ROS_opencv_apps_ContourArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/Contour.h" + +namespace opencv_apps +{ + + class ContourArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t contours_length; + typedef opencv_apps::Contour _contours_type; + _contours_type st_contours; + _contours_type * contours; + + ContourArrayStamped(): + header(), + contours_length(0), st_contours(), contours(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->contours_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->contours_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->contours_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->contours_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->contours_length); + for( uint32_t i = 0; i < contours_length; i++){ + offset += this->contours[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t contours_lengthT = ((uint32_t) (*(inbuffer + offset))); + contours_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + contours_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + contours_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->contours_length); + if(contours_lengthT > contours_length) + this->contours = (opencv_apps::Contour*)realloc(this->contours, contours_lengthT * sizeof(opencv_apps::Contour)); + contours_length = contours_lengthT; + for( uint32_t i = 0; i < contours_length; i++){ + offset += this->st_contours.deserialize(inbuffer + offset); + memcpy( &(this->contours[i]), &(this->st_contours), sizeof(opencv_apps::Contour)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/ContourArrayStamped"; }; + virtual const char * getMD5() override { return "6bcf2733566be102cf11fc89685fd962"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Face.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Face.h new file mode 100644 index 000000000..9e0de4aa4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Face.h @@ -0,0 +1,91 @@ +#ifndef _ROS_opencv_apps_Face_h +#define _ROS_opencv_apps_Face_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Rect.h" + +namespace opencv_apps +{ + + class Face : public ros::Msg + { + public: + typedef opencv_apps::Rect _face_type; + _face_type face; + uint32_t eyes_length; + typedef opencv_apps::Rect _eyes_type; + _eyes_type st_eyes; + _eyes_type * eyes; + typedef const char* _label_type; + _label_type label; + typedef float _confidence_type; + _confidence_type confidence; + + Face(): + face(), + eyes_length(0), st_eyes(), eyes(nullptr), + label(""), + confidence(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->face.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->eyes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->eyes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->eyes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->eyes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->eyes_length); + for( uint32_t i = 0; i < eyes_length; i++){ + offset += this->eyes[i].serialize(outbuffer + offset); + } + 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 += serializeAvrFloat64(outbuffer + offset, this->confidence); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->face.deserialize(inbuffer + offset); + uint32_t eyes_lengthT = ((uint32_t) (*(inbuffer + offset))); + eyes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + eyes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + eyes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->eyes_length); + if(eyes_lengthT > eyes_length) + this->eyes = (opencv_apps::Rect*)realloc(this->eyes, eyes_lengthT * sizeof(opencv_apps::Rect)); + eyes_length = eyes_lengthT; + for( uint32_t i = 0; i < eyes_length; i++){ + offset += this->st_eyes.deserialize(inbuffer + offset); + memcpy( &(this->eyes[i]), &(this->st_eyes), sizeof(opencv_apps::Rect)); + } + 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 += deserializeAvrFloat64(inbuffer + offset, &(this->confidence)); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Face"; }; + virtual const char * getMD5() override { return "a1a50e747b0ca7822ce8611c3ffa7a02"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceArray.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceArray.h new file mode 100644 index 000000000..1c8343828 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_opencv_apps_FaceArray_h +#define _ROS_opencv_apps_FaceArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Face.h" + +namespace opencv_apps +{ + + class FaceArray : public ros::Msg + { + public: + uint32_t faces_length; + typedef opencv_apps::Face _faces_type; + _faces_type st_faces; + _faces_type * faces; + + FaceArray(): + faces_length(0), st_faces(), faces(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->faces_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->faces_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->faces_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->faces_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->faces_length); + for( uint32_t i = 0; i < faces_length; i++){ + offset += this->faces[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t faces_lengthT = ((uint32_t) (*(inbuffer + offset))); + faces_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + faces_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + faces_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->faces_length); + if(faces_lengthT > faces_length) + this->faces = (opencv_apps::Face*)realloc(this->faces, faces_lengthT * sizeof(opencv_apps::Face)); + faces_length = faces_lengthT; + for( uint32_t i = 0; i < faces_length; i++){ + offset += this->st_faces.deserialize(inbuffer + offset); + memcpy( &(this->faces[i]), &(this->st_faces), sizeof(opencv_apps::Face)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/FaceArray"; }; + virtual const char * getMD5() override { return "3ae7a36ff47d72f5dd1d764612b2b3c8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceArrayStamped.h new file mode 100644 index 000000000..7b0271daf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceArrayStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_opencv_apps_FaceArrayStamped_h +#define _ROS_opencv_apps_FaceArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/Face.h" + +namespace opencv_apps +{ + + class FaceArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t faces_length; + typedef opencv_apps::Face _faces_type; + _faces_type st_faces; + _faces_type * faces; + + FaceArrayStamped(): + header(), + faces_length(0), st_faces(), faces(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->faces_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->faces_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->faces_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->faces_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->faces_length); + for( uint32_t i = 0; i < faces_length; i++){ + offset += this->faces[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t faces_lengthT = ((uint32_t) (*(inbuffer + offset))); + faces_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + faces_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + faces_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->faces_length); + if(faces_lengthT > faces_length) + this->faces = (opencv_apps::Face*)realloc(this->faces, faces_lengthT * sizeof(opencv_apps::Face)); + faces_length = faces_lengthT; + for( uint32_t i = 0; i < faces_length; i++){ + offset += this->st_faces.deserialize(inbuffer + offset); + memcpy( &(this->faces[i]), &(this->st_faces), sizeof(opencv_apps::Face)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/FaceArrayStamped"; }; + virtual const char * getMD5() override { return "a43dedd70c7b2338df14a8f4de0940ef"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceRecognitionTrain.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceRecognitionTrain.h new file mode 100644 index 000000000..9642d9cdd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FaceRecognitionTrain.h @@ -0,0 +1,194 @@ +#ifndef _ROS_SERVICE_FaceRecognitionTrain_h +#define _ROS_SERVICE_FaceRecognitionTrain_h +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Rect.h" +#include "sensor_msgs/Image.h" + +namespace opencv_apps +{ + +static const char FACERECOGNITIONTRAIN[] = "opencv_apps/FaceRecognitionTrain"; + + class FaceRecognitionTrainRequest : public ros::Msg + { + public: + uint32_t images_length; + typedef sensor_msgs::Image _images_type; + _images_type st_images; + _images_type * images; + uint32_t rects_length; + typedef opencv_apps::Rect _rects_type; + _rects_type st_rects; + _rects_type * rects; + uint32_t labels_length; + typedef char* _labels_type; + _labels_type st_labels; + _labels_type * labels; + + FaceRecognitionTrainRequest(): + images_length(0), st_images(), images(nullptr), + rects_length(0), st_rects(), rects(nullptr), + labels_length(0), st_labels(), labels(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->images_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->images_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->images_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->images_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->images_length); + for( uint32_t i = 0; i < images_length; i++){ + offset += this->images[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->rects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rects_length); + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->rects[i].serialize(outbuffer + offset); + } + *(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 images_lengthT = ((uint32_t) (*(inbuffer + offset))); + images_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + images_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + images_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->images_length); + if(images_lengthT > images_length) + this->images = (sensor_msgs::Image*)realloc(this->images, images_lengthT * sizeof(sensor_msgs::Image)); + images_length = images_lengthT; + for( uint32_t i = 0; i < images_length; i++){ + offset += this->st_images.deserialize(inbuffer + offset); + memcpy( &(this->images[i]), &(this->st_images), sizeof(sensor_msgs::Image)); + } + uint32_t rects_lengthT = ((uint32_t) (*(inbuffer + offset))); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rects_length); + if(rects_lengthT > rects_length) + this->rects = (opencv_apps::Rect*)realloc(this->rects, rects_lengthT * sizeof(opencv_apps::Rect)); + rects_length = rects_lengthT; + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->st_rects.deserialize(inbuffer + offset); + memcpy( &(this->rects[i]), &(this->st_rects), sizeof(opencv_apps::Rect)); + } + 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 FACERECOGNITIONTRAIN; }; + virtual const char * getMD5() override { return "ba188b4bf792edbaf69c7f296a16e0ec"; }; + + }; + + class FaceRecognitionTrainResponse : public ros::Msg + { + public: + typedef bool _ok_type; + _ok_type ok; + typedef const char* _error_type; + _error_type error; + + FaceRecognitionTrainResponse(): + ok(0), + error("") + { + } + + 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); + uint32_t length_error = strlen(this->error); + varToArr(outbuffer + offset, length_error); + offset += 4; + memcpy(outbuffer + offset, this->error, length_error); + offset += length_error; + 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); + uint32_t length_error; + arrToVar(length_error, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error-1]=0; + this->error = (char *)(inbuffer + offset-1); + offset += length_error; + return offset; + } + + virtual const char * getType() override { return FACERECOGNITIONTRAIN; }; + virtual const char * getMD5() override { return "14d6fca830116fb9833d983a296f00ed"; }; + + }; + + class FaceRecognitionTrain { + public: + typedef FaceRecognitionTrainRequest Request; + typedef FaceRecognitionTrainResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Flow.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Flow.h new file mode 100644 index 000000000..32bfc96ac --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Flow.h @@ -0,0 +1,49 @@ +#ifndef _ROS_opencv_apps_Flow_h +#define _ROS_opencv_apps_Flow_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Point2D.h" + +namespace opencv_apps +{ + + class Flow : public ros::Msg + { + public: + typedef opencv_apps::Point2D _point_type; + _point_type point; + typedef opencv_apps::Point2D _velocity_type; + _velocity_type velocity; + + Flow(): + point(), + velocity() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->point.serialize(outbuffer + offset); + offset += this->velocity.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->point.deserialize(inbuffer + offset); + offset += this->velocity.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Flow"; }; + virtual const char * getMD5() override { return "dd9a9efd88ba39035e78af697593d751"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowArray.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowArray.h new file mode 100644 index 000000000..3d452cea2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_opencv_apps_FlowArray_h +#define _ROS_opencv_apps_FlowArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Flow.h" + +namespace opencv_apps +{ + + class FlowArray : public ros::Msg + { + public: + uint32_t flow_length; + typedef opencv_apps::Flow _flow_type; + _flow_type st_flow; + _flow_type * flow; + + FlowArray(): + flow_length(0), st_flow(), flow(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->flow_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->flow_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->flow_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->flow_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->flow_length); + for( uint32_t i = 0; i < flow_length; i++){ + offset += this->flow[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t flow_lengthT = ((uint32_t) (*(inbuffer + offset))); + flow_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + flow_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + flow_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->flow_length); + if(flow_lengthT > flow_length) + this->flow = (opencv_apps::Flow*)realloc(this->flow, flow_lengthT * sizeof(opencv_apps::Flow)); + flow_length = flow_lengthT; + for( uint32_t i = 0; i < flow_length; i++){ + offset += this->st_flow.deserialize(inbuffer + offset); + memcpy( &(this->flow[i]), &(this->st_flow), sizeof(opencv_apps::Flow)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/FlowArray"; }; + virtual const char * getMD5() override { return "fe292dca56eb3673cd698ea9ef841962"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowArrayStamped.h new file mode 100644 index 000000000..4c6684bc9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowArrayStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_opencv_apps_FlowArrayStamped_h +#define _ROS_opencv_apps_FlowArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/Flow.h" + +namespace opencv_apps +{ + + class FlowArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t flow_length; + typedef opencv_apps::Flow _flow_type; + _flow_type st_flow; + _flow_type * flow; + + FlowArrayStamped(): + header(), + flow_length(0), st_flow(), flow(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->flow_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->flow_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->flow_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->flow_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->flow_length); + for( uint32_t i = 0; i < flow_length; i++){ + offset += this->flow[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t flow_lengthT = ((uint32_t) (*(inbuffer + offset))); + flow_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + flow_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + flow_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->flow_length); + if(flow_lengthT > flow_length) + this->flow = (opencv_apps::Flow*)realloc(this->flow, flow_lengthT * sizeof(opencv_apps::Flow)); + flow_length = flow_lengthT; + for( uint32_t i = 0; i < flow_length; i++){ + offset += this->st_flow.deserialize(inbuffer + offset); + memcpy( &(this->flow[i]), &(this->st_flow), sizeof(opencv_apps::Flow)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/FlowArrayStamped"; }; + virtual const char * getMD5() override { return "b55faf909449963372b92417925b68cc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowStamped.h new file mode 100644 index 000000000..da95d4f83 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/FlowStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_opencv_apps_FlowStamped_h +#define _ROS_opencv_apps_FlowStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/Flow.h" + +namespace opencv_apps +{ + + class FlowStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef opencv_apps::Flow _flow_type; + _flow_type flow; + + FlowStamped(): + header(), + flow() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->flow.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->flow.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/FlowStamped"; }; + virtual const char * getMD5() override { return "b55faf909449963372b92417925b68cc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Line.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Line.h new file mode 100644 index 000000000..e8b6071f5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Line.h @@ -0,0 +1,49 @@ +#ifndef _ROS_opencv_apps_Line_h +#define _ROS_opencv_apps_Line_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Point2D.h" + +namespace opencv_apps +{ + + class Line : public ros::Msg + { + public: + typedef opencv_apps::Point2D _pt1_type; + _pt1_type pt1; + typedef opencv_apps::Point2D _pt2_type; + _pt2_type pt2; + + Line(): + pt1(), + pt2() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pt1.serialize(outbuffer + offset); + offset += this->pt2.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pt1.deserialize(inbuffer + offset); + offset += this->pt2.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Line"; }; + virtual const char * getMD5() override { return "a1419010b3fc4549e3f450018363d000"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/LineArray.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/LineArray.h new file mode 100644 index 000000000..9a14681a6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/LineArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_opencv_apps_LineArray_h +#define _ROS_opencv_apps_LineArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Line.h" + +namespace opencv_apps +{ + + class LineArray : public ros::Msg + { + public: + uint32_t lines_length; + typedef opencv_apps::Line _lines_type; + _lines_type st_lines; + _lines_type * lines; + + LineArray(): + lines_length(0), st_lines(), lines(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->lines_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lines_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lines_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lines_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->lines_length); + for( uint32_t i = 0; i < lines_length; i++){ + offset += this->lines[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t lines_lengthT = ((uint32_t) (*(inbuffer + offset))); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lines_length); + if(lines_lengthT > lines_length) + this->lines = (opencv_apps::Line*)realloc(this->lines, lines_lengthT * sizeof(opencv_apps::Line)); + lines_length = lines_lengthT; + for( uint32_t i = 0; i < lines_length; i++){ + offset += this->st_lines.deserialize(inbuffer + offset); + memcpy( &(this->lines[i]), &(this->st_lines), sizeof(opencv_apps::Line)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/LineArray"; }; + virtual const char * getMD5() override { return "2b5441933900cc71528395dda29124da"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/LineArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/LineArrayStamped.h new file mode 100644 index 000000000..922b666f2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/LineArrayStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_opencv_apps_LineArrayStamped_h +#define _ROS_opencv_apps_LineArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/Line.h" + +namespace opencv_apps +{ + + class LineArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t lines_length; + typedef opencv_apps::Line _lines_type; + _lines_type st_lines; + _lines_type * lines; + + LineArrayStamped(): + header(), + lines_length(0), st_lines(), lines(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lines_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lines_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lines_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lines_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->lines_length); + for( uint32_t i = 0; i < lines_length; i++){ + offset += this->lines[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t lines_lengthT = ((uint32_t) (*(inbuffer + offset))); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lines_length); + if(lines_lengthT > lines_length) + this->lines = (opencv_apps::Line*)realloc(this->lines, lines_lengthT * sizeof(opencv_apps::Line)); + lines_length = lines_lengthT; + for( uint32_t i = 0; i < lines_length; i++){ + offset += this->st_lines.deserialize(inbuffer + offset); + memcpy( &(this->lines[i]), &(this->st_lines), sizeof(opencv_apps::Line)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/LineArrayStamped"; }; + virtual const char * getMD5() override { return "8ad5d104256b4f6774479453d1118f74"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Moment.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Moment.h new file mode 100644 index 000000000..aa0ad22c1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Moment.h @@ -0,0 +1,174 @@ +#ifndef _ROS_opencv_apps_Moment_h +#define _ROS_opencv_apps_Moment_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Point2D.h" + +namespace opencv_apps +{ + + class Moment : public ros::Msg + { + public: + typedef float _m00_type; + _m00_type m00; + typedef float _m10_type; + _m10_type m10; + typedef float _m01_type; + _m01_type m01; + typedef float _m20_type; + _m20_type m20; + typedef float _m11_type; + _m11_type m11; + typedef float _m02_type; + _m02_type m02; + typedef float _m30_type; + _m30_type m30; + typedef float _m21_type; + _m21_type m21; + typedef float _m12_type; + _m12_type m12; + typedef float _m03_type; + _m03_type m03; + typedef float _mu20_type; + _mu20_type mu20; + typedef float _mu11_type; + _mu11_type mu11; + typedef float _mu02_type; + _mu02_type mu02; + typedef float _mu30_type; + _mu30_type mu30; + typedef float _mu21_type; + _mu21_type mu21; + typedef float _mu12_type; + _mu12_type mu12; + typedef float _mu03_type; + _mu03_type mu03; + typedef float _nu20_type; + _nu20_type nu20; + typedef float _nu11_type; + _nu11_type nu11; + typedef float _nu02_type; + _nu02_type nu02; + typedef float _nu30_type; + _nu30_type nu30; + typedef float _nu21_type; + _nu21_type nu21; + typedef float _nu12_type; + _nu12_type nu12; + typedef float _nu03_type; + _nu03_type nu03; + typedef opencv_apps::Point2D _center_type; + _center_type center; + typedef float _length_type; + _length_type length; + typedef float _area_type; + _area_type area; + + Moment(): + m00(0), + m10(0), + m01(0), + m20(0), + m11(0), + m02(0), + m30(0), + m21(0), + m12(0), + m03(0), + mu20(0), + mu11(0), + mu02(0), + mu30(0), + mu21(0), + mu12(0), + mu03(0), + nu20(0), + nu11(0), + nu02(0), + nu30(0), + nu21(0), + nu12(0), + nu03(0), + center(), + length(0), + area(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->m00); + offset += serializeAvrFloat64(outbuffer + offset, this->m10); + offset += serializeAvrFloat64(outbuffer + offset, this->m01); + offset += serializeAvrFloat64(outbuffer + offset, this->m20); + offset += serializeAvrFloat64(outbuffer + offset, this->m11); + offset += serializeAvrFloat64(outbuffer + offset, this->m02); + offset += serializeAvrFloat64(outbuffer + offset, this->m30); + offset += serializeAvrFloat64(outbuffer + offset, this->m21); + offset += serializeAvrFloat64(outbuffer + offset, this->m12); + offset += serializeAvrFloat64(outbuffer + offset, this->m03); + offset += serializeAvrFloat64(outbuffer + offset, this->mu20); + offset += serializeAvrFloat64(outbuffer + offset, this->mu11); + offset += serializeAvrFloat64(outbuffer + offset, this->mu02); + offset += serializeAvrFloat64(outbuffer + offset, this->mu30); + offset += serializeAvrFloat64(outbuffer + offset, this->mu21); + offset += serializeAvrFloat64(outbuffer + offset, this->mu12); + offset += serializeAvrFloat64(outbuffer + offset, this->mu03); + offset += serializeAvrFloat64(outbuffer + offset, this->nu20); + offset += serializeAvrFloat64(outbuffer + offset, this->nu11); + offset += serializeAvrFloat64(outbuffer + offset, this->nu02); + offset += serializeAvrFloat64(outbuffer + offset, this->nu30); + offset += serializeAvrFloat64(outbuffer + offset, this->nu21); + offset += serializeAvrFloat64(outbuffer + offset, this->nu12); + offset += serializeAvrFloat64(outbuffer + offset, this->nu03); + offset += this->center.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->length); + offset += serializeAvrFloat64(outbuffer + offset, this->area); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m00)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m10)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m01)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m20)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m11)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m02)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m30)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m21)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m12)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m03)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mu20)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mu11)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mu02)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mu30)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mu21)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mu12)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mu03)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->nu20)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->nu11)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->nu02)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->nu30)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->nu21)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->nu12)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->nu03)); + offset += this->center.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->length)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->area)); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Moment"; }; + virtual const char * getMD5() override { return "560ee3fabfffb4ed4155742d6db8a03c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/MomentArray.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/MomentArray.h new file mode 100644 index 000000000..7af35c154 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/MomentArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_opencv_apps_MomentArray_h +#define _ROS_opencv_apps_MomentArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Moment.h" + +namespace opencv_apps +{ + + class MomentArray : public ros::Msg + { + public: + uint32_t moments_length; + typedef opencv_apps::Moment _moments_type; + _moments_type st_moments; + _moments_type * moments; + + MomentArray(): + moments_length(0), st_moments(), moments(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->moments_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->moments_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->moments_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->moments_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->moments_length); + for( uint32_t i = 0; i < moments_length; i++){ + offset += this->moments[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t moments_lengthT = ((uint32_t) (*(inbuffer + offset))); + moments_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + moments_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + moments_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->moments_length); + if(moments_lengthT > moments_length) + this->moments = (opencv_apps::Moment*)realloc(this->moments, moments_lengthT * sizeof(opencv_apps::Moment)); + moments_length = moments_lengthT; + for( uint32_t i = 0; i < moments_length; i++){ + offset += this->st_moments.deserialize(inbuffer + offset); + memcpy( &(this->moments[i]), &(this->st_moments), sizeof(opencv_apps::Moment)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/MomentArray"; }; + virtual const char * getMD5() override { return "fb51ddd1dea5da45f56842efe759d448"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/MomentArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/MomentArrayStamped.h new file mode 100644 index 000000000..5e9168cf9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/MomentArrayStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_opencv_apps_MomentArrayStamped_h +#define _ROS_opencv_apps_MomentArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/Moment.h" + +namespace opencv_apps +{ + + class MomentArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t moments_length; + typedef opencv_apps::Moment _moments_type; + _moments_type st_moments; + _moments_type * moments; + + MomentArrayStamped(): + header(), + moments_length(0), st_moments(), moments(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->moments_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->moments_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->moments_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->moments_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->moments_length); + for( uint32_t i = 0; i < moments_length; i++){ + offset += this->moments[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t moments_lengthT = ((uint32_t) (*(inbuffer + offset))); + moments_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + moments_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + moments_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->moments_length); + if(moments_lengthT > moments_length) + this->moments = (opencv_apps::Moment*)realloc(this->moments, moments_lengthT * sizeof(opencv_apps::Moment)); + moments_length = moments_lengthT; + for( uint32_t i = 0; i < moments_length; i++){ + offset += this->st_moments.deserialize(inbuffer + offset); + memcpy( &(this->moments[i]), &(this->st_moments), sizeof(opencv_apps::Moment)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/MomentArrayStamped"; }; + virtual const char * getMD5() override { return "28ac0beb70b037acf76c3bed71b679a9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2D.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2D.h new file mode 100644 index 000000000..b6932aba1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2D.h @@ -0,0 +1,48 @@ +#ifndef _ROS_opencv_apps_Point2D_h +#define _ROS_opencv_apps_Point2D_h + +#include +#include +#include +#include "ros/msg.h" + +namespace opencv_apps +{ + + class Point2D : public ros::Msg + { + public: + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + + Point2D(): + x(0), + y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Point2D"; }; + virtual const char * getMD5() override { return "209f516d3eb691f0663e25cb750d67c1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DArray.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DArray.h new file mode 100644 index 000000000..7a073b2c2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_opencv_apps_Point2DArray_h +#define _ROS_opencv_apps_Point2DArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Point2D.h" + +namespace opencv_apps +{ + + class Point2DArray : public ros::Msg + { + public: + uint32_t points_length; + typedef opencv_apps::Point2D _points_type; + _points_type st_points; + _points_type * points; + + Point2DArray(): + points_length(0), st_points(), points(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 = (opencv_apps::Point2D*)realloc(this->points, points_lengthT * sizeof(opencv_apps::Point2D)); + 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(opencv_apps::Point2D)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Point2DArray"; }; + virtual const char * getMD5() override { return "8f02263beef99aa03117a577a3eb879d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DArrayStamped.h new file mode 100644 index 000000000..b2e2c34cf --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DArrayStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_opencv_apps_Point2DArrayStamped_h +#define _ROS_opencv_apps_Point2DArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/Point2D.h" + +namespace opencv_apps +{ + + class Point2DArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t points_length; + typedef opencv_apps::Point2D _points_type; + _points_type st_points; + _points_type * points; + + Point2DArrayStamped(): + header(), + points_length(0), st_points(), points(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.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 = (opencv_apps::Point2D*)realloc(this->points, points_lengthT * sizeof(opencv_apps::Point2D)); + 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(opencv_apps::Point2D)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Point2DArrayStamped"; }; + virtual const char * getMD5() override { return "06c8694bd7b07dbc04014c86ef9991a2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DStamped.h new file mode 100644 index 000000000..9965e65e3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Point2DStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_opencv_apps_Point2DStamped_h +#define _ROS_opencv_apps_Point2DStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/Point2D.h" + +namespace opencv_apps +{ + + class Point2DStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef opencv_apps::Point2D _point_type; + _point_type point; + + Point2DStamped(): + header(), + point() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->point.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Point2DStamped"; }; + virtual const char * getMD5() override { return "9f7db918fde9989a73131d0d083d049d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Rect.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Rect.h new file mode 100644 index 000000000..379c4f64d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Rect.h @@ -0,0 +1,58 @@ +#ifndef _ROS_opencv_apps_Rect_h +#define _ROS_opencv_apps_Rect_h + +#include +#include +#include +#include "ros/msg.h" + +namespace opencv_apps +{ + + class Rect : public ros::Msg + { + public: + typedef float _x_type; + _x_type x; + typedef float _y_type; + _y_type y; + typedef float _width_type; + _width_type width; + typedef float _height_type; + _height_type height; + + Rect(): + x(0), + y(0), + width(0), + height(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->width); + offset += serializeAvrFloat64(outbuffer + offset, this->height); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->width)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->height)); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Rect"; }; + virtual const char * getMD5() override { return "7048f28f1f0ef51e102638c86d9a7728"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RectArray.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RectArray.h new file mode 100644 index 000000000..613da180b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RectArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_opencv_apps_RectArray_h +#define _ROS_opencv_apps_RectArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Rect.h" + +namespace opencv_apps +{ + + class RectArray : public ros::Msg + { + public: + uint32_t rects_length; + typedef opencv_apps::Rect _rects_type; + _rects_type st_rects; + _rects_type * rects; + + RectArray(): + rects_length(0), st_rects(), rects(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->rects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rects_length); + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->rects[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t rects_lengthT = ((uint32_t) (*(inbuffer + offset))); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rects_length); + if(rects_lengthT > rects_length) + this->rects = (opencv_apps::Rect*)realloc(this->rects, rects_lengthT * sizeof(opencv_apps::Rect)); + rects_length = rects_lengthT; + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->st_rects.deserialize(inbuffer + offset); + memcpy( &(this->rects[i]), &(this->st_rects), sizeof(opencv_apps::Rect)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/RectArray"; }; + virtual const char * getMD5() override { return "d4a6f20c7699fa2791af675958a5f148"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RectArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RectArrayStamped.h new file mode 100644 index 000000000..4ef467294 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RectArrayStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_opencv_apps_RectArrayStamped_h +#define _ROS_opencv_apps_RectArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/Rect.h" + +namespace opencv_apps +{ + + class RectArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t rects_length; + typedef opencv_apps::Rect _rects_type; + _rects_type st_rects; + _rects_type * rects; + + RectArrayStamped(): + header(), + rects_length(0), st_rects(), rects(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->rects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rects_length); + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->rects[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t rects_lengthT = ((uint32_t) (*(inbuffer + offset))); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rects_length); + if(rects_lengthT > rects_length) + this->rects = (opencv_apps::Rect*)realloc(this->rects, rects_lengthT * sizeof(opencv_apps::Rect)); + rects_length = rects_lengthT; + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->st_rects.deserialize(inbuffer + offset); + memcpy( &(this->rects[i]), &(this->st_rects), sizeof(opencv_apps::Rect)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/RectArrayStamped"; }; + virtual const char * getMD5() override { return "f29b08b33e061c73d7d9fc35142631d0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRect.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRect.h new file mode 100644 index 000000000..78a3db4aa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRect.h @@ -0,0 +1,55 @@ +#ifndef _ROS_opencv_apps_RotatedRect_h +#define _ROS_opencv_apps_RotatedRect_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/Point2D.h" +#include "opencv_apps/Size.h" + +namespace opencv_apps +{ + + class RotatedRect : public ros::Msg + { + public: + typedef float _angle_type; + _angle_type angle; + typedef opencv_apps::Point2D _center_type; + _center_type center; + typedef opencv_apps::Size _size_type; + _size_type size; + + RotatedRect(): + angle(0), + center(), + size() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->angle); + offset += this->center.serialize(outbuffer + offset); + offset += this->size.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->angle)); + offset += this->center.deserialize(inbuffer + offset); + offset += this->size.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/RotatedRect"; }; + virtual const char * getMD5() override { return "0ae60505c52f020176686d0689b8d390"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectArray.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectArray.h new file mode 100644 index 000000000..f7d93cbfe --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_opencv_apps_RotatedRectArray_h +#define _ROS_opencv_apps_RotatedRectArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "opencv_apps/RotatedRect.h" + +namespace opencv_apps +{ + + class RotatedRectArray : public ros::Msg + { + public: + uint32_t rects_length; + typedef opencv_apps::RotatedRect _rects_type; + _rects_type st_rects; + _rects_type * rects; + + RotatedRectArray(): + rects_length(0), st_rects(), rects(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->rects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rects_length); + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->rects[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t rects_lengthT = ((uint32_t) (*(inbuffer + offset))); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rects_length); + if(rects_lengthT > rects_length) + this->rects = (opencv_apps::RotatedRect*)realloc(this->rects, rects_lengthT * sizeof(opencv_apps::RotatedRect)); + rects_length = rects_lengthT; + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->st_rects.deserialize(inbuffer + offset); + memcpy( &(this->rects[i]), &(this->st_rects), sizeof(opencv_apps::RotatedRect)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/RotatedRectArray"; }; + virtual const char * getMD5() override { return "a27e397ed2b5b1a633561d324f64d2a6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectArrayStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectArrayStamped.h new file mode 100644 index 000000000..20ff6cb9d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectArrayStamped.h @@ -0,0 +1,70 @@ +#ifndef _ROS_opencv_apps_RotatedRectArrayStamped_h +#define _ROS_opencv_apps_RotatedRectArrayStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/RotatedRect.h" + +namespace opencv_apps +{ + + class RotatedRectArrayStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t rects_length; + typedef opencv_apps::RotatedRect _rects_type; + _rects_type st_rects; + _rects_type * rects; + + RotatedRectArrayStamped(): + header(), + rects_length(0), st_rects(), rects(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->rects_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rects_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rects_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rects_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rects_length); + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->rects[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t rects_lengthT = ((uint32_t) (*(inbuffer + offset))); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rects_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rects_length); + if(rects_lengthT > rects_length) + this->rects = (opencv_apps::RotatedRect*)realloc(this->rects, rects_lengthT * sizeof(opencv_apps::RotatedRect)); + rects_length = rects_lengthT; + for( uint32_t i = 0; i < rects_length; i++){ + offset += this->st_rects.deserialize(inbuffer + offset); + memcpy( &(this->rects[i]), &(this->st_rects), sizeof(opencv_apps::RotatedRect)); + } + return offset; + } + + virtual const char * getType() override { return "opencv_apps/RotatedRectArrayStamped"; }; + virtual const char * getMD5() override { return "89a2d4a7db2d2945ca46c25a3bd8c7c5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectStamped.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectStamped.h new file mode 100644 index 000000000..046ee60f5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/RotatedRectStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_opencv_apps_RotatedRectStamped_h +#define _ROS_opencv_apps_RotatedRectStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "opencv_apps/RotatedRect.h" + +namespace opencv_apps +{ + + class RotatedRectStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef opencv_apps::RotatedRect _rect_type; + _rect_type rect; + + RotatedRectStamped(): + header(), + rect() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->rect.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->rect.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/RotatedRectStamped"; }; + virtual const char * getMD5() override { return "ba2d76a1968e4f77570c01223781fe15"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Size.h b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Size.h new file mode 100644 index 000000000..b0889f626 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/opencv_apps/Size.h @@ -0,0 +1,48 @@ +#ifndef _ROS_opencv_apps_Size_h +#define _ROS_opencv_apps_Size_h + +#include +#include +#include +#include "ros/msg.h" + +namespace opencv_apps +{ + + class Size : public ros::Msg + { + public: + typedef float _width_type; + _width_type width; + typedef float _height_type; + _height_type height; + + Size(): + width(0), + height(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->width); + offset += serializeAvrFloat64(outbuffer + offset, this->height); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->width)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->height)); + return offset; + } + + virtual const char * getType() override { return "opencv_apps/Size"; }; + virtual const char * getMD5() override { return "f86522e647336fb10b55359fe003f673"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/openni2_camera/GetSerial.h b/smart_device_protocol/ros_lib/ros_lib/openni2_camera/GetSerial.h new file mode 100644 index 000000000..4685751f8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/openni2_camera/GetSerial.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_GetSerial_h +#define _ROS_SERVICE_GetSerial_h +#include +#include +#include +#include "ros/msg.h" + +namespace openni2_camera +{ + +static const char GETSERIAL[] = "openni2_camera/GetSerial"; + + class GetSerialRequest : public ros::Msg + { + public: + + GetSerialRequest() + { + } + + 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 GETSERIAL; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetSerialResponse : public ros::Msg + { + public: + typedef const char* _serial_type; + _serial_type serial; + + GetSerialResponse(): + serial("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_serial = strlen(this->serial); + varToArr(outbuffer + offset, length_serial); + offset += 4; + memcpy(outbuffer + offset, this->serial, length_serial); + offset += length_serial; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_serial; + arrToVar(length_serial, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_serial; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_serial-1]=0; + this->serial = (char *)(inbuffer + offset-1); + offset += length_serial; + return offset; + } + + virtual const char * getType() override { return GETSERIAL; }; + virtual const char * getMD5() override { return "fca40cf463282a80db4e2037c8a61741"; }; + + }; + + class GetSerial { + public: + typedef GetSerialRequest Request; + typedef GetSerialResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/ModelCoefficients.h b/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/ModelCoefficients.h new file mode 100644 index 000000000..c9e373c07 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/ModelCoefficients.h @@ -0,0 +1,88 @@ +#ifndef _ROS_pcl_msgs_ModelCoefficients_h +#define _ROS_pcl_msgs_ModelCoefficients_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pcl_msgs +{ + + class ModelCoefficients : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t values_length; + typedef float _values_type; + _values_type st_values; + _values_type * values; + + ModelCoefficients(): + header(), + values_length(0), st_values(), values(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->values_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->values_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->values_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->values_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->values_length); + for( uint32_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_valuesi; + u_valuesi.real = this->values[i]; + *(outbuffer + offset + 0) = (u_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t values_lengthT = ((uint32_t) (*(inbuffer + offset))); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->values_length); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + values_length = values_lengthT; + for( uint32_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_st_values; + u_st_values.base = 0; + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_values = u_st_values.real; + offset += sizeof(this->st_values); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "pcl_msgs/ModelCoefficients"; }; + virtual const char * getMD5() override { return "ca27dea75e72cb894cd36f9e5005e93e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/PointIndices.h b/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/PointIndices.h new file mode 100644 index 000000000..22dc955c6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/PointIndices.h @@ -0,0 +1,88 @@ +#ifndef _ROS_pcl_msgs_PointIndices_h +#define _ROS_pcl_msgs_PointIndices_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pcl_msgs +{ + + class PointIndices : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t indices_length; + typedef int32_t _indices_type; + _indices_type st_indices; + _indices_type * indices; + + PointIndices(): + header(), + indices_length(0), st_indices(), indices(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->indices_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->indices_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->indices_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->indices_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->indices_length); + for( uint32_t i = 0; i < indices_length; i++){ + union { + int32_t real; + uint32_t base; + } u_indicesi; + u_indicesi.real = this->indices[i]; + *(outbuffer + offset + 0) = (u_indicesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_indicesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_indicesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_indicesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->indices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t indices_lengthT = ((uint32_t) (*(inbuffer + offset))); + indices_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + indices_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + indices_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->indices_length); + if(indices_lengthT > indices_length) + this->indices = (int32_t*)realloc(this->indices, indices_lengthT * sizeof(int32_t)); + indices_length = indices_lengthT; + for( uint32_t i = 0; i < indices_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_indices; + u_st_indices.base = 0; + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_indices = u_st_indices.real; + offset += sizeof(this->st_indices); + memcpy( &(this->indices[i]), &(this->st_indices), sizeof(int32_t)); + } + return offset; + } + + virtual const char * getType() override { return "pcl_msgs/PointIndices"; }; + virtual const char * getMD5() override { return "458c7998b7eaf99908256472e273b3d4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/PolygonMesh.h b/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/PolygonMesh.h new file mode 100644 index 000000000..41c45c3a0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/PolygonMesh.h @@ -0,0 +1,76 @@ +#ifndef _ROS_pcl_msgs_PolygonMesh_h +#define _ROS_pcl_msgs_PolygonMesh_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointCloud2.h" +#include "pcl_msgs/Vertices.h" + +namespace pcl_msgs +{ + + class PolygonMesh : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef sensor_msgs::PointCloud2 _cloud_type; + _cloud_type cloud; + uint32_t polygons_length; + typedef pcl_msgs::Vertices _polygons_type; + _polygons_type st_polygons; + _polygons_type * polygons; + + PolygonMesh(): + header(), + cloud(), + polygons_length(0), st_polygons(), polygons(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->cloud.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->polygons_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->polygons_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->polygons_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->polygons_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->polygons_length); + for( uint32_t i = 0; i < polygons_length; i++){ + offset += this->polygons[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->cloud.deserialize(inbuffer + offset); + uint32_t polygons_lengthT = ((uint32_t) (*(inbuffer + offset))); + polygons_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + polygons_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + polygons_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->polygons_length); + if(polygons_lengthT > polygons_length) + this->polygons = (pcl_msgs::Vertices*)realloc(this->polygons, polygons_lengthT * sizeof(pcl_msgs::Vertices)); + polygons_length = polygons_lengthT; + for( uint32_t i = 0; i < polygons_length; i++){ + offset += this->st_polygons.deserialize(inbuffer + offset); + memcpy( &(this->polygons[i]), &(this->st_polygons), sizeof(pcl_msgs::Vertices)); + } + return offset; + } + + virtual const char * getType() override { return "pcl_msgs/PolygonMesh"; }; + virtual const char * getMD5() override { return "45a5fc6ad2cde8489600a790acc9a38a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/UpdateFilename.h b/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/UpdateFilename.h new file mode 100644 index 000000000..7a3534d9d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/UpdateFilename.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_UpdateFilename_h +#define _ROS_SERVICE_UpdateFilename_h +#include +#include +#include +#include "ros/msg.h" + +namespace pcl_msgs +{ + +static const char UPDATEFILENAME[] = "pcl_msgs/UpdateFilename"; + + class UpdateFilenameRequest : public ros::Msg + { + public: + typedef const char* _filename_type; + _filename_type filename; + + UpdateFilenameRequest(): + filename("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_filename = strlen(this->filename); + varToArr(outbuffer + offset, length_filename); + offset += 4; + memcpy(outbuffer + offset, this->filename, length_filename); + offset += length_filename; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_filename; + arrToVar(length_filename, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_filename; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_filename-1]=0; + this->filename = (char *)(inbuffer + offset-1); + offset += length_filename; + return offset; + } + + virtual const char * getType() override { return UPDATEFILENAME; }; + virtual const char * getMD5() override { return "030824f52a0628ead956fb9d67e66ae9"; }; + + }; + + class UpdateFilenameResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + UpdateFilenameResponse(): + 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 UPDATEFILENAME; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class UpdateFilename { + public: + typedef UpdateFilenameRequest Request; + typedef UpdateFilenameResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/Vertices.h b/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/Vertices.h new file mode 100644 index 000000000..02b05e6ec --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pcl_msgs/Vertices.h @@ -0,0 +1,71 @@ +#ifndef _ROS_pcl_msgs_Vertices_h +#define _ROS_pcl_msgs_Vertices_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pcl_msgs +{ + + class Vertices : public ros::Msg + { + public: + uint32_t vertices_length; + typedef uint32_t _vertices_type; + _vertices_type st_vertices; + _vertices_type * vertices; + + Vertices(): + vertices_length(0), st_vertices(), vertices(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->vertices_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertices_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertices_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertices_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertices_length); + for( uint32_t i = 0; i < vertices_length; i++){ + *(outbuffer + offset + 0) = (this->vertices[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertices[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertices[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertices[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t vertices_lengthT = ((uint32_t) (*(inbuffer + offset))); + vertices_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + vertices_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + vertices_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vertices_length); + if(vertices_lengthT > vertices_length) + this->vertices = (uint32_t*)realloc(this->vertices, vertices_lengthT * sizeof(uint32_t)); + vertices_length = vertices_lengthT; + for( uint32_t i = 0; i < vertices_length; i++){ + this->st_vertices = ((uint32_t) (*(inbuffer + offset))); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_vertices); + memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(uint32_t)); + } + return offset; + } + + virtual const char * getType() override { return "pcl_msgs/Vertices"; }; + virtual const char * getMD5() override { return "39bd7b1c23763ddd1b882b97cb7cfe11"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/people_msgs/People.h b/smart_device_protocol/ros_lib/ros_lib/people_msgs/People.h new file mode 100644 index 000000000..43bf7d774 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/people_msgs/People.h @@ -0,0 +1,70 @@ +#ifndef _ROS_people_msgs_People_h +#define _ROS_people_msgs_People_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "people_msgs/Person.h" + +namespace people_msgs +{ + + class People : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t people_length; + typedef people_msgs::Person _people_type; + _people_type st_people; + _people_type * people; + + People(): + header(), + people_length(0), st_people(), people(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->people_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->people_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->people_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->people_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->people_length); + for( uint32_t i = 0; i < people_length; i++){ + offset += this->people[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t people_lengthT = ((uint32_t) (*(inbuffer + offset))); + people_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + people_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + people_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->people_length); + if(people_lengthT > people_length) + this->people = (people_msgs::Person*)realloc(this->people, people_lengthT * sizeof(people_msgs::Person)); + people_length = people_lengthT; + for( uint32_t i = 0; i < people_length; i++){ + offset += this->st_people.deserialize(inbuffer + offset); + memcpy( &(this->people[i]), &(this->st_people), sizeof(people_msgs::Person)); + } + return offset; + } + + virtual const char * getType() override { return "people_msgs/People"; }; + virtual const char * getMD5() override { return "18722f4b8db20cc2369740732357847b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/people_msgs/Person.h b/smart_device_protocol/ros_lib/ros_lib/people_msgs/Person.h new file mode 100644 index 000000000..b3292c008 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/people_msgs/Person.h @@ -0,0 +1,145 @@ +#ifndef _ROS_people_msgs_Person_h +#define _ROS_people_msgs_Person_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" + +namespace people_msgs +{ + + class Person : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef geometry_msgs::Point _position_type; + _position_type position; + typedef geometry_msgs::Point _velocity_type; + _velocity_type velocity; + typedef float _reliability_type; + _reliability_type reliability; + uint32_t tagnames_length; + typedef char* _tagnames_type; + _tagnames_type st_tagnames; + _tagnames_type * tagnames; + uint32_t tags_length; + typedef char* _tags_type; + _tags_type st_tags; + _tags_type * tags; + + Person(): + name(""), + position(), + velocity(), + reliability(0), + tagnames_length(0), st_tagnames(), tagnames(nullptr), + tags_length(0), st_tags(), tags(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; + offset += this->position.serialize(outbuffer + offset); + offset += this->velocity.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->reliability); + *(outbuffer + offset + 0) = (this->tagnames_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->tagnames_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->tagnames_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->tagnames_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->tagnames_length); + for( uint32_t i = 0; i < tagnames_length; i++){ + uint32_t length_tagnamesi = strlen(this->tagnames[i]); + varToArr(outbuffer + offset, length_tagnamesi); + offset += 4; + memcpy(outbuffer + offset, this->tagnames[i], length_tagnamesi); + offset += length_tagnamesi; + } + *(outbuffer + offset + 0) = (this->tags_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->tags_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->tags_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->tags_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->tags_length); + for( uint32_t i = 0; i < tags_length; i++){ + uint32_t length_tagsi = strlen(this->tags[i]); + varToArr(outbuffer + offset, length_tagsi); + offset += 4; + memcpy(outbuffer + offset, this->tags[i], length_tagsi); + offset += length_tagsi; + } + 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; + offset += this->position.deserialize(inbuffer + offset); + offset += this->velocity.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->reliability)); + uint32_t tagnames_lengthT = ((uint32_t) (*(inbuffer + offset))); + tagnames_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + tagnames_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + tagnames_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->tagnames_length); + if(tagnames_lengthT > tagnames_length) + this->tagnames = (char**)realloc(this->tagnames, tagnames_lengthT * sizeof(char*)); + tagnames_length = tagnames_lengthT; + for( uint32_t i = 0; i < tagnames_length; i++){ + uint32_t length_st_tagnames; + arrToVar(length_st_tagnames, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_tagnames; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_tagnames-1]=0; + this->st_tagnames = (char *)(inbuffer + offset-1); + offset += length_st_tagnames; + memcpy( &(this->tagnames[i]), &(this->st_tagnames), sizeof(char*)); + } + uint32_t tags_lengthT = ((uint32_t) (*(inbuffer + offset))); + tags_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + tags_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + tags_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->tags_length); + if(tags_lengthT > tags_length) + this->tags = (char**)realloc(this->tags, tags_lengthT * sizeof(char*)); + tags_length = tags_lengthT; + for( uint32_t i = 0; i < tags_length; i++){ + uint32_t length_st_tags; + arrToVar(length_st_tags, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_tags; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_tags-1]=0; + this->st_tags = (char *)(inbuffer + offset-1); + offset += length_st_tags; + memcpy( &(this->tags[i]), &(this->st_tags), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "people_msgs/Person"; }; + virtual const char * getMD5() override { return "0b7c0818b76476f3863bd13f4d59f8df"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/people_msgs/PersonStamped.h b/smart_device_protocol/ros_lib/ros_lib/people_msgs/PersonStamped.h new file mode 100644 index 000000000..dfb681d69 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/people_msgs/PersonStamped.h @@ -0,0 +1,50 @@ +#ifndef _ROS_people_msgs_PersonStamped_h +#define _ROS_people_msgs_PersonStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "people_msgs/Person.h" + +namespace people_msgs +{ + + class PersonStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef people_msgs::Person _person_type; + _person_type person; + + PersonStamped(): + header(), + person() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->person.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->person.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "people_msgs/PersonStamped"; }; + virtual const char * getMD5() override { return "4a352a8b709eb9fec941a4f0f42651e7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/people_msgs/PositionMeasurement.h b/smart_device_protocol/ros_lib/ros_lib/people_msgs/PositionMeasurement.h new file mode 100644 index 000000000..53df745fc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/people_msgs/PositionMeasurement.h @@ -0,0 +1,115 @@ +#ifndef _ROS_people_msgs_PositionMeasurement_h +#define _ROS_people_msgs_PositionMeasurement_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace people_msgs +{ + + class PositionMeasurement : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _name_type; + _name_type name; + typedef const char* _object_id_type; + _object_id_type object_id; + typedef geometry_msgs::Point _pos_type; + _pos_type pos; + typedef float _reliability_type; + _reliability_type reliability; + float covariance[9]; + typedef int8_t _initialization_type; + _initialization_type initialization; + + PositionMeasurement(): + header(), + name(""), + object_id(""), + pos(), + reliability(0), + covariance(), + initialization(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + 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_object_id = strlen(this->object_id); + varToArr(outbuffer + offset, length_object_id); + offset += 4; + memcpy(outbuffer + offset, this->object_id, length_object_id); + offset += length_object_id; + offset += this->pos.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->reliability); + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + union { + int8_t real; + uint8_t base; + } u_initialization; + u_initialization.real = this->initialization; + *(outbuffer + offset + 0) = (u_initialization.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->initialization); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + 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_object_id; + arrToVar(length_object_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_object_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_object_id-1]=0; + this->object_id = (char *)(inbuffer + offset-1); + offset += length_object_id; + offset += this->pos.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->reliability)); + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + union { + int8_t real; + uint8_t base; + } u_initialization; + u_initialization.base = 0; + u_initialization.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->initialization = u_initialization.real; + offset += sizeof(this->initialization); + return offset; + } + + virtual const char * getType() override { return "people_msgs/PositionMeasurement"; }; + virtual const char * getMD5() override { return "54fa938b4ec28728e01575b79eb0ec7c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/people_msgs/PositionMeasurementArray.h b/smart_device_protocol/ros_lib/ros_lib/people_msgs/PositionMeasurementArray.h new file mode 100644 index 000000000..57a971365 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/people_msgs/PositionMeasurementArray.h @@ -0,0 +1,114 @@ +#ifndef _ROS_people_msgs_PositionMeasurementArray_h +#define _ROS_people_msgs_PositionMeasurementArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "people_msgs/PositionMeasurement.h" + +namespace people_msgs +{ + + class PositionMeasurementArray : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t people_length; + typedef people_msgs::PositionMeasurement _people_type; + _people_type st_people; + _people_type * people; + uint32_t cooccurrence_length; + typedef float _cooccurrence_type; + _cooccurrence_type st_cooccurrence; + _cooccurrence_type * cooccurrence; + + PositionMeasurementArray(): + header(), + people_length(0), st_people(), people(nullptr), + cooccurrence_length(0), st_cooccurrence(), cooccurrence(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->people_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->people_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->people_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->people_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->people_length); + for( uint32_t i = 0; i < people_length; i++){ + offset += this->people[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->cooccurrence_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cooccurrence_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cooccurrence_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cooccurrence_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cooccurrence_length); + for( uint32_t i = 0; i < cooccurrence_length; i++){ + union { + float real; + uint32_t base; + } u_cooccurrencei; + u_cooccurrencei.real = this->cooccurrence[i]; + *(outbuffer + offset + 0) = (u_cooccurrencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cooccurrencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cooccurrencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cooccurrencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cooccurrence[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t people_lengthT = ((uint32_t) (*(inbuffer + offset))); + people_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + people_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + people_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->people_length); + if(people_lengthT > people_length) + this->people = (people_msgs::PositionMeasurement*)realloc(this->people, people_lengthT * sizeof(people_msgs::PositionMeasurement)); + people_length = people_lengthT; + for( uint32_t i = 0; i < people_length; i++){ + offset += this->st_people.deserialize(inbuffer + offset); + memcpy( &(this->people[i]), &(this->st_people), sizeof(people_msgs::PositionMeasurement)); + } + uint32_t cooccurrence_lengthT = ((uint32_t) (*(inbuffer + offset))); + cooccurrence_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cooccurrence_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cooccurrence_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cooccurrence_length); + if(cooccurrence_lengthT > cooccurrence_length) + this->cooccurrence = (float*)realloc(this->cooccurrence, cooccurrence_lengthT * sizeof(float)); + cooccurrence_length = cooccurrence_lengthT; + for( uint32_t i = 0; i < cooccurrence_length; i++){ + union { + float real; + uint32_t base; + } u_st_cooccurrence; + u_st_cooccurrence.base = 0; + u_st_cooccurrence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_cooccurrence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_cooccurrence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_cooccurrence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_cooccurrence = u_st_cooccurrence.real; + offset += sizeof(this->st_cooccurrence); + memcpy( &(this->cooccurrence[i]), &(this->st_cooccurrence), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "people_msgs/PositionMeasurementArray"; }; + virtual const char * getMD5() override { return "59c860d40aa739ec920eb3ad24ae019e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/DataPoint.h b/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/DataPoint.h new file mode 100644 index 000000000..ae8d2fe0d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/DataPoint.h @@ -0,0 +1,57 @@ +#ifndef _ROS_plotjuggler_msgs_DataPoint_h +#define _ROS_plotjuggler_msgs_DataPoint_h + +#include +#include +#include +#include "ros/msg.h" + +namespace plotjuggler_msgs +{ + + class DataPoint : public ros::Msg + { + public: + typedef uint16_t _name_index_type; + _name_index_type name_index; + typedef float _stamp_type; + _stamp_type stamp; + typedef float _value_type; + _value_type value; + + DataPoint(): + name_index(0), + stamp(0), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->name_index >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->name_index >> (8 * 1)) & 0xFF; + offset += sizeof(this->name_index); + offset += serializeAvrFloat64(outbuffer + offset, this->stamp); + offset += serializeAvrFloat64(outbuffer + offset, this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->name_index = ((uint16_t) (*(inbuffer + offset))); + this->name_index |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->name_index); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->stamp)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + virtual const char * getType() override { return "plotjuggler_msgs/DataPoint"; }; + virtual const char * getMD5() override { return "580ca7c40f92b9a6ab4b921c02ebcd28"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/DataPoints.h b/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/DataPoints.h new file mode 100644 index 000000000..52b2ccc37 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/DataPoints.h @@ -0,0 +1,77 @@ +#ifndef _ROS_plotjuggler_msgs_DataPoints_h +#define _ROS_plotjuggler_msgs_DataPoints_h + +#include +#include +#include +#include "ros/msg.h" +#include "plotjuggler_msgs/DataPoint.h" + +namespace plotjuggler_msgs +{ + + class DataPoints : public ros::Msg + { + public: + typedef uint32_t _dictionary_uuid_type; + _dictionary_uuid_type dictionary_uuid; + uint32_t samples_length; + typedef plotjuggler_msgs::DataPoint _samples_type; + _samples_type st_samples; + _samples_type * samples; + + DataPoints(): + dictionary_uuid(0), + samples_length(0), st_samples(), samples(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->dictionary_uuid >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->dictionary_uuid >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->dictionary_uuid >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->dictionary_uuid >> (8 * 3)) & 0xFF; + offset += sizeof(this->dictionary_uuid); + *(outbuffer + offset + 0) = (this->samples_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->samples_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->samples_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->samples_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->samples_length); + for( uint32_t i = 0; i < samples_length; i++){ + offset += this->samples[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->dictionary_uuid = ((uint32_t) (*(inbuffer + offset))); + this->dictionary_uuid |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->dictionary_uuid |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->dictionary_uuid |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->dictionary_uuid); + uint32_t samples_lengthT = ((uint32_t) (*(inbuffer + offset))); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->samples_length); + if(samples_lengthT > samples_length) + this->samples = (plotjuggler_msgs::DataPoint*)realloc(this->samples, samples_lengthT * sizeof(plotjuggler_msgs::DataPoint)); + samples_length = samples_lengthT; + for( uint32_t i = 0; i < samples_length; i++){ + offset += this->st_samples.deserialize(inbuffer + offset); + memcpy( &(this->samples[i]), &(this->st_samples), sizeof(plotjuggler_msgs::DataPoint)); + } + return offset; + } + + virtual const char * getType() override { return "plotjuggler_msgs/DataPoints"; }; + virtual const char * getMD5() override { return "14e65e7956023a9a11291bc53d5d695a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/Dictionary.h b/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/Dictionary.h new file mode 100644 index 000000000..3fa5478b6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/Dictionary.h @@ -0,0 +1,88 @@ +#ifndef _ROS_plotjuggler_msgs_Dictionary_h +#define _ROS_plotjuggler_msgs_Dictionary_h + +#include +#include +#include +#include "ros/msg.h" + +namespace plotjuggler_msgs +{ + + class Dictionary : public ros::Msg + { + public: + typedef uint32_t _dictionary_uuid_type; + _dictionary_uuid_type dictionary_uuid; + uint32_t names_length; + typedef char* _names_type; + _names_type st_names; + _names_type * names; + + Dictionary(): + dictionary_uuid(0), + names_length(0), st_names(), names(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->dictionary_uuid >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->dictionary_uuid >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->dictionary_uuid >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->dictionary_uuid >> (8 * 3)) & 0xFF; + offset += sizeof(this->dictionary_uuid); + *(outbuffer + offset + 0) = (this->names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->names_length); + for( uint32_t i = 0; i < names_length; i++){ + uint32_t length_namesi = strlen(this->names[i]); + varToArr(outbuffer + offset, length_namesi); + offset += 4; + memcpy(outbuffer + offset, this->names[i], length_namesi); + offset += length_namesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->dictionary_uuid = ((uint32_t) (*(inbuffer + offset))); + this->dictionary_uuid |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->dictionary_uuid |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->dictionary_uuid |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->dictionary_uuid); + uint32_t names_lengthT = ((uint32_t) (*(inbuffer + offset))); + names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->names_length); + if(names_lengthT > names_length) + this->names = (char**)realloc(this->names, names_lengthT * sizeof(char*)); + names_length = names_lengthT; + for( uint32_t i = 0; i < names_length; i++){ + uint32_t length_st_names; + arrToVar(length_st_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_names-1]=0; + this->st_names = (char *)(inbuffer + offset-1); + offset += length_st_names; + memcpy( &(this->names[i]), &(this->st_names), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "plotjuggler_msgs/Dictionary"; }; + virtual const char * getMD5() override { return "12d13553d8d6a9826829b71cac454ebe"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/StatisticsNames.h b/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/StatisticsNames.h new file mode 100644 index 000000000..c357600d2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/StatisticsNames.h @@ -0,0 +1,94 @@ +#ifndef _ROS_plotjuggler_msgs_StatisticsNames_h +#define _ROS_plotjuggler_msgs_StatisticsNames_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace plotjuggler_msgs +{ + + class StatisticsNames : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t names_length; + typedef char* _names_type; + _names_type st_names; + _names_type * names; + typedef uint32_t _names_version_type; + _names_version_type names_version; + + StatisticsNames(): + header(), + names_length(0), st_names(), names(nullptr), + names_version(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->names_length); + for( uint32_t i = 0; i < names_length; i++){ + uint32_t length_namesi = strlen(this->names[i]); + varToArr(outbuffer + offset, length_namesi); + offset += 4; + memcpy(outbuffer + offset, this->names[i], length_namesi); + offset += length_namesi; + } + *(outbuffer + offset + 0) = (this->names_version >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->names_version >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->names_version >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->names_version >> (8 * 3)) & 0xFF; + offset += sizeof(this->names_version); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t names_lengthT = ((uint32_t) (*(inbuffer + offset))); + names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->names_length); + if(names_lengthT > names_length) + this->names = (char**)realloc(this->names, names_lengthT * sizeof(char*)); + names_length = names_lengthT; + for( uint32_t i = 0; i < names_length; i++){ + uint32_t length_st_names; + arrToVar(length_st_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_names-1]=0; + this->st_names = (char *)(inbuffer + offset-1); + offset += length_st_names; + memcpy( &(this->names[i]), &(this->st_names), sizeof(char*)); + } + this->names_version = ((uint32_t) (*(inbuffer + offset))); + this->names_version |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->names_version |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->names_version |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->names_version); + return offset; + } + + virtual const char * getType() override { return "plotjuggler_msgs/StatisticsNames"; }; + virtual const char * getMD5() override { return "bece3d42a81d5c50cd68f110cf17bf55"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/StatisticsValues.h b/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/StatisticsValues.h new file mode 100644 index 000000000..7970a081b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/plotjuggler_msgs/StatisticsValues.h @@ -0,0 +1,82 @@ +#ifndef _ROS_plotjuggler_msgs_StatisticsValues_h +#define _ROS_plotjuggler_msgs_StatisticsValues_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace plotjuggler_msgs +{ + + class StatisticsValues : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t values_length; + typedef float _values_type; + _values_type st_values; + _values_type * values; + typedef uint32_t _names_version_type; + _names_version_type names_version; + + StatisticsValues(): + header(), + values_length(0), st_values(), values(nullptr), + names_version(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->values_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->values_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->values_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->values_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->values_length); + for( uint32_t i = 0; i < values_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->values[i]); + } + *(outbuffer + offset + 0) = (this->names_version >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->names_version >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->names_version >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->names_version >> (8 * 3)) & 0xFF; + offset += sizeof(this->names_version); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t values_lengthT = ((uint32_t) (*(inbuffer + offset))); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->values_length); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + values_length = values_lengthT; + for( uint32_t i = 0; i < values_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_values)); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + this->names_version = ((uint32_t) (*(inbuffer + offset))); + this->names_version |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->names_version |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->names_version |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->names_version); + return offset; + } + + virtual const char * getType() override { return "plotjuggler_msgs/StatisticsValues"; }; + virtual const char * getMD5() override { return "44646896ace86f96c24fbb63054eeee8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/polled_camera/GetPolledImage.h b/smart_device_protocol/ros_lib/ros_lib/polled_camera/GetPolledImage.h new file mode 100644 index 000000000..0011042de --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/polled_camera/GetPolledImage.h @@ -0,0 +1,202 @@ +#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/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Curve1D.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Curve1D.h new file mode 100644 index 000000000..093240ca1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Curve1D.h @@ -0,0 +1,82 @@ +#ifndef _ROS_posedetection_msgs_Curve1D_h +#define _ROS_posedetection_msgs_Curve1D_h + +#include +#include +#include +#include "ros/msg.h" + +namespace posedetection_msgs +{ + + class Curve1D : public ros::Msg + { + public: + uint32_t pts_length; + typedef float _pts_type; + _pts_type st_pts; + _pts_type * pts; + + Curve1D(): + pts_length(0), st_pts(), pts(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->pts_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pts_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pts_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pts_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->pts_length); + for( uint32_t i = 0; i < pts_length; i++){ + union { + float real; + uint32_t base; + } u_ptsi; + u_ptsi.real = this->pts[i]; + *(outbuffer + offset + 0) = (u_ptsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_ptsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_ptsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_ptsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->pts[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t pts_lengthT = ((uint32_t) (*(inbuffer + offset))); + pts_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + pts_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + pts_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pts_length); + if(pts_lengthT > pts_length) + this->pts = (float*)realloc(this->pts, pts_lengthT * sizeof(float)); + pts_length = pts_lengthT; + for( uint32_t i = 0; i < pts_length; i++){ + union { + float real; + uint32_t base; + } u_st_pts; + u_st_pts.base = 0; + u_st_pts.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_pts.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_pts.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_pts.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_pts = u_st_pts.real; + offset += sizeof(this->st_pts); + memcpy( &(this->pts[i]), &(this->st_pts), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "posedetection_msgs/Curve1D"; }; + virtual const char * getMD5() override { return "e5367ca89dc9a58670f8f288e2c52f5d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Detect.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Detect.h new file mode 100644 index 000000000..f06512a08 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Detect.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_Detect_h +#define _ROS_SERVICE_Detect_h +#include +#include +#include +#include "ros/msg.h" +#include "posedetection_msgs/ObjectDetection.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/CameraInfo.h" + +namespace posedetection_msgs +{ + +static const char DETECT[] = "posedetection_msgs/Detect"; + + class DetectRequest : public ros::Msg + { + public: + typedef sensor_msgs::Image _image_type; + _image_type image; + typedef sensor_msgs::CameraInfo _camera_info_type; + _camera_info_type camera_info; + + DetectRequest(): + image(), + camera_info() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->image.serialize(outbuffer + offset); + offset += this->camera_info.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->image.deserialize(inbuffer + offset); + offset += this->camera_info.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return DETECT; }; + virtual const char * getMD5() override { return "bfee1901edaf2aa4d9f0844a03ff634f"; }; + + }; + + class DetectResponse : public ros::Msg + { + public: + typedef posedetection_msgs::ObjectDetection _object_detection_type; + _object_detection_type object_detection; + + DetectResponse(): + object_detection() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->object_detection.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->object_detection.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return DETECT; }; + virtual const char * getMD5() override { return "7b25cb2a35e9a4692af3117eeddab11b"; }; + + }; + + class Detect { + public: + typedef DetectRequest Request; + typedef DetectResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature0D.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature0D.h new file mode 100644 index 000000000..5c3e79dd9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature0D.h @@ -0,0 +1,305 @@ +#ifndef _ROS_posedetection_msgs_Feature0D_h +#define _ROS_posedetection_msgs_Feature0D_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace posedetection_msgs +{ + + class Feature0D : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t positions_length; + typedef float _positions_type; + _positions_type st_positions; + _positions_type * positions; + uint32_t scales_length; + typedef float _scales_type; + _scales_type st_scales; + _scales_type * scales; + uint32_t orientations_length; + typedef float _orientations_type; + _orientations_type st_orientations; + _orientations_type * orientations; + uint32_t confidences_length; + typedef float _confidences_type; + _confidences_type st_confidences; + _confidences_type * confidences; + uint32_t descriptors_length; + typedef float _descriptors_type; + _descriptors_type st_descriptors; + _descriptors_type * descriptors; + typedef int32_t _descriptor_dim_type; + _descriptor_dim_type descriptor_dim; + typedef const char* _type_type; + _type_type type; + + Feature0D(): + header(), + positions_length(0), st_positions(), positions(nullptr), + scales_length(0), st_scales(), scales(nullptr), + orientations_length(0), st_orientations(), orientations(nullptr), + confidences_length(0), st_confidences(), confidences(nullptr), + descriptors_length(0), st_descriptors(), descriptors(nullptr), + descriptor_dim(0), + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->positions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->positions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->positions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->positions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->positions_length); + for( uint32_t i = 0; i < positions_length; i++){ + union { + float real; + uint32_t base; + } u_positionsi; + u_positionsi.real = this->positions[i]; + *(outbuffer + offset + 0) = (u_positionsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_positionsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_positionsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_positionsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->positions[i]); + } + *(outbuffer + offset + 0) = (this->scales_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->scales_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->scales_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->scales_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->scales_length); + for( uint32_t i = 0; i < scales_length; i++){ + union { + float real; + uint32_t base; + } u_scalesi; + u_scalesi.real = this->scales[i]; + *(outbuffer + offset + 0) = (u_scalesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scalesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scalesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scalesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scales[i]); + } + *(outbuffer + offset + 0) = (this->orientations_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->orientations_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->orientations_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->orientations_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->orientations_length); + for( uint32_t i = 0; i < orientations_length; i++){ + union { + float real; + uint32_t base; + } u_orientationsi; + u_orientationsi.real = this->orientations[i]; + *(outbuffer + offset + 0) = (u_orientationsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_orientationsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_orientationsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_orientationsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->orientations[i]); + } + *(outbuffer + offset + 0) = (this->confidences_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->confidences_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->confidences_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->confidences_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidences_length); + for( uint32_t i = 0; i < confidences_length; i++){ + union { + float real; + uint32_t base; + } u_confidencesi; + u_confidencesi.real = this->confidences[i]; + *(outbuffer + offset + 0) = (u_confidencesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_confidencesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_confidencesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_confidencesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidences[i]); + } + *(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++){ + union { + float real; + uint32_t base; + } u_descriptorsi; + u_descriptorsi.real = this->descriptors[i]; + *(outbuffer + offset + 0) = (u_descriptorsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_descriptorsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_descriptorsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_descriptorsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->descriptors[i]); + } + union { + int32_t real; + uint32_t base; + } u_descriptor_dim; + u_descriptor_dim.real = this->descriptor_dim; + *(outbuffer + offset + 0) = (u_descriptor_dim.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_descriptor_dim.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_descriptor_dim.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_descriptor_dim.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->descriptor_dim); + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t positions_lengthT = ((uint32_t) (*(inbuffer + offset))); + positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->positions_length); + if(positions_lengthT > positions_length) + this->positions = (float*)realloc(this->positions, positions_lengthT * sizeof(float)); + positions_length = positions_lengthT; + for( uint32_t i = 0; i < positions_length; i++){ + union { + float real; + uint32_t base; + } u_st_positions; + u_st_positions.base = 0; + u_st_positions.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_positions.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_positions.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_positions.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_positions = u_st_positions.real; + offset += sizeof(this->st_positions); + memcpy( &(this->positions[i]), &(this->st_positions), sizeof(float)); + } + uint32_t scales_lengthT = ((uint32_t) (*(inbuffer + offset))); + scales_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + scales_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + scales_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->scales_length); + if(scales_lengthT > scales_length) + this->scales = (float*)realloc(this->scales, scales_lengthT * sizeof(float)); + scales_length = scales_lengthT; + for( uint32_t i = 0; i < scales_length; i++){ + union { + float real; + uint32_t base; + } u_st_scales; + u_st_scales.base = 0; + u_st_scales.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_scales.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_scales.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_scales.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_scales = u_st_scales.real; + offset += sizeof(this->st_scales); + memcpy( &(this->scales[i]), &(this->st_scales), sizeof(float)); + } + uint32_t orientations_lengthT = ((uint32_t) (*(inbuffer + offset))); + orientations_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + orientations_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + orientations_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->orientations_length); + if(orientations_lengthT > orientations_length) + this->orientations = (float*)realloc(this->orientations, orientations_lengthT * sizeof(float)); + orientations_length = orientations_lengthT; + for( uint32_t i = 0; i < orientations_length; i++){ + union { + float real; + uint32_t base; + } u_st_orientations; + u_st_orientations.base = 0; + u_st_orientations.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_orientations.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_orientations.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_orientations.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_orientations = u_st_orientations.real; + offset += sizeof(this->st_orientations); + memcpy( &(this->orientations[i]), &(this->st_orientations), sizeof(float)); + } + uint32_t confidences_lengthT = ((uint32_t) (*(inbuffer + offset))); + confidences_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + confidences_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + confidences_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->confidences_length); + if(confidences_lengthT > confidences_length) + this->confidences = (float*)realloc(this->confidences, confidences_lengthT * sizeof(float)); + confidences_length = confidences_lengthT; + for( uint32_t i = 0; i < confidences_length; i++){ + union { + float real; + uint32_t base; + } u_st_confidences; + u_st_confidences.base = 0; + u_st_confidences.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_confidences.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_confidences.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_confidences.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_confidences = u_st_confidences.real; + offset += sizeof(this->st_confidences); + memcpy( &(this->confidences[i]), &(this->st_confidences), sizeof(float)); + } + 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 = (float*)realloc(this->descriptors, descriptors_lengthT * sizeof(float)); + descriptors_length = descriptors_lengthT; + for( uint32_t i = 0; i < descriptors_length; i++){ + union { + float real; + uint32_t base; + } u_st_descriptors; + u_st_descriptors.base = 0; + u_st_descriptors.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_descriptors.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_descriptors.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_descriptors.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_descriptors = u_st_descriptors.real; + offset += sizeof(this->st_descriptors); + memcpy( &(this->descriptors[i]), &(this->st_descriptors), sizeof(float)); + } + union { + int32_t real; + uint32_t base; + } u_descriptor_dim; + u_descriptor_dim.base = 0; + u_descriptor_dim.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_descriptor_dim.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_descriptor_dim.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_descriptor_dim.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->descriptor_dim = u_descriptor_dim.real; + offset += sizeof(this->descriptor_dim); + 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; + return offset; + } + + virtual const char * getType() override { return "posedetection_msgs/Feature0D"; }; + virtual const char * getMD5() override { return "fcb3ba42a42cf972f3838cdb171f5e04"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature0DDetect.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature0DDetect.h new file mode 100644 index 000000000..1ddc829ff --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature0DDetect.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_Feature0DDetect_h +#define _ROS_SERVICE_Feature0DDetect_h +#include +#include +#include +#include "ros/msg.h" +#include "posedetection_msgs/Feature0D.h" +#include "sensor_msgs/Image.h" + +namespace posedetection_msgs +{ + +static const char FEATURE0DDETECT[] = "posedetection_msgs/Feature0DDetect"; + + class Feature0DDetectRequest : public ros::Msg + { + public: + typedef sensor_msgs::Image _image_type; + _image_type image; + + Feature0DDetectRequest(): + image() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->image.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->image.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return FEATURE0DDETECT; }; + virtual const char * getMD5() override { return "b13d2865c5af2a64e6e30ab1b56e1dd5"; }; + + }; + + class Feature0DDetectResponse : public ros::Msg + { + public: + typedef posedetection_msgs::Feature0D _features_type; + _features_type features; + + Feature0DDetectResponse(): + features() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->features.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->features.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return FEATURE0DDETECT; }; + virtual const char * getMD5() override { return "fa5677bbe36e6cfb2be31b9bbea8bcae"; }; + + }; + + class Feature0DDetect { + public: + typedef Feature0DDetectRequest Request; + typedef Feature0DDetectResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature1D.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature1D.h new file mode 100644 index 000000000..3ac802bca --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature1D.h @@ -0,0 +1,182 @@ +#ifndef _ROS_posedetection_msgs_Feature1D_h +#define _ROS_posedetection_msgs_Feature1D_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "posedetection_msgs/Curve1D.h" + +namespace posedetection_msgs +{ + + class Feature1D : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t lines_length; + typedef posedetection_msgs::Curve1D _lines_type; + _lines_type st_lines; + _lines_type * lines; + uint32_t descriptors_length; + typedef float _descriptors_type; + _descriptors_type st_descriptors; + _descriptors_type * descriptors; + uint32_t confidences_length; + typedef float _confidences_type; + _confidences_type st_confidences; + _confidences_type * confidences; + typedef int32_t _descriptor_dim_type; + _descriptor_dim_type descriptor_dim; + + Feature1D(): + header(), + lines_length(0), st_lines(), lines(nullptr), + descriptors_length(0), st_descriptors(), descriptors(nullptr), + confidences_length(0), st_confidences(), confidences(nullptr), + descriptor_dim(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lines_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lines_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lines_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lines_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->lines_length); + for( uint32_t i = 0; i < lines_length; i++){ + offset += this->lines[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++){ + union { + float real; + uint32_t base; + } u_descriptorsi; + u_descriptorsi.real = this->descriptors[i]; + *(outbuffer + offset + 0) = (u_descriptorsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_descriptorsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_descriptorsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_descriptorsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->descriptors[i]); + } + *(outbuffer + offset + 0) = (this->confidences_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->confidences_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->confidences_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->confidences_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidences_length); + for( uint32_t i = 0; i < confidences_length; i++){ + union { + float real; + uint32_t base; + } u_confidencesi; + u_confidencesi.real = this->confidences[i]; + *(outbuffer + offset + 0) = (u_confidencesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_confidencesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_confidencesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_confidencesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidences[i]); + } + union { + int32_t real; + uint32_t base; + } u_descriptor_dim; + u_descriptor_dim.real = this->descriptor_dim; + *(outbuffer + offset + 0) = (u_descriptor_dim.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_descriptor_dim.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_descriptor_dim.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_descriptor_dim.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->descriptor_dim); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t lines_lengthT = ((uint32_t) (*(inbuffer + offset))); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + lines_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lines_length); + if(lines_lengthT > lines_length) + this->lines = (posedetection_msgs::Curve1D*)realloc(this->lines, lines_lengthT * sizeof(posedetection_msgs::Curve1D)); + lines_length = lines_lengthT; + for( uint32_t i = 0; i < lines_length; i++){ + offset += this->st_lines.deserialize(inbuffer + offset); + memcpy( &(this->lines[i]), &(this->st_lines), sizeof(posedetection_msgs::Curve1D)); + } + 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 = (float*)realloc(this->descriptors, descriptors_lengthT * sizeof(float)); + descriptors_length = descriptors_lengthT; + for( uint32_t i = 0; i < descriptors_length; i++){ + union { + float real; + uint32_t base; + } u_st_descriptors; + u_st_descriptors.base = 0; + u_st_descriptors.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_descriptors.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_descriptors.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_descriptors.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_descriptors = u_st_descriptors.real; + offset += sizeof(this->st_descriptors); + memcpy( &(this->descriptors[i]), &(this->st_descriptors), sizeof(float)); + } + uint32_t confidences_lengthT = ((uint32_t) (*(inbuffer + offset))); + confidences_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + confidences_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + confidences_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->confidences_length); + if(confidences_lengthT > confidences_length) + this->confidences = (float*)realloc(this->confidences, confidences_lengthT * sizeof(float)); + confidences_length = confidences_lengthT; + for( uint32_t i = 0; i < confidences_length; i++){ + union { + float real; + uint32_t base; + } u_st_confidences; + u_st_confidences.base = 0; + u_st_confidences.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_confidences.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_confidences.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_confidences.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_confidences = u_st_confidences.real; + offset += sizeof(this->st_confidences); + memcpy( &(this->confidences[i]), &(this->st_confidences), sizeof(float)); + } + union { + int32_t real; + uint32_t base; + } u_descriptor_dim; + u_descriptor_dim.base = 0; + u_descriptor_dim.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_descriptor_dim.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_descriptor_dim.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_descriptor_dim.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->descriptor_dim = u_descriptor_dim.real; + offset += sizeof(this->descriptor_dim); + return offset; + } + + virtual const char * getType() override { return "posedetection_msgs/Feature1D"; }; + virtual const char * getMD5() override { return "4568f21f2dd0840ca2d658d4d1710f33"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature1DDetect.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature1DDetect.h new file mode 100644 index 000000000..11aa90bf8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Feature1DDetect.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_Feature1DDetect_h +#define _ROS_SERVICE_Feature1DDetect_h +#include +#include +#include +#include "ros/msg.h" +#include "posedetection_msgs/Feature1D.h" +#include "sensor_msgs/Image.h" + +namespace posedetection_msgs +{ + +static const char FEATURE1DDETECT[] = "posedetection_msgs/Feature1DDetect"; + + class Feature1DDetectRequest : public ros::Msg + { + public: + typedef sensor_msgs::Image _image_type; + _image_type image; + + Feature1DDetectRequest(): + image() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->image.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->image.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return FEATURE1DDETECT; }; + virtual const char * getMD5() override { return "b13d2865c5af2a64e6e30ab1b56e1dd5"; }; + + }; + + class Feature1DDetectResponse : public ros::Msg + { + public: + typedef posedetection_msgs::Feature1D _features_type; + _features_type features; + + Feature1DDetectResponse(): + features() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->features.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->features.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return FEATURE1DDETECT; }; + virtual const char * getMD5() override { return "37f67775de1cbab99b78b350a3d63479"; }; + + }; + + class Feature1DDetect { + public: + typedef Feature1DDetectRequest Request; + typedef Feature1DDetectResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ImageFeature0D.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ImageFeature0D.h new file mode 100644 index 000000000..98306bcd8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ImageFeature0D.h @@ -0,0 +1,56 @@ +#ifndef _ROS_posedetection_msgs_ImageFeature0D_h +#define _ROS_posedetection_msgs_ImageFeature0D_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/CameraInfo.h" +#include "posedetection_msgs/Feature0D.h" + +namespace posedetection_msgs +{ + + class ImageFeature0D : public ros::Msg + { + public: + typedef sensor_msgs::Image _image_type; + _image_type image; + typedef sensor_msgs::CameraInfo _info_type; + _info_type info; + typedef posedetection_msgs::Feature0D _features_type; + _features_type features; + + ImageFeature0D(): + image(), + info(), + features() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->image.serialize(outbuffer + offset); + offset += this->info.serialize(outbuffer + offset); + offset += this->features.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->image.deserialize(inbuffer + offset); + offset += this->info.deserialize(inbuffer + offset); + offset += this->features.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "posedetection_msgs/ImageFeature0D"; }; + virtual const char * getMD5() override { return "a16c5327c89b15820420449cf843ed75"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ImageFeature1D.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ImageFeature1D.h new file mode 100644 index 000000000..65b4caab6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ImageFeature1D.h @@ -0,0 +1,56 @@ +#ifndef _ROS_posedetection_msgs_ImageFeature1D_h +#define _ROS_posedetection_msgs_ImageFeature1D_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/CameraInfo.h" +#include "posedetection_msgs/Feature1D.h" + +namespace posedetection_msgs +{ + + class ImageFeature1D : public ros::Msg + { + public: + typedef sensor_msgs::Image _image_type; + _image_type image; + typedef sensor_msgs::CameraInfo _info_type; + _info_type info; + typedef posedetection_msgs::Feature1D _features_type; + _features_type features; + + ImageFeature1D(): + image(), + info(), + features() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->image.serialize(outbuffer + offset); + offset += this->info.serialize(outbuffer + offset); + offset += this->features.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->image.deserialize(inbuffer + offset); + offset += this->info.deserialize(inbuffer + offset); + offset += this->features.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "posedetection_msgs/ImageFeature1D"; }; + virtual const char * getMD5() override { return "bfd3a262e6342c55b7e11fccf00d8b2c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Object6DPose.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Object6DPose.h new file mode 100644 index 000000000..fdc61882a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/Object6DPose.h @@ -0,0 +1,85 @@ +#ifndef _ROS_posedetection_msgs_Object6DPose_h +#define _ROS_posedetection_msgs_Object6DPose_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace posedetection_msgs +{ + + class Object6DPose : public ros::Msg + { + public: + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef float _reliability_type; + _reliability_type reliability; + typedef const char* _type_type; + _type_type type; + + Object6DPose(): + pose(), + reliability(0), + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_reliability; + u_reliability.real = this->reliability; + *(outbuffer + offset + 0) = (u_reliability.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_reliability.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_reliability.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_reliability.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->reliability); + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_reliability; + u_reliability.base = 0; + u_reliability.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_reliability.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_reliability.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_reliability.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->reliability = u_reliability.real; + offset += sizeof(this->reliability); + 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; + return offset; + } + + virtual const char * getType() override { return "posedetection_msgs/Object6DPose"; }; + virtual const char * getMD5() override { return "68aad97d55c4f9555772eee1814bb3c7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ObjectDetection.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ObjectDetection.h new file mode 100644 index 000000000..dd2f2ac9a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/ObjectDetection.h @@ -0,0 +1,70 @@ +#ifndef _ROS_posedetection_msgs_ObjectDetection_h +#define _ROS_posedetection_msgs_ObjectDetection_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "posedetection_msgs/Object6DPose.h" + +namespace posedetection_msgs +{ + + class ObjectDetection : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t objects_length; + typedef posedetection_msgs::Object6DPose _objects_type; + _objects_type st_objects; + _objects_type * objects; + + ObjectDetection(): + 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 = (posedetection_msgs::Object6DPose*)realloc(this->objects, objects_lengthT * sizeof(posedetection_msgs::Object6DPose)); + 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(posedetection_msgs::Object6DPose)); + } + return offset; + } + + virtual const char * getType() override { return "posedetection_msgs/ObjectDetection"; }; + virtual const char * getMD5() override { return "450ee77eda8a92543774df0b858b3605"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/TargetObj.h b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/TargetObj.h new file mode 100644 index 000000000..c0d65098e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/posedetection_msgs/TargetObj.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_TargetObj_h +#define _ROS_SERVICE_TargetObj_h +#include +#include +#include +#include "ros/msg.h" +#include "posedetection_msgs/Object6DPose.h" + +namespace posedetection_msgs +{ + +static const char TARGETOBJ[] = "posedetection_msgs/TargetObj"; + + class TargetObjRequest : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + + TargetObjRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return TARGETOBJ; }; + virtual const char * getMD5() override { return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class TargetObjResponse : public ros::Msg + { + public: + typedef posedetection_msgs::Object6DPose _object_pose_type; + _object_pose_type object_pose; + + TargetObjResponse(): + object_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->object_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->object_pose.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return TARGETOBJ; }; + virtual const char * getMD5() override { return "9e3e0d9a56ba420ae5c3854c1194abf0"; }; + + }; + + class TargetObj { + public: + typedef TargetObjRequest Request; + typedef TargetObjResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/power_msgs/BatteryState.h b/smart_device_protocol/ros_lib/ros_lib/power_msgs/BatteryState.h new file mode 100644 index 000000000..707b14125 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/power_msgs/BatteryState.h @@ -0,0 +1,259 @@ +#ifndef _ROS_power_msgs_BatteryState_h +#define _ROS_power_msgs_BatteryState_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace power_msgs +{ + + class BatteryState : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef float _charge_level_type; + _charge_level_type charge_level; + typedef bool _is_charging_type; + _is_charging_type is_charging; + typedef ros::Duration _remaining_time_type; + _remaining_time_type remaining_time; + typedef float _total_capacity_type; + _total_capacity_type total_capacity; + typedef float _current_capacity_type; + _current_capacity_type current_capacity; + typedef float _battery_voltage_type; + _battery_voltage_type battery_voltage; + typedef float _supply_voltage_type; + _supply_voltage_type supply_voltage; + typedef float _charger_voltage_type; + _charger_voltage_type charger_voltage; + typedef bool _is_charger_detected_type; + _is_charger_detected_type is_charger_detected; + + BatteryState(): + name(""), + charge_level(0), + is_charging(0), + remaining_time(), + total_capacity(0), + current_capacity(0), + battery_voltage(0), + supply_voltage(0), + charger_voltage(0), + is_charger_detected(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; + union { + float real; + uint32_t base; + } u_charge_level; + u_charge_level.real = this->charge_level; + *(outbuffer + offset + 0) = (u_charge_level.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_charge_level.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_charge_level.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_charge_level.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->charge_level); + union { + bool real; + uint8_t base; + } u_is_charging; + u_is_charging.real = this->is_charging; + *(outbuffer + offset + 0) = (u_is_charging.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_charging); + *(outbuffer + offset + 0) = (this->remaining_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->remaining_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->remaining_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->remaining_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->remaining_time.sec); + *(outbuffer + offset + 0) = (this->remaining_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->remaining_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->remaining_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->remaining_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->remaining_time.nsec); + union { + float real; + uint32_t base; + } u_total_capacity; + u_total_capacity.real = this->total_capacity; + *(outbuffer + offset + 0) = (u_total_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_total_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_total_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_total_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->total_capacity); + union { + float real; + uint32_t base; + } u_current_capacity; + u_current_capacity.real = this->current_capacity; + *(outbuffer + offset + 0) = (u_current_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_current_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_current_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_current_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->current_capacity); + union { + float real; + uint32_t base; + } u_battery_voltage; + u_battery_voltage.real = this->battery_voltage; + *(outbuffer + offset + 0) = (u_battery_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_battery_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_battery_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_battery_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery_voltage); + union { + float real; + uint32_t base; + } u_supply_voltage; + u_supply_voltage.real = this->supply_voltage; + *(outbuffer + offset + 0) = (u_supply_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_supply_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_supply_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_supply_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->supply_voltage); + union { + float real; + uint32_t base; + } u_charger_voltage; + u_charger_voltage.real = this->charger_voltage; + *(outbuffer + offset + 0) = (u_charger_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_charger_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_charger_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_charger_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->charger_voltage); + union { + bool real; + uint8_t base; + } u_is_charger_detected; + u_is_charger_detected.real = this->is_charger_detected; + *(outbuffer + offset + 0) = (u_is_charger_detected.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_charger_detected); + 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; + union { + float real; + uint32_t base; + } u_charge_level; + u_charge_level.base = 0; + u_charge_level.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_charge_level.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_charge_level.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_charge_level.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->charge_level = u_charge_level.real; + offset += sizeof(this->charge_level); + union { + bool real; + uint8_t base; + } u_is_charging; + u_is_charging.base = 0; + u_is_charging.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_charging = u_is_charging.real; + offset += sizeof(this->is_charging); + this->remaining_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->remaining_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->remaining_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->remaining_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->remaining_time.sec); + this->remaining_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->remaining_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->remaining_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->remaining_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->remaining_time.nsec); + union { + float real; + uint32_t base; + } u_total_capacity; + u_total_capacity.base = 0; + u_total_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_total_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_total_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_total_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->total_capacity = u_total_capacity.real; + offset += sizeof(this->total_capacity); + union { + float real; + uint32_t base; + } u_current_capacity; + u_current_capacity.base = 0; + u_current_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_current_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_current_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_current_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->current_capacity = u_current_capacity.real; + offset += sizeof(this->current_capacity); + union { + float real; + uint32_t base; + } u_battery_voltage; + u_battery_voltage.base = 0; + u_battery_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_battery_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_battery_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_battery_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->battery_voltage = u_battery_voltage.real; + offset += sizeof(this->battery_voltage); + union { + float real; + uint32_t base; + } u_supply_voltage; + u_supply_voltage.base = 0; + u_supply_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_supply_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_supply_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_supply_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->supply_voltage = u_supply_voltage.real; + offset += sizeof(this->supply_voltage); + union { + float real; + uint32_t base; + } u_charger_voltage; + u_charger_voltage.base = 0; + u_charger_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_charger_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_charger_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_charger_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->charger_voltage = u_charger_voltage.real; + offset += sizeof(this->charger_voltage); + union { + bool real; + uint8_t base; + } u_is_charger_detected; + u_is_charger_detected.base = 0; + u_is_charger_detected.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_charger_detected = u_is_charger_detected.real; + offset += sizeof(this->is_charger_detected); + return offset; + } + + virtual const char * getType() override { return "power_msgs/BatteryState"; }; + virtual const char * getMD5() override { return "c7430ea7e5c95a5cba20f69647789404"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/power_msgs/BreakerCommand.h b/smart_device_protocol/ros_lib/ros_lib/power_msgs/BreakerCommand.h new file mode 100644 index 000000000..52d8c71e6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/power_msgs/BreakerCommand.h @@ -0,0 +1,94 @@ +#ifndef _ROS_SERVICE_BreakerCommand_h +#define _ROS_SERVICE_BreakerCommand_h +#include +#include +#include +#include "ros/msg.h" +#include "power_msgs/BreakerState.h" + +namespace power_msgs +{ + +static const char BREAKERCOMMAND[] = "power_msgs/BreakerCommand"; + + class BreakerCommandRequest : public ros::Msg + { + public: + typedef bool _enable_type; + _enable_type enable; + + BreakerCommandRequest(): + enable(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_enable; + u_enable.real = this->enable; + *(outbuffer + offset + 0) = (u_enable.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->enable); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_enable; + u_enable.base = 0; + u_enable.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->enable = u_enable.real; + offset += sizeof(this->enable); + return offset; + } + + virtual const char * getType() override { return BREAKERCOMMAND; }; + virtual const char * getMD5() override { return "8c1211af706069c994c06e00eb59ac9e"; }; + + }; + + class BreakerCommandResponse : public ros::Msg + { + public: + typedef power_msgs::BreakerState _status_type; + _status_type status; + + BreakerCommandResponse(): + status() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->status.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->status.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return BREAKERCOMMAND; }; + virtual const char * getMD5() override { return "5cda044252165071cdad9c3098df0594"; }; + + }; + + class BreakerCommand { + public: + typedef BreakerCommandRequest Request; + typedef BreakerCommandResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/power_msgs/BreakerState.h b/smart_device_protocol/ros_lib/ros_lib/power_msgs/BreakerState.h new file mode 100644 index 000000000..7d1fe718d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/power_msgs/BreakerState.h @@ -0,0 +1,185 @@ +#ifndef _ROS_power_msgs_BreakerState_h +#define _ROS_power_msgs_BreakerState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace power_msgs +{ + + class BreakerState : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef uint8_t _state_type; + _state_type state; + typedef float _current_type; + _current_type current; + typedef float _temperature_type; + _temperature_type temperature; + typedef float _min_rated_current_type; + _min_rated_current_type min_rated_current; + typedef float _max_rated_current_type; + _max_rated_current_type max_rated_current; + typedef float _max_rated_temperature_type; + _max_rated_temperature_type max_rated_temperature; + enum { STATE_DISABLED = 0 }; + enum { STATE_ENABLED = 1 }; + enum { STATE_ERROR = 2 }; + + BreakerState(): + name(""), + state(0), + current(0), + temperature(0), + min_rated_current(0), + max_rated_current(0), + max_rated_temperature(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->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + 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_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_min_rated_current; + u_min_rated_current.real = this->min_rated_current; + *(outbuffer + offset + 0) = (u_min_rated_current.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_rated_current.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_rated_current.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_rated_current.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_rated_current); + union { + float real; + uint32_t base; + } u_max_rated_current; + u_max_rated_current.real = this->max_rated_current; + *(outbuffer + offset + 0) = (u_max_rated_current.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_rated_current.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_rated_current.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_rated_current.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_rated_current); + union { + float real; + uint32_t base; + } u_max_rated_temperature; + u_max_rated_temperature.real = this->max_rated_temperature; + *(outbuffer + offset + 0) = (u_max_rated_temperature.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_rated_temperature.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_rated_temperature.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_rated_temperature.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_rated_temperature); + 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->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + 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_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_min_rated_current; + u_min_rated_current.base = 0; + u_min_rated_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_rated_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_rated_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_rated_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_rated_current = u_min_rated_current.real; + offset += sizeof(this->min_rated_current); + union { + float real; + uint32_t base; + } u_max_rated_current; + u_max_rated_current.base = 0; + u_max_rated_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_rated_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_rated_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_rated_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_rated_current = u_max_rated_current.real; + offset += sizeof(this->max_rated_current); + union { + float real; + uint32_t base; + } u_max_rated_temperature; + u_max_rated_temperature.base = 0; + u_max_rated_temperature.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_rated_temperature.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_rated_temperature.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_rated_temperature.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_rated_temperature = u_max_rated_temperature.real; + offset += sizeof(this->max_rated_temperature); + return offset; + } + + virtual const char * getType() override { return "power_msgs/BreakerState"; }; + virtual const char * getMD5() override { return "e8cf206acdcddee3412681363f829642"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKAction.h new file mode 100644 index 000000000..259dff033 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_common_action_msgs_ArmMoveIKAction_h +#define _ROS_pr2_common_action_msgs_ArmMoveIKAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_common_action_msgs/ArmMoveIKActionGoal.h" +#include "pr2_common_action_msgs/ArmMoveIKActionResult.h" +#include "pr2_common_action_msgs/ArmMoveIKActionFeedback.h" + +namespace pr2_common_action_msgs +{ + + class ArmMoveIKAction : public ros::Msg + { + public: + typedef pr2_common_action_msgs::ArmMoveIKActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_common_action_msgs::ArmMoveIKActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_common_action_msgs::ArmMoveIKActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + ArmMoveIKAction(): + 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 "pr2_common_action_msgs/ArmMoveIKAction"; }; + virtual const char * getMD5() override { return "f9df8066f1c6f2acf0247564f92e5ff2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionFeedback.h new file mode 100644 index 000000000..61206de5e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_common_action_msgs_ArmMoveIKActionFeedback_h +#define _ROS_pr2_common_action_msgs_ArmMoveIKActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_common_action_msgs/ArmMoveIKFeedback.h" + +namespace pr2_common_action_msgs +{ + + class ArmMoveIKActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_common_action_msgs::ArmMoveIKFeedback _feedback_type; + _feedback_type feedback; + + ArmMoveIKActionFeedback(): + 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 "pr2_common_action_msgs/ArmMoveIKActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionGoal.h new file mode 100644 index 000000000..ccbdc11b4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_common_action_msgs_ArmMoveIKActionGoal_h +#define _ROS_pr2_common_action_msgs_ArmMoveIKActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_common_action_msgs/ArmMoveIKGoal.h" + +namespace pr2_common_action_msgs +{ + + class ArmMoveIKActionGoal : 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 pr2_common_action_msgs::ArmMoveIKGoal _goal_type; + _goal_type goal; + + ArmMoveIKActionGoal(): + 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 "pr2_common_action_msgs/ArmMoveIKActionGoal"; }; + virtual const char * getMD5() override { return "3e40f142a36fa484e230f6135ba5b21b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionResult.h new file mode 100644 index 000000000..86278ad46 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_common_action_msgs_ArmMoveIKActionResult_h +#define _ROS_pr2_common_action_msgs_ArmMoveIKActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_common_action_msgs/ArmMoveIKResult.h" + +namespace pr2_common_action_msgs +{ + + class ArmMoveIKActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_common_action_msgs::ArmMoveIKResult _result_type; + _result_type result; + + ArmMoveIKActionResult(): + 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 "pr2_common_action_msgs/ArmMoveIKActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKFeedback.h new file mode 100644 index 000000000..d69acee9b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_pr2_common_action_msgs_ArmMoveIKFeedback_h +#define _ROS_pr2_common_action_msgs_ArmMoveIKFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_common_action_msgs +{ + + class ArmMoveIKFeedback : public ros::Msg + { + public: + + ArmMoveIKFeedback() + { + } + + 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 "pr2_common_action_msgs/ArmMoveIKFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKGoal.h new file mode 100644 index 000000000..76525f5f6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKGoal.h @@ -0,0 +1,102 @@ +#ifndef _ROS_pr2_common_action_msgs_ArmMoveIKGoal_h +#define _ROS_pr2_common_action_msgs_ArmMoveIKGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "sensor_msgs/JointState.h" +#include "ros/duration.h" + +namespace pr2_common_action_msgs +{ + + class ArmMoveIKGoal : public ros::Msg + { + public: + typedef geometry_msgs::PoseStamped _pose_type; + _pose_type pose; + typedef geometry_msgs::PoseStamped _tool_frame_type; + _tool_frame_type tool_frame; + typedef sensor_msgs::JointState _ik_seed_type; + _ik_seed_type ik_seed; + typedef ros::Duration _ik_timeout_type; + _ik_timeout_type ik_timeout; + typedef ros::Duration _move_duration_type; + _move_duration_type move_duration; + + ArmMoveIKGoal(): + pose(), + tool_frame(), + ik_seed(), + ik_timeout(), + move_duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + offset += this->tool_frame.serialize(outbuffer + offset); + offset += this->ik_seed.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->ik_timeout.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ik_timeout.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ik_timeout.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ik_timeout.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->ik_timeout.sec); + *(outbuffer + offset + 0) = (this->ik_timeout.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ik_timeout.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ik_timeout.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ik_timeout.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->ik_timeout.nsec); + *(outbuffer + offset + 0) = (this->move_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->move_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->move_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->move_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->move_duration.sec); + *(outbuffer + offset + 0) = (this->move_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->move_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->move_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->move_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->move_duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->tool_frame.deserialize(inbuffer + offset); + offset += this->ik_seed.deserialize(inbuffer + offset); + this->ik_timeout.sec = ((uint32_t) (*(inbuffer + offset))); + this->ik_timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->ik_timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->ik_timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ik_timeout.sec); + this->ik_timeout.nsec = ((uint32_t) (*(inbuffer + offset))); + this->ik_timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->ik_timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->ik_timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ik_timeout.nsec); + this->move_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->move_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->move_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->move_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->move_duration.sec); + this->move_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->move_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->move_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->move_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->move_duration.nsec); + return offset; + } + + virtual const char * getType() override { return "pr2_common_action_msgs/ArmMoveIKGoal"; }; + virtual const char * getMD5() override { return "659cdac4f142756518faf4644a34bdda"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKResult.h new file mode 100644 index 000000000..3b023ed6a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/ArmMoveIKResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_pr2_common_action_msgs_ArmMoveIKResult_h +#define _ROS_pr2_common_action_msgs_ArmMoveIKResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_common_action_msgs +{ + + class ArmMoveIKResult : public ros::Msg + { + public: + + ArmMoveIKResult() + { + } + + 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 "pr2_common_action_msgs/ArmMoveIKResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsAction.h new file mode 100644 index 000000000..858a530b6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_common_action_msgs_TuckArmsAction_h +#define _ROS_pr2_common_action_msgs_TuckArmsAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_common_action_msgs/TuckArmsActionGoal.h" +#include "pr2_common_action_msgs/TuckArmsActionResult.h" +#include "pr2_common_action_msgs/TuckArmsActionFeedback.h" + +namespace pr2_common_action_msgs +{ + + class TuckArmsAction : public ros::Msg + { + public: + typedef pr2_common_action_msgs::TuckArmsActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_common_action_msgs::TuckArmsActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_common_action_msgs::TuckArmsActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + TuckArmsAction(): + 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 "pr2_common_action_msgs/TuckArmsAction"; }; + virtual const char * getMD5() override { return "4385d436aaa7b0cb11299848e25300f5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionFeedback.h new file mode 100644 index 000000000..593c87dea --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_common_action_msgs_TuckArmsActionFeedback_h +#define _ROS_pr2_common_action_msgs_TuckArmsActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_common_action_msgs/TuckArmsFeedback.h" + +namespace pr2_common_action_msgs +{ + + class TuckArmsActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_common_action_msgs::TuckArmsFeedback _feedback_type; + _feedback_type feedback; + + TuckArmsActionFeedback(): + 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 "pr2_common_action_msgs/TuckArmsActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionGoal.h new file mode 100644 index 000000000..48b12e910 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_common_action_msgs_TuckArmsActionGoal_h +#define _ROS_pr2_common_action_msgs_TuckArmsActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_common_action_msgs/TuckArmsGoal.h" + +namespace pr2_common_action_msgs +{ + + class TuckArmsActionGoal : 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 pr2_common_action_msgs::TuckArmsGoal _goal_type; + _goal_type goal; + + TuckArmsActionGoal(): + 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 "pr2_common_action_msgs/TuckArmsActionGoal"; }; + virtual const char * getMD5() override { return "c8b69f27f8015edb9bf64bbf03a42618"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionResult.h new file mode 100644 index 000000000..30e9d65a3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_common_action_msgs_TuckArmsActionResult_h +#define _ROS_pr2_common_action_msgs_TuckArmsActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_common_action_msgs/TuckArmsResult.h" + +namespace pr2_common_action_msgs +{ + + class TuckArmsActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_common_action_msgs::TuckArmsResult _result_type; + _result_type result; + + TuckArmsActionResult(): + 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 "pr2_common_action_msgs/TuckArmsActionResult"; }; + virtual const char * getMD5() override { return "a151ea69df95c9525872b19d347d7f8e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsFeedback.h new file mode 100644 index 000000000..c59373f5a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_pr2_common_action_msgs_TuckArmsFeedback_h +#define _ROS_pr2_common_action_msgs_TuckArmsFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_common_action_msgs +{ + + class TuckArmsFeedback : public ros::Msg + { + public: + + TuckArmsFeedback() + { + } + + 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 "pr2_common_action_msgs/TuckArmsFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsGoal.h new file mode 100644 index 000000000..85288a54e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsGoal.h @@ -0,0 +1,74 @@ +#ifndef _ROS_pr2_common_action_msgs_TuckArmsGoal_h +#define _ROS_pr2_common_action_msgs_TuckArmsGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_common_action_msgs +{ + + class TuckArmsGoal : public ros::Msg + { + public: + typedef bool _tuck_left_type; + _tuck_left_type tuck_left; + typedef bool _tuck_right_type; + _tuck_right_type tuck_right; + + TuckArmsGoal(): + tuck_left(0), + tuck_right(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_tuck_left; + u_tuck_left.real = this->tuck_left; + *(outbuffer + offset + 0) = (u_tuck_left.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->tuck_left); + union { + bool real; + uint8_t base; + } u_tuck_right; + u_tuck_right.real = this->tuck_right; + *(outbuffer + offset + 0) = (u_tuck_right.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->tuck_right); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_tuck_left; + u_tuck_left.base = 0; + u_tuck_left.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->tuck_left = u_tuck_left.real; + offset += sizeof(this->tuck_left); + union { + bool real; + uint8_t base; + } u_tuck_right; + u_tuck_right.base = 0; + u_tuck_right.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->tuck_right = u_tuck_right.real; + offset += sizeof(this->tuck_right); + return offset; + } + + virtual const char * getType() override { return "pr2_common_action_msgs/TuckArmsGoal"; }; + virtual const char * getMD5() override { return "a07b11078a50f9881dc3004ca1174834"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsResult.h new file mode 100644 index 000000000..b62d12e5d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_common_action_msgs/TuckArmsResult.h @@ -0,0 +1,74 @@ +#ifndef _ROS_pr2_common_action_msgs_TuckArmsResult_h +#define _ROS_pr2_common_action_msgs_TuckArmsResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_common_action_msgs +{ + + class TuckArmsResult : public ros::Msg + { + public: + typedef bool _tuck_left_type; + _tuck_left_type tuck_left; + typedef bool _tuck_right_type; + _tuck_right_type tuck_right; + + TuckArmsResult(): + tuck_left(0), + tuck_right(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_tuck_left; + u_tuck_left.real = this->tuck_left; + *(outbuffer + offset + 0) = (u_tuck_left.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->tuck_left); + union { + bool real; + uint8_t base; + } u_tuck_right; + u_tuck_right.real = this->tuck_right; + *(outbuffer + offset + 0) = (u_tuck_right.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->tuck_right); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_tuck_left; + u_tuck_left.base = 0; + u_tuck_left.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->tuck_left = u_tuck_left.real; + offset += sizeof(this->tuck_left); + union { + bool real; + uint8_t base; + } u_tuck_right; + u_tuck_right.base = 0; + u_tuck_right.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->tuck_right = u_tuck_right.real; + offset += sizeof(this->tuck_right); + return offset; + } + + virtual const char * getType() override { return "pr2_common_action_msgs/TuckArmsResult"; }; + virtual const char * getMD5() override { return "a07b11078a50f9881dc3004ca1174834"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointControllerState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointControllerState.h new file mode 100644 index 000000000..4b02f96e1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointControllerState.h @@ -0,0 +1,94 @@ +#ifndef _ROS_pr2_controllers_msgs_JointControllerState_h +#define _ROS_pr2_controllers_msgs_JointControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pr2_controllers_msgs +{ + + class JointControllerState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _set_point_type; + _set_point_type set_point; + typedef float _process_value_type; + _process_value_type process_value; + typedef float _process_value_dot_type; + _process_value_dot_type process_value_dot; + typedef float _error_type; + _error_type error; + typedef float _time_step_type; + _time_step_type time_step; + typedef float _command_type; + _command_type command; + 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; + + JointControllerState(): + header(), + set_point(0), + process_value(0), + process_value_dot(0), + error(0), + time_step(0), + command(0), + p(0), + i(0), + d(0), + i_clamp(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->set_point); + offset += serializeAvrFloat64(outbuffer + offset, this->process_value); + offset += serializeAvrFloat64(outbuffer + offset, this->process_value_dot); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + offset += serializeAvrFloat64(outbuffer + offset, this->command); + 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); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->set_point)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->process_value)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->process_value_dot)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->command)); + 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)); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/JointControllerState"; }; + virtual const char * getMD5() override { return "c0d034a7bf20aeb1c37f3eccb7992b69"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryAction.h new file mode 100644 index 000000000..71f1926b3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_JointTrajectoryAction_h +#define _ROS_pr2_controllers_msgs_JointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_controllers_msgs/JointTrajectoryActionGoal.h" +#include "pr2_controllers_msgs/JointTrajectoryActionResult.h" +#include "pr2_controllers_msgs/JointTrajectoryActionFeedback.h" + +namespace pr2_controllers_msgs +{ + + class JointTrajectoryAction : public ros::Msg + { + public: + typedef pr2_controllers_msgs::JointTrajectoryActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_controllers_msgs::JointTrajectoryActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_controllers_msgs::JointTrajectoryActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + JointTrajectoryAction(): + 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 "pr2_controllers_msgs/JointTrajectoryAction"; }; + virtual const char * getMD5() override { return "a04ba3ee8f6a2d0985a6aeaf23d9d7ad"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionFeedback.h new file mode 100644 index 000000000..24118b2db --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_JointTrajectoryActionFeedback_h +#define _ROS_pr2_controllers_msgs_JointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_controllers_msgs/JointTrajectoryFeedback.h" + +namespace pr2_controllers_msgs +{ + + class JointTrajectoryActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_controllers_msgs::JointTrajectoryFeedback _feedback_type; + _feedback_type feedback; + + JointTrajectoryActionFeedback(): + 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 "pr2_controllers_msgs/JointTrajectoryActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionGoal.h new file mode 100644 index 000000000..8e5aad73b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_JointTrajectoryActionGoal_h +#define _ROS_pr2_controllers_msgs_JointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_controllers_msgs/JointTrajectoryGoal.h" + +namespace pr2_controllers_msgs +{ + + class JointTrajectoryActionGoal : 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 pr2_controllers_msgs::JointTrajectoryGoal _goal_type; + _goal_type goal; + + JointTrajectoryActionGoal(): + 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 "pr2_controllers_msgs/JointTrajectoryActionGoal"; }; + virtual const char * getMD5() override { return "a99e83ef6185f9fdd7693efe99623a86"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionResult.h new file mode 100644 index 000000000..0eb1b59a0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_JointTrajectoryActionResult_h +#define _ROS_pr2_controllers_msgs_JointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_controllers_msgs/JointTrajectoryResult.h" + +namespace pr2_controllers_msgs +{ + + class JointTrajectoryActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_controllers_msgs::JointTrajectoryResult _result_type; + _result_type result; + + JointTrajectoryActionResult(): + 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 "pr2_controllers_msgs/JointTrajectoryActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryControllerState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryControllerState.h new file mode 100644 index 000000000..9c4108bdc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryControllerState.h @@ -0,0 +1,97 @@ +#ifndef _ROS_pr2_controllers_msgs_JointTrajectoryControllerState_h +#define _ROS_pr2_controllers_msgs_JointTrajectoryControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace pr2_controllers_msgs +{ + + class JointTrajectoryControllerState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + typedef trajectory_msgs::JointTrajectoryPoint _desired_type; + _desired_type desired; + typedef trajectory_msgs::JointTrajectoryPoint _actual_type; + _actual_type actual; + typedef trajectory_msgs::JointTrajectoryPoint _error_type; + _error_type error; + + JointTrajectoryControllerState(): + header(), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/JointTrajectoryControllerState"; }; + virtual const char * getMD5() override { return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryFeedback.h new file mode 100644 index 000000000..93c8b8b20 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_pr2_controllers_msgs_JointTrajectoryFeedback_h +#define _ROS_pr2_controllers_msgs_JointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_controllers_msgs +{ + + class JointTrajectoryFeedback : public ros::Msg + { + public: + + JointTrajectoryFeedback() + { + } + + 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 "pr2_controllers_msgs/JointTrajectoryFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryGoal.h new file mode 100644 index 000000000..fa0aad5b3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_controllers_msgs_JointTrajectoryGoal_h +#define _ROS_pr2_controllers_msgs_JointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" + +namespace pr2_controllers_msgs +{ + + class JointTrajectoryGoal : public ros::Msg + { + public: + typedef trajectory_msgs::JointTrajectory _trajectory_type; + _trajectory_type trajectory; + + JointTrajectoryGoal(): + trajectory() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/JointTrajectoryGoal"; }; + virtual const char * getMD5() override { return "2a0eff76c870e8595636c2a562ca298e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryResult.h new file mode 100644 index 000000000..befed3c79 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/JointTrajectoryResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_pr2_controllers_msgs_JointTrajectoryResult_h +#define _ROS_pr2_controllers_msgs_JointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_controllers_msgs +{ + + class JointTrajectoryResult : public ros::Msg + { + public: + + JointTrajectoryResult() + { + } + + 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 "pr2_controllers_msgs/JointTrajectoryResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadAction.h new file mode 100644 index 000000000..2c6a64ee5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_PointHeadAction_h +#define _ROS_pr2_controllers_msgs_PointHeadAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_controllers_msgs/PointHeadActionGoal.h" +#include "pr2_controllers_msgs/PointHeadActionResult.h" +#include "pr2_controllers_msgs/PointHeadActionFeedback.h" + +namespace pr2_controllers_msgs +{ + + class PointHeadAction : public ros::Msg + { + public: + typedef pr2_controllers_msgs::PointHeadActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_controllers_msgs::PointHeadActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_controllers_msgs::PointHeadActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PointHeadAction(): + 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 "pr2_controllers_msgs/PointHeadAction"; }; + virtual const char * getMD5() override { return "7252920f1243de1b741f14f214125371"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionFeedback.h new file mode 100644 index 000000000..10789185a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_PointHeadActionFeedback_h +#define _ROS_pr2_controllers_msgs_PointHeadActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_controllers_msgs/PointHeadFeedback.h" + +namespace pr2_controllers_msgs +{ + + class PointHeadActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_controllers_msgs::PointHeadFeedback _feedback_type; + _feedback_type feedback; + + PointHeadActionFeedback(): + 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 "pr2_controllers_msgs/PointHeadActionFeedback"; }; + virtual const char * getMD5() override { return "33c9244957176bbba97dd641119e8460"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionGoal.h new file mode 100644 index 000000000..88ac09693 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_PointHeadActionGoal_h +#define _ROS_pr2_controllers_msgs_PointHeadActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_controllers_msgs/PointHeadGoal.h" + +namespace pr2_controllers_msgs +{ + + class PointHeadActionGoal : 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 pr2_controllers_msgs::PointHeadGoal _goal_type; + _goal_type goal; + + PointHeadActionGoal(): + 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 "pr2_controllers_msgs/PointHeadActionGoal"; }; + virtual const char * getMD5() override { return "b53a8323d0ba7b310ba17a2d3a82a6b8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionResult.h new file mode 100644 index 000000000..1d3c97f58 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_PointHeadActionResult_h +#define _ROS_pr2_controllers_msgs_PointHeadActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_controllers_msgs/PointHeadResult.h" + +namespace pr2_controllers_msgs +{ + + class PointHeadActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_controllers_msgs::PointHeadResult _result_type; + _result_type result; + + PointHeadActionResult(): + 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 "pr2_controllers_msgs/PointHeadActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadFeedback.h new file mode 100644 index 000000000..734e3c127 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadFeedback.h @@ -0,0 +1,43 @@ +#ifndef _ROS_pr2_controllers_msgs_PointHeadFeedback_h +#define _ROS_pr2_controllers_msgs_PointHeadFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_controllers_msgs +{ + + class PointHeadFeedback : public ros::Msg + { + public: + typedef float _pointing_angle_error_type; + _pointing_angle_error_type pointing_angle_error; + + PointHeadFeedback(): + pointing_angle_error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->pointing_angle_error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pointing_angle_error)); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/PointHeadFeedback"; }; + virtual const char * getMD5() override { return "cce80d27fd763682da8805a73316cab4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadGoal.h new file mode 100644 index 000000000..0e3c7d20c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadGoal.h @@ -0,0 +1,96 @@ +#ifndef _ROS_pr2_controllers_msgs_PointHeadGoal_h +#define _ROS_pr2_controllers_msgs_PointHeadGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PointStamped.h" +#include "geometry_msgs/Vector3.h" +#include "ros/duration.h" + +namespace pr2_controllers_msgs +{ + + class PointHeadGoal : public ros::Msg + { + public: + typedef geometry_msgs::PointStamped _target_type; + _target_type target; + typedef geometry_msgs::Vector3 _pointing_axis_type; + _pointing_axis_type pointing_axis; + typedef const char* _pointing_frame_type; + _pointing_frame_type pointing_frame; + typedef ros::Duration _min_duration_type; + _min_duration_type min_duration; + typedef float _max_velocity_type; + _max_velocity_type max_velocity; + + PointHeadGoal(): + target(), + pointing_axis(), + pointing_frame(""), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->target.serialize(outbuffer + offset); + offset += this->pointing_axis.serialize(outbuffer + offset); + uint32_t length_pointing_frame = strlen(this->pointing_frame); + varToArr(outbuffer + offset, length_pointing_frame); + offset += 4; + memcpy(outbuffer + offset, this->pointing_frame, length_pointing_frame); + offset += length_pointing_frame; + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->target.deserialize(inbuffer + offset); + offset += this->pointing_axis.deserialize(inbuffer + offset); + uint32_t length_pointing_frame; + arrToVar(length_pointing_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pointing_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pointing_frame-1]=0; + this->pointing_frame = (char *)(inbuffer + offset-1); + offset += length_pointing_frame; + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/PointHeadGoal"; }; + virtual const char * getMD5() override { return "8b92b1cd5e06c8a94c917dc3209a4c1d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadResult.h new file mode 100644 index 000000000..7801ee511 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/PointHeadResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_pr2_controllers_msgs_PointHeadResult_h +#define _ROS_pr2_controllers_msgs_PointHeadResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_controllers_msgs +{ + + class PointHeadResult : public ros::Msg + { + public: + + PointHeadResult() + { + } + + 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 "pr2_controllers_msgs/PointHeadResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommand.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommand.h new file mode 100644 index 000000000..b3ab9a503 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommand.h @@ -0,0 +1,48 @@ +#ifndef _ROS_pr2_controllers_msgs_Pr2GripperCommand_h +#define _ROS_pr2_controllers_msgs_Pr2GripperCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_controllers_msgs +{ + + class Pr2GripperCommand : public ros::Msg + { + public: + typedef float _position_type; + _position_type position; + typedef float _max_effort_type; + _max_effort_type max_effort; + + Pr2GripperCommand(): + position(0), + max_effort(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->max_effort); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_effort)); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/Pr2GripperCommand"; }; + virtual const char * getMD5() override { return "680acaff79486f017132a7f198d40f08"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandAction.h new file mode 100644 index 000000000..6b2376c0f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_Pr2GripperCommandAction_h +#define _ROS_pr2_controllers_msgs_Pr2GripperCommandAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_controllers_msgs/Pr2GripperCommandActionGoal.h" +#include "pr2_controllers_msgs/Pr2GripperCommandActionResult.h" +#include "pr2_controllers_msgs/Pr2GripperCommandActionFeedback.h" + +namespace pr2_controllers_msgs +{ + + class Pr2GripperCommandAction : public ros::Msg + { + public: + typedef pr2_controllers_msgs::Pr2GripperCommandActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_controllers_msgs::Pr2GripperCommandActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_controllers_msgs::Pr2GripperCommandActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + Pr2GripperCommandAction(): + 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 "pr2_controllers_msgs/Pr2GripperCommandAction"; }; + virtual const char * getMD5() override { return "950b2a6ebe831f5d4f4ceaba3d8be01e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionFeedback.h new file mode 100644 index 000000000..ccb26ab22 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_Pr2GripperCommandActionFeedback_h +#define _ROS_pr2_controllers_msgs_Pr2GripperCommandActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_controllers_msgs/Pr2GripperCommandFeedback.h" + +namespace pr2_controllers_msgs +{ + + class Pr2GripperCommandActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_controllers_msgs::Pr2GripperCommandFeedback _feedback_type; + _feedback_type feedback; + + Pr2GripperCommandActionFeedback(): + 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 "pr2_controllers_msgs/Pr2GripperCommandActionFeedback"; }; + virtual const char * getMD5() override { return "653dff30c045f5e6ff3feb3409f4558d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionGoal.h new file mode 100644 index 000000000..3aebfb8e7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_Pr2GripperCommandActionGoal_h +#define _ROS_pr2_controllers_msgs_Pr2GripperCommandActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_controllers_msgs/Pr2GripperCommandGoal.h" + +namespace pr2_controllers_msgs +{ + + class Pr2GripperCommandActionGoal : 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 pr2_controllers_msgs::Pr2GripperCommandGoal _goal_type; + _goal_type goal; + + Pr2GripperCommandActionGoal(): + 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 "pr2_controllers_msgs/Pr2GripperCommandActionGoal"; }; + virtual const char * getMD5() override { return "aa581f648a35ed681db2ec0bf7a82bea"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionResult.h new file mode 100644 index 000000000..455a40f0f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_Pr2GripperCommandActionResult_h +#define _ROS_pr2_controllers_msgs_Pr2GripperCommandActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_controllers_msgs/Pr2GripperCommandResult.h" + +namespace pr2_controllers_msgs +{ + + class Pr2GripperCommandActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_controllers_msgs::Pr2GripperCommandResult _result_type; + _result_type result; + + Pr2GripperCommandActionResult(): + 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 "pr2_controllers_msgs/Pr2GripperCommandActionResult"; }; + virtual const char * getMD5() override { return "143702cb2df0f163c5283cedc5efc6b6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandFeedback.h new file mode 100644 index 000000000..c15683c5e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandFeedback.h @@ -0,0 +1,84 @@ +#ifndef _ROS_pr2_controllers_msgs_Pr2GripperCommandFeedback_h +#define _ROS_pr2_controllers_msgs_Pr2GripperCommandFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_controllers_msgs +{ + + class Pr2GripperCommandFeedback : public ros::Msg + { + public: + typedef float _position_type; + _position_type position; + typedef float _effort_type; + _effort_type effort; + typedef bool _stalled_type; + _stalled_type stalled; + typedef bool _reached_goal_type; + _reached_goal_type reached_goal; + + Pr2GripperCommandFeedback(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/Pr2GripperCommandFeedback"; }; + virtual const char * getMD5() override { return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandGoal.h new file mode 100644 index 000000000..8911dd80b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_controllers_msgs_Pr2GripperCommandGoal_h +#define _ROS_pr2_controllers_msgs_Pr2GripperCommandGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_controllers_msgs/Pr2GripperCommand.h" + +namespace pr2_controllers_msgs +{ + + class Pr2GripperCommandGoal : public ros::Msg + { + public: + typedef pr2_controllers_msgs::Pr2GripperCommand _command_type; + _command_type command; + + Pr2GripperCommandGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/Pr2GripperCommandGoal"; }; + virtual const char * getMD5() override { return "86fd82f4ddc48a4cb6856cfa69217e43"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandResult.h new file mode 100644 index 000000000..e23b27f3f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/Pr2GripperCommandResult.h @@ -0,0 +1,84 @@ +#ifndef _ROS_pr2_controllers_msgs_Pr2GripperCommandResult_h +#define _ROS_pr2_controllers_msgs_Pr2GripperCommandResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_controllers_msgs +{ + + class Pr2GripperCommandResult : public ros::Msg + { + public: + typedef float _position_type; + _position_type position; + typedef float _effort_type; + _effort_type effort; + typedef bool _stalled_type; + _stalled_type stalled; + typedef bool _reached_goal_type; + _reached_goal_type reached_goal; + + Pr2GripperCommandResult(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/Pr2GripperCommandResult"; }; + virtual const char * getMD5() override { return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/QueryCalibrationState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/QueryCalibrationState.h new file mode 100644 index 000000000..1f68dea9d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/QueryCalibrationState.h @@ -0,0 +1,88 @@ +#ifndef _ROS_SERVICE_QueryCalibrationState_h +#define _ROS_SERVICE_QueryCalibrationState_h +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_controllers_msgs +{ + +static const char QUERYCALIBRATIONSTATE[] = "pr2_controllers_msgs/QueryCalibrationState"; + + class QueryCalibrationStateRequest : public ros::Msg + { + public: + + QueryCalibrationStateRequest() + { + } + + 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 QUERYCALIBRATIONSTATE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class QueryCalibrationStateResponse : public ros::Msg + { + public: + typedef bool _is_calibrated_type; + _is_calibrated_type is_calibrated; + + QueryCalibrationStateResponse(): + is_calibrated(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.real = this->is_calibrated; + *(outbuffer + offset + 0) = (u_is_calibrated.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_calibrated); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.base = 0; + u_is_calibrated.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_calibrated = u_is_calibrated.real; + offset += sizeof(this->is_calibrated); + return offset; + } + + virtual const char * getType() override { return QUERYCALIBRATIONSTATE; }; + virtual const char * getMD5() override { return "28af3beedcb84986b8e470dc5470507d"; }; + + }; + + class QueryCalibrationState { + public: + typedef QueryCalibrationStateRequest Request; + typedef QueryCalibrationStateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/QueryTrajectoryState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/QueryTrajectoryState.h new file mode 100644 index 000000000..8ace59e84 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/QueryTrajectoryState.h @@ -0,0 +1,206 @@ +#ifndef _ROS_SERVICE_QueryTrajectoryState_h +#define _ROS_SERVICE_QueryTrajectoryState_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace pr2_controllers_msgs +{ + +static const char QUERYTRAJECTORYSTATE[] = "pr2_controllers_msgs/QueryTrajectoryState"; + + class QueryTrajectoryStateRequest : public ros::Msg + { + public: + typedef ros::Time _time_type; + _time_type time; + + QueryTrajectoryStateRequest(): + time() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.sec); + *(outbuffer + offset + 0) = (this->time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->time.sec = ((uint32_t) (*(inbuffer + offset))); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.sec); + this->time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.nsec); + return offset; + } + + virtual const char * getType() override { return QUERYTRAJECTORYSTATE; }; + virtual const char * getMD5() override { return "556a4fb76023a469987922359d08a844"; }; + + }; + + class QueryTrajectoryStateResponse : public ros::Msg + { + public: + uint32_t name_length; + typedef char* _name_type; + _name_type st_name; + _name_type * name; + uint32_t position_length; + typedef float _position_type; + _position_type st_position; + _position_type * position; + uint32_t velocity_length; + typedef float _velocity_type; + _velocity_type st_velocity; + _velocity_type * velocity; + uint32_t acceleration_length; + typedef float _acceleration_type; + _acceleration_type st_acceleration; + _acceleration_type * acceleration; + + QueryTrajectoryStateResponse(): + name_length(0), st_name(), name(nullptr), + position_length(0), st_position(), position(nullptr), + velocity_length(0), st_velocity(), velocity(nullptr), + acceleration_length(0), st_acceleration(), acceleration(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->name_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->name_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->name_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->name_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->name_length); + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + varToArr(outbuffer + offset, length_namei); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset + 0) = (this->position_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->position_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->position_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->position_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->position_length); + for( uint32_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset + 0) = (this->velocity_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->velocity_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->velocity_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->velocity_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->velocity_length); + for( uint32_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset + 0) = (this->acceleration_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->acceleration_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->acceleration_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->acceleration_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->acceleration_length); + for( uint32_t i = 0; i < acceleration_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t name_lengthT = ((uint32_t) (*(inbuffer + offset))); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->name_length); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + name_length = name_lengthT; + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + arrToVar(length_st_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint32_t position_lengthT = ((uint32_t) (*(inbuffer + offset))); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->position_length); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + position_length = position_lengthT; + for( uint32_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint32_t velocity_lengthT = ((uint32_t) (*(inbuffer + offset))); + velocity_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + velocity_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + velocity_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->velocity_length); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + velocity_length = velocity_lengthT; + for( uint32_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint32_t acceleration_lengthT = ((uint32_t) (*(inbuffer + offset))); + acceleration_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + acceleration_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + acceleration_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->acceleration_length); + if(acceleration_lengthT > acceleration_length) + this->acceleration = (float*)realloc(this->acceleration, acceleration_lengthT * sizeof(float)); + acceleration_length = acceleration_lengthT; + for( uint32_t i = 0; i < acceleration_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_acceleration)); + memcpy( &(this->acceleration[i]), &(this->st_acceleration), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return QUERYTRAJECTORYSTATE; }; + virtual const char * getMD5() override { return "1f1a6554ad060f44d013e71868403c1a"; }; + + }; + + class QueryTrajectoryState { + public: + typedef QueryTrajectoryStateRequest Request; + typedef QueryTrajectoryStateResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionAction.h new file mode 100644 index 000000000..3eeba0ddb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_SingleJointPositionAction_h +#define _ROS_pr2_controllers_msgs_SingleJointPositionAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_controllers_msgs/SingleJointPositionActionGoal.h" +#include "pr2_controllers_msgs/SingleJointPositionActionResult.h" +#include "pr2_controllers_msgs/SingleJointPositionActionFeedback.h" + +namespace pr2_controllers_msgs +{ + + class SingleJointPositionAction : public ros::Msg + { + public: + typedef pr2_controllers_msgs::SingleJointPositionActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_controllers_msgs::SingleJointPositionActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_controllers_msgs::SingleJointPositionActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + SingleJointPositionAction(): + 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 "pr2_controllers_msgs/SingleJointPositionAction"; }; + virtual const char * getMD5() override { return "c4a786b7d53e5d0983decf967a5a779e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionFeedback.h new file mode 100644 index 000000000..0bc300148 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_SingleJointPositionActionFeedback_h +#define _ROS_pr2_controllers_msgs_SingleJointPositionActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_controllers_msgs/SingleJointPositionFeedback.h" + +namespace pr2_controllers_msgs +{ + + class SingleJointPositionActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_controllers_msgs::SingleJointPositionFeedback _feedback_type; + _feedback_type feedback; + + SingleJointPositionActionFeedback(): + 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 "pr2_controllers_msgs/SingleJointPositionActionFeedback"; }; + virtual const char * getMD5() override { return "3503b7cf8972f90d245850a5d8796cfa"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionGoal.h new file mode 100644 index 000000000..b547e3ef4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_SingleJointPositionActionGoal_h +#define _ROS_pr2_controllers_msgs_SingleJointPositionActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_controllers_msgs/SingleJointPositionGoal.h" + +namespace pr2_controllers_msgs +{ + + class SingleJointPositionActionGoal : 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 pr2_controllers_msgs::SingleJointPositionGoal _goal_type; + _goal_type goal; + + SingleJointPositionActionGoal(): + 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 "pr2_controllers_msgs/SingleJointPositionActionGoal"; }; + virtual const char * getMD5() override { return "4b0d3d091471663e17749c1d0db90f61"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionResult.h new file mode 100644 index 000000000..501383975 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_controllers_msgs_SingleJointPositionActionResult_h +#define _ROS_pr2_controllers_msgs_SingleJointPositionActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_controllers_msgs/SingleJointPositionResult.h" + +namespace pr2_controllers_msgs +{ + + class SingleJointPositionActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_controllers_msgs::SingleJointPositionResult _result_type; + _result_type result; + + SingleJointPositionActionResult(): + 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 "pr2_controllers_msgs/SingleJointPositionActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionFeedback.h new file mode 100644 index 000000000..867bf4ffc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionFeedback.h @@ -0,0 +1,59 @@ +#ifndef _ROS_pr2_controllers_msgs_SingleJointPositionFeedback_h +#define _ROS_pr2_controllers_msgs_SingleJointPositionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pr2_controllers_msgs +{ + + class SingleJointPositionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _position_type; + _position_type position; + typedef float _velocity_type; + _velocity_type velocity; + typedef float _error_type; + _error_type error; + + SingleJointPositionFeedback(): + header(), + position(0), + velocity(0), + error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/SingleJointPositionFeedback"; }; + virtual const char * getMD5() override { return "8cee65610a3d08e0a1bded82f146f1fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionGoal.h new file mode 100644 index 000000000..cb9ebccc1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionGoal.h @@ -0,0 +1,72 @@ +#ifndef _ROS_pr2_controllers_msgs_SingleJointPositionGoal_h +#define _ROS_pr2_controllers_msgs_SingleJointPositionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace pr2_controllers_msgs +{ + + class SingleJointPositionGoal : public ros::Msg + { + public: + typedef float _position_type; + _position_type position; + typedef ros::Duration _min_duration_type; + _min_duration_type min_duration; + typedef float _max_velocity_type; + _max_velocity_type max_velocity; + + SingleJointPositionGoal(): + position(0), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + return offset; + } + + virtual const char * getType() override { return "pr2_controllers_msgs/SingleJointPositionGoal"; }; + virtual const char * getMD5() override { return "fbaaa562a23a013fd5053e5f72cbb35c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionResult.h new file mode 100644 index 000000000..cbdc12065 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_controllers_msgs/SingleJointPositionResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_pr2_controllers_msgs_SingleJointPositionResult_h +#define _ROS_pr2_controllers_msgs_SingleJointPositionResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_controllers_msgs +{ + + class SingleJointPositionResult : public ros::Msg + { + public: + + SingleJointPositionResult() + { + } + + 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 "pr2_controllers_msgs/SingleJointPositionResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/ModelJointsState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/ModelJointsState.h new file mode 100644 index 000000000..61d7f9513 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/ModelJointsState.h @@ -0,0 +1,126 @@ +#ifndef _ROS_pr2_gazebo_plugins_ModelJointsState_h +#define _ROS_pr2_gazebo_plugins_ModelJointsState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace pr2_gazebo_plugins +{ + + class ModelJointsState : public ros::Msg + { + public: + uint32_t model_pose_length; + typedef geometry_msgs::Pose _model_pose_type; + _model_pose_type st_model_pose; + _model_pose_type * model_pose; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t joint_positions_length; + typedef float _joint_positions_type; + _joint_positions_type st_joint_positions; + _joint_positions_type * joint_positions; + + ModelJointsState(): + model_pose_length(0), st_model_pose(), model_pose(nullptr), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + joint_positions_length(0), st_joint_positions(), joint_positions(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->model_pose_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->model_pose_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->model_pose_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->model_pose_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->model_pose_length); + for( uint32_t i = 0; i < model_pose_length; i++){ + offset += this->model_pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset + 0) = (this->joint_positions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_positions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_positions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_positions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_positions_length); + for( uint32_t i = 0; i < joint_positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_positions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t model_pose_lengthT = ((uint32_t) (*(inbuffer + offset))); + model_pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + model_pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + model_pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->model_pose_length); + if(model_pose_lengthT > model_pose_length) + this->model_pose = (geometry_msgs::Pose*)realloc(this->model_pose, model_pose_lengthT * sizeof(geometry_msgs::Pose)); + model_pose_length = model_pose_lengthT; + for( uint32_t i = 0; i < model_pose_length; i++){ + offset += this->st_model_pose.deserialize(inbuffer + offset); + memcpy( &(this->model_pose[i]), &(this->st_model_pose), sizeof(geometry_msgs::Pose)); + } + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint32_t joint_positions_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_positions_length); + if(joint_positions_lengthT > joint_positions_length) + this->joint_positions = (float*)realloc(this->joint_positions, joint_positions_lengthT * sizeof(float)); + joint_positions_length = joint_positions_lengthT; + for( uint32_t i = 0; i < joint_positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_positions)); + memcpy( &(this->joint_positions[i]), &(this->st_joint_positions), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_gazebo_plugins/ModelJointsState"; }; + virtual const char * getMD5() override { return "f700a74958b6566fae4cd77fbb80ffd4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/PlugCommand.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/PlugCommand.h new file mode 100644 index 000000000..05fd01c33 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/PlugCommand.h @@ -0,0 +1,71 @@ +#ifndef _ROS_pr2_gazebo_plugins_PlugCommand_h +#define _ROS_pr2_gazebo_plugins_PlugCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_gazebo_plugins +{ + + class PlugCommand : public ros::Msg + { + public: + typedef bool _ac_present_type; + _ac_present_type ac_present; + typedef float _charge_rate_type; + _charge_rate_type charge_rate; + typedef float _discharge_rate_type; + _discharge_rate_type discharge_rate; + typedef float _charge_type; + _charge_type charge; + + PlugCommand(): + ac_present(0), + charge_rate(0), + discharge_rate(0), + charge(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_ac_present; + u_ac_present.real = this->ac_present; + *(outbuffer + offset + 0) = (u_ac_present.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->ac_present); + offset += serializeAvrFloat64(outbuffer + offset, this->charge_rate); + offset += serializeAvrFloat64(outbuffer + offset, this->discharge_rate); + offset += serializeAvrFloat64(outbuffer + offset, this->charge); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_ac_present; + u_ac_present.base = 0; + u_ac_present.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->ac_present = u_ac_present.real; + offset += sizeof(this->ac_present); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->charge_rate)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->discharge_rate)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->charge)); + return offset; + } + + virtual const char * getType() override { return "pr2_gazebo_plugins/PlugCommand"; }; + virtual const char * getMD5() override { return "852b7035ee3e7fa6390824cf7b7e6dd1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/SetModelsJointsStates.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/SetModelsJointsStates.h new file mode 100644 index 000000000..e20d0234d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gazebo_plugins/SetModelsJointsStates.h @@ -0,0 +1,168 @@ +#ifndef _ROS_SERVICE_SetModelsJointsStates_h +#define _ROS_SERVICE_SetModelsJointsStates_h +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gazebo_plugins/ModelJointsState.h" + +namespace pr2_gazebo_plugins +{ + +static const char SETMODELSJOINTSSTATES[] = "pr2_gazebo_plugins/SetModelsJointsStates"; + + class SetModelsJointsStatesRequest : public ros::Msg + { + public: + uint32_t model_names_length; + typedef char* _model_names_type; + _model_names_type st_model_names; + _model_names_type * model_names; + uint32_t model_joints_states_length; + typedef pr2_gazebo_plugins::ModelJointsState _model_joints_states_type; + _model_joints_states_type st_model_joints_states; + _model_joints_states_type * model_joints_states; + + SetModelsJointsStatesRequest(): + model_names_length(0), st_model_names(), model_names(nullptr), + model_joints_states_length(0), st_model_joints_states(), model_joints_states(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->model_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->model_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->model_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->model_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->model_names_length); + for( uint32_t i = 0; i < model_names_length; i++){ + uint32_t length_model_namesi = strlen(this->model_names[i]); + varToArr(outbuffer + offset, length_model_namesi); + offset += 4; + memcpy(outbuffer + offset, this->model_names[i], length_model_namesi); + offset += length_model_namesi; + } + *(outbuffer + offset + 0) = (this->model_joints_states_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->model_joints_states_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->model_joints_states_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->model_joints_states_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->model_joints_states_length); + for( uint32_t i = 0; i < model_joints_states_length; i++){ + offset += this->model_joints_states[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t model_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->model_names_length); + if(model_names_lengthT > model_names_length) + this->model_names = (char**)realloc(this->model_names, model_names_lengthT * sizeof(char*)); + model_names_length = model_names_lengthT; + for( uint32_t i = 0; i < model_names_length; i++){ + uint32_t length_st_model_names; + arrToVar(length_st_model_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_model_names-1]=0; + this->st_model_names = (char *)(inbuffer + offset-1); + offset += length_st_model_names; + memcpy( &(this->model_names[i]), &(this->st_model_names), sizeof(char*)); + } + uint32_t model_joints_states_lengthT = ((uint32_t) (*(inbuffer + offset))); + model_joints_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + model_joints_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + model_joints_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->model_joints_states_length); + if(model_joints_states_lengthT > model_joints_states_length) + this->model_joints_states = (pr2_gazebo_plugins::ModelJointsState*)realloc(this->model_joints_states, model_joints_states_lengthT * sizeof(pr2_gazebo_plugins::ModelJointsState)); + model_joints_states_length = model_joints_states_lengthT; + for( uint32_t i = 0; i < model_joints_states_length; i++){ + offset += this->st_model_joints_states.deserialize(inbuffer + offset); + memcpy( &(this->model_joints_states[i]), &(this->st_model_joints_states), sizeof(pr2_gazebo_plugins::ModelJointsState)); + } + return offset; + } + + virtual const char * getType() override { return SETMODELSJOINTSSTATES; }; + virtual const char * getMD5() override { return "ecf71b483df7b70447575a8231727200"; }; + + }; + + class SetModelsJointsStatesResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetModelsJointsStatesResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETMODELSJOINTSSTATES; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelsJointsStates { + public: + typedef SetModelsJointsStatesRequest Request; + typedef SetModelsJointsStatesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorAction.h new file mode 100644 index 000000000..7d6c3b753 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorAction_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionGoal.h" +#include "pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionResult.h" +#include "pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperEventDetectorAction : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperEventDetectorActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_gripper_sensor_msgs::PR2GripperEventDetectorActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_gripper_sensor_msgs::PR2GripperEventDetectorActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PR2GripperEventDetectorAction(): + 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 "pr2_gripper_sensor_msgs/PR2GripperEventDetectorAction"; }; + virtual const char * getMD5() override { return "d4e2ee2d04e941280f34bdb366daa9a4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionFeedback.h new file mode 100644 index 000000000..7f9adb2b6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorActionFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperEventDetectorFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperEventDetectorActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperEventDetectorFeedback _feedback_type; + _feedback_type feedback; + + PR2GripperEventDetectorActionFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionFeedback"; }; + virtual const char * getMD5() override { return "b7cae5a018676f4d59b2f204229012d4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionGoal.h new file mode 100644 index 000000000..c78d50858 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorActionGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_gripper_sensor_msgs/PR2GripperEventDetectorGoal.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperEventDetectorActionGoal : 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 pr2_gripper_sensor_msgs::PR2GripperEventDetectorGoal _goal_type; + _goal_type goal; + + PR2GripperEventDetectorActionGoal(): + 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 "pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionGoal"; }; + virtual const char * getMD5() override { return "b1b345667b018e9030cc7b6aad5c1455"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionResult.h new file mode 100644 index 000000000..8bbe9d12e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorActionResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperEventDetectorResult.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperEventDetectorActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperEventDetectorResult _result_type; + _result_type result; + + PR2GripperEventDetectorActionResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionResult"; }; + virtual const char * getMD5() override { return "a8c6f42e274ecd861ad072720ef9894b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand.h new file mode 100644 index 000000000..ccddc1b11 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand.h @@ -0,0 +1,71 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorCommand_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperEventDetectorCommand : public ros::Msg + { + public: + typedef int8_t _trigger_conditions_type; + _trigger_conditions_type trigger_conditions; + typedef float _acceleration_trigger_magnitude_type; + _acceleration_trigger_magnitude_type acceleration_trigger_magnitude; + typedef float _slip_trigger_magnitude_type; + _slip_trigger_magnitude_type slip_trigger_magnitude; + enum { FINGER_SIDE_IMPACT_OR_ACC = 0 }; + enum { SLIP_AND_ACC = 1 }; + enum { FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC = 2 }; + enum { SLIP = 3 }; + enum { ACC = 4 }; + + PR2GripperEventDetectorCommand(): + trigger_conditions(0), + acceleration_trigger_magnitude(0), + slip_trigger_magnitude(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_trigger_conditions; + u_trigger_conditions.real = this->trigger_conditions; + *(outbuffer + offset + 0) = (u_trigger_conditions.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->trigger_conditions); + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration_trigger_magnitude); + offset += serializeAvrFloat64(outbuffer + offset, this->slip_trigger_magnitude); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_trigger_conditions; + u_trigger_conditions.base = 0; + u_trigger_conditions.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->trigger_conditions = u_trigger_conditions.real; + offset += sizeof(this->trigger_conditions); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acceleration_trigger_magnitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->slip_trigger_magnitude)); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand"; }; + virtual const char * getMD5() override { return "b91a7e1e863671a84c1d06e0cac3146e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorData.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorData.h new file mode 100644 index 000000000..a8c30cd23 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorData.h @@ -0,0 +1,124 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorData_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperEventDetectorData : public ros::Msg + { + public: + typedef ros::Time _stamp_type; + _stamp_type stamp; + typedef bool _trigger_conditions_met_type; + _trigger_conditions_met_type trigger_conditions_met; + typedef bool _slip_event_type; + _slip_event_type slip_event; + typedef bool _acceleration_event_type; + _acceleration_event_type acceleration_event; + float acceleration_vector[3]; + + PR2GripperEventDetectorData(): + stamp(), + trigger_conditions_met(0), + slip_event(0), + acceleration_event(0), + acceleration_vector() + { + } + + 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); + union { + bool real; + uint8_t base; + } u_trigger_conditions_met; + u_trigger_conditions_met.real = this->trigger_conditions_met; + *(outbuffer + offset + 0) = (u_trigger_conditions_met.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->trigger_conditions_met); + union { + bool real; + uint8_t base; + } u_slip_event; + u_slip_event.real = this->slip_event; + *(outbuffer + offset + 0) = (u_slip_event.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->slip_event); + union { + bool real; + uint8_t base; + } u_acceleration_event; + u_acceleration_event.real = this->acceleration_event; + *(outbuffer + offset + 0) = (u_acceleration_event.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->acceleration_event); + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration_vector[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); + union { + bool real; + uint8_t base; + } u_trigger_conditions_met; + u_trigger_conditions_met.base = 0; + u_trigger_conditions_met.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->trigger_conditions_met = u_trigger_conditions_met.real; + offset += sizeof(this->trigger_conditions_met); + union { + bool real; + uint8_t base; + } u_slip_event; + u_slip_event.base = 0; + u_slip_event.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->slip_event = u_slip_event.real; + offset += sizeof(this->slip_event); + union { + bool real; + uint8_t base; + } u_acceleration_event; + u_acceleration_event.base = 0; + u_acceleration_event.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->acceleration_event = u_acceleration_event.real; + offset += sizeof(this->acceleration_event); + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acceleration_vector[i])); + } + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperEventDetectorData"; }; + virtual const char * getMD5() override { return "9536d682ef6215440ecc47846d4117c2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorFeedback.h new file mode 100644 index 000000000..8b38fc55f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorFeedback.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperEventDetectorData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperEventDetectorFeedback : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperEventDetectorData _data_type; + _data_type data; + + PR2GripperEventDetectorFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperEventDetectorFeedback"; }; + virtual const char * getMD5() override { return "817b45a51c75a067eb5dfb8e18b14aa1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorGoal.h new file mode 100644 index 000000000..ad99a3175 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperEventDetectorGoal : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperEventDetectorCommand _command_type; + _command_type command; + + PR2GripperEventDetectorGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperEventDetectorGoal"; }; + virtual const char * getMD5() override { return "88b98e578eece7bef53cd48d37d3253b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorResult.h new file mode 100644 index 000000000..5dece04cd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperEventDetectorResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperEventDetectorResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperEventDetectorData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperEventDetectorResult : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperEventDetectorData _data_type; + _data_type data; + + PR2GripperEventDetectorResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperEventDetectorResult"; }; + virtual const char * getMD5() override { return "817b45a51c75a067eb5dfb8e18b14aa1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactAction.h new file mode 100644 index 000000000..2e8f3a7d0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactAction_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperFindContactActionGoal.h" +#include "pr2_gripper_sensor_msgs/PR2GripperFindContactActionResult.h" +#include "pr2_gripper_sensor_msgs/PR2GripperFindContactActionFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperFindContactAction : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperFindContactActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_gripper_sensor_msgs::PR2GripperFindContactActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_gripper_sensor_msgs::PR2GripperFindContactActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PR2GripperFindContactAction(): + 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 "pr2_gripper_sensor_msgs/PR2GripperFindContactAction"; }; + virtual const char * getMD5() override { return "99ab2df1bbde46c447b38f28b7896d16"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionFeedback.h new file mode 100644 index 000000000..70b0cdba5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactActionFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperFindContactActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperFindContactFeedback _feedback_type; + _feedback_type feedback; + + PR2GripperFindContactActionFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperFindContactActionFeedback"; }; + virtual const char * getMD5() override { return "6f5508091ee61f963690fb74fc7df932"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionGoal.h new file mode 100644 index 000000000..a1658495f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactActionGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_gripper_sensor_msgs/PR2GripperFindContactGoal.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperFindContactActionGoal : 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 pr2_gripper_sensor_msgs::PR2GripperFindContactGoal _goal_type; + _goal_type goal; + + PR2GripperFindContactActionGoal(): + 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 "pr2_gripper_sensor_msgs/PR2GripperFindContactActionGoal"; }; + virtual const char * getMD5() override { return "50fc3f7e604d4e257a2e38e3aa3f204e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionResult.h new file mode 100644 index 000000000..317ae1104 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactActionResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperFindContactResult.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperFindContactActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperFindContactResult _result_type; + _result_type result; + + PR2GripperFindContactActionResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperFindContactActionResult"; }; + virtual const char * getMD5() override { return "a6c2a5d7fd0f224cb63dad13756a8a2a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactCommand.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactCommand.h new file mode 100644 index 000000000..9cb3d4e29 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactCommand.h @@ -0,0 +1,78 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactCommand_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperFindContactCommand : public ros::Msg + { + public: + typedef bool _zero_fingertip_sensors_type; + _zero_fingertip_sensors_type zero_fingertip_sensors; + typedef int8_t _contact_conditions_type; + _contact_conditions_type contact_conditions; + enum { BOTH = 0 }; + enum { LEFT = 1 }; + enum { RIGHT = 2 }; + enum { EITHER = 3 }; + + PR2GripperFindContactCommand(): + zero_fingertip_sensors(0), + contact_conditions(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_zero_fingertip_sensors; + u_zero_fingertip_sensors.real = this->zero_fingertip_sensors; + *(outbuffer + offset + 0) = (u_zero_fingertip_sensors.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->zero_fingertip_sensors); + union { + int8_t real; + uint8_t base; + } u_contact_conditions; + u_contact_conditions.real = this->contact_conditions; + *(outbuffer + offset + 0) = (u_contact_conditions.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->contact_conditions); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_zero_fingertip_sensors; + u_zero_fingertip_sensors.base = 0; + u_zero_fingertip_sensors.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->zero_fingertip_sensors = u_zero_fingertip_sensors.real; + offset += sizeof(this->zero_fingertip_sensors); + union { + int8_t real; + uint8_t base; + } u_contact_conditions; + u_contact_conditions.base = 0; + u_contact_conditions.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->contact_conditions = u_contact_conditions.real; + offset += sizeof(this->contact_conditions); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperFindContactCommand"; }; + virtual const char * getMD5() override { return "4a38a1a8e495aae86921ef2b292ec260"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactData.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactData.h new file mode 100644 index 000000000..2624e0cdd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactData.h @@ -0,0 +1,142 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactData_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSensorRTState.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperFindContactData : public ros::Msg + { + public: + typedef ros::Time _stamp_type; + _stamp_type stamp; + typedef bool _contact_conditions_met_type; + _contact_conditions_met_type contact_conditions_met; + typedef bool _left_fingertip_pad_contact_type; + _left_fingertip_pad_contact_type left_fingertip_pad_contact; + typedef bool _right_fingertip_pad_contact_type; + _right_fingertip_pad_contact_type right_fingertip_pad_contact; + typedef float _left_fingertip_pad_force_type; + _left_fingertip_pad_force_type left_fingertip_pad_force; + typedef float _right_fingertip_pad_force_type; + _right_fingertip_pad_force_type right_fingertip_pad_force; + typedef float _joint_position_type; + _joint_position_type joint_position; + typedef float _joint_effort_type; + _joint_effort_type joint_effort; + typedef pr2_gripper_sensor_msgs::PR2GripperSensorRTState _rtstate_type; + _rtstate_type rtstate; + + PR2GripperFindContactData(): + stamp(), + contact_conditions_met(0), + left_fingertip_pad_contact(0), + right_fingertip_pad_contact(0), + left_fingertip_pad_force(0), + right_fingertip_pad_force(0), + joint_position(0), + joint_effort(0), + rtstate() + { + } + + 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); + union { + bool real; + uint8_t base; + } u_contact_conditions_met; + u_contact_conditions_met.real = this->contact_conditions_met; + *(outbuffer + offset + 0) = (u_contact_conditions_met.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->contact_conditions_met); + union { + bool real; + uint8_t base; + } u_left_fingertip_pad_contact; + u_left_fingertip_pad_contact.real = this->left_fingertip_pad_contact; + *(outbuffer + offset + 0) = (u_left_fingertip_pad_contact.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->left_fingertip_pad_contact); + union { + bool real; + uint8_t base; + } u_right_fingertip_pad_contact; + u_right_fingertip_pad_contact.real = this->right_fingertip_pad_contact; + *(outbuffer + offset + 0) = (u_right_fingertip_pad_contact.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->right_fingertip_pad_contact); + offset += serializeAvrFloat64(outbuffer + offset, this->left_fingertip_pad_force); + offset += serializeAvrFloat64(outbuffer + offset, this->right_fingertip_pad_force); + offset += serializeAvrFloat64(outbuffer + offset, this->joint_position); + offset += serializeAvrFloat64(outbuffer + offset, this->joint_effort); + offset += this->rtstate.serialize(outbuffer + offset); + 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); + union { + bool real; + uint8_t base; + } u_contact_conditions_met; + u_contact_conditions_met.base = 0; + u_contact_conditions_met.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->contact_conditions_met = u_contact_conditions_met.real; + offset += sizeof(this->contact_conditions_met); + union { + bool real; + uint8_t base; + } u_left_fingertip_pad_contact; + u_left_fingertip_pad_contact.base = 0; + u_left_fingertip_pad_contact.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->left_fingertip_pad_contact = u_left_fingertip_pad_contact.real; + offset += sizeof(this->left_fingertip_pad_contact); + union { + bool real; + uint8_t base; + } u_right_fingertip_pad_contact; + u_right_fingertip_pad_contact.base = 0; + u_right_fingertip_pad_contact.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->right_fingertip_pad_contact = u_right_fingertip_pad_contact.real; + offset += sizeof(this->right_fingertip_pad_contact); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->left_fingertip_pad_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->right_fingertip_pad_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->joint_position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->joint_effort)); + offset += this->rtstate.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperFindContactData"; }; + virtual const char * getMD5() override { return "bc53e3dc7d19b896ca9b5ea205d54b91"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback.h new file mode 100644 index 000000000..287370c4a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperFindContactData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperFindContactFeedback : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperFindContactData _data_type; + _data_type data; + + PR2GripperFindContactFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback"; }; + virtual const char * getMD5() override { return "a1cc8c2fc9268b550e6167f268f97574"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactGoal.h new file mode 100644 index 000000000..9f42be4f8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperFindContactCommand.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperFindContactGoal : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperFindContactCommand _command_type; + _command_type command; + + PR2GripperFindContactGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperFindContactGoal"; }; + virtual const char * getMD5() override { return "f0ae570e217e7429eba0f205341933a0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactResult.h new file mode 100644 index 000000000..a097231eb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperFindContactResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperFindContactResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperFindContactData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperFindContactResult : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperFindContactData _data_type; + _data_type data; + + PR2GripperFindContactResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperFindContactResult"; }; + virtual const char * getMD5() override { return "a1cc8c2fc9268b550e6167f268f97574"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoAction.h new file mode 100644 index 000000000..32d6fe1f9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoAction_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperForceServoActionGoal.h" +#include "pr2_gripper_sensor_msgs/PR2GripperForceServoActionResult.h" +#include "pr2_gripper_sensor_msgs/PR2GripperForceServoActionFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperForceServoAction : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperForceServoActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_gripper_sensor_msgs::PR2GripperForceServoActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_gripper_sensor_msgs::PR2GripperForceServoActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PR2GripperForceServoAction(): + 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 "pr2_gripper_sensor_msgs/PR2GripperForceServoAction"; }; + virtual const char * getMD5() override { return "0540bb7603e65b3df5c9dc87b150e790"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionFeedback.h new file mode 100644 index 000000000..87d0ce873 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoActionFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperForceServoFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperForceServoActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperForceServoFeedback _feedback_type; + _feedback_type feedback; + + PR2GripperForceServoActionFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperForceServoActionFeedback"; }; + virtual const char * getMD5() override { return "d8ca0d3860c2a6ed1145d230fe6bd9db"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionGoal.h new file mode 100644 index 000000000..c4e4921a1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoActionGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_gripper_sensor_msgs/PR2GripperForceServoGoal.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperForceServoActionGoal : 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 pr2_gripper_sensor_msgs::PR2GripperForceServoGoal _goal_type; + _goal_type goal; + + PR2GripperForceServoActionGoal(): + 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 "pr2_gripper_sensor_msgs/PR2GripperForceServoActionGoal"; }; + virtual const char * getMD5() override { return "6fef46f6d468335bf123ba62175e1dc9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionResult.h new file mode 100644 index 000000000..dc6be7729 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoActionResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperForceServoResult.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperForceServoActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperForceServoResult _result_type; + _result_type result; + + PR2GripperForceServoActionResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperForceServoActionResult"; }; + virtual const char * getMD5() override { return "2c107270a9608ca3951b3a5b1939e401"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoCommand.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoCommand.h new file mode 100644 index 000000000..d4e5c3f4a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoCommand.h @@ -0,0 +1,43 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoCommand_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperForceServoCommand : public ros::Msg + { + public: + typedef float _fingertip_force_type; + _fingertip_force_type fingertip_force; + + PR2GripperForceServoCommand(): + fingertip_force(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->fingertip_force); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->fingertip_force)); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperForceServoCommand"; }; + virtual const char * getMD5() override { return "dd4b2a0dfafa27b67d2002841f544379"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoData.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoData.h new file mode 100644 index 000000000..16e6ca3cd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoData.h @@ -0,0 +1,101 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoData_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSensorRTState.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperForceServoData : public ros::Msg + { + public: + typedef ros::Time _stamp_type; + _stamp_type stamp; + typedef float _left_fingertip_pad_force_type; + _left_fingertip_pad_force_type left_fingertip_pad_force; + typedef float _right_fingertip_pad_force_type; + _right_fingertip_pad_force_type right_fingertip_pad_force; + typedef float _joint_effort_type; + _joint_effort_type joint_effort; + typedef bool _force_achieved_type; + _force_achieved_type force_achieved; + typedef pr2_gripper_sensor_msgs::PR2GripperSensorRTState _rtstate_type; + _rtstate_type rtstate; + + PR2GripperForceServoData(): + stamp(), + left_fingertip_pad_force(0), + right_fingertip_pad_force(0), + joint_effort(0), + force_achieved(0), + rtstate() + { + } + + 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); + offset += serializeAvrFloat64(outbuffer + offset, this->left_fingertip_pad_force); + offset += serializeAvrFloat64(outbuffer + offset, this->right_fingertip_pad_force); + offset += serializeAvrFloat64(outbuffer + offset, this->joint_effort); + union { + bool real; + uint8_t base; + } u_force_achieved; + u_force_achieved.real = this->force_achieved; + *(outbuffer + offset + 0) = (u_force_achieved.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->force_achieved); + offset += this->rtstate.serialize(outbuffer + offset); + 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); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->left_fingertip_pad_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->right_fingertip_pad_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->joint_effort)); + union { + bool real; + uint8_t base; + } u_force_achieved; + u_force_achieved.base = 0; + u_force_achieved.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->force_achieved = u_force_achieved.real; + offset += sizeof(this->force_achieved); + offset += this->rtstate.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperForceServoData"; }; + virtual const char * getMD5() override { return "d3960eb2ecb6a9b4c27065619e47fd06"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoFeedback.h new file mode 100644 index 000000000..ffccd7232 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoFeedback.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperForceServoData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperForceServoFeedback : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperForceServoData _data_type; + _data_type data; + + PR2GripperForceServoFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperForceServoFeedback"; }; + virtual const char * getMD5() override { return "a85c0d43537b45945527f5de565ab7c2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoGoal.h new file mode 100644 index 000000000..d467268ae --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperForceServoCommand.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperForceServoGoal : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperForceServoCommand _command_type; + _command_type command; + + PR2GripperForceServoGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperForceServoGoal"; }; + virtual const char * getMD5() override { return "72dfec6461d0f26a4433260fc791bc48"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoResult.h new file mode 100644 index 000000000..2b2b046f8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperForceServoResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperForceServoResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperForceServoData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperForceServoResult : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperForceServoData _data_type; + _data_type data; + + PR2GripperForceServoResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperForceServoResult"; }; + virtual const char * getMD5() override { return "a85c0d43537b45945527f5de565ab7c2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabAction.h new file mode 100644 index 000000000..4ae3edcdb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabAction_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperGrabActionGoal.h" +#include "pr2_gripper_sensor_msgs/PR2GripperGrabActionResult.h" +#include "pr2_gripper_sensor_msgs/PR2GripperGrabActionFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperGrabAction : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperGrabActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_gripper_sensor_msgs::PR2GripperGrabActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_gripper_sensor_msgs::PR2GripperGrabActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PR2GripperGrabAction(): + 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 "pr2_gripper_sensor_msgs/PR2GripperGrabAction"; }; + virtual const char * getMD5() override { return "f467562414aabe5b90666be976b0c379"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionFeedback.h new file mode 100644 index 000000000..bc1a7c8fb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabActionFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperGrabFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperGrabActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperGrabFeedback _feedback_type; + _feedback_type feedback; + + PR2GripperGrabActionFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperGrabActionFeedback"; }; + virtual const char * getMD5() override { return "83231ee429239525d42b1713d6791069"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionGoal.h new file mode 100644 index 000000000..d9986a965 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabActionGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_gripper_sensor_msgs/PR2GripperGrabGoal.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperGrabActionGoal : 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 pr2_gripper_sensor_msgs::PR2GripperGrabGoal _goal_type; + _goal_type goal; + + PR2GripperGrabActionGoal(): + 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 "pr2_gripper_sensor_msgs/PR2GripperGrabActionGoal"; }; + virtual const char * getMD5() override { return "e540762b3e9da0e115b0380658bdbe12"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionResult.h new file mode 100644 index 000000000..7b79b5160 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabActionResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperGrabResult.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperGrabActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperGrabResult _result_type; + _result_type result; + + PR2GripperGrabActionResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperGrabActionResult"; }; + virtual const char * getMD5() override { return "cffa4a24ed0ee3ef3fa8a4d8b2706751"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabCommand.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabCommand.h new file mode 100644 index 000000000..755aeecf3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabCommand.h @@ -0,0 +1,43 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabCommand_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperGrabCommand : public ros::Msg + { + public: + typedef float _hardness_gain_type; + _hardness_gain_type hardness_gain; + + PR2GripperGrabCommand(): + hardness_gain(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->hardness_gain); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->hardness_gain)); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperGrabCommand"; }; + virtual const char * getMD5() override { return "cf286b093615060c79527896d36bf694"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabData.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabData.h new file mode 100644 index 000000000..a2081f944 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabData.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabData_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabData_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSensorRTState.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperGrabData : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperSensorRTState _rtstate_type; + _rtstate_type rtstate; + + PR2GripperGrabData(): + rtstate() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->rtstate.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->rtstate.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperGrabData"; }; + virtual const char * getMD5() override { return "2c917fd7a48bc8daa7ae36787c8b7a82"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabFeedback.h new file mode 100644 index 000000000..25cc1927e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabFeedback.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperGrabData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperGrabFeedback : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperGrabData _data_type; + _data_type data; + + PR2GripperGrabFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperGrabFeedback"; }; + virtual const char * getMD5() override { return "b4b68d48ac7d07bdb11b7f3badfa9266"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabGoal.h new file mode 100644 index 000000000..67d197a94 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperGrabCommand.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperGrabGoal : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperGrabCommand _command_type; + _command_type command; + + PR2GripperGrabGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperGrabGoal"; }; + virtual const char * getMD5() override { return "4dec90ce1cb7519ca39577ac65441112"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabResult.h new file mode 100644 index 000000000..ea93d3c9d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperGrabResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperGrabResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperGrabData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperGrabResult : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperGrabData _data_type; + _data_type data; + + PR2GripperGrabResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperGrabResult"; }; + virtual const char * getMD5() override { return "b4b68d48ac7d07bdb11b7f3badfa9266"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperPressureData.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperPressureData.h new file mode 100644 index 000000000..b641939bb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperPressureData.h @@ -0,0 +1,59 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperPressureData_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperPressureData_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperPressureData : public ros::Msg + { + public: + float pressure_left[22]; + float pressure_right[22]; + typedef float _rostime_type; + _rostime_type rostime; + + PR2GripperPressureData(): + pressure_left(), + pressure_right(), + rostime(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 22; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->pressure_left[i]); + } + for( uint32_t i = 0; i < 22; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->pressure_right[i]); + } + offset += serializeAvrFloat64(outbuffer + offset, this->rostime); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 22; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pressure_left[i])); + } + for( uint32_t i = 0; i < 22; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pressure_right[i])); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->rostime)); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperPressureData"; }; + virtual const char * getMD5() override { return "b69255f5117bf05fdcd1e83d4e6ab779"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseAction.h new file mode 100644 index 000000000..7253e5614 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseAction_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperReleaseActionGoal.h" +#include "pr2_gripper_sensor_msgs/PR2GripperReleaseActionResult.h" +#include "pr2_gripper_sensor_msgs/PR2GripperReleaseActionFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperReleaseAction : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperReleaseActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_gripper_sensor_msgs::PR2GripperReleaseActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_gripper_sensor_msgs::PR2GripperReleaseActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PR2GripperReleaseAction(): + 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 "pr2_gripper_sensor_msgs/PR2GripperReleaseAction"; }; + virtual const char * getMD5() override { return "c3c9b6394f2bb7d0d9e5ed002d9a759a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionFeedback.h new file mode 100644 index 000000000..56505a77a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseActionFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperReleaseFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperReleaseActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperReleaseFeedback _feedback_type; + _feedback_type feedback; + + PR2GripperReleaseActionFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperReleaseActionFeedback"; }; + virtual const char * getMD5() override { return "83231ee429239525d42b1713d6791069"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionGoal.h new file mode 100644 index 000000000..f929c45bd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseActionGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_gripper_sensor_msgs/PR2GripperReleaseGoal.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperReleaseActionGoal : 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 pr2_gripper_sensor_msgs::PR2GripperReleaseGoal _goal_type; + _goal_type goal; + + PR2GripperReleaseActionGoal(): + 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 "pr2_gripper_sensor_msgs/PR2GripperReleaseActionGoal"; }; + virtual const char * getMD5() override { return "e5f06f3717f8990527330a2e0eaa0c81"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionResult.h new file mode 100644 index 000000000..1df6ce7e5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseActionResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperReleaseResult.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperReleaseActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperReleaseResult _result_type; + _result_type result; + + PR2GripperReleaseActionResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperReleaseActionResult"; }; + virtual const char * getMD5() override { return "cffa4a24ed0ee3ef3fa8a4d8b2706751"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseCommand.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseCommand.h new file mode 100644 index 000000000..b70bcbbc5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseCommand.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseCommand_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseCommand_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperReleaseCommand : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperEventDetectorCommand _event_type; + _event_type event; + + PR2GripperReleaseCommand(): + event() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->event.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->event.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperReleaseCommand"; }; + virtual const char * getMD5() override { return "e62b08129864bf301ed0a1335e6158dc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseData.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseData.h new file mode 100644 index 000000000..e74c7c239 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseData.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseData_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseData_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSensorRTState.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperReleaseData : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperSensorRTState _rtstate_type; + _rtstate_type rtstate; + + PR2GripperReleaseData(): + rtstate() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->rtstate.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->rtstate.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperReleaseData"; }; + virtual const char * getMD5() override { return "2c917fd7a48bc8daa7ae36787c8b7a82"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseFeedback.h new file mode 100644 index 000000000..98a96b362 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseFeedback.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperReleaseData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperReleaseFeedback : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperReleaseData _data_type; + _data_type data; + + PR2GripperReleaseFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperReleaseFeedback"; }; + virtual const char * getMD5() override { return "b4b68d48ac7d07bdb11b7f3badfa9266"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseGoal.h new file mode 100644 index 000000000..c1b091be1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperReleaseCommand.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperReleaseGoal : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperReleaseCommand _command_type; + _command_type command; + + PR2GripperReleaseGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperReleaseGoal"; }; + virtual const char * getMD5() override { return "f92a4c7c03d33b62ef7f6041bec6a43d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseResult.h new file mode 100644 index 000000000..497b4b57c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperReleaseResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperReleaseResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperReleaseData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperReleaseResult : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperReleaseData _data_type; + _data_type data; + + PR2GripperReleaseResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperReleaseResult"; }; + virtual const char * getMD5() override { return "b4b68d48ac7d07bdb11b7f3badfa9266"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSensorRTState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSensorRTState.h new file mode 100644 index 000000000..89ca7cc6b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSensorRTState.h @@ -0,0 +1,61 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSensorRTState_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSensorRTState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSensorRTState : public ros::Msg + { + public: + typedef int8_t _realtime_controller_state_type; + _realtime_controller_state_type realtime_controller_state; + enum { DISABLED = 0 }; + enum { POSITION_SERVO = 3 }; + enum { FORCE_SERVO = 4 }; + enum { FIND_CONTACT = 5 }; + enum { SLIP_SERVO = 6 }; + + PR2GripperSensorRTState(): + realtime_controller_state(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_realtime_controller_state; + u_realtime_controller_state.real = this->realtime_controller_state; + *(outbuffer + offset + 0) = (u_realtime_controller_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->realtime_controller_state); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_realtime_controller_state; + u_realtime_controller_state.base = 0; + u_realtime_controller_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->realtime_controller_state = u_realtime_controller_state.real; + offset += sizeof(this->realtime_controller_state); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperSensorRTState"; }; + virtual const char * getMD5() override { return "8109436c1f7237c52c00d885ed5755d7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSensorRawData.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSensorRawData.h new file mode 100644 index 000000000..9a981d0fc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSensorRawData.h @@ -0,0 +1,180 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSensorRawData_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSensorRawData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSensorRawData : public ros::Msg + { + public: + typedef ros::Time _stamp_type; + _stamp_type stamp; + typedef float _left_finger_pad_force_type; + _left_finger_pad_force_type left_finger_pad_force; + typedef float _right_finger_pad_force_type; + _right_finger_pad_force_type right_finger_pad_force; + typedef float _left_finger_pad_force_filtered_type; + _left_finger_pad_force_filtered_type left_finger_pad_force_filtered; + typedef float _right_finger_pad_force_filtered_type; + _right_finger_pad_force_filtered_type right_finger_pad_force_filtered; + float left_finger_pad_forces[22]; + float right_finger_pad_forces[22]; + float left_finger_pad_forces_filtered[22]; + float right_finger_pad_forces_filtered[22]; + typedef float _acc_x_raw_type; + _acc_x_raw_type acc_x_raw; + typedef float _acc_y_raw_type; + _acc_y_raw_type acc_y_raw; + typedef float _acc_z_raw_type; + _acc_z_raw_type acc_z_raw; + typedef float _acc_x_filtered_type; + _acc_x_filtered_type acc_x_filtered; + typedef float _acc_y_filtered_type; + _acc_y_filtered_type acc_y_filtered; + typedef float _acc_z_filtered_type; + _acc_z_filtered_type acc_z_filtered; + typedef bool _left_contact_type; + _left_contact_type left_contact; + typedef bool _right_contact_type; + _right_contact_type right_contact; + + PR2GripperSensorRawData(): + stamp(), + left_finger_pad_force(0), + right_finger_pad_force(0), + left_finger_pad_force_filtered(0), + right_finger_pad_force_filtered(0), + left_finger_pad_forces(), + right_finger_pad_forces(), + left_finger_pad_forces_filtered(), + right_finger_pad_forces_filtered(), + acc_x_raw(0), + acc_y_raw(0), + acc_z_raw(0), + acc_x_filtered(0), + acc_y_filtered(0), + acc_z_filtered(0), + left_contact(0), + right_contact(0) + { + } + + 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); + offset += serializeAvrFloat64(outbuffer + offset, this->left_finger_pad_force); + offset += serializeAvrFloat64(outbuffer + offset, this->right_finger_pad_force); + offset += serializeAvrFloat64(outbuffer + offset, this->left_finger_pad_force_filtered); + offset += serializeAvrFloat64(outbuffer + offset, this->right_finger_pad_force_filtered); + for( uint32_t i = 0; i < 22; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->left_finger_pad_forces[i]); + } + for( uint32_t i = 0; i < 22; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->right_finger_pad_forces[i]); + } + for( uint32_t i = 0; i < 22; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->left_finger_pad_forces_filtered[i]); + } + for( uint32_t i = 0; i < 22; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->right_finger_pad_forces_filtered[i]); + } + offset += serializeAvrFloat64(outbuffer + offset, this->acc_x_raw); + offset += serializeAvrFloat64(outbuffer + offset, this->acc_y_raw); + offset += serializeAvrFloat64(outbuffer + offset, this->acc_z_raw); + offset += serializeAvrFloat64(outbuffer + offset, this->acc_x_filtered); + offset += serializeAvrFloat64(outbuffer + offset, this->acc_y_filtered); + offset += serializeAvrFloat64(outbuffer + offset, this->acc_z_filtered); + union { + bool real; + uint8_t base; + } u_left_contact; + u_left_contact.real = this->left_contact; + *(outbuffer + offset + 0) = (u_left_contact.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->left_contact); + union { + bool real; + uint8_t base; + } u_right_contact; + u_right_contact.real = this->right_contact; + *(outbuffer + offset + 0) = (u_right_contact.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->right_contact); + 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); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->left_finger_pad_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->right_finger_pad_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->left_finger_pad_force_filtered)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->right_finger_pad_force_filtered)); + for( uint32_t i = 0; i < 22; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->left_finger_pad_forces[i])); + } + for( uint32_t i = 0; i < 22; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->right_finger_pad_forces[i])); + } + for( uint32_t i = 0; i < 22; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->left_finger_pad_forces_filtered[i])); + } + for( uint32_t i = 0; i < 22; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->right_finger_pad_forces_filtered[i])); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acc_x_raw)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acc_y_raw)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acc_z_raw)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acc_x_filtered)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acc_y_filtered)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acc_z_filtered)); + union { + bool real; + uint8_t base; + } u_left_contact; + u_left_contact.base = 0; + u_left_contact.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->left_contact = u_left_contact.real; + offset += sizeof(this->left_contact); + union { + bool real; + uint8_t base; + } u_right_contact; + u_right_contact.base = 0; + u_right_contact.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->right_contact = u_right_contact.real; + offset += sizeof(this->right_contact); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperSensorRawData"; }; + virtual const char * getMD5() override { return "696a1f2e6969deb0bc6998636ae1b17e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoAction.h new file mode 100644 index 000000000..e95ca9eec --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoAction_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSlipServoActionGoal.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSlipServoActionResult.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSlipServoActionFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSlipServoAction : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperSlipServoActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_gripper_sensor_msgs::PR2GripperSlipServoActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_gripper_sensor_msgs::PR2GripperSlipServoActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + PR2GripperSlipServoAction(): + 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 "pr2_gripper_sensor_msgs/PR2GripperSlipServoAction"; }; + virtual const char * getMD5() override { return "d1abef6e5d417a62bf67570de0fcd426"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionFeedback.h new file mode 100644 index 000000000..45c9d7dc8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoActionFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSlipServoFeedback.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSlipServoActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperSlipServoFeedback _feedback_type; + _feedback_type feedback; + + PR2GripperSlipServoActionFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperSlipServoActionFeedback"; }; + virtual const char * getMD5() override { return "8819de47d9e7dfd2acefc052395548ad"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionGoal.h new file mode 100644 index 000000000..0875c4d1d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoActionGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSlipServoGoal.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSlipServoActionGoal : 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 pr2_gripper_sensor_msgs::PR2GripperSlipServoGoal _goal_type; + _goal_type goal; + + PR2GripperSlipServoActionGoal(): + 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 "pr2_gripper_sensor_msgs/PR2GripperSlipServoActionGoal"; }; + virtual const char * getMD5() override { return "914602bece7e5362946a6609cb95300c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionResult.h new file mode 100644 index 000000000..6d3f8503e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoActionResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSlipServoResult.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSlipServoActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_gripper_sensor_msgs::PR2GripperSlipServoResult _result_type; + _result_type result; + + PR2GripperSlipServoActionResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperSlipServoActionResult"; }; + virtual const char * getMD5() override { return "803e6845ed2b1f1d15016f48d0689075"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoCommand.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoCommand.h new file mode 100644 index 000000000..5ae553148 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoCommand.h @@ -0,0 +1,38 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoCommand_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSlipServoCommand : public ros::Msg + { + public: + + PR2GripperSlipServoCommand() + { + } + + 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 "pr2_gripper_sensor_msgs/PR2GripperSlipServoCommand"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoData.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoData.h new file mode 100644 index 000000000..08bbb119d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoData.h @@ -0,0 +1,160 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoData_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSensorRTState.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSlipServoData : public ros::Msg + { + public: + typedef ros::Time _stamp_type; + _stamp_type stamp; + typedef float _deformation_type; + _deformation_type deformation; + typedef float _left_fingertip_pad_force_type; + _left_fingertip_pad_force_type left_fingertip_pad_force; + typedef float _right_fingertip_pad_force_type; + _right_fingertip_pad_force_type right_fingertip_pad_force; + typedef float _joint_effort_type; + _joint_effort_type joint_effort; + typedef bool _slip_detected_type; + _slip_detected_type slip_detected; + typedef bool _deformation_limit_reached_type; + _deformation_limit_reached_type deformation_limit_reached; + typedef bool _fingertip_force_limit_reached_type; + _fingertip_force_limit_reached_type fingertip_force_limit_reached; + typedef bool _gripper_empty_type; + _gripper_empty_type gripper_empty; + typedef pr2_gripper_sensor_msgs::PR2GripperSensorRTState _rtstate_type; + _rtstate_type rtstate; + + PR2GripperSlipServoData(): + stamp(), + deformation(0), + left_fingertip_pad_force(0), + right_fingertip_pad_force(0), + joint_effort(0), + slip_detected(0), + deformation_limit_reached(0), + fingertip_force_limit_reached(0), + gripper_empty(0), + rtstate() + { + } + + 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); + offset += serializeAvrFloat64(outbuffer + offset, this->deformation); + offset += serializeAvrFloat64(outbuffer + offset, this->left_fingertip_pad_force); + offset += serializeAvrFloat64(outbuffer + offset, this->right_fingertip_pad_force); + offset += serializeAvrFloat64(outbuffer + offset, this->joint_effort); + union { + bool real; + uint8_t base; + } u_slip_detected; + u_slip_detected.real = this->slip_detected; + *(outbuffer + offset + 0) = (u_slip_detected.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->slip_detected); + union { + bool real; + uint8_t base; + } u_deformation_limit_reached; + u_deformation_limit_reached.real = this->deformation_limit_reached; + *(outbuffer + offset + 0) = (u_deformation_limit_reached.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->deformation_limit_reached); + union { + bool real; + uint8_t base; + } u_fingertip_force_limit_reached; + u_fingertip_force_limit_reached.real = this->fingertip_force_limit_reached; + *(outbuffer + offset + 0) = (u_fingertip_force_limit_reached.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->fingertip_force_limit_reached); + union { + bool real; + uint8_t base; + } u_gripper_empty; + u_gripper_empty.real = this->gripper_empty; + *(outbuffer + offset + 0) = (u_gripper_empty.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gripper_empty); + offset += this->rtstate.serialize(outbuffer + offset); + 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); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->deformation)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->left_fingertip_pad_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->right_fingertip_pad_force)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->joint_effort)); + union { + bool real; + uint8_t base; + } u_slip_detected; + u_slip_detected.base = 0; + u_slip_detected.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->slip_detected = u_slip_detected.real; + offset += sizeof(this->slip_detected); + union { + bool real; + uint8_t base; + } u_deformation_limit_reached; + u_deformation_limit_reached.base = 0; + u_deformation_limit_reached.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->deformation_limit_reached = u_deformation_limit_reached.real; + offset += sizeof(this->deformation_limit_reached); + union { + bool real; + uint8_t base; + } u_fingertip_force_limit_reached; + u_fingertip_force_limit_reached.base = 0; + u_fingertip_force_limit_reached.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->fingertip_force_limit_reached = u_fingertip_force_limit_reached.real; + offset += sizeof(this->fingertip_force_limit_reached); + union { + bool real; + uint8_t base; + } u_gripper_empty; + u_gripper_empty.base = 0; + u_gripper_empty.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gripper_empty = u_gripper_empty.real; + offset += sizeof(this->gripper_empty); + offset += this->rtstate.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperSlipServoData"; }; + virtual const char * getMD5() override { return "a49728a2e0c40706b3c9b74046f006aa"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoFeedback.h new file mode 100644 index 000000000..573c9ee5f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoFeedback.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoFeedback_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSlipServoData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSlipServoFeedback : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperSlipServoData _data_type; + _data_type data; + + PR2GripperSlipServoFeedback(): + 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 "pr2_gripper_sensor_msgs/PR2GripperSlipServoFeedback"; }; + virtual const char * getMD5() override { return "1b10af616c7e94f609790b12cde04c6d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoGoal.h new file mode 100644 index 000000000..c5054b740 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoGoal_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSlipServoCommand.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSlipServoGoal : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperSlipServoCommand _command_type; + _command_type command; + + PR2GripperSlipServoGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_gripper_sensor_msgs/PR2GripperSlipServoGoal"; }; + virtual const char * getMD5() override { return "bf76e656d304158c04ab279db7cefc85"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoResult.h new file mode 100644 index 000000000..507e98c04 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_gripper_sensor_msgs/PR2GripperSlipServoResult.h @@ -0,0 +1,44 @@ +#ifndef _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoResult_h +#define _ROS_pr2_gripper_sensor_msgs_PR2GripperSlipServoResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_gripper_sensor_msgs/PR2GripperSlipServoData.h" + +namespace pr2_gripper_sensor_msgs +{ + + class PR2GripperSlipServoResult : public ros::Msg + { + public: + typedef pr2_gripper_sensor_msgs::PR2GripperSlipServoData _data_type; + _data_type data; + + PR2GripperSlipServoResult(): + 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 "pr2_gripper_sensor_msgs/PR2GripperSlipServoResult"; }; + virtual const char * getMD5() override { return "1b10af616c7e94f609790b12cde04c6d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseControllerState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseControllerState.h new file mode 100644 index 000000000..a2cd45c49 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseControllerState.h @@ -0,0 +1,231 @@ +#ifndef _ROS_pr2_mechanism_controllers_BaseControllerState_h +#define _ROS_pr2_mechanism_controllers_BaseControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Twist.h" + +namespace pr2_mechanism_controllers +{ + + class BaseControllerState : public ros::Msg + { + public: + typedef geometry_msgs::Twist _command_type; + _command_type command; + uint32_t joint_velocity_measured_length; + typedef float _joint_velocity_measured_type; + _joint_velocity_measured_type st_joint_velocity_measured; + _joint_velocity_measured_type * joint_velocity_measured; + uint32_t joint_velocity_commanded_length; + typedef float _joint_velocity_commanded_type; + _joint_velocity_commanded_type st_joint_velocity_commanded; + _joint_velocity_commanded_type * joint_velocity_commanded; + uint32_t joint_velocity_error_length; + typedef float _joint_velocity_error_type; + _joint_velocity_error_type st_joint_velocity_error; + _joint_velocity_error_type * joint_velocity_error; + uint32_t joint_effort_measured_length; + typedef float _joint_effort_measured_type; + _joint_effort_measured_type st_joint_effort_measured; + _joint_effort_measured_type * joint_effort_measured; + uint32_t joint_effort_commanded_length; + typedef float _joint_effort_commanded_type; + _joint_effort_commanded_type st_joint_effort_commanded; + _joint_effort_commanded_type * joint_effort_commanded; + uint32_t joint_effort_error_length; + typedef float _joint_effort_error_type; + _joint_effort_error_type st_joint_effort_error; + _joint_effort_error_type * joint_effort_error; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + + BaseControllerState(): + command(), + joint_velocity_measured_length(0), st_joint_velocity_measured(), joint_velocity_measured(nullptr), + joint_velocity_commanded_length(0), st_joint_velocity_commanded(), joint_velocity_commanded(nullptr), + joint_velocity_error_length(0), st_joint_velocity_error(), joint_velocity_error(nullptr), + joint_effort_measured_length(0), st_joint_effort_measured(), joint_effort_measured(nullptr), + joint_effort_commanded_length(0), st_joint_effort_commanded(), joint_effort_commanded(nullptr), + joint_effort_error_length(0), st_joint_effort_error(), joint_effort_error(nullptr), + joint_names_length(0), st_joint_names(), joint_names(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_velocity_measured_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_velocity_measured_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_velocity_measured_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_velocity_measured_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_velocity_measured_length); + for( uint32_t i = 0; i < joint_velocity_measured_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_velocity_measured[i]); + } + *(outbuffer + offset + 0) = (this->joint_velocity_commanded_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_velocity_commanded_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_velocity_commanded_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_velocity_commanded_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_velocity_commanded_length); + for( uint32_t i = 0; i < joint_velocity_commanded_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_velocity_commanded[i]); + } + *(outbuffer + offset + 0) = (this->joint_velocity_error_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_velocity_error_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_velocity_error_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_velocity_error_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_velocity_error_length); + for( uint32_t i = 0; i < joint_velocity_error_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_velocity_error[i]); + } + *(outbuffer + offset + 0) = (this->joint_effort_measured_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_effort_measured_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_effort_measured_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_effort_measured_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_effort_measured_length); + for( uint32_t i = 0; i < joint_effort_measured_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_effort_measured[i]); + } + *(outbuffer + offset + 0) = (this->joint_effort_commanded_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_effort_commanded_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_effort_commanded_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_effort_commanded_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_effort_commanded_length); + for( uint32_t i = 0; i < joint_effort_commanded_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_effort_commanded[i]); + } + *(outbuffer + offset + 0) = (this->joint_effort_error_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_effort_error_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_effort_error_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_effort_error_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_effort_error_length); + for( uint32_t i = 0; i < joint_effort_error_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_effort_error[i]); + } + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + uint32_t joint_velocity_measured_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_velocity_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_velocity_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_velocity_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_velocity_measured_length); + if(joint_velocity_measured_lengthT > joint_velocity_measured_length) + this->joint_velocity_measured = (float*)realloc(this->joint_velocity_measured, joint_velocity_measured_lengthT * sizeof(float)); + joint_velocity_measured_length = joint_velocity_measured_lengthT; + for( uint32_t i = 0; i < joint_velocity_measured_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_velocity_measured)); + memcpy( &(this->joint_velocity_measured[i]), &(this->st_joint_velocity_measured), sizeof(float)); + } + uint32_t joint_velocity_commanded_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_velocity_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_velocity_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_velocity_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_velocity_commanded_length); + if(joint_velocity_commanded_lengthT > joint_velocity_commanded_length) + this->joint_velocity_commanded = (float*)realloc(this->joint_velocity_commanded, joint_velocity_commanded_lengthT * sizeof(float)); + joint_velocity_commanded_length = joint_velocity_commanded_lengthT; + for( uint32_t i = 0; i < joint_velocity_commanded_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_velocity_commanded)); + memcpy( &(this->joint_velocity_commanded[i]), &(this->st_joint_velocity_commanded), sizeof(float)); + } + uint32_t joint_velocity_error_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_velocity_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_velocity_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_velocity_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_velocity_error_length); + if(joint_velocity_error_lengthT > joint_velocity_error_length) + this->joint_velocity_error = (float*)realloc(this->joint_velocity_error, joint_velocity_error_lengthT * sizeof(float)); + joint_velocity_error_length = joint_velocity_error_lengthT; + for( uint32_t i = 0; i < joint_velocity_error_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_velocity_error)); + memcpy( &(this->joint_velocity_error[i]), &(this->st_joint_velocity_error), sizeof(float)); + } + uint32_t joint_effort_measured_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_effort_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_effort_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_effort_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_effort_measured_length); + if(joint_effort_measured_lengthT > joint_effort_measured_length) + this->joint_effort_measured = (float*)realloc(this->joint_effort_measured, joint_effort_measured_lengthT * sizeof(float)); + joint_effort_measured_length = joint_effort_measured_lengthT; + for( uint32_t i = 0; i < joint_effort_measured_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_effort_measured)); + memcpy( &(this->joint_effort_measured[i]), &(this->st_joint_effort_measured), sizeof(float)); + } + uint32_t joint_effort_commanded_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_effort_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_effort_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_effort_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_effort_commanded_length); + if(joint_effort_commanded_lengthT > joint_effort_commanded_length) + this->joint_effort_commanded = (float*)realloc(this->joint_effort_commanded, joint_effort_commanded_lengthT * sizeof(float)); + joint_effort_commanded_length = joint_effort_commanded_lengthT; + for( uint32_t i = 0; i < joint_effort_commanded_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_effort_commanded)); + memcpy( &(this->joint_effort_commanded[i]), &(this->st_joint_effort_commanded), sizeof(float)); + } + uint32_t joint_effort_error_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_effort_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_effort_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_effort_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_effort_error_length); + if(joint_effort_error_lengthT > joint_effort_error_length) + this->joint_effort_error = (float*)realloc(this->joint_effort_error, joint_effort_error_lengthT * sizeof(float)); + joint_effort_error_length = joint_effort_error_lengthT; + for( uint32_t i = 0; i < joint_effort_error_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_effort_error)); + memcpy( &(this->joint_effort_error[i]), &(this->st_joint_effort_error), sizeof(float)); + } + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_controllers/BaseControllerState"; }; + virtual const char * getMD5() override { return "7a488aa492f9175d5fa35e22e56c4b28"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseControllerState2.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseControllerState2.h new file mode 100644 index 000000000..ab396d1b4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseControllerState2.h @@ -0,0 +1,256 @@ +#ifndef _ROS_pr2_mechanism_controllers_BaseControllerState2_h +#define _ROS_pr2_mechanism_controllers_BaseControllerState2_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Twist.h" + +namespace pr2_mechanism_controllers +{ + + class BaseControllerState2 : public ros::Msg + { + public: + typedef geometry_msgs::Twist _command_type; + _command_type command; + uint32_t joint_command_length; + typedef float _joint_command_type; + _joint_command_type st_joint_command; + _joint_command_type * joint_command; + uint32_t joint_error_length; + typedef float _joint_error_type; + _joint_error_type st_joint_error; + _joint_error_type * joint_error; + uint32_t joint_velocity_commanded_length; + typedef float _joint_velocity_commanded_type; + _joint_velocity_commanded_type st_joint_velocity_commanded; + _joint_velocity_commanded_type * joint_velocity_commanded; + uint32_t joint_velocity_measured_length; + typedef float _joint_velocity_measured_type; + _joint_velocity_measured_type st_joint_velocity_measured; + _joint_velocity_measured_type * joint_velocity_measured; + uint32_t joint_effort_measured_length; + typedef float _joint_effort_measured_type; + _joint_effort_measured_type st_joint_effort_measured; + _joint_effort_measured_type * joint_effort_measured; + uint32_t joint_effort_commanded_length; + typedef float _joint_effort_commanded_type; + _joint_effort_commanded_type st_joint_effort_commanded; + _joint_effort_commanded_type * joint_effort_commanded; + uint32_t joint_effort_error_length; + typedef float _joint_effort_error_type; + _joint_effort_error_type st_joint_effort_error; + _joint_effort_error_type * joint_effort_error; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + + BaseControllerState2(): + command(), + joint_command_length(0), st_joint_command(), joint_command(nullptr), + joint_error_length(0), st_joint_error(), joint_error(nullptr), + joint_velocity_commanded_length(0), st_joint_velocity_commanded(), joint_velocity_commanded(nullptr), + joint_velocity_measured_length(0), st_joint_velocity_measured(), joint_velocity_measured(nullptr), + joint_effort_measured_length(0), st_joint_effort_measured(), joint_effort_measured(nullptr), + joint_effort_commanded_length(0), st_joint_effort_commanded(), joint_effort_commanded(nullptr), + joint_effort_error_length(0), st_joint_effort_error(), joint_effort_error(nullptr), + joint_names_length(0), st_joint_names(), joint_names(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_command_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_command_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_command_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_command_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_command_length); + for( uint32_t i = 0; i < joint_command_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_command[i]); + } + *(outbuffer + offset + 0) = (this->joint_error_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_error_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_error_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_error_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_error_length); + for( uint32_t i = 0; i < joint_error_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_error[i]); + } + *(outbuffer + offset + 0) = (this->joint_velocity_commanded_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_velocity_commanded_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_velocity_commanded_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_velocity_commanded_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_velocity_commanded_length); + for( uint32_t i = 0; i < joint_velocity_commanded_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_velocity_commanded[i]); + } + *(outbuffer + offset + 0) = (this->joint_velocity_measured_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_velocity_measured_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_velocity_measured_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_velocity_measured_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_velocity_measured_length); + for( uint32_t i = 0; i < joint_velocity_measured_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_velocity_measured[i]); + } + *(outbuffer + offset + 0) = (this->joint_effort_measured_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_effort_measured_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_effort_measured_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_effort_measured_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_effort_measured_length); + for( uint32_t i = 0; i < joint_effort_measured_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_effort_measured[i]); + } + *(outbuffer + offset + 0) = (this->joint_effort_commanded_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_effort_commanded_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_effort_commanded_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_effort_commanded_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_effort_commanded_length); + for( uint32_t i = 0; i < joint_effort_commanded_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_effort_commanded[i]); + } + *(outbuffer + offset + 0) = (this->joint_effort_error_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_effort_error_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_effort_error_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_effort_error_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_effort_error_length); + for( uint32_t i = 0; i < joint_effort_error_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_effort_error[i]); + } + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + uint32_t joint_command_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_command_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_command_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_command_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_command_length); + if(joint_command_lengthT > joint_command_length) + this->joint_command = (float*)realloc(this->joint_command, joint_command_lengthT * sizeof(float)); + joint_command_length = joint_command_lengthT; + for( uint32_t i = 0; i < joint_command_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_command)); + memcpy( &(this->joint_command[i]), &(this->st_joint_command), sizeof(float)); + } + uint32_t joint_error_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_error_length); + if(joint_error_lengthT > joint_error_length) + this->joint_error = (float*)realloc(this->joint_error, joint_error_lengthT * sizeof(float)); + joint_error_length = joint_error_lengthT; + for( uint32_t i = 0; i < joint_error_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_error)); + memcpy( &(this->joint_error[i]), &(this->st_joint_error), sizeof(float)); + } + uint32_t joint_velocity_commanded_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_velocity_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_velocity_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_velocity_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_velocity_commanded_length); + if(joint_velocity_commanded_lengthT > joint_velocity_commanded_length) + this->joint_velocity_commanded = (float*)realloc(this->joint_velocity_commanded, joint_velocity_commanded_lengthT * sizeof(float)); + joint_velocity_commanded_length = joint_velocity_commanded_lengthT; + for( uint32_t i = 0; i < joint_velocity_commanded_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_velocity_commanded)); + memcpy( &(this->joint_velocity_commanded[i]), &(this->st_joint_velocity_commanded), sizeof(float)); + } + uint32_t joint_velocity_measured_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_velocity_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_velocity_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_velocity_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_velocity_measured_length); + if(joint_velocity_measured_lengthT > joint_velocity_measured_length) + this->joint_velocity_measured = (float*)realloc(this->joint_velocity_measured, joint_velocity_measured_lengthT * sizeof(float)); + joint_velocity_measured_length = joint_velocity_measured_lengthT; + for( uint32_t i = 0; i < joint_velocity_measured_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_velocity_measured)); + memcpy( &(this->joint_velocity_measured[i]), &(this->st_joint_velocity_measured), sizeof(float)); + } + uint32_t joint_effort_measured_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_effort_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_effort_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_effort_measured_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_effort_measured_length); + if(joint_effort_measured_lengthT > joint_effort_measured_length) + this->joint_effort_measured = (float*)realloc(this->joint_effort_measured, joint_effort_measured_lengthT * sizeof(float)); + joint_effort_measured_length = joint_effort_measured_lengthT; + for( uint32_t i = 0; i < joint_effort_measured_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_effort_measured)); + memcpy( &(this->joint_effort_measured[i]), &(this->st_joint_effort_measured), sizeof(float)); + } + uint32_t joint_effort_commanded_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_effort_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_effort_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_effort_commanded_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_effort_commanded_length); + if(joint_effort_commanded_lengthT > joint_effort_commanded_length) + this->joint_effort_commanded = (float*)realloc(this->joint_effort_commanded, joint_effort_commanded_lengthT * sizeof(float)); + joint_effort_commanded_length = joint_effort_commanded_lengthT; + for( uint32_t i = 0; i < joint_effort_commanded_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_effort_commanded)); + memcpy( &(this->joint_effort_commanded[i]), &(this->st_joint_effort_commanded), sizeof(float)); + } + uint32_t joint_effort_error_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_effort_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_effort_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_effort_error_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_effort_error_length); + if(joint_effort_error_lengthT > joint_effort_error_length) + this->joint_effort_error = (float*)realloc(this->joint_effort_error, joint_effort_error_lengthT * sizeof(float)); + joint_effort_error_length = joint_effort_error_lengthT; + for( uint32_t i = 0; i < joint_effort_error_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_effort_error)); + memcpy( &(this->joint_effort_error[i]), &(this->st_joint_effort_error), sizeof(float)); + } + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_controllers/BaseControllerState2"; }; + virtual const char * getMD5() override { return "d4b64baf09d8cb133f3f2bc279de1137"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseOdometryState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseOdometryState.h new file mode 100644 index 000000000..4d0338672 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/BaseOdometryState.h @@ -0,0 +1,131 @@ +#ifndef _ROS_pr2_mechanism_controllers_BaseOdometryState_h +#define _ROS_pr2_mechanism_controllers_BaseOdometryState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Twist.h" + +namespace pr2_mechanism_controllers +{ + + class BaseOdometryState : public ros::Msg + { + public: + typedef geometry_msgs::Twist _velocity_type; + _velocity_type velocity; + uint32_t wheel_link_names_length; + typedef char* _wheel_link_names_type; + _wheel_link_names_type st_wheel_link_names; + _wheel_link_names_type * wheel_link_names; + uint32_t drive_constraint_errors_length; + typedef float _drive_constraint_errors_type; + _drive_constraint_errors_type st_drive_constraint_errors; + _drive_constraint_errors_type * drive_constraint_errors; + uint32_t longitudinal_slip_constraint_errors_length; + typedef float _longitudinal_slip_constraint_errors_type; + _longitudinal_slip_constraint_errors_type st_longitudinal_slip_constraint_errors; + _longitudinal_slip_constraint_errors_type * longitudinal_slip_constraint_errors; + + BaseOdometryState(): + velocity(), + wheel_link_names_length(0), st_wheel_link_names(), wheel_link_names(nullptr), + drive_constraint_errors_length(0), st_drive_constraint_errors(), drive_constraint_errors(nullptr), + longitudinal_slip_constraint_errors_length(0), st_longitudinal_slip_constraint_errors(), longitudinal_slip_constraint_errors(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->velocity.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->wheel_link_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wheel_link_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wheel_link_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wheel_link_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->wheel_link_names_length); + for( uint32_t i = 0; i < wheel_link_names_length; i++){ + uint32_t length_wheel_link_namesi = strlen(this->wheel_link_names[i]); + varToArr(outbuffer + offset, length_wheel_link_namesi); + offset += 4; + memcpy(outbuffer + offset, this->wheel_link_names[i], length_wheel_link_namesi); + offset += length_wheel_link_namesi; + } + *(outbuffer + offset + 0) = (this->drive_constraint_errors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->drive_constraint_errors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->drive_constraint_errors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->drive_constraint_errors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->drive_constraint_errors_length); + for( uint32_t i = 0; i < drive_constraint_errors_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->drive_constraint_errors[i]); + } + *(outbuffer + offset + 0) = (this->longitudinal_slip_constraint_errors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->longitudinal_slip_constraint_errors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->longitudinal_slip_constraint_errors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->longitudinal_slip_constraint_errors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->longitudinal_slip_constraint_errors_length); + for( uint32_t i = 0; i < longitudinal_slip_constraint_errors_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->longitudinal_slip_constraint_errors[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->velocity.deserialize(inbuffer + offset); + uint32_t wheel_link_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + wheel_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + wheel_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + wheel_link_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wheel_link_names_length); + if(wheel_link_names_lengthT > wheel_link_names_length) + this->wheel_link_names = (char**)realloc(this->wheel_link_names, wheel_link_names_lengthT * sizeof(char*)); + wheel_link_names_length = wheel_link_names_lengthT; + for( uint32_t i = 0; i < wheel_link_names_length; i++){ + uint32_t length_st_wheel_link_names; + arrToVar(length_st_wheel_link_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_wheel_link_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_wheel_link_names-1]=0; + this->st_wheel_link_names = (char *)(inbuffer + offset-1); + offset += length_st_wheel_link_names; + memcpy( &(this->wheel_link_names[i]), &(this->st_wheel_link_names), sizeof(char*)); + } + uint32_t drive_constraint_errors_lengthT = ((uint32_t) (*(inbuffer + offset))); + drive_constraint_errors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + drive_constraint_errors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + drive_constraint_errors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->drive_constraint_errors_length); + if(drive_constraint_errors_lengthT > drive_constraint_errors_length) + this->drive_constraint_errors = (float*)realloc(this->drive_constraint_errors, drive_constraint_errors_lengthT * sizeof(float)); + drive_constraint_errors_length = drive_constraint_errors_lengthT; + for( uint32_t i = 0; i < drive_constraint_errors_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_drive_constraint_errors)); + memcpy( &(this->drive_constraint_errors[i]), &(this->st_drive_constraint_errors), sizeof(float)); + } + uint32_t longitudinal_slip_constraint_errors_lengthT = ((uint32_t) (*(inbuffer + offset))); + longitudinal_slip_constraint_errors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + longitudinal_slip_constraint_errors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + longitudinal_slip_constraint_errors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->longitudinal_slip_constraint_errors_length); + if(longitudinal_slip_constraint_errors_lengthT > longitudinal_slip_constraint_errors_length) + this->longitudinal_slip_constraint_errors = (float*)realloc(this->longitudinal_slip_constraint_errors, longitudinal_slip_constraint_errors_lengthT * sizeof(float)); + longitudinal_slip_constraint_errors_length = longitudinal_slip_constraint_errors_lengthT; + for( uint32_t i = 0; i < longitudinal_slip_constraint_errors_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_longitudinal_slip_constraint_errors)); + memcpy( &(this->longitudinal_slip_constraint_errors[i]), &(this->st_longitudinal_slip_constraint_errors), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_controllers/BaseOdometryState"; }; + virtual const char * getMD5() override { return "8a483e137ebc37abafa4c26549091dd6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/DebugInfo.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/DebugInfo.h new file mode 100644 index 000000000..bad3f0981 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/DebugInfo.h @@ -0,0 +1,110 @@ +#ifndef _ROS_pr2_mechanism_controllers_DebugInfo_h +#define _ROS_pr2_mechanism_controllers_DebugInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_controllers +{ + + class DebugInfo : public ros::Msg + { + public: + uint32_t timing_length; + typedef float _timing_type; + _timing_type st_timing; + _timing_type * timing; + typedef int32_t _sequence_type; + _sequence_type sequence; + typedef bool _input_valid_type; + _input_valid_type input_valid; + typedef float _residual_type; + _residual_type residual; + + DebugInfo(): + timing_length(0), st_timing(), timing(nullptr), + sequence(0), + input_valid(0), + residual(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->timing_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timing_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timing_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timing_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->timing_length); + for( uint32_t i = 0; i < timing_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->timing[i]); + } + union { + int32_t real; + uint32_t base; + } u_sequence; + u_sequence.real = this->sequence; + *(outbuffer + offset + 0) = (u_sequence.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sequence.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sequence.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sequence.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sequence); + union { + bool real; + uint8_t base; + } u_input_valid; + u_input_valid.real = this->input_valid; + *(outbuffer + offset + 0) = (u_input_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->input_valid); + offset += serializeAvrFloat64(outbuffer + offset, this->residual); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t timing_lengthT = ((uint32_t) (*(inbuffer + offset))); + timing_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + timing_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + timing_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timing_length); + if(timing_lengthT > timing_length) + this->timing = (float*)realloc(this->timing, timing_lengthT * sizeof(float)); + timing_length = timing_lengthT; + for( uint32_t i = 0; i < timing_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_timing)); + memcpy( &(this->timing[i]), &(this->st_timing), sizeof(float)); + } + union { + int32_t real; + uint32_t base; + } u_sequence; + u_sequence.base = 0; + u_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sequence = u_sequence.real; + offset += sizeof(this->sequence); + union { + bool real; + uint8_t base; + } u_input_valid; + u_input_valid.base = 0; + u_input_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->input_valid = u_input_valid.real; + offset += sizeof(this->input_valid); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->residual)); + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_controllers/DebugInfo"; }; + virtual const char * getMD5() override { return "6281356ce897e33da024b8eb319460f2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/Odometer.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/Odometer.h new file mode 100644 index 000000000..5257fd335 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/Odometer.h @@ -0,0 +1,48 @@ +#ifndef _ROS_pr2_mechanism_controllers_Odometer_h +#define _ROS_pr2_mechanism_controllers_Odometer_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_controllers +{ + + class Odometer : public ros::Msg + { + public: + typedef float _distance_type; + _distance_type distance; + typedef float _angle_type; + _angle_type angle; + + Odometer(): + distance(0), + angle(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->distance); + offset += serializeAvrFloat64(outbuffer + offset, this->angle); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->distance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->angle)); + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_controllers/Odometer"; }; + virtual const char * getMD5() override { return "1f1d53743f4592ee455aa3eaf9019457"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/OdometryMatrix.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/OdometryMatrix.h new file mode 100644 index 000000000..f8db5e91e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/OdometryMatrix.h @@ -0,0 +1,63 @@ +#ifndef _ROS_pr2_mechanism_controllers_OdometryMatrix_h +#define _ROS_pr2_mechanism_controllers_OdometryMatrix_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_controllers +{ + + class OdometryMatrix : public ros::Msg + { + public: + uint32_t m_length; + typedef float _m_type; + _m_type st_m; + _m_type * m; + + OdometryMatrix(): + m_length(0), st_m(), m(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->m_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->m_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->m_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->m_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->m_length); + for( uint32_t i = 0; i < m_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->m[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t m_lengthT = ((uint32_t) (*(inbuffer + offset))); + m_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + m_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + m_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->m_length); + if(m_lengthT > m_length) + this->m = (float*)realloc(this->m, m_lengthT * sizeof(float)); + m_length = m_lengthT; + for( uint32_t i = 0; i < m_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_m)); + memcpy( &(this->m[i]), &(this->st_m), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_controllers/OdometryMatrix"; }; + virtual const char * getMD5() override { return "1f7818e7ce16454badf1bee936b0ff16"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/SetProfile.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/SetProfile.h new file mode 100644 index 000000000..e05c39474 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/SetProfile.h @@ -0,0 +1,115 @@ +#ifndef _ROS_SERVICE_SetProfile_h +#define _ROS_SERVICE_SetProfile_h +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_controllers +{ + +static const char SETPROFILE[] = "pr2_mechanism_controllers/SetProfile"; + + class SetProfileRequest : public ros::Msg + { + public: + typedef float _UpperTurnaround_type; + _UpperTurnaround_type UpperTurnaround; + typedef float _LowerTurnaround_type; + _LowerTurnaround_type LowerTurnaround; + typedef float _upperDecelBuffer_type; + _upperDecelBuffer_type upperDecelBuffer; + typedef float _lowerDecelBuffer_type; + _lowerDecelBuffer_type lowerDecelBuffer; + typedef float _profile_type; + _profile_type profile; + typedef float _period_type; + _period_type period; + typedef float _amplitude_type; + _amplitude_type amplitude; + typedef float _offset_type; + _offset_type offset; + + SetProfileRequest(): + UpperTurnaround(0), + LowerTurnaround(0), + upperDecelBuffer(0), + lowerDecelBuffer(0), + profile(0), + period(0), + amplitude(0), + offset(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->UpperTurnaround); + offset += serializeAvrFloat64(outbuffer + offset, this->LowerTurnaround); + offset += serializeAvrFloat64(outbuffer + offset, this->upperDecelBuffer); + offset += serializeAvrFloat64(outbuffer + offset, this->lowerDecelBuffer); + offset += serializeAvrFloat64(outbuffer + offset, this->profile); + offset += serializeAvrFloat64(outbuffer + offset, this->period); + offset += serializeAvrFloat64(outbuffer + offset, this->amplitude); + offset += serializeAvrFloat64(outbuffer + offset, this->offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->UpperTurnaround)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->LowerTurnaround)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->upperDecelBuffer)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->lowerDecelBuffer)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->profile)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->period)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->amplitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->offset)); + return offset; + } + + virtual const char * getType() override { return SETPROFILE; }; + virtual const char * getMD5() override { return "309001fc196b0094f23b1ae2bd672fb2"; }; + + }; + + class SetProfileResponse : public ros::Msg + { + public: + typedef float _time_type; + _time_type time; + + SetProfileResponse(): + time(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->time); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time)); + return offset; + } + + virtual const char * getType() override { return SETPROFILE; }; + virtual const char * getMD5() override { return "be5310e7aa4c90cdee120add91648cee"; }; + + }; + + class SetProfile { + public: + typedef SetProfileRequest Request; + typedef SetProfileResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/TrackLinkCmd.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/TrackLinkCmd.h new file mode 100644 index 000000000..98bec791e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_controllers/TrackLinkCmd.h @@ -0,0 +1,79 @@ +#ifndef _ROS_pr2_mechanism_controllers_TrackLinkCmd_h +#define _ROS_pr2_mechanism_controllers_TrackLinkCmd_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" + +namespace pr2_mechanism_controllers +{ + + class TrackLinkCmd : public ros::Msg + { + public: + typedef int8_t _enable_type; + _enable_type enable; + typedef const char* _link_name_type; + _link_name_type link_name; + typedef geometry_msgs::Point _point_type; + _point_type point; + + TrackLinkCmd(): + enable(0), + link_name(""), + point() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_enable; + u_enable.real = this->enable; + *(outbuffer + offset + 0) = (u_enable.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->enable); + uint32_t length_link_name = strlen(this->link_name); + varToArr(outbuffer + offset, length_link_name); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_enable; + u_enable.base = 0; + u_enable.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->enable = u_enable.real; + offset += sizeof(this->enable); + uint32_t length_link_name; + arrToVar(length_link_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->point.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_controllers/TrackLinkCmd"; }; + virtual const char * getMD5() override { return "08ccfe603e4e21c792896712c3b72de2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ActuatorStatistics.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ActuatorStatistics.h new file mode 100644 index 000000000..805b550a2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ActuatorStatistics.h @@ -0,0 +1,306 @@ +#ifndef _ROS_pr2_mechanism_msgs_ActuatorStatistics_h +#define _ROS_pr2_mechanism_msgs_ActuatorStatistics_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace pr2_mechanism_msgs +{ + + class ActuatorStatistics : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef int32_t _device_id_type; + _device_id_type device_id; + typedef ros::Time _timestamp_type; + _timestamp_type timestamp; + typedef int32_t _encoder_count_type; + _encoder_count_type encoder_count; + typedef float _encoder_offset_type; + _encoder_offset_type encoder_offset; + typedef float _position_type; + _position_type position; + typedef float _encoder_velocity_type; + _encoder_velocity_type encoder_velocity; + typedef float _velocity_type; + _velocity_type velocity; + typedef bool _calibration_reading_type; + _calibration_reading_type calibration_reading; + typedef bool _calibration_rising_edge_valid_type; + _calibration_rising_edge_valid_type calibration_rising_edge_valid; + typedef bool _calibration_falling_edge_valid_type; + _calibration_falling_edge_valid_type calibration_falling_edge_valid; + typedef float _last_calibration_rising_edge_type; + _last_calibration_rising_edge_type last_calibration_rising_edge; + typedef float _last_calibration_falling_edge_type; + _last_calibration_falling_edge_type last_calibration_falling_edge; + typedef bool _is_enabled_type; + _is_enabled_type is_enabled; + typedef bool _halted_type; + _halted_type halted; + typedef float _last_commanded_current_type; + _last_commanded_current_type last_commanded_current; + typedef float _last_commanded_effort_type; + _last_commanded_effort_type last_commanded_effort; + typedef float _last_executed_current_type; + _last_executed_current_type last_executed_current; + typedef float _last_executed_effort_type; + _last_executed_effort_type last_executed_effort; + typedef float _last_measured_current_type; + _last_measured_current_type last_measured_current; + typedef float _last_measured_effort_type; + _last_measured_effort_type last_measured_effort; + typedef float _motor_voltage_type; + _motor_voltage_type motor_voltage; + typedef int32_t _num_encoder_errors_type; + _num_encoder_errors_type num_encoder_errors; + + ActuatorStatistics(): + name(""), + device_id(0), + timestamp(), + encoder_count(0), + encoder_offset(0), + position(0), + encoder_velocity(0), + velocity(0), + calibration_reading(0), + calibration_rising_edge_valid(0), + calibration_falling_edge_valid(0), + last_calibration_rising_edge(0), + last_calibration_falling_edge(0), + is_enabled(0), + halted(0), + last_commanded_current(0), + last_commanded_effort(0), + last_executed_current(0), + last_executed_effort(0), + last_measured_current(0), + last_measured_effort(0), + motor_voltage(0), + num_encoder_errors(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; + union { + int32_t real; + uint32_t base; + } u_device_id; + u_device_id.real = this->device_id; + *(outbuffer + offset + 0) = (u_device_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_device_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_device_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_device_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->device_id); + *(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 { + int32_t real; + uint32_t base; + } u_encoder_count; + u_encoder_count.real = this->encoder_count; + *(outbuffer + offset + 0) = (u_encoder_count.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_encoder_count.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_encoder_count.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_encoder_count.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->encoder_count); + offset += serializeAvrFloat64(outbuffer + offset, this->encoder_offset); + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->encoder_velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + union { + bool real; + uint8_t base; + } u_calibration_reading; + u_calibration_reading.real = this->calibration_reading; + *(outbuffer + offset + 0) = (u_calibration_reading.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->calibration_reading); + union { + bool real; + uint8_t base; + } u_calibration_rising_edge_valid; + u_calibration_rising_edge_valid.real = this->calibration_rising_edge_valid; + *(outbuffer + offset + 0) = (u_calibration_rising_edge_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->calibration_rising_edge_valid); + union { + bool real; + uint8_t base; + } u_calibration_falling_edge_valid; + u_calibration_falling_edge_valid.real = this->calibration_falling_edge_valid; + *(outbuffer + offset + 0) = (u_calibration_falling_edge_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->calibration_falling_edge_valid); + offset += serializeAvrFloat64(outbuffer + offset, this->last_calibration_rising_edge); + offset += serializeAvrFloat64(outbuffer + offset, this->last_calibration_falling_edge); + union { + bool real; + uint8_t base; + } u_is_enabled; + u_is_enabled.real = this->is_enabled; + *(outbuffer + offset + 0) = (u_is_enabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_enabled); + union { + bool real; + uint8_t base; + } u_halted; + u_halted.real = this->halted; + *(outbuffer + offset + 0) = (u_halted.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->halted); + offset += serializeAvrFloat64(outbuffer + offset, this->last_commanded_current); + offset += serializeAvrFloat64(outbuffer + offset, this->last_commanded_effort); + offset += serializeAvrFloat64(outbuffer + offset, this->last_executed_current); + offset += serializeAvrFloat64(outbuffer + offset, this->last_executed_effort); + offset += serializeAvrFloat64(outbuffer + offset, this->last_measured_current); + offset += serializeAvrFloat64(outbuffer + offset, this->last_measured_effort); + offset += serializeAvrFloat64(outbuffer + offset, this->motor_voltage); + union { + int32_t real; + uint32_t base; + } u_num_encoder_errors; + u_num_encoder_errors.real = this->num_encoder_errors; + *(outbuffer + offset + 0) = (u_num_encoder_errors.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_num_encoder_errors.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_num_encoder_errors.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_num_encoder_errors.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->num_encoder_errors); + 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; + union { + int32_t real; + uint32_t base; + } u_device_id; + u_device_id.base = 0; + u_device_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_device_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_device_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_device_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->device_id = u_device_id.real; + offset += sizeof(this->device_id); + 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 { + int32_t real; + uint32_t base; + } u_encoder_count; + u_encoder_count.base = 0; + u_encoder_count.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_encoder_count.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_encoder_count.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_encoder_count.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->encoder_count = u_encoder_count.real; + offset += sizeof(this->encoder_count); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->encoder_offset)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->encoder_velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + union { + bool real; + uint8_t base; + } u_calibration_reading; + u_calibration_reading.base = 0; + u_calibration_reading.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->calibration_reading = u_calibration_reading.real; + offset += sizeof(this->calibration_reading); + union { + bool real; + uint8_t base; + } u_calibration_rising_edge_valid; + u_calibration_rising_edge_valid.base = 0; + u_calibration_rising_edge_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->calibration_rising_edge_valid = u_calibration_rising_edge_valid.real; + offset += sizeof(this->calibration_rising_edge_valid); + union { + bool real; + uint8_t base; + } u_calibration_falling_edge_valid; + u_calibration_falling_edge_valid.base = 0; + u_calibration_falling_edge_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->calibration_falling_edge_valid = u_calibration_falling_edge_valid.real; + offset += sizeof(this->calibration_falling_edge_valid); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_calibration_rising_edge)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_calibration_falling_edge)); + union { + bool real; + uint8_t base; + } u_is_enabled; + u_is_enabled.base = 0; + u_is_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_enabled = u_is_enabled.real; + offset += sizeof(this->is_enabled); + union { + bool real; + uint8_t base; + } u_halted; + u_halted.base = 0; + u_halted.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->halted = u_halted.real; + offset += sizeof(this->halted); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_commanded_current)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_commanded_effort)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_executed_current)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_executed_effort)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_measured_current)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_measured_effort)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->motor_voltage)); + union { + int32_t real; + uint32_t base; + } u_num_encoder_errors; + u_num_encoder_errors.base = 0; + u_num_encoder_errors.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_num_encoder_errors.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_num_encoder_errors.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_num_encoder_errors.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->num_encoder_errors = u_num_encoder_errors.real; + offset += sizeof(this->num_encoder_errors); + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_msgs/ActuatorStatistics"; }; + virtual const char * getMD5() override { return "c37184273b29627de29382f1d3670175"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ControllerStatistics.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ControllerStatistics.h new file mode 100644 index 000000000..fde533bc8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ControllerStatistics.h @@ -0,0 +1,214 @@ +#ifndef _ROS_pr2_mechanism_msgs_ControllerStatistics_h +#define _ROS_pr2_mechanism_msgs_ControllerStatistics_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" + +namespace pr2_mechanism_msgs +{ + + class ControllerStatistics : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + 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(""), + 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; + *(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; + 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 "pr2_mechanism_msgs/ControllerStatistics"; }; + virtual const char * getMD5() override { return "6d15d137eea402018e3c7c8dbecd4b95"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/JointStatistics.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/JointStatistics.h new file mode 100644 index 000000000..fe2baf4ed --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/JointStatistics.h @@ -0,0 +1,160 @@ +#ifndef _ROS_pr2_mechanism_msgs_JointStatistics_h +#define _ROS_pr2_mechanism_msgs_JointStatistics_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace pr2_mechanism_msgs +{ + + class JointStatistics : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef ros::Time _timestamp_type; + _timestamp_type timestamp; + typedef float _position_type; + _position_type position; + typedef float _velocity_type; + _velocity_type velocity; + typedef float _measured_effort_type; + _measured_effort_type measured_effort; + typedef float _commanded_effort_type; + _commanded_effort_type commanded_effort; + typedef bool _is_calibrated_type; + _is_calibrated_type is_calibrated; + typedef bool _violated_limits_type; + _violated_limits_type violated_limits; + typedef float _odometer_type; + _odometer_type odometer; + typedef float _min_position_type; + _min_position_type min_position; + typedef float _max_position_type; + _max_position_type max_position; + typedef float _max_abs_velocity_type; + _max_abs_velocity_type max_abs_velocity; + typedef float _max_abs_effort_type; + _max_abs_effort_type max_abs_effort; + + JointStatistics(): + name(""), + timestamp(), + position(0), + velocity(0), + measured_effort(0), + commanded_effort(0), + is_calibrated(0), + violated_limits(0), + odometer(0), + min_position(0), + max_position(0), + max_abs_velocity(0), + max_abs_effort(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->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); + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->measured_effort); + offset += serializeAvrFloat64(outbuffer + offset, this->commanded_effort); + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.real = this->is_calibrated; + *(outbuffer + offset + 0) = (u_is_calibrated.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_calibrated); + union { + bool real; + uint8_t base; + } u_violated_limits; + u_violated_limits.real = this->violated_limits; + *(outbuffer + offset + 0) = (u_violated_limits.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->violated_limits); + offset += serializeAvrFloat64(outbuffer + offset, this->odometer); + offset += serializeAvrFloat64(outbuffer + offset, this->min_position); + offset += serializeAvrFloat64(outbuffer + offset, this->max_position); + offset += serializeAvrFloat64(outbuffer + offset, this->max_abs_velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->max_abs_effort); + 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->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); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->measured_effort)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->commanded_effort)); + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.base = 0; + u_is_calibrated.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_calibrated = u_is_calibrated.real; + offset += sizeof(this->is_calibrated); + union { + bool real; + uint8_t base; + } u_violated_limits; + u_violated_limits.base = 0; + u_violated_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->violated_limits = u_violated_limits.real; + offset += sizeof(this->violated_limits); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->odometer)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_abs_velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_abs_effort)); + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_msgs/JointStatistics"; }; + virtual const char * getMD5() override { return "90fdc8acbce5bc783d8b4aec49af6590"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ListControllerTypes.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ListControllerTypes.h new file mode 100644 index 000000000..162df55fc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ListControllerTypes.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_ListControllerTypes_h +#define _ROS_SERVICE_ListControllerTypes_h +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_msgs +{ + +static const char LISTCONTROLLERTYPES[] = "pr2_mechanism_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; + + ListControllerTypesResponse(): + types_length(0), st_types(), types(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; + } + 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*)); + } + return offset; + } + + virtual const char * getType() override { return LISTCONTROLLERTYPES; }; + virtual const char * getMD5() override { return "80aee506387f88339842e9a93044c959"; }; + + }; + + class ListControllerTypes { + public: + typedef ListControllerTypesRequest Request; + typedef ListControllerTypesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ListControllers.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ListControllers.h new file mode 100644 index 000000000..e2bcf33f4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ListControllers.h @@ -0,0 +1,144 @@ +#ifndef _ROS_SERVICE_ListControllers_h +#define _ROS_SERVICE_ListControllers_h +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_msgs +{ + +static const char LISTCONTROLLERS[] = "pr2_mechanism_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 controllers_length; + typedef char* _controllers_type; + _controllers_type st_controllers; + _controllers_type * controllers; + uint32_t state_length; + typedef char* _state_type; + _state_type st_state; + _state_type * state; + + ListControllersResponse(): + controllers_length(0), st_controllers(), controllers(nullptr), + state_length(0), st_state(), state(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->controllers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->controllers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->controllers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->controllers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->controllers_length); + for( uint32_t i = 0; i < controllers_length; i++){ + uint32_t length_controllersi = strlen(this->controllers[i]); + varToArr(outbuffer + offset, length_controllersi); + offset += 4; + memcpy(outbuffer + offset, this->controllers[i], length_controllersi); + offset += length_controllersi; + } + *(outbuffer + offset + 0) = (this->state_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->state_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->state_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->state_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->state_length); + for( uint32_t i = 0; i < state_length; i++){ + uint32_t length_statei = strlen(this->state[i]); + varToArr(outbuffer + offset, length_statei); + offset += 4; + memcpy(outbuffer + offset, this->state[i], length_statei); + offset += length_statei; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t controllers_lengthT = ((uint32_t) (*(inbuffer + offset))); + controllers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + controllers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + controllers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->controllers_length); + if(controllers_lengthT > controllers_length) + this->controllers = (char**)realloc(this->controllers, controllers_lengthT * sizeof(char*)); + controllers_length = controllers_lengthT; + for( uint32_t i = 0; i < controllers_length; i++){ + uint32_t length_st_controllers; + arrToVar(length_st_controllers, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_controllers; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_controllers-1]=0; + this->st_controllers = (char *)(inbuffer + offset-1); + offset += length_st_controllers; + memcpy( &(this->controllers[i]), &(this->st_controllers), sizeof(char*)); + } + uint32_t state_lengthT = ((uint32_t) (*(inbuffer + offset))); + state_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + state_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + state_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->state_length); + if(state_lengthT > state_length) + this->state = (char**)realloc(this->state, state_lengthT * sizeof(char*)); + state_length = state_lengthT; + for( uint32_t i = 0; i < state_length; i++){ + uint32_t length_st_state; + arrToVar(length_st_state, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_state; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_state-1]=0; + this->st_state = (char *)(inbuffer + offset-1); + offset += length_st_state; + memcpy( &(this->state[i]), &(this->st_state), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return LISTCONTROLLERS; }; + virtual const char * getMD5() override { return "39c8d39516aed5c7d76284ac06c220e5"; }; + + }; + + class ListControllers { + public: + typedef ListControllersRequest Request; + typedef ListControllersResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/LoadController.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/LoadController.h new file mode 100644 index 000000000..d0e5ac38c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/LoadController.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_LoadController_h +#define _ROS_SERVICE_LoadController_h +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_msgs +{ + +static const char LOADCONTROLLER[] = "pr2_mechanism_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/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/MechanismStatistics.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/MechanismStatistics.h new file mode 100644 index 000000000..77eacc854 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/MechanismStatistics.h @@ -0,0 +1,122 @@ +#ifndef _ROS_pr2_mechanism_msgs_MechanismStatistics_h +#define _ROS_pr2_mechanism_msgs_MechanismStatistics_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "pr2_mechanism_msgs/ActuatorStatistics.h" +#include "pr2_mechanism_msgs/JointStatistics.h" +#include "pr2_mechanism_msgs/ControllerStatistics.h" + +namespace pr2_mechanism_msgs +{ + + class MechanismStatistics : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t actuator_statistics_length; + typedef pr2_mechanism_msgs::ActuatorStatistics _actuator_statistics_type; + _actuator_statistics_type st_actuator_statistics; + _actuator_statistics_type * actuator_statistics; + uint32_t joint_statistics_length; + typedef pr2_mechanism_msgs::JointStatistics _joint_statistics_type; + _joint_statistics_type st_joint_statistics; + _joint_statistics_type * joint_statistics; + uint32_t controller_statistics_length; + typedef pr2_mechanism_msgs::ControllerStatistics _controller_statistics_type; + _controller_statistics_type st_controller_statistics; + _controller_statistics_type * controller_statistics; + + MechanismStatistics(): + header(), + actuator_statistics_length(0), st_actuator_statistics(), actuator_statistics(nullptr), + joint_statistics_length(0), st_joint_statistics(), joint_statistics(nullptr), + controller_statistics_length(0), st_controller_statistics(), controller_statistics(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->actuator_statistics_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->actuator_statistics_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->actuator_statistics_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->actuator_statistics_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->actuator_statistics_length); + for( uint32_t i = 0; i < actuator_statistics_length; i++){ + offset += this->actuator_statistics[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->joint_statistics_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_statistics_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_statistics_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_statistics_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_statistics_length); + for( uint32_t i = 0; i < joint_statistics_length; i++){ + offset += this->joint_statistics[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->controller_statistics_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->controller_statistics_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->controller_statistics_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->controller_statistics_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->controller_statistics_length); + for( uint32_t i = 0; i < controller_statistics_length; i++){ + offset += this->controller_statistics[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t actuator_statistics_lengthT = ((uint32_t) (*(inbuffer + offset))); + actuator_statistics_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + actuator_statistics_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + actuator_statistics_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->actuator_statistics_length); + if(actuator_statistics_lengthT > actuator_statistics_length) + this->actuator_statistics = (pr2_mechanism_msgs::ActuatorStatistics*)realloc(this->actuator_statistics, actuator_statistics_lengthT * sizeof(pr2_mechanism_msgs::ActuatorStatistics)); + actuator_statistics_length = actuator_statistics_lengthT; + for( uint32_t i = 0; i < actuator_statistics_length; i++){ + offset += this->st_actuator_statistics.deserialize(inbuffer + offset); + memcpy( &(this->actuator_statistics[i]), &(this->st_actuator_statistics), sizeof(pr2_mechanism_msgs::ActuatorStatistics)); + } + uint32_t joint_statistics_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_statistics_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_statistics_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_statistics_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_statistics_length); + if(joint_statistics_lengthT > joint_statistics_length) + this->joint_statistics = (pr2_mechanism_msgs::JointStatistics*)realloc(this->joint_statistics, joint_statistics_lengthT * sizeof(pr2_mechanism_msgs::JointStatistics)); + joint_statistics_length = joint_statistics_lengthT; + for( uint32_t i = 0; i < joint_statistics_length; i++){ + offset += this->st_joint_statistics.deserialize(inbuffer + offset); + memcpy( &(this->joint_statistics[i]), &(this->st_joint_statistics), sizeof(pr2_mechanism_msgs::JointStatistics)); + } + uint32_t controller_statistics_lengthT = ((uint32_t) (*(inbuffer + offset))); + controller_statistics_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + controller_statistics_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + controller_statistics_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->controller_statistics_length); + if(controller_statistics_lengthT > controller_statistics_length) + this->controller_statistics = (pr2_mechanism_msgs::ControllerStatistics*)realloc(this->controller_statistics, controller_statistics_lengthT * sizeof(pr2_mechanism_msgs::ControllerStatistics)); + controller_statistics_length = controller_statistics_lengthT; + for( uint32_t i = 0; i < controller_statistics_length; i++){ + offset += this->st_controller_statistics.deserialize(inbuffer + offset); + memcpy( &(this->controller_statistics[i]), &(this->st_controller_statistics), sizeof(pr2_mechanism_msgs::ControllerStatistics)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_msgs/MechanismStatistics"; }; + virtual const char * getMD5() override { return "b4a99069393681672c01f8c823458e04"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ReloadControllerLibraries.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ReloadControllerLibraries.h new file mode 100644 index 000000000..6471fefbb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/ReloadControllerLibraries.h @@ -0,0 +1,106 @@ +#ifndef _ROS_SERVICE_ReloadControllerLibraries_h +#define _ROS_SERVICE_ReloadControllerLibraries_h +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_msgs +{ + +static const char RELOADCONTROLLERLIBRARIES[] = "pr2_mechanism_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/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchController.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchController.h new file mode 100644 index 000000000..86376bc77 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchController.h @@ -0,0 +1,188 @@ +#ifndef _ROS_SERVICE_SwitchController_h +#define _ROS_SERVICE_SwitchController_h +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_msgs +{ + +static const char SWITCHCONTROLLER[] = "pr2_mechanism_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; + 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) + { + } + + 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); + 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); + return offset; + } + + virtual const char * getType() override { return SWITCHCONTROLLER; }; + virtual const char * getMD5() override { return "434da54adc434a5af5743ed711fd6ba1"; }; + + }; + + 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/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerAction.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerAction.h new file mode 100644 index 000000000..c943845d7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_mechanism_msgs_SwitchControllerAction_h +#define _ROS_pr2_mechanism_msgs_SwitchControllerAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "pr2_mechanism_msgs/SwitchControllerActionGoal.h" +#include "pr2_mechanism_msgs/SwitchControllerActionResult.h" +#include "pr2_mechanism_msgs/SwitchControllerActionFeedback.h" + +namespace pr2_mechanism_msgs +{ + + class SwitchControllerAction : public ros::Msg + { + public: + typedef pr2_mechanism_msgs::SwitchControllerActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef pr2_mechanism_msgs::SwitchControllerActionResult _action_result_type; + _action_result_type action_result; + typedef pr2_mechanism_msgs::SwitchControllerActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + SwitchControllerAction(): + 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 "pr2_mechanism_msgs/SwitchControllerAction"; }; + virtual const char * getMD5() override { return "c7b048ee44f1abe19d1dfae77332d13a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionFeedback.h new file mode 100644 index 000000000..6e34763be --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_mechanism_msgs_SwitchControllerActionFeedback_h +#define _ROS_pr2_mechanism_msgs_SwitchControllerActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_mechanism_msgs/SwitchControllerFeedback.h" + +namespace pr2_mechanism_msgs +{ + + class SwitchControllerActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_mechanism_msgs::SwitchControllerFeedback _feedback_type; + _feedback_type feedback; + + SwitchControllerActionFeedback(): + 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 "pr2_mechanism_msgs/SwitchControllerActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionGoal.h new file mode 100644 index 000000000..0cb17f184 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_mechanism_msgs_SwitchControllerActionGoal_h +#define _ROS_pr2_mechanism_msgs_SwitchControllerActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "pr2_mechanism_msgs/SwitchControllerGoal.h" + +namespace pr2_mechanism_msgs +{ + + class SwitchControllerActionGoal : 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 pr2_mechanism_msgs::SwitchControllerGoal _goal_type; + _goal_type goal; + + SwitchControllerActionGoal(): + 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 "pr2_mechanism_msgs/SwitchControllerActionGoal"; }; + virtual const char * getMD5() override { return "c1a50547b620e7c8fc34420b6601a77a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionResult.h new file mode 100644 index 000000000..f2aee0d6e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_pr2_mechanism_msgs_SwitchControllerActionResult_h +#define _ROS_pr2_mechanism_msgs_SwitchControllerActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "pr2_mechanism_msgs/SwitchControllerResult.h" + +namespace pr2_mechanism_msgs +{ + + class SwitchControllerActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef pr2_mechanism_msgs::SwitchControllerResult _result_type; + _result_type result; + + SwitchControllerActionResult(): + 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 "pr2_mechanism_msgs/SwitchControllerActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerFeedback.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerFeedback.h new file mode 100644 index 000000000..21cd5ee41 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_pr2_mechanism_msgs_SwitchControllerFeedback_h +#define _ROS_pr2_mechanism_msgs_SwitchControllerFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_msgs +{ + + class SwitchControllerFeedback : public ros::Msg + { + public: + + SwitchControllerFeedback() + { + } + + 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 "pr2_mechanism_msgs/SwitchControllerFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerGoal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerGoal.h new file mode 100644 index 000000000..7b86a43cc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerGoal.h @@ -0,0 +1,112 @@ +#ifndef _ROS_pr2_mechanism_msgs_SwitchControllerGoal_h +#define _ROS_pr2_mechanism_msgs_SwitchControllerGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_msgs +{ + + class SwitchControllerGoal : 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; + + SwitchControllerGoal(): + start_controllers_length(0), st_start_controllers(), start_controllers(nullptr), + stop_controllers_length(0), st_stop_controllers(), stop_controllers(nullptr) + { + } + + 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; + } + 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*)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_mechanism_msgs/SwitchControllerGoal"; }; + virtual const char * getMD5() override { return "c3f1879cbb2d6cd8732c0e031574dde5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerResult.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerResult.h new file mode 100644 index 000000000..32995252d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/SwitchControllerResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_pr2_mechanism_msgs_SwitchControllerResult_h +#define _ROS_pr2_mechanism_msgs_SwitchControllerResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_msgs +{ + + class SwitchControllerResult : public ros::Msg + { + public: + + SwitchControllerResult() + { + } + + 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 "pr2_mechanism_msgs/SwitchControllerResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/UnloadController.h b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/UnloadController.h new file mode 100644 index 000000000..7ea94c953 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_mechanism_msgs/UnloadController.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_UnloadController_h +#define _ROS_SERVICE_UnloadController_h +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_mechanism_msgs +{ + +static const char UNLOADCONTROLLER[] = "pr2_mechanism_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/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/AccelerometerState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/AccelerometerState.h new file mode 100644 index 000000000..3634bb727 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/AccelerometerState.h @@ -0,0 +1,70 @@ +#ifndef _ROS_pr2_msgs_AccelerometerState_h +#define _ROS_pr2_msgs_AccelerometerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace pr2_msgs +{ + + class AccelerometerState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t samples_length; + typedef geometry_msgs::Vector3 _samples_type; + _samples_type st_samples; + _samples_type * samples; + + AccelerometerState(): + header(), + samples_length(0), st_samples(), samples(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->samples_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->samples_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->samples_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->samples_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->samples_length); + for( uint32_t i = 0; i < samples_length; i++){ + offset += this->samples[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t samples_lengthT = ((uint32_t) (*(inbuffer + offset))); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + samples_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->samples_length); + if(samples_lengthT > samples_length) + this->samples = (geometry_msgs::Vector3*)realloc(this->samples, samples_lengthT * sizeof(geometry_msgs::Vector3)); + samples_length = samples_lengthT; + for( uint32_t i = 0; i < samples_length; i++){ + offset += this->st_samples.deserialize(inbuffer + offset); + memcpy( &(this->samples[i]), &(this->st_samples), sizeof(geometry_msgs::Vector3)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/AccelerometerState"; }; + virtual const char * getMD5() override { return "26492e97ed8c13252c4a85592d3e93fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/AccessPoint.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/AccessPoint.h new file mode 100644 index 000000000..06185856c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/AccessPoint.h @@ -0,0 +1,232 @@ +#ifndef _ROS_pr2_msgs_AccessPoint_h +#define _ROS_pr2_msgs_AccessPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pr2_msgs +{ + + class AccessPoint : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _essid_type; + _essid_type essid; + typedef const char* _macaddr_type; + _macaddr_type macaddr; + typedef int32_t _signal_type; + _signal_type signal; + typedef int32_t _noise_type; + _noise_type noise; + typedef int32_t _snr_type; + _snr_type snr; + typedef int32_t _channel_type; + _channel_type channel; + typedef const char* _rate_type; + _rate_type rate; + typedef const char* _tx_power_type; + _tx_power_type tx_power; + typedef int32_t _quality_type; + _quality_type quality; + + AccessPoint(): + header(), + essid(""), + macaddr(""), + signal(0), + noise(0), + snr(0), + channel(0), + rate(""), + tx_power(""), + quality(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_essid = strlen(this->essid); + varToArr(outbuffer + offset, length_essid); + offset += 4; + memcpy(outbuffer + offset, this->essid, length_essid); + offset += length_essid; + uint32_t length_macaddr = strlen(this->macaddr); + varToArr(outbuffer + offset, length_macaddr); + offset += 4; + memcpy(outbuffer + offset, this->macaddr, length_macaddr); + offset += length_macaddr; + union { + int32_t real; + uint32_t base; + } u_signal; + u_signal.real = this->signal; + *(outbuffer + offset + 0) = (u_signal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_signal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_signal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_signal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->signal); + union { + int32_t real; + uint32_t base; + } u_noise; + u_noise.real = this->noise; + *(outbuffer + offset + 0) = (u_noise.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_noise.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_noise.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_noise.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->noise); + union { + int32_t real; + uint32_t base; + } u_snr; + u_snr.real = this->snr; + *(outbuffer + offset + 0) = (u_snr.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_snr.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_snr.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_snr.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->snr); + union { + int32_t real; + uint32_t base; + } u_channel; + u_channel.real = this->channel; + *(outbuffer + offset + 0) = (u_channel.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_channel.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_channel.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_channel.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->channel); + uint32_t length_rate = strlen(this->rate); + varToArr(outbuffer + offset, length_rate); + offset += 4; + memcpy(outbuffer + offset, this->rate, length_rate); + offset += length_rate; + uint32_t length_tx_power = strlen(this->tx_power); + varToArr(outbuffer + offset, length_tx_power); + offset += 4; + memcpy(outbuffer + offset, this->tx_power, length_tx_power); + offset += length_tx_power; + union { + int32_t real; + uint32_t base; + } u_quality; + u_quality.real = this->quality; + *(outbuffer + offset + 0) = (u_quality.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_quality.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_quality.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_quality.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->quality); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_essid; + arrToVar(length_essid, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_essid; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_essid-1]=0; + this->essid = (char *)(inbuffer + offset-1); + offset += length_essid; + uint32_t length_macaddr; + arrToVar(length_macaddr, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_macaddr; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_macaddr-1]=0; + this->macaddr = (char *)(inbuffer + offset-1); + offset += length_macaddr; + union { + int32_t real; + uint32_t base; + } u_signal; + u_signal.base = 0; + u_signal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_signal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_signal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_signal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->signal = u_signal.real; + offset += sizeof(this->signal); + union { + int32_t real; + uint32_t base; + } u_noise; + u_noise.base = 0; + u_noise.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_noise.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_noise.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_noise.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->noise = u_noise.real; + offset += sizeof(this->noise); + union { + int32_t real; + uint32_t base; + } u_snr; + u_snr.base = 0; + u_snr.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_snr.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_snr.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_snr.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->snr = u_snr.real; + offset += sizeof(this->snr); + union { + int32_t real; + uint32_t base; + } u_channel; + u_channel.base = 0; + u_channel.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_channel.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_channel.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_channel.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->channel = u_channel.real; + offset += sizeof(this->channel); + uint32_t length_rate; + arrToVar(length_rate, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_rate; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_rate-1]=0; + this->rate = (char *)(inbuffer + offset-1); + offset += length_rate; + uint32_t length_tx_power; + arrToVar(length_tx_power, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_tx_power; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_tx_power-1]=0; + this->tx_power = (char *)(inbuffer + offset-1); + offset += length_tx_power; + union { + int32_t real; + uint32_t base; + } u_quality; + u_quality.base = 0; + u_quality.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_quality.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_quality.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_quality.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->quality = u_quality.real; + offset += sizeof(this->quality); + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/AccessPoint"; }; + virtual const char * getMD5() override { return "810217d9e35df31ffb396ea5673d7d1b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryServer.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryServer.h new file mode 100644 index 000000000..0812f8670 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryServer.h @@ -0,0 +1,242 @@ +#ifndef _ROS_pr2_msgs_BatteryServer_h +#define _ROS_pr2_msgs_BatteryServer_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "pr2_msgs/BatteryState.h" + +namespace pr2_msgs +{ + + class BatteryServer : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _id_type; + _id_type id; + typedef int32_t _lastTimeSystem_type; + _lastTimeSystem_type lastTimeSystem; + typedef uint16_t _timeLeft_type; + _timeLeft_type timeLeft; + typedef uint16_t _averageCharge_type; + _averageCharge_type averageCharge; + typedef const char* _message_type; + _message_type message; + typedef int32_t _lastTimeController_type; + _lastTimeController_type lastTimeController; + typedef uint16_t _present_type; + _present_type present; + typedef uint16_t _charging_type; + _charging_type charging; + typedef uint16_t _discharging_type; + _discharging_type discharging; + typedef uint16_t _reserved_type; + _reserved_type reserved; + typedef uint16_t _powerPresent_type; + _powerPresent_type powerPresent; + typedef uint16_t _powerNG_type; + _powerNG_type powerNG; + typedef uint16_t _inhibited_type; + _inhibited_type inhibited; + uint32_t battery_length; + typedef pr2_msgs::BatteryState _battery_type; + _battery_type st_battery; + _battery_type * battery; + enum { MAX_BAT_COUNT = 4 }; + enum { MAX_BAT_REG = 48 }; + + BatteryServer(): + header(), + id(0), + lastTimeSystem(0), + timeLeft(0), + averageCharge(0), + message(""), + lastTimeController(0), + present(0), + charging(0), + discharging(0), + reserved(0), + powerPresent(0), + powerNG(0), + inhibited(0), + battery_length(0), st_battery(), battery(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_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_lastTimeSystem; + u_lastTimeSystem.real = this->lastTimeSystem; + *(outbuffer + offset + 0) = (u_lastTimeSystem.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_lastTimeSystem.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_lastTimeSystem.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_lastTimeSystem.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->lastTimeSystem); + *(outbuffer + offset + 0) = (this->timeLeft >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeLeft >> (8 * 1)) & 0xFF; + offset += sizeof(this->timeLeft); + *(outbuffer + offset + 0) = (this->averageCharge >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->averageCharge >> (8 * 1)) & 0xFF; + offset += sizeof(this->averageCharge); + uint32_t length_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + union { + int32_t real; + uint32_t base; + } u_lastTimeController; + u_lastTimeController.real = this->lastTimeController; + *(outbuffer + offset + 0) = (u_lastTimeController.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_lastTimeController.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_lastTimeController.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_lastTimeController.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->lastTimeController); + *(outbuffer + offset + 0) = (this->present >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->present >> (8 * 1)) & 0xFF; + offset += sizeof(this->present); + *(outbuffer + offset + 0) = (this->charging >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->charging >> (8 * 1)) & 0xFF; + offset += sizeof(this->charging); + *(outbuffer + offset + 0) = (this->discharging >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->discharging >> (8 * 1)) & 0xFF; + offset += sizeof(this->discharging); + *(outbuffer + offset + 0) = (this->reserved >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->reserved >> (8 * 1)) & 0xFF; + offset += sizeof(this->reserved); + *(outbuffer + offset + 0) = (this->powerPresent >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->powerPresent >> (8 * 1)) & 0xFF; + offset += sizeof(this->powerPresent); + *(outbuffer + offset + 0) = (this->powerNG >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->powerNG >> (8 * 1)) & 0xFF; + offset += sizeof(this->powerNG); + *(outbuffer + offset + 0) = (this->inhibited >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->inhibited >> (8 * 1)) & 0xFF; + offset += sizeof(this->inhibited); + *(outbuffer + offset + 0) = (this->battery_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->battery_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->battery_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->battery_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery_length); + for( uint32_t i = 0; i < battery_length; i++){ + offset += this->battery[i].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_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_lastTimeSystem; + u_lastTimeSystem.base = 0; + u_lastTimeSystem.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_lastTimeSystem.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_lastTimeSystem.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_lastTimeSystem.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->lastTimeSystem = u_lastTimeSystem.real; + offset += sizeof(this->lastTimeSystem); + this->timeLeft = ((uint16_t) (*(inbuffer + offset))); + this->timeLeft |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->timeLeft); + this->averageCharge = ((uint16_t) (*(inbuffer + offset))); + this->averageCharge |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->averageCharge); + 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; + union { + int32_t real; + uint32_t base; + } u_lastTimeController; + u_lastTimeController.base = 0; + u_lastTimeController.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_lastTimeController.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_lastTimeController.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_lastTimeController.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->lastTimeController = u_lastTimeController.real; + offset += sizeof(this->lastTimeController); + this->present = ((uint16_t) (*(inbuffer + offset))); + this->present |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->present); + this->charging = ((uint16_t) (*(inbuffer + offset))); + this->charging |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->charging); + this->discharging = ((uint16_t) (*(inbuffer + offset))); + this->discharging |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->discharging); + this->reserved = ((uint16_t) (*(inbuffer + offset))); + this->reserved |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->reserved); + this->powerPresent = ((uint16_t) (*(inbuffer + offset))); + this->powerPresent |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->powerPresent); + this->powerNG = ((uint16_t) (*(inbuffer + offset))); + this->powerNG |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->powerNG); + this->inhibited = ((uint16_t) (*(inbuffer + offset))); + this->inhibited |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->inhibited); + uint32_t battery_lengthT = ((uint32_t) (*(inbuffer + offset))); + battery_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + battery_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + battery_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->battery_length); + if(battery_lengthT > battery_length) + this->battery = (pr2_msgs::BatteryState*)realloc(this->battery, battery_lengthT * sizeof(pr2_msgs::BatteryState)); + battery_length = battery_lengthT; + for( uint32_t i = 0; i < battery_length; i++){ + offset += this->st_battery.deserialize(inbuffer + offset); + memcpy( &(this->battery[i]), &(this->st_battery), sizeof(pr2_msgs::BatteryState)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/BatteryServer"; }; + virtual const char * getMD5() override { return "4f6d6e54c9581beb1df7ea408c0727be"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryServer2.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryServer2.h new file mode 100644 index 000000000..ef3589b7a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryServer2.h @@ -0,0 +1,208 @@ +#ifndef _ROS_pr2_msgs_BatteryServer2_h +#define _ROS_pr2_msgs_BatteryServer2_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/time.h" +#include "ros/duration.h" +#include "pr2_msgs/BatteryState2.h" + +namespace pr2_msgs +{ + + class BatteryServer2 : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _id_type; + _id_type id; + typedef ros::Time _last_system_update_type; + _last_system_update_type last_system_update; + typedef ros::Duration _time_left_type; + _time_left_type time_left; + typedef int32_t _average_charge_type; + _average_charge_type average_charge; + typedef const char* _message_type; + _message_type message; + typedef ros::Time _last_controller_update_type; + _last_controller_update_type last_controller_update; + uint32_t battery_length; + typedef pr2_msgs::BatteryState2 _battery_type; + _battery_type st_battery; + _battery_type * battery; + enum { MAX_BAT_COUNT = 4 }; + enum { MAX_BAT_REG = 48 }; + + BatteryServer2(): + header(), + id(0), + last_system_update(), + time_left(), + average_charge(0), + message(""), + last_controller_update(), + battery_length(0), st_battery(), battery(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_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); + *(outbuffer + offset + 0) = (this->last_system_update.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->last_system_update.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->last_system_update.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->last_system_update.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->last_system_update.sec); + *(outbuffer + offset + 0) = (this->last_system_update.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->last_system_update.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->last_system_update.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->last_system_update.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->last_system_update.nsec); + *(outbuffer + offset + 0) = (this->time_left.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_left.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_left.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_left.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_left.sec); + *(outbuffer + offset + 0) = (this->time_left.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_left.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_left.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_left.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_left.nsec); + union { + int32_t real; + uint32_t base; + } u_average_charge; + u_average_charge.real = this->average_charge; + *(outbuffer + offset + 0) = (u_average_charge.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_average_charge.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_average_charge.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_average_charge.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->average_charge); + uint32_t length_message = strlen(this->message); + varToArr(outbuffer + offset, length_message); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + *(outbuffer + offset + 0) = (this->last_controller_update.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->last_controller_update.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->last_controller_update.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->last_controller_update.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->last_controller_update.sec); + *(outbuffer + offset + 0) = (this->last_controller_update.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->last_controller_update.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->last_controller_update.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->last_controller_update.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->last_controller_update.nsec); + *(outbuffer + offset + 0) = (this->battery_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->battery_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->battery_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->battery_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery_length); + for( uint32_t i = 0; i < battery_length; i++){ + offset += this->battery[i].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_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); + this->last_system_update.sec = ((uint32_t) (*(inbuffer + offset))); + this->last_system_update.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->last_system_update.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->last_system_update.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->last_system_update.sec); + this->last_system_update.nsec = ((uint32_t) (*(inbuffer + offset))); + this->last_system_update.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->last_system_update.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->last_system_update.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->last_system_update.nsec); + this->time_left.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_left.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_left.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_left.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_left.sec); + this->time_left.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_left.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_left.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_left.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_left.nsec); + union { + int32_t real; + uint32_t base; + } u_average_charge; + u_average_charge.base = 0; + u_average_charge.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_average_charge.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_average_charge.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_average_charge.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->average_charge = u_average_charge.real; + offset += sizeof(this->average_charge); + 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; + this->last_controller_update.sec = ((uint32_t) (*(inbuffer + offset))); + this->last_controller_update.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->last_controller_update.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->last_controller_update.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->last_controller_update.sec); + this->last_controller_update.nsec = ((uint32_t) (*(inbuffer + offset))); + this->last_controller_update.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->last_controller_update.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->last_controller_update.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->last_controller_update.nsec); + uint32_t battery_lengthT = ((uint32_t) (*(inbuffer + offset))); + battery_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + battery_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + battery_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->battery_length); + if(battery_lengthT > battery_length) + this->battery = (pr2_msgs::BatteryState2*)realloc(this->battery, battery_lengthT * sizeof(pr2_msgs::BatteryState2)); + battery_length = battery_lengthT; + for( uint32_t i = 0; i < battery_length; i++){ + offset += this->st_battery.deserialize(inbuffer + offset); + memcpy( &(this->battery[i]), &(this->st_battery), sizeof(pr2_msgs::BatteryState2)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/BatteryServer2"; }; + virtual const char * getMD5() override { return "5f2cec7d06c312d756189db96c1f3819"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryState.h new file mode 100644 index 000000000..2568dc669 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryState.h @@ -0,0 +1,113 @@ +#ifndef _ROS_pr2_msgs_BatteryState_h +#define _ROS_pr2_msgs_BatteryState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_msgs +{ + + class BatteryState : public ros::Msg + { + public: + typedef int32_t _lastTimeBattery_type; + _lastTimeBattery_type lastTimeBattery; + uint16_t batReg[48]; + uint16_t batRegFlag[48]; + int32_t batRegTime[48]; + + BatteryState(): + lastTimeBattery(0), + batReg(), + batRegFlag(), + batRegTime() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_lastTimeBattery; + u_lastTimeBattery.real = this->lastTimeBattery; + *(outbuffer + offset + 0) = (u_lastTimeBattery.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_lastTimeBattery.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_lastTimeBattery.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_lastTimeBattery.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->lastTimeBattery); + for( uint32_t i = 0; i < 48; i++){ + *(outbuffer + offset + 0) = (this->batReg[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->batReg[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->batReg[i]); + } + for( uint32_t i = 0; i < 48; i++){ + *(outbuffer + offset + 0) = (this->batRegFlag[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->batRegFlag[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->batRegFlag[i]); + } + for( uint32_t i = 0; i < 48; i++){ + union { + int32_t real; + uint32_t base; + } u_batRegTimei; + u_batRegTimei.real = this->batRegTime[i]; + *(outbuffer + offset + 0) = (u_batRegTimei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_batRegTimei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_batRegTimei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_batRegTimei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->batRegTime[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_lastTimeBattery; + u_lastTimeBattery.base = 0; + u_lastTimeBattery.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_lastTimeBattery.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_lastTimeBattery.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_lastTimeBattery.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->lastTimeBattery = u_lastTimeBattery.real; + offset += sizeof(this->lastTimeBattery); + for( uint32_t i = 0; i < 48; i++){ + this->batReg[i] = ((uint16_t) (*(inbuffer + offset))); + this->batReg[i] |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->batReg[i]); + } + for( uint32_t i = 0; i < 48; i++){ + this->batRegFlag[i] = ((uint16_t) (*(inbuffer + offset))); + this->batRegFlag[i] |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->batRegFlag[i]); + } + for( uint32_t i = 0; i < 48; i++){ + union { + int32_t real; + uint32_t base; + } u_batRegTimei; + u_batRegTimei.base = 0; + u_batRegTimei.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_batRegTimei.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_batRegTimei.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_batRegTimei.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->batRegTime[i] = u_batRegTimei.real; + offset += sizeof(this->batRegTime[i]); + } + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/BatteryState"; }; + virtual const char * getMD5() override { return "00e9f996c2fc26700fd25abcd8422db0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryState2.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryState2.h new file mode 100644 index 000000000..10292c184 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/BatteryState2.h @@ -0,0 +1,240 @@ +#ifndef _ROS_pr2_msgs_BatteryState2_h +#define _ROS_pr2_msgs_BatteryState2_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace pr2_msgs +{ + + class BatteryState2 : public ros::Msg + { + public: + typedef bool _present_type; + _present_type present; + typedef bool _charging_type; + _charging_type charging; + typedef bool _discharging_type; + _discharging_type discharging; + typedef bool _power_present_type; + _power_present_type power_present; + typedef bool _power_no_good_type; + _power_no_good_type power_no_good; + typedef bool _inhibited_type; + _inhibited_type inhibited; + typedef ros::Time _last_battery_update_type; + _last_battery_update_type last_battery_update; + int16_t battery_register[48]; + bool battery_update_flag[48]; + ros::Time battery_register_update[48]; + + BatteryState2(): + present(0), + charging(0), + discharging(0), + power_present(0), + power_no_good(0), + inhibited(0), + last_battery_update(), + battery_register(), + battery_update_flag(), + battery_register_update() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_present; + u_present.real = this->present; + *(outbuffer + offset + 0) = (u_present.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->present); + union { + bool real; + uint8_t base; + } u_charging; + u_charging.real = this->charging; + *(outbuffer + offset + 0) = (u_charging.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->charging); + union { + bool real; + uint8_t base; + } u_discharging; + u_discharging.real = this->discharging; + *(outbuffer + offset + 0) = (u_discharging.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->discharging); + union { + bool real; + uint8_t base; + } u_power_present; + u_power_present.real = this->power_present; + *(outbuffer + offset + 0) = (u_power_present.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_present); + union { + bool real; + uint8_t base; + } u_power_no_good; + u_power_no_good.real = this->power_no_good; + *(outbuffer + offset + 0) = (u_power_no_good.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_no_good); + union { + bool real; + uint8_t base; + } u_inhibited; + u_inhibited.real = this->inhibited; + *(outbuffer + offset + 0) = (u_inhibited.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->inhibited); + *(outbuffer + offset + 0) = (this->last_battery_update.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->last_battery_update.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->last_battery_update.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->last_battery_update.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->last_battery_update.sec); + *(outbuffer + offset + 0) = (this->last_battery_update.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->last_battery_update.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->last_battery_update.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->last_battery_update.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->last_battery_update.nsec); + for( uint32_t i = 0; i < 48; i++){ + union { + int16_t real; + uint16_t base; + } u_battery_registeri; + u_battery_registeri.real = this->battery_register[i]; + *(outbuffer + offset + 0) = (u_battery_registeri.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_battery_registeri.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->battery_register[i]); + } + for( uint32_t i = 0; i < 48; i++){ + union { + bool real; + uint8_t base; + } u_battery_update_flagi; + u_battery_update_flagi.real = this->battery_update_flag[i]; + *(outbuffer + offset + 0) = (u_battery_update_flagi.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->battery_update_flag[i]); + } + for( uint32_t i = 0; i < 48; i++){ + *(outbuffer + offset + 0) = (this->battery_register_update[i].sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->battery_register_update[i].sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->battery_register_update[i].sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->battery_register_update[i].sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery_register_update[i].sec); + *(outbuffer + offset + 0) = (this->battery_register_update[i].nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->battery_register_update[i].nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->battery_register_update[i].nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->battery_register_update[i].nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->battery_register_update[i].nsec); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_present; + u_present.base = 0; + u_present.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->present = u_present.real; + offset += sizeof(this->present); + union { + bool real; + uint8_t base; + } u_charging; + u_charging.base = 0; + u_charging.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->charging = u_charging.real; + offset += sizeof(this->charging); + union { + bool real; + uint8_t base; + } u_discharging; + u_discharging.base = 0; + u_discharging.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->discharging = u_discharging.real; + offset += sizeof(this->discharging); + union { + bool real; + uint8_t base; + } u_power_present; + u_power_present.base = 0; + u_power_present.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->power_present = u_power_present.real; + offset += sizeof(this->power_present); + union { + bool real; + uint8_t base; + } u_power_no_good; + u_power_no_good.base = 0; + u_power_no_good.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->power_no_good = u_power_no_good.real; + offset += sizeof(this->power_no_good); + union { + bool real; + uint8_t base; + } u_inhibited; + u_inhibited.base = 0; + u_inhibited.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->inhibited = u_inhibited.real; + offset += sizeof(this->inhibited); + this->last_battery_update.sec = ((uint32_t) (*(inbuffer + offset))); + this->last_battery_update.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->last_battery_update.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->last_battery_update.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->last_battery_update.sec); + this->last_battery_update.nsec = ((uint32_t) (*(inbuffer + offset))); + this->last_battery_update.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->last_battery_update.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->last_battery_update.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->last_battery_update.nsec); + for( uint32_t i = 0; i < 48; i++){ + union { + int16_t real; + uint16_t base; + } u_battery_registeri; + u_battery_registeri.base = 0; + u_battery_registeri.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_battery_registeri.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->battery_register[i] = u_battery_registeri.real; + offset += sizeof(this->battery_register[i]); + } + for( uint32_t i = 0; i < 48; i++){ + union { + bool real; + uint8_t base; + } u_battery_update_flagi; + u_battery_update_flagi.base = 0; + u_battery_update_flagi.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->battery_update_flag[i] = u_battery_update_flagi.real; + offset += sizeof(this->battery_update_flag[i]); + } + for( uint32_t i = 0; i < 48; i++){ + this->battery_register_update[i].sec = ((uint32_t) (*(inbuffer + offset))); + this->battery_register_update[i].sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->battery_register_update[i].sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->battery_register_update[i].sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->battery_register_update[i].sec); + this->battery_register_update[i].nsec = ((uint32_t) (*(inbuffer + offset))); + this->battery_register_update[i].nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->battery_register_update[i].nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->battery_register_update[i].nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->battery_register_update[i].nsec); + } + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/BatteryState2"; }; + virtual const char * getMD5() override { return "91b4acb000aa990ac3006834f9a99669"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/DashboardState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/DashboardState.h new file mode 100644 index 000000000..d4ac9511a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/DashboardState.h @@ -0,0 +1,134 @@ +#ifndef _ROS_pr2_msgs_DashboardState_h +#define _ROS_pr2_msgs_DashboardState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Bool.h" +#include "pr2_msgs/PowerBoardState.h" +#include "pr2_msgs/PowerState.h" +#include "pr2_msgs/AccessPoint.h" + +namespace pr2_msgs +{ + + class DashboardState : public ros::Msg + { + public: + typedef std_msgs::Bool _motors_halted_type; + _motors_halted_type motors_halted; + typedef bool _motors_halted_valid_type; + _motors_halted_valid_type motors_halted_valid; + typedef pr2_msgs::PowerBoardState _power_board_state_type; + _power_board_state_type power_board_state; + typedef bool _power_board_state_valid_type; + _power_board_state_valid_type power_board_state_valid; + typedef pr2_msgs::PowerState _power_state_type; + _power_state_type power_state; + typedef bool _power_state_valid_type; + _power_state_valid_type power_state_valid; + typedef pr2_msgs::AccessPoint _access_point_type; + _access_point_type access_point; + typedef bool _access_point_valid_type; + _access_point_valid_type access_point_valid; + + DashboardState(): + motors_halted(), + motors_halted_valid(0), + power_board_state(), + power_board_state_valid(0), + power_state(), + power_state_valid(0), + access_point(), + access_point_valid(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->motors_halted.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_motors_halted_valid; + u_motors_halted_valid.real = this->motors_halted_valid; + *(outbuffer + offset + 0) = (u_motors_halted_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->motors_halted_valid); + offset += this->power_board_state.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_power_board_state_valid; + u_power_board_state_valid.real = this->power_board_state_valid; + *(outbuffer + offset + 0) = (u_power_board_state_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_board_state_valid); + offset += this->power_state.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_power_state_valid; + u_power_state_valid.real = this->power_state_valid; + *(outbuffer + offset + 0) = (u_power_state_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_state_valid); + offset += this->access_point.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_access_point_valid; + u_access_point_valid.real = this->access_point_valid; + *(outbuffer + offset + 0) = (u_access_point_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->access_point_valid); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->motors_halted.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_motors_halted_valid; + u_motors_halted_valid.base = 0; + u_motors_halted_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->motors_halted_valid = u_motors_halted_valid.real; + offset += sizeof(this->motors_halted_valid); + offset += this->power_board_state.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_power_board_state_valid; + u_power_board_state_valid.base = 0; + u_power_board_state_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->power_board_state_valid = u_power_board_state_valid.real; + offset += sizeof(this->power_board_state_valid); + offset += this->power_state.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_power_state_valid; + u_power_state_valid.base = 0; + u_power_state_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->power_state_valid = u_power_state_valid.real; + offset += sizeof(this->power_state_valid); + offset += this->access_point.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_access_point_valid; + u_access_point_valid.base = 0; + u_access_point_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->access_point_valid = u_access_point_valid.real; + offset += sizeof(this->access_point_valid); + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/DashboardState"; }; + virtual const char * getMD5() override { return "db0cd0d535d75e0f6257b20c403e87f5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/GPUStatus.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/GPUStatus.h new file mode 100644 index 000000000..3865635ec --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/GPUStatus.h @@ -0,0 +1,225 @@ +#ifndef _ROS_pr2_msgs_GPUStatus_h +#define _ROS_pr2_msgs_GPUStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pr2_msgs +{ + + class GPUStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _product_name_type; + _product_name_type product_name; + typedef const char* _pci_device_id_type; + _pci_device_id_type pci_device_id; + typedef const char* _pci_location_type; + _pci_location_type pci_location; + typedef const char* _display_type; + _display_type display; + typedef const char* _driver_version_type; + _driver_version_type driver_version; + typedef float _temperature_type; + _temperature_type temperature; + typedef float _fan_speed_type; + _fan_speed_type fan_speed; + typedef float _gpu_usage_type; + _gpu_usage_type gpu_usage; + typedef float _memory_usage_type; + _memory_usage_type memory_usage; + + GPUStatus(): + header(), + product_name(""), + pci_device_id(""), + pci_location(""), + display(""), + driver_version(""), + temperature(0), + fan_speed(0), + gpu_usage(0), + memory_usage(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_product_name = strlen(this->product_name); + varToArr(outbuffer + offset, length_product_name); + offset += 4; + memcpy(outbuffer + offset, this->product_name, length_product_name); + offset += length_product_name; + uint32_t length_pci_device_id = strlen(this->pci_device_id); + varToArr(outbuffer + offset, length_pci_device_id); + offset += 4; + memcpy(outbuffer + offset, this->pci_device_id, length_pci_device_id); + offset += length_pci_device_id; + uint32_t length_pci_location = strlen(this->pci_location); + varToArr(outbuffer + offset, length_pci_location); + offset += 4; + memcpy(outbuffer + offset, this->pci_location, length_pci_location); + offset += length_pci_location; + uint32_t length_display = strlen(this->display); + varToArr(outbuffer + offset, length_display); + offset += 4; + memcpy(outbuffer + offset, this->display, length_display); + offset += length_display; + uint32_t length_driver_version = strlen(this->driver_version); + varToArr(outbuffer + offset, length_driver_version); + offset += 4; + memcpy(outbuffer + offset, this->driver_version, length_driver_version); + offset += length_driver_version; + 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_fan_speed; + u_fan_speed.real = this->fan_speed; + *(outbuffer + offset + 0) = (u_fan_speed.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_fan_speed.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_fan_speed.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_fan_speed.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->fan_speed); + union { + float real; + uint32_t base; + } u_gpu_usage; + u_gpu_usage.real = this->gpu_usage; + *(outbuffer + offset + 0) = (u_gpu_usage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_gpu_usage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_gpu_usage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_gpu_usage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->gpu_usage); + union { + float real; + uint32_t base; + } u_memory_usage; + u_memory_usage.real = this->memory_usage; + *(outbuffer + offset + 0) = (u_memory_usage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_memory_usage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_memory_usage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_memory_usage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->memory_usage); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_product_name; + arrToVar(length_product_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_product_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_product_name-1]=0; + this->product_name = (char *)(inbuffer + offset-1); + offset += length_product_name; + uint32_t length_pci_device_id; + arrToVar(length_pci_device_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pci_device_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pci_device_id-1]=0; + this->pci_device_id = (char *)(inbuffer + offset-1); + offset += length_pci_device_id; + uint32_t length_pci_location; + arrToVar(length_pci_location, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pci_location; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pci_location-1]=0; + this->pci_location = (char *)(inbuffer + offset-1); + offset += length_pci_location; + uint32_t length_display; + arrToVar(length_display, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_display; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_display-1]=0; + this->display = (char *)(inbuffer + offset-1); + offset += length_display; + uint32_t length_driver_version; + arrToVar(length_driver_version, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_driver_version; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_driver_version-1]=0; + this->driver_version = (char *)(inbuffer + offset-1); + offset += length_driver_version; + 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_fan_speed; + u_fan_speed.base = 0; + u_fan_speed.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_fan_speed.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_fan_speed.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_fan_speed.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->fan_speed = u_fan_speed.real; + offset += sizeof(this->fan_speed); + union { + float real; + uint32_t base; + } u_gpu_usage; + u_gpu_usage.base = 0; + u_gpu_usage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_gpu_usage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_gpu_usage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_gpu_usage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->gpu_usage = u_gpu_usage.real; + offset += sizeof(this->gpu_usage); + union { + float real; + uint32_t base; + } u_memory_usage; + u_memory_usage.base = 0; + u_memory_usage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_memory_usage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_memory_usage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_memory_usage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->memory_usage = u_memory_usage.real; + offset += sizeof(this->memory_usage); + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/GPUStatus"; }; + virtual const char * getMD5() override { return "4c74e5474b8aade04e56108262099c6e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/LaserScannerSignal.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/LaserScannerSignal.h new file mode 100644 index 000000000..017194b5b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/LaserScannerSignal.h @@ -0,0 +1,68 @@ +#ifndef _ROS_pr2_msgs_LaserScannerSignal_h +#define _ROS_pr2_msgs_LaserScannerSignal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pr2_msgs +{ + + class LaserScannerSignal : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int32_t _signal_type; + _signal_type signal; + + LaserScannerSignal(): + header(), + signal(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_signal; + u_signal.real = this->signal; + *(outbuffer + offset + 0) = (u_signal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_signal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_signal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_signal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->signal); + 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_signal; + u_signal.base = 0; + u_signal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_signal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_signal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_signal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->signal = u_signal.real; + offset += sizeof(this->signal); + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/LaserScannerSignal"; }; + virtual const char * getMD5() override { return "78f41e618127bce049dd6104d9c31dc5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/LaserTrajCmd.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/LaserTrajCmd.h new file mode 100644 index 000000000..725afc872 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/LaserTrajCmd.h @@ -0,0 +1,140 @@ +#ifndef _ROS_pr2_msgs_LaserTrajCmd_h +#define _ROS_pr2_msgs_LaserTrajCmd_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/duration.h" + +namespace pr2_msgs +{ + + class LaserTrajCmd : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _profile_type; + _profile_type profile; + uint32_t position_length; + typedef float _position_type; + _position_type st_position; + _position_type * position; + uint32_t time_from_start_length; + typedef ros::Duration _time_from_start_type; + _time_from_start_type st_time_from_start; + _time_from_start_type * time_from_start; + typedef float _max_velocity_type; + _max_velocity_type max_velocity; + typedef float _max_acceleration_type; + _max_acceleration_type max_acceleration; + + LaserTrajCmd(): + header(), + profile(""), + position_length(0), st_position(), position(nullptr), + time_from_start_length(0), st_time_from_start(), time_from_start(nullptr), + max_velocity(0), + max_acceleration(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_profile = strlen(this->profile); + varToArr(outbuffer + offset, length_profile); + offset += 4; + memcpy(outbuffer + offset, this->profile, length_profile); + offset += length_profile; + *(outbuffer + offset + 0) = (this->position_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->position_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->position_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->position_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->position_length); + for( uint32_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset + 0) = (this->time_from_start_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start_length); + for( uint32_t i = 0; i < time_from_start_length; i++){ + *(outbuffer + offset + 0) = (this->time_from_start[i].sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start[i].sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start[i].sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start[i].sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start[i].sec); + *(outbuffer + offset + 0) = (this->time_from_start[i].nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start[i].nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start[i].nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start[i].nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start[i].nsec); + } + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->max_acceleration); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_profile; + arrToVar(length_profile, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_profile; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_profile-1]=0; + this->profile = (char *)(inbuffer + offset-1); + offset += length_profile; + uint32_t position_lengthT = ((uint32_t) (*(inbuffer + offset))); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->position_length); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + position_length = position_lengthT; + for( uint32_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint32_t time_from_start_lengthT = ((uint32_t) (*(inbuffer + offset))); + time_from_start_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + time_from_start_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + time_from_start_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start_length); + if(time_from_start_lengthT > time_from_start_length) + this->time_from_start = (ros::Duration*)realloc(this->time_from_start, time_from_start_lengthT * sizeof(ros::Duration)); + time_from_start_length = time_from_start_lengthT; + for( uint32_t i = 0; i < time_from_start_length; i++){ + this->st_time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->st_time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_time_from_start.sec); + this->st_time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->st_time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_time_from_start.nsec); + memcpy( &(this->time_from_start[i]), &(this->st_time_from_start), sizeof(ros::Duration)); + } + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_acceleration)); + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/LaserTrajCmd"; }; + virtual const char * getMD5() override { return "68a1665e9079049dce55a0384cb2e9b5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PeriodicCmd.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PeriodicCmd.h new file mode 100644 index 000000000..d6561cc07 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PeriodicCmd.h @@ -0,0 +1,76 @@ +#ifndef _ROS_pr2_msgs_PeriodicCmd_h +#define _ROS_pr2_msgs_PeriodicCmd_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pr2_msgs +{ + + class PeriodicCmd : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _profile_type; + _profile_type profile; + typedef float _period_type; + _period_type period; + typedef float _amplitude_type; + _amplitude_type amplitude; + typedef float _offset_type; + _offset_type offset; + + PeriodicCmd(): + header(), + profile(""), + period(0), + amplitude(0), + offset(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_profile = strlen(this->profile); + varToArr(outbuffer + offset, length_profile); + offset += 4; + memcpy(outbuffer + offset, this->profile, length_profile); + offset += length_profile; + offset += serializeAvrFloat64(outbuffer + offset, this->period); + offset += serializeAvrFloat64(outbuffer + offset, this->amplitude); + offset += serializeAvrFloat64(outbuffer + offset, this->offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_profile; + arrToVar(length_profile, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_profile; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_profile-1]=0; + this->profile = (char *)(inbuffer + offset-1); + offset += length_profile; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->period)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->amplitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->offset)); + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/PeriodicCmd"; }; + virtual const char * getMD5() override { return "95ab7e548e3d4274f83393129dd96c2e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PowerBoardState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PowerBoardState.h new file mode 100644 index 000000000..dfab1493d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PowerBoardState.h @@ -0,0 +1,173 @@ +#ifndef _ROS_pr2_msgs_PowerBoardState_h +#define _ROS_pr2_msgs_PowerBoardState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pr2_msgs +{ + + class PowerBoardState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _name_type; + _name_type name; + typedef uint32_t _serial_num_type; + _serial_num_type serial_num; + typedef float _input_voltage_type; + _input_voltage_type input_voltage; + typedef int8_t _master_state_type; + _master_state_type master_state; + int8_t circuit_state[3]; + float circuit_voltage[3]; + typedef bool _run_stop_type; + _run_stop_type run_stop; + typedef bool _wireless_stop_type; + _wireless_stop_type wireless_stop; + enum { STATE_NOPOWER = 0 }; + enum { STATE_STANDBY = 1 }; + enum { STATE_PUMPING = 2 }; + enum { STATE_ON = 3 }; + enum { STATE_ENABLED = 3 }; + enum { STATE_DISABLED = 4 }; + enum { MASTER_NOPOWER = 0 }; + enum { MASTER_STANDBY = 1 }; + enum { MASTER_ON = 2 }; + enum { MASTER_OFF = 3 }; + enum { MASTER_SHUTDOWN = 4 }; + + PowerBoardState(): + header(), + name(""), + serial_num(0), + input_voltage(0), + master_state(0), + circuit_state(), + circuit_voltage(), + run_stop(0), + wireless_stop(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + 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->serial_num >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->serial_num >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->serial_num >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->serial_num >> (8 * 3)) & 0xFF; + offset += sizeof(this->serial_num); + offset += serializeAvrFloat64(outbuffer + offset, this->input_voltage); + union { + int8_t real; + uint8_t base; + } u_master_state; + u_master_state.real = this->master_state; + *(outbuffer + offset + 0) = (u_master_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->master_state); + for( uint32_t i = 0; i < 3; i++){ + union { + int8_t real; + uint8_t base; + } u_circuit_statei; + u_circuit_statei.real = this->circuit_state[i]; + *(outbuffer + offset + 0) = (u_circuit_statei.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->circuit_state[i]); + } + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->circuit_voltage[i]); + } + union { + bool real; + uint8_t base; + } u_run_stop; + u_run_stop.real = this->run_stop; + *(outbuffer + offset + 0) = (u_run_stop.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->run_stop); + union { + bool real; + uint8_t base; + } u_wireless_stop; + u_wireless_stop.real = this->wireless_stop; + *(outbuffer + offset + 0) = (u_wireless_stop.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->wireless_stop); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + 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->serial_num = ((uint32_t) (*(inbuffer + offset))); + this->serial_num |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->serial_num |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->serial_num |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->serial_num); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->input_voltage)); + union { + int8_t real; + uint8_t base; + } u_master_state; + u_master_state.base = 0; + u_master_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->master_state = u_master_state.real; + offset += sizeof(this->master_state); + for( uint32_t i = 0; i < 3; i++){ + union { + int8_t real; + uint8_t base; + } u_circuit_statei; + u_circuit_statei.base = 0; + u_circuit_statei.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->circuit_state[i] = u_circuit_statei.real; + offset += sizeof(this->circuit_state[i]); + } + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->circuit_voltage[i])); + } + union { + bool real; + uint8_t base; + } u_run_stop; + u_run_stop.base = 0; + u_run_stop.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->run_stop = u_run_stop.real; + offset += sizeof(this->run_stop); + union { + bool real; + uint8_t base; + } u_wireless_stop; + u_wireless_stop.base = 0; + u_wireless_stop.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->wireless_stop = u_wireless_stop.real; + offset += sizeof(this->wireless_stop); + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/PowerBoardState"; }; + virtual const char * getMD5() override { return "08899b671e6a1a449e7ce0000da8ae7b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PowerState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PowerState.h new file mode 100644 index 000000000..938dd618a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PowerState.h @@ -0,0 +1,126 @@ +#ifndef _ROS_pr2_msgs_PowerState_h +#define _ROS_pr2_msgs_PowerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/duration.h" + +namespace pr2_msgs +{ + + class PowerState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _power_consumption_type; + _power_consumption_type power_consumption; + typedef ros::Duration _time_remaining_type; + _time_remaining_type time_remaining; + typedef const char* _prediction_method_type; + _prediction_method_type prediction_method; + typedef int8_t _relative_capacity_type; + _relative_capacity_type relative_capacity; + typedef int8_t _AC_present_type; + _AC_present_type AC_present; + + PowerState(): + header(), + power_consumption(0), + time_remaining(), + prediction_method(""), + relative_capacity(0), + AC_present(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->power_consumption); + *(outbuffer + offset + 0) = (this->time_remaining.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_remaining.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_remaining.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_remaining.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_remaining.sec); + *(outbuffer + offset + 0) = (this->time_remaining.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_remaining.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_remaining.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_remaining.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_remaining.nsec); + uint32_t length_prediction_method = strlen(this->prediction_method); + varToArr(outbuffer + offset, length_prediction_method); + offset += 4; + memcpy(outbuffer + offset, this->prediction_method, length_prediction_method); + offset += length_prediction_method; + union { + int8_t real; + uint8_t base; + } u_relative_capacity; + u_relative_capacity.real = this->relative_capacity; + *(outbuffer + offset + 0) = (u_relative_capacity.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->relative_capacity); + union { + int8_t real; + uint8_t base; + } u_AC_present; + u_AC_present.real = this->AC_present; + *(outbuffer + offset + 0) = (u_AC_present.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->AC_present); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->power_consumption)); + this->time_remaining.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_remaining.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_remaining.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_remaining.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_remaining.sec); + this->time_remaining.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_remaining.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_remaining.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_remaining.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_remaining.nsec); + uint32_t length_prediction_method; + arrToVar(length_prediction_method, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_prediction_method; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_prediction_method-1]=0; + this->prediction_method = (char *)(inbuffer + offset-1); + offset += length_prediction_method; + union { + int8_t real; + uint8_t base; + } u_relative_capacity; + u_relative_capacity.base = 0; + u_relative_capacity.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->relative_capacity = u_relative_capacity.real; + offset += sizeof(this->relative_capacity); + union { + int8_t real; + uint8_t base; + } u_AC_present; + u_AC_present.base = 0; + u_AC_present.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->AC_present = u_AC_present.real; + offset += sizeof(this->AC_present); + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/PowerState"; }; + virtual const char * getMD5() override { return "e6fa46a387cad0b7a80959a21587a6c9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PressureState.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PressureState.h new file mode 100644 index 000000000..635f5f40c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/PressureState.h @@ -0,0 +1,124 @@ +#ifndef _ROS_pr2_msgs_PressureState_h +#define _ROS_pr2_msgs_PressureState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pr2_msgs +{ + + class PressureState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t l_finger_tip_length; + typedef int16_t _l_finger_tip_type; + _l_finger_tip_type st_l_finger_tip; + _l_finger_tip_type * l_finger_tip; + uint32_t r_finger_tip_length; + typedef int16_t _r_finger_tip_type; + _r_finger_tip_type st_r_finger_tip; + _r_finger_tip_type * r_finger_tip; + + PressureState(): + header(), + l_finger_tip_length(0), st_l_finger_tip(), l_finger_tip(nullptr), + r_finger_tip_length(0), st_r_finger_tip(), r_finger_tip(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->l_finger_tip_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->l_finger_tip_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->l_finger_tip_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->l_finger_tip_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->l_finger_tip_length); + for( uint32_t i = 0; i < l_finger_tip_length; i++){ + union { + int16_t real; + uint16_t base; + } u_l_finger_tipi; + u_l_finger_tipi.real = this->l_finger_tip[i]; + *(outbuffer + offset + 0) = (u_l_finger_tipi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_l_finger_tipi.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->l_finger_tip[i]); + } + *(outbuffer + offset + 0) = (this->r_finger_tip_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->r_finger_tip_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->r_finger_tip_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->r_finger_tip_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->r_finger_tip_length); + for( uint32_t i = 0; i < r_finger_tip_length; i++){ + union { + int16_t real; + uint16_t base; + } u_r_finger_tipi; + u_r_finger_tipi.real = this->r_finger_tip[i]; + *(outbuffer + offset + 0) = (u_r_finger_tipi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r_finger_tipi.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->r_finger_tip[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t l_finger_tip_lengthT = ((uint32_t) (*(inbuffer + offset))); + l_finger_tip_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + l_finger_tip_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + l_finger_tip_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->l_finger_tip_length); + if(l_finger_tip_lengthT > l_finger_tip_length) + this->l_finger_tip = (int16_t*)realloc(this->l_finger_tip, l_finger_tip_lengthT * sizeof(int16_t)); + l_finger_tip_length = l_finger_tip_lengthT; + for( uint32_t i = 0; i < l_finger_tip_length; i++){ + union { + int16_t real; + uint16_t base; + } u_st_l_finger_tip; + u_st_l_finger_tip.base = 0; + u_st_l_finger_tip.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_l_finger_tip.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_l_finger_tip = u_st_l_finger_tip.real; + offset += sizeof(this->st_l_finger_tip); + memcpy( &(this->l_finger_tip[i]), &(this->st_l_finger_tip), sizeof(int16_t)); + } + uint32_t r_finger_tip_lengthT = ((uint32_t) (*(inbuffer + offset))); + r_finger_tip_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + r_finger_tip_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + r_finger_tip_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->r_finger_tip_length); + if(r_finger_tip_lengthT > r_finger_tip_length) + this->r_finger_tip = (int16_t*)realloc(this->r_finger_tip, r_finger_tip_lengthT * sizeof(int16_t)); + r_finger_tip_length = r_finger_tip_lengthT; + for( uint32_t i = 0; i < r_finger_tip_length; i++){ + union { + int16_t real; + uint16_t base; + } u_st_r_finger_tip; + u_st_r_finger_tip.base = 0; + u_st_r_finger_tip.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_r_finger_tip.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_r_finger_tip = u_st_r_finger_tip.real; + offset += sizeof(this->st_r_finger_tip); + memcpy( &(this->r_finger_tip[i]), &(this->st_r_finger_tip), sizeof(int16_t)); + } + return offset; + } + + virtual const char * getType() override { return "pr2_msgs/PressureState"; }; + virtual const char * getMD5() override { return "756fb3b75fa8884524fd0789a78eb04b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/SetLaserTrajCmd.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/SetLaserTrajCmd.h new file mode 100644 index 000000000..4d7818f25 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/SetLaserTrajCmd.h @@ -0,0 +1,100 @@ +#ifndef _ROS_SERVICE_SetLaserTrajCmd_h +#define _ROS_SERVICE_SetLaserTrajCmd_h +#include +#include +#include +#include "ros/msg.h" +#include "pr2_msgs/LaserTrajCmd.h" +#include "ros/time.h" + +namespace pr2_msgs +{ + +static const char SETLASERTRAJCMD[] = "pr2_msgs/SetLaserTrajCmd"; + + class SetLaserTrajCmdRequest : public ros::Msg + { + public: + typedef pr2_msgs::LaserTrajCmd _command_type; + _command_type command; + + SetLaserTrajCmdRequest(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETLASERTRAJCMD; }; + virtual const char * getMD5() override { return "83f915c37d36f61442c752779261e7d4"; }; + + }; + + class SetLaserTrajCmdResponse : public ros::Msg + { + public: + typedef ros::Time _start_time_type; + _start_time_type start_time; + + SetLaserTrajCmdResponse(): + start_time() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + return offset; + } + + virtual const char * getType() override { return SETLASERTRAJCMD; }; + virtual const char * getMD5() override { return "3888666920054f1ef39d2df7a5d94b02"; }; + + }; + + class SetLaserTrajCmd { + public: + typedef SetLaserTrajCmdRequest Request; + typedef SetLaserTrajCmdResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/SetPeriodicCmd.h b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/SetPeriodicCmd.h new file mode 100644 index 000000000..a0f4c58bd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_msgs/SetPeriodicCmd.h @@ -0,0 +1,100 @@ +#ifndef _ROS_SERVICE_SetPeriodicCmd_h +#define _ROS_SERVICE_SetPeriodicCmd_h +#include +#include +#include +#include "ros/msg.h" +#include "pr2_msgs/PeriodicCmd.h" +#include "ros/time.h" + +namespace pr2_msgs +{ + +static const char SETPERIODICCMD[] = "pr2_msgs/SetPeriodicCmd"; + + class SetPeriodicCmdRequest : public ros::Msg + { + public: + typedef pr2_msgs::PeriodicCmd _command_type; + _command_type command; + + SetPeriodicCmdRequest(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETPERIODICCMD; }; + virtual const char * getMD5() override { return "d4deedcc194c4a77110f7228904ee733"; }; + + }; + + class SetPeriodicCmdResponse : public ros::Msg + { + public: + typedef ros::Time _start_time_type; + _start_time_type start_time; + + SetPeriodicCmdResponse(): + start_time() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + return offset; + } + + virtual const char * getType() override { return SETPERIODICCMD; }; + virtual const char * getMD5() override { return "3888666920054f1ef39d2df7a5d94b02"; }; + + }; + + class SetPeriodicCmd { + public: + typedef SetPeriodicCmdRequest Request; + typedef SetPeriodicCmdResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_power_board/PowerBoardCommand.h b/smart_device_protocol/ros_lib/ros_lib/pr2_power_board/PowerBoardCommand.h new file mode 100644 index 000000000..f9d823c56 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_power_board/PowerBoardCommand.h @@ -0,0 +1,161 @@ +#ifndef _ROS_SERVICE_PowerBoardCommand_h +#define _ROS_SERVICE_PowerBoardCommand_h +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_power_board +{ + +static const char POWERBOARDCOMMAND[] = "pr2_power_board/PowerBoardCommand"; + + class PowerBoardCommandRequest : public ros::Msg + { + public: + typedef uint32_t _serial_number_type; + _serial_number_type serial_number; + typedef int32_t _breaker_number_type; + _breaker_number_type breaker_number; + typedef const char* _command_type; + _command_type command; + typedef uint32_t _flags_type; + _flags_type flags; + + PowerBoardCommandRequest(): + serial_number(0), + breaker_number(0), + command(""), + flags(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->serial_number >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->serial_number >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->serial_number >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->serial_number >> (8 * 3)) & 0xFF; + offset += sizeof(this->serial_number); + union { + int32_t real; + uint32_t base; + } u_breaker_number; + u_breaker_number.real = this->breaker_number; + *(outbuffer + offset + 0) = (u_breaker_number.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_breaker_number.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_breaker_number.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_breaker_number.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->breaker_number); + uint32_t length_command = strlen(this->command); + varToArr(outbuffer + offset, length_command); + offset += 4; + memcpy(outbuffer + offset, this->command, length_command); + offset += length_command; + *(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; + offset += sizeof(this->flags); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->serial_number = ((uint32_t) (*(inbuffer + offset))); + this->serial_number |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->serial_number |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->serial_number |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->serial_number); + union { + int32_t real; + uint32_t base; + } u_breaker_number; + u_breaker_number.base = 0; + u_breaker_number.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_breaker_number.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_breaker_number.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_breaker_number.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->breaker_number = u_breaker_number.real; + offset += sizeof(this->breaker_number); + uint32_t length_command; + arrToVar(length_command, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command-1]=0; + this->command = (char *)(inbuffer + offset-1); + offset += length_command; + this->flags = ((uint32_t) (*(inbuffer + offset))); + this->flags |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->flags |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->flags |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->flags); + return offset; + } + + virtual const char * getType() override { return POWERBOARDCOMMAND; }; + virtual const char * getMD5() override { return "9c621f5309bca0033e8eaef81c31500a"; }; + + }; + + class PowerBoardCommandResponse : public ros::Msg + { + public: + typedef int32_t _retval_type; + _retval_type retval; + + PowerBoardCommandResponse(): + retval(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_retval; + u_retval.real = this->retval; + *(outbuffer + offset + 0) = (u_retval.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_retval.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_retval.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_retval.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->retval); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_retval; + u_retval.base = 0; + u_retval.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_retval.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_retval.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_retval.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->retval = u_retval.real; + offset += sizeof(this->retval); + return offset; + } + + virtual const char * getType() override { return POWERBOARDCOMMAND; }; + virtual const char * getMD5() override { return "f5697a1e05c2a3e1c23cab49a31319ec"; }; + + }; + + class PowerBoardCommand { + public: + typedef PowerBoardCommandRequest Request; + typedef PowerBoardCommandResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/pr2_power_board/PowerBoardCommand2.h b/smart_device_protocol/ros_lib/ros_lib/pr2_power_board/PowerBoardCommand2.h new file mode 100644 index 000000000..f7c1919b4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/pr2_power_board/PowerBoardCommand2.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_PowerBoardCommand2_h +#define _ROS_SERVICE_PowerBoardCommand2_h +#include +#include +#include +#include "ros/msg.h" + +namespace pr2_power_board +{ + +static const char POWERBOARDCOMMAND2[] = "pr2_power_board/PowerBoardCommand2"; + + class PowerBoardCommand2Request : public ros::Msg + { + public: + typedef int32_t _circuit_type; + _circuit_type circuit; + typedef const char* _command_type; + _command_type command; + typedef bool _reset_stats_type; + _reset_stats_type reset_stats; + typedef bool _reset_circuits_type; + _reset_circuits_type reset_circuits; + enum { NUMBER_OF_CIRCUITS = 3 }; + enum { BASE = 0 }; + enum { RIGHT_ARM = 1 }; + enum { LEFT_ARM = 2 }; + + PowerBoardCommand2Request(): + circuit(0), + command(""), + reset_stats(0), + reset_circuits(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_circuit; + u_circuit.real = this->circuit; + *(outbuffer + offset + 0) = (u_circuit.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_circuit.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_circuit.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_circuit.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->circuit); + uint32_t length_command = strlen(this->command); + varToArr(outbuffer + offset, length_command); + offset += 4; + memcpy(outbuffer + offset, this->command, length_command); + offset += length_command; + union { + bool real; + uint8_t base; + } u_reset_stats; + u_reset_stats.real = this->reset_stats; + *(outbuffer + offset + 0) = (u_reset_stats.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reset_stats); + union { + bool real; + uint8_t base; + } u_reset_circuits; + u_reset_circuits.real = this->reset_circuits; + *(outbuffer + offset + 0) = (u_reset_circuits.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reset_circuits); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_circuit; + u_circuit.base = 0; + u_circuit.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_circuit.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_circuit.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_circuit.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->circuit = u_circuit.real; + offset += sizeof(this->circuit); + uint32_t length_command; + arrToVar(length_command, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command-1]=0; + this->command = (char *)(inbuffer + offset-1); + offset += length_command; + union { + bool real; + uint8_t base; + } u_reset_stats; + u_reset_stats.base = 0; + u_reset_stats.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reset_stats = u_reset_stats.real; + offset += sizeof(this->reset_stats); + union { + bool real; + uint8_t base; + } u_reset_circuits; + u_reset_circuits.base = 0; + u_reset_circuits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reset_circuits = u_reset_circuits.real; + offset += sizeof(this->reset_circuits); + return offset; + } + + virtual const char * getType() override { return POWERBOARDCOMMAND2; }; + virtual const char * getMD5() override { return "a31aee1db4294698375ff2a8cf53fea5"; }; + + }; + + class PowerBoardCommand2Response : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + PowerBoardCommand2Response(): + 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 POWERBOARDCOMMAND2; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class PowerBoardCommand2 { + public: + typedef PowerBoardCommand2Request Request; + typedef PowerBoardCommand2Response Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/realsense2_camera/DeviceInfo.h b/smart_device_protocol/ros_lib/ros_lib/realsense2_camera/DeviceInfo.h new file mode 100644 index 000000000..4867227fa --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/realsense2_camera/Extrinsics.h b/smart_device_protocol/ros_lib/ros_lib/realsense2_camera/Extrinsics.h new file mode 100644 index 000000000..5896818af --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/realsense2_camera/IMUInfo.h b/smart_device_protocol/ros_lib/ros_lib/realsense2_camera/IMUInfo.h new file mode 100644 index 000000000..38442d055 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/realsense2_camera/Metadata.h b/smart_device_protocol/ros_lib/ros_lib/realsense2_camera/Metadata.h new file mode 100644 index 000000000..01a7c42a8 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CalibrationData.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CalibrationData.h new file mode 100644 index 000000000..a885241d3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CalibrationData.h @@ -0,0 +1,70 @@ +#ifndef _ROS_robot_calibration_msgs_CalibrationData_h +#define _ROS_robot_calibration_msgs_CalibrationData_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JointState.h" +#include "robot_calibration_msgs/Observation.h" + +namespace robot_calibration_msgs +{ + + class CalibrationData : public ros::Msg + { + public: + typedef sensor_msgs::JointState _joint_states_type; + _joint_states_type joint_states; + uint32_t observations_length; + typedef robot_calibration_msgs::Observation _observations_type; + _observations_type st_observations; + _observations_type * observations; + + CalibrationData(): + joint_states(), + observations_length(0), st_observations(), observations(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->joint_states.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->observations_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->observations_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->observations_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->observations_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->observations_length); + for( uint32_t i = 0; i < observations_length; i++){ + offset += this->observations[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->joint_states.deserialize(inbuffer + offset); + uint32_t observations_lengthT = ((uint32_t) (*(inbuffer + offset))); + observations_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + observations_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + observations_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->observations_length); + if(observations_lengthT > observations_length) + this->observations = (robot_calibration_msgs::Observation*)realloc(this->observations, observations_lengthT * sizeof(robot_calibration_msgs::Observation)); + observations_length = observations_lengthT; + for( uint32_t i = 0; i < observations_length; i++){ + offset += this->st_observations.deserialize(inbuffer + offset); + memcpy( &(this->observations[i]), &(this->st_observations), sizeof(robot_calibration_msgs::Observation)); + } + return offset; + } + + virtual const char * getType() override { return "robot_calibration_msgs/CalibrationData"; }; + virtual const char * getMD5() override { return "a9a1a8b53ea9e13de6dae25608004191"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CameraParameter.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CameraParameter.h new file mode 100644 index 000000000..49943e6d6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CameraParameter.h @@ -0,0 +1,60 @@ +#ifndef _ROS_robot_calibration_msgs_CameraParameter_h +#define _ROS_robot_calibration_msgs_CameraParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace robot_calibration_msgs +{ + + class CameraParameter : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef float _value_type; + _value_type value; + + CameraParameter(): + name(""), + value(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; + offset += serializeAvrFloat64(outbuffer + offset, this->value); + 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; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + virtual const char * getType() override { return "robot_calibration_msgs/CameraParameter"; }; + virtual const char * getMD5() override { return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CaptureConfig.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CaptureConfig.h new file mode 100644 index 000000000..353d92b1a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/CaptureConfig.h @@ -0,0 +1,81 @@ +#ifndef _ROS_robot_calibration_msgs_CaptureConfig_h +#define _ROS_robot_calibration_msgs_CaptureConfig_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JointState.h" + +namespace robot_calibration_msgs +{ + + class CaptureConfig : public ros::Msg + { + public: + typedef sensor_msgs::JointState _joint_states_type; + _joint_states_type joint_states; + uint32_t features_length; + typedef char* _features_type; + _features_type st_features; + _features_type * features; + + CaptureConfig(): + joint_states(), + features_length(0), st_features(), features(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->joint_states.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++){ + uint32_t length_featuresi = strlen(this->features[i]); + varToArr(outbuffer + offset, length_featuresi); + offset += 4; + memcpy(outbuffer + offset, this->features[i], length_featuresi); + offset += length_featuresi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->joint_states.deserialize(inbuffer + offset); + 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 = (char**)realloc(this->features, features_lengthT * sizeof(char*)); + features_length = features_lengthT; + for( uint32_t i = 0; i < features_length; i++){ + uint32_t length_st_features; + arrToVar(length_st_features, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_features; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_features-1]=0; + this->st_features = (char *)(inbuffer + offset-1); + offset += length_st_features; + memcpy( &(this->features[i]), &(this->st_features), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "robot_calibration_msgs/CaptureConfig"; }; + virtual const char * getMD5() override { return "f347b595aa5cb3d9820e25d6d41f25cd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/ExtendedCameraInfo.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/ExtendedCameraInfo.h new file mode 100644 index 000000000..be4114eb9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/ExtendedCameraInfo.h @@ -0,0 +1,70 @@ +#ifndef _ROS_robot_calibration_msgs_ExtendedCameraInfo_h +#define _ROS_robot_calibration_msgs_ExtendedCameraInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/CameraInfo.h" +#include "robot_calibration_msgs/CameraParameter.h" + +namespace robot_calibration_msgs +{ + + class ExtendedCameraInfo : public ros::Msg + { + public: + typedef sensor_msgs::CameraInfo _camera_info_type; + _camera_info_type camera_info; + uint32_t parameters_length; + typedef robot_calibration_msgs::CameraParameter _parameters_type; + _parameters_type st_parameters; + _parameters_type * parameters; + + ExtendedCameraInfo(): + camera_info(), + parameters_length(0), st_parameters(), parameters(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->camera_info.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->parameters_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->parameters_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->parameters_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->parameters_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->parameters_length); + for( uint32_t i = 0; i < parameters_length; i++){ + offset += this->parameters[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->camera_info.deserialize(inbuffer + offset); + uint32_t parameters_lengthT = ((uint32_t) (*(inbuffer + offset))); + parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->parameters_length); + if(parameters_lengthT > parameters_length) + this->parameters = (robot_calibration_msgs::CameraParameter*)realloc(this->parameters, parameters_lengthT * sizeof(robot_calibration_msgs::CameraParameter)); + parameters_length = parameters_lengthT; + for( uint32_t i = 0; i < parameters_length; i++){ + offset += this->st_parameters.deserialize(inbuffer + offset); + memcpy( &(this->parameters[i]), &(this->st_parameters), sizeof(robot_calibration_msgs::CameraParameter)); + } + return offset; + } + + virtual const char * getType() override { return "robot_calibration_msgs/ExtendedCameraInfo"; }; + virtual const char * getMD5() override { return "d35c5c887e3d90c7f6f9c5a697f44485"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandAction.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandAction.h new file mode 100644 index 000000000..e1ca02dd2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_robot_calibration_msgs_GripperLedCommandAction_h +#define _ROS_robot_calibration_msgs_GripperLedCommandAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "robot_calibration_msgs/GripperLedCommandActionGoal.h" +#include "robot_calibration_msgs/GripperLedCommandActionResult.h" +#include "robot_calibration_msgs/GripperLedCommandActionFeedback.h" + +namespace robot_calibration_msgs +{ + + class GripperLedCommandAction : public ros::Msg + { + public: + typedef robot_calibration_msgs::GripperLedCommandActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef robot_calibration_msgs::GripperLedCommandActionResult _action_result_type; + _action_result_type action_result; + typedef robot_calibration_msgs::GripperLedCommandActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + GripperLedCommandAction(): + 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 "robot_calibration_msgs/GripperLedCommandAction"; }; + virtual const char * getMD5() override { return "48f166d6c125d28b70639966a1197497"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionFeedback.h new file mode 100644 index 000000000..dd0c8cb19 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_robot_calibration_msgs_GripperLedCommandActionFeedback_h +#define _ROS_robot_calibration_msgs_GripperLedCommandActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "robot_calibration_msgs/GripperLedCommandFeedback.h" + +namespace robot_calibration_msgs +{ + + class GripperLedCommandActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef robot_calibration_msgs::GripperLedCommandFeedback _feedback_type; + _feedback_type feedback; + + GripperLedCommandActionFeedback(): + 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 "robot_calibration_msgs/GripperLedCommandActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionGoal.h new file mode 100644 index 000000000..073e5ff10 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_robot_calibration_msgs_GripperLedCommandActionGoal_h +#define _ROS_robot_calibration_msgs_GripperLedCommandActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "robot_calibration_msgs/GripperLedCommandGoal.h" + +namespace robot_calibration_msgs +{ + + class GripperLedCommandActionGoal : 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 robot_calibration_msgs::GripperLedCommandGoal _goal_type; + _goal_type goal; + + GripperLedCommandActionGoal(): + 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 "robot_calibration_msgs/GripperLedCommandActionGoal"; }; + virtual const char * getMD5() override { return "a6f43a5345c808a3839fc4ee405e8697"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionResult.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionResult.h new file mode 100644 index 000000000..f46d85c7d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_robot_calibration_msgs_GripperLedCommandActionResult_h +#define _ROS_robot_calibration_msgs_GripperLedCommandActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "robot_calibration_msgs/GripperLedCommandResult.h" + +namespace robot_calibration_msgs +{ + + class GripperLedCommandActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef robot_calibration_msgs::GripperLedCommandResult _result_type; + _result_type result; + + GripperLedCommandActionResult(): + 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 "robot_calibration_msgs/GripperLedCommandActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandFeedback.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandFeedback.h new file mode 100644 index 000000000..2c3928e1d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_robot_calibration_msgs_GripperLedCommandFeedback_h +#define _ROS_robot_calibration_msgs_GripperLedCommandFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace robot_calibration_msgs +{ + + class GripperLedCommandFeedback : public ros::Msg + { + public: + + GripperLedCommandFeedback() + { + } + + 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 "robot_calibration_msgs/GripperLedCommandFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandGoal.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandGoal.h new file mode 100644 index 000000000..c0518b0f3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandGoal.h @@ -0,0 +1,45 @@ +#ifndef _ROS_robot_calibration_msgs_GripperLedCommandGoal_h +#define _ROS_robot_calibration_msgs_GripperLedCommandGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace robot_calibration_msgs +{ + + class GripperLedCommandGoal : public ros::Msg + { + public: + typedef uint8_t _led_code_type; + _led_code_type led_code; + + GripperLedCommandGoal(): + led_code(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->led_code >> (8 * 0)) & 0xFF; + offset += sizeof(this->led_code); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->led_code = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->led_code); + return offset; + } + + virtual const char * getType() override { return "robot_calibration_msgs/GripperLedCommandGoal"; }; + virtual const char * getMD5() override { return "11513917910062a2ca72ae2699b68556"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandResult.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandResult.h new file mode 100644 index 000000000..1dbc0407c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/GripperLedCommandResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_robot_calibration_msgs_GripperLedCommandResult_h +#define _ROS_robot_calibration_msgs_GripperLedCommandResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace robot_calibration_msgs +{ + + class GripperLedCommandResult : public ros::Msg + { + public: + + GripperLedCommandResult() + { + } + + 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 "robot_calibration_msgs/GripperLedCommandResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/Observation.h b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/Observation.h new file mode 100644 index 000000000..aa7454f50 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_calibration_msgs/Observation.h @@ -0,0 +1,99 @@ +#ifndef _ROS_robot_calibration_msgs_Observation_h +#define _ROS_robot_calibration_msgs_Observation_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PointStamped.h" +#include "robot_calibration_msgs/ExtendedCameraInfo.h" +#include "sensor_msgs/PointCloud2.h" +#include "sensor_msgs/Image.h" + +namespace robot_calibration_msgs +{ + + class Observation : public ros::Msg + { + public: + typedef const char* _sensor_name_type; + _sensor_name_type sensor_name; + uint32_t features_length; + typedef geometry_msgs::PointStamped _features_type; + _features_type st_features; + _features_type * features; + typedef robot_calibration_msgs::ExtendedCameraInfo _ext_camera_info_type; + _ext_camera_info_type ext_camera_info; + typedef sensor_msgs::PointCloud2 _cloud_type; + _cloud_type cloud; + typedef sensor_msgs::Image _image_type; + _image_type image; + + Observation(): + sensor_name(""), + features_length(0), st_features(), features(nullptr), + ext_camera_info(), + cloud(), + image() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_sensor_name = strlen(this->sensor_name); + varToArr(outbuffer + offset, length_sensor_name); + offset += 4; + memcpy(outbuffer + offset, this->sensor_name, length_sensor_name); + offset += length_sensor_name; + *(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); + } + offset += this->ext_camera_info.serialize(outbuffer + offset); + offset += this->cloud.serialize(outbuffer + offset); + offset += this->image.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_sensor_name; + arrToVar(length_sensor_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_sensor_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_sensor_name-1]=0; + this->sensor_name = (char *)(inbuffer + offset-1); + offset += length_sensor_name; + 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 = (geometry_msgs::PointStamped*)realloc(this->features, features_lengthT * sizeof(geometry_msgs::PointStamped)); + 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(geometry_msgs::PointStamped)); + } + offset += this->ext_camera_info.deserialize(inbuffer + offset); + offset += this->cloud.deserialize(inbuffer + offset); + offset += this->image.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "robot_calibration_msgs/Observation"; }; + virtual const char * getMD5() override { return "b5e5b7c2eb5f83de33806b676db440c9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/ControllerState.h b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/ControllerState.h new file mode 100644 index 000000000..39a2e19d7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/ControllerState.h @@ -0,0 +1,82 @@ +#ifndef _ROS_robot_controllers_msgs_ControllerState_h +#define _ROS_robot_controllers_msgs_ControllerState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace robot_controllers_msgs +{ + + class ControllerState : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _type_type; + _type_type type; + typedef uint8_t _state_type; + _state_type state; + enum { STOPPED = 0 }; + enum { RUNNING = 1 }; + enum { ERROR = 2 }; + + ControllerState(): + name(""), + type(""), + state(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; + 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->state >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + 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->state = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->state); + return offset; + } + + virtual const char * getType() override { return "robot_controllers_msgs/ControllerState"; }; + virtual const char * getMD5() override { return "af57e70ba1ab402f75604e58ad260b8f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/DiffDriveLimiterParams.h b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/DiffDriveLimiterParams.h new file mode 100644 index 000000000..3bb13a39f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/DiffDriveLimiterParams.h @@ -0,0 +1,104 @@ +#ifndef _ROS_robot_controllers_msgs_DiffDriveLimiterParams_h +#define _ROS_robot_controllers_msgs_DiffDriveLimiterParams_h + +#include +#include +#include +#include "ros/msg.h" + +namespace robot_controllers_msgs +{ + + class DiffDriveLimiterParams : public ros::Msg + { + public: + typedef float _max_linear_velocity_type; + _max_linear_velocity_type max_linear_velocity; + typedef float _max_linear_acceleration_type; + _max_linear_acceleration_type max_linear_acceleration; + typedef float _max_angular_velocity_type; + _max_angular_velocity_type max_angular_velocity; + typedef float _max_angular_acceleration_type; + _max_angular_acceleration_type max_angular_acceleration; + typedef float _max_wheel_velocity_type; + _max_wheel_velocity_type max_wheel_velocity; + typedef float _track_width_type; + _track_width_type track_width; + typedef bool _angular_velocity_limits_linear_velocity_type; + _angular_velocity_limits_linear_velocity_type angular_velocity_limits_linear_velocity; + typedef bool _scale_to_wheel_velocity_limits_type; + _scale_to_wheel_velocity_limits_type scale_to_wheel_velocity_limits; + + DiffDriveLimiterParams(): + max_linear_velocity(0), + max_linear_acceleration(0), + max_angular_velocity(0), + max_angular_acceleration(0), + max_wheel_velocity(0), + track_width(0), + angular_velocity_limits_linear_velocity(0), + scale_to_wheel_velocity_limits(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->max_linear_velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->max_linear_acceleration); + offset += serializeAvrFloat64(outbuffer + offset, this->max_angular_velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->max_angular_acceleration); + offset += serializeAvrFloat64(outbuffer + offset, this->max_wheel_velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->track_width); + union { + bool real; + uint8_t base; + } u_angular_velocity_limits_linear_velocity; + u_angular_velocity_limits_linear_velocity.real = this->angular_velocity_limits_linear_velocity; + *(outbuffer + offset + 0) = (u_angular_velocity_limits_linear_velocity.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->angular_velocity_limits_linear_velocity); + union { + bool real; + uint8_t base; + } u_scale_to_wheel_velocity_limits; + u_scale_to_wheel_velocity_limits.real = this->scale_to_wheel_velocity_limits; + *(outbuffer + offset + 0) = (u_scale_to_wheel_velocity_limits.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->scale_to_wheel_velocity_limits); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_linear_velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_linear_acceleration)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_angular_velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_angular_acceleration)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_wheel_velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->track_width)); + union { + bool real; + uint8_t base; + } u_angular_velocity_limits_linear_velocity; + u_angular_velocity_limits_linear_velocity.base = 0; + u_angular_velocity_limits_linear_velocity.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->angular_velocity_limits_linear_velocity = u_angular_velocity_limits_linear_velocity.real; + offset += sizeof(this->angular_velocity_limits_linear_velocity); + union { + bool real; + uint8_t base; + } u_scale_to_wheel_velocity_limits; + u_scale_to_wheel_velocity_limits.base = 0; + u_scale_to_wheel_velocity_limits.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->scale_to_wheel_velocity_limits = u_scale_to_wheel_velocity_limits.real; + offset += sizeof(this->scale_to_wheel_velocity_limits); + return offset; + } + + virtual const char * getType() override { return "robot_controllers_msgs/DiffDriveLimiterParams"; }; + virtual const char * getMD5() override { return "c438ebbdf2d3d45fdfb67f5ba9e6ca3d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesAction.h b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesAction.h new file mode 100644 index 000000000..1959960f2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_robot_controllers_msgs_QueryControllerStatesAction_h +#define _ROS_robot_controllers_msgs_QueryControllerStatesAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "robot_controllers_msgs/QueryControllerStatesActionGoal.h" +#include "robot_controllers_msgs/QueryControllerStatesActionResult.h" +#include "robot_controllers_msgs/QueryControllerStatesActionFeedback.h" + +namespace robot_controllers_msgs +{ + + class QueryControllerStatesAction : public ros::Msg + { + public: + typedef robot_controllers_msgs::QueryControllerStatesActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef robot_controllers_msgs::QueryControllerStatesActionResult _action_result_type; + _action_result_type action_result; + typedef robot_controllers_msgs::QueryControllerStatesActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + QueryControllerStatesAction(): + 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 "robot_controllers_msgs/QueryControllerStatesAction"; }; + virtual const char * getMD5() override { return "09c0acaa5ed1f30d01515baab9a95895"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionFeedback.h new file mode 100644 index 000000000..4f58a0540 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_robot_controllers_msgs_QueryControllerStatesActionFeedback_h +#define _ROS_robot_controllers_msgs_QueryControllerStatesActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "robot_controllers_msgs/QueryControllerStatesFeedback.h" + +namespace robot_controllers_msgs +{ + + class QueryControllerStatesActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef robot_controllers_msgs::QueryControllerStatesFeedback _feedback_type; + _feedback_type feedback; + + QueryControllerStatesActionFeedback(): + 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 "robot_controllers_msgs/QueryControllerStatesActionFeedback"; }; + virtual const char * getMD5() override { return "27d9ffea72fe024e2f600b8921a3f631"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionGoal.h new file mode 100644 index 000000000..ee9ab5c3c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_robot_controllers_msgs_QueryControllerStatesActionGoal_h +#define _ROS_robot_controllers_msgs_QueryControllerStatesActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "robot_controllers_msgs/QueryControllerStatesGoal.h" + +namespace robot_controllers_msgs +{ + + class QueryControllerStatesActionGoal : 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 robot_controllers_msgs::QueryControllerStatesGoal _goal_type; + _goal_type goal; + + QueryControllerStatesActionGoal(): + 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 "robot_controllers_msgs/QueryControllerStatesActionGoal"; }; + virtual const char * getMD5() override { return "291a917d724f37ef2a137fb40fae4e4a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionResult.h b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionResult.h new file mode 100644 index 000000000..e7c66b9f4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_robot_controllers_msgs_QueryControllerStatesActionResult_h +#define _ROS_robot_controllers_msgs_QueryControllerStatesActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "robot_controllers_msgs/QueryControllerStatesResult.h" + +namespace robot_controllers_msgs +{ + + class QueryControllerStatesActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef robot_controllers_msgs::QueryControllerStatesResult _result_type; + _result_type result; + + QueryControllerStatesActionResult(): + 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 "robot_controllers_msgs/QueryControllerStatesActionResult"; }; + virtual const char * getMD5() override { return "9a8e94275d921606c4552f40989a801e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesFeedback.h b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesFeedback.h new file mode 100644 index 000000000..83e957a61 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesFeedback.h @@ -0,0 +1,64 @@ +#ifndef _ROS_robot_controllers_msgs_QueryControllerStatesFeedback_h +#define _ROS_robot_controllers_msgs_QueryControllerStatesFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "robot_controllers_msgs/ControllerState.h" + +namespace robot_controllers_msgs +{ + + class QueryControllerStatesFeedback : public ros::Msg + { + public: + uint32_t state_diff_length; + typedef robot_controllers_msgs::ControllerState _state_diff_type; + _state_diff_type st_state_diff; + _state_diff_type * state_diff; + + QueryControllerStatesFeedback(): + state_diff_length(0), st_state_diff(), state_diff(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->state_diff_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->state_diff_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->state_diff_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->state_diff_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->state_diff_length); + for( uint32_t i = 0; i < state_diff_length; i++){ + offset += this->state_diff[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t state_diff_lengthT = ((uint32_t) (*(inbuffer + offset))); + state_diff_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + state_diff_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + state_diff_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->state_diff_length); + if(state_diff_lengthT > state_diff_length) + this->state_diff = (robot_controllers_msgs::ControllerState*)realloc(this->state_diff, state_diff_lengthT * sizeof(robot_controllers_msgs::ControllerState)); + state_diff_length = state_diff_lengthT; + for( uint32_t i = 0; i < state_diff_length; i++){ + offset += this->st_state_diff.deserialize(inbuffer + offset); + memcpy( &(this->state_diff[i]), &(this->st_state_diff), sizeof(robot_controllers_msgs::ControllerState)); + } + return offset; + } + + virtual const char * getType() override { return "robot_controllers_msgs/QueryControllerStatesFeedback"; }; + virtual const char * getMD5() override { return "884ebbcebb33b2855209539dadfa0dc6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesGoal.h b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesGoal.h new file mode 100644 index 000000000..f8e585561 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesGoal.h @@ -0,0 +1,64 @@ +#ifndef _ROS_robot_controllers_msgs_QueryControllerStatesGoal_h +#define _ROS_robot_controllers_msgs_QueryControllerStatesGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "robot_controllers_msgs/ControllerState.h" + +namespace robot_controllers_msgs +{ + + class QueryControllerStatesGoal : public ros::Msg + { + public: + uint32_t updates_length; + typedef robot_controllers_msgs::ControllerState _updates_type; + _updates_type st_updates; + _updates_type * updates; + + QueryControllerStatesGoal(): + updates_length(0), st_updates(), updates(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->updates_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->updates_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->updates_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->updates_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->updates_length); + for( uint32_t i = 0; i < updates_length; i++){ + offset += this->updates[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t updates_lengthT = ((uint32_t) (*(inbuffer + offset))); + updates_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + updates_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + updates_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->updates_length); + if(updates_lengthT > updates_length) + this->updates = (robot_controllers_msgs::ControllerState*)realloc(this->updates, updates_lengthT * sizeof(robot_controllers_msgs::ControllerState)); + updates_length = updates_lengthT; + for( uint32_t i = 0; i < updates_length; i++){ + offset += this->st_updates.deserialize(inbuffer + offset); + memcpy( &(this->updates[i]), &(this->st_updates), sizeof(robot_controllers_msgs::ControllerState)); + } + return offset; + } + + virtual const char * getType() override { return "robot_controllers_msgs/QueryControllerStatesGoal"; }; + virtual const char * getMD5() override { return "6ecbb837d1e8545d81a831a4c1c4bfcc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesResult.h b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesResult.h new file mode 100644 index 000000000..719cda505 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_controllers_msgs/QueryControllerStatesResult.h @@ -0,0 +1,64 @@ +#ifndef _ROS_robot_controllers_msgs_QueryControllerStatesResult_h +#define _ROS_robot_controllers_msgs_QueryControllerStatesResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "robot_controllers_msgs/ControllerState.h" + +namespace robot_controllers_msgs +{ + + class QueryControllerStatesResult : public ros::Msg + { + public: + uint32_t state_length; + typedef robot_controllers_msgs::ControllerState _state_type; + _state_type st_state; + _state_type * state; + + QueryControllerStatesResult(): + state_length(0), st_state(), state(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->state_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->state_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->state_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->state_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->state_length); + for( uint32_t i = 0; i < state_length; i++){ + offset += this->state[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t state_lengthT = ((uint32_t) (*(inbuffer + offset))); + state_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + state_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + state_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->state_length); + if(state_lengthT > state_length) + this->state = (robot_controllers_msgs::ControllerState*)realloc(this->state, state_lengthT * sizeof(robot_controllers_msgs::ControllerState)); + state_length = state_lengthT; + for( uint32_t i = 0; i < state_length; i++){ + offset += this->st_state.deserialize(inbuffer + offset); + memcpy( &(this->state[i]), &(this->st_state), sizeof(robot_controllers_msgs::ControllerState)); + } + return offset; + } + + virtual const char * getType() override { return "robot_controllers_msgs/QueryControllerStatesResult"; }; + virtual const char * getMD5() override { return "95b3426d59527deffe501158443b26c9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_localization/FromLL.h b/smart_device_protocol/ros_lib/ros_lib/robot_localization/FromLL.h new file mode 100644 index 000000000..a9f5584bf --- /dev/null +++ b/smart_device_protocol/ros_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 "geographic_msgs/GeoPoint.h" +#include "geometry_msgs/Point.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/smart_device_protocol/ros_lib/ros_lib/robot_localization/GetState.h b/smart_device_protocol/ros_lib/ros_lib/robot_localization/GetState.h new file mode 100644 index 000000000..0f8f9c9f3 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/robot_localization/SetDatum.h b/smart_device_protocol/ros_lib/ros_lib/robot_localization/SetDatum.h new file mode 100644 index 000000000..b3ce76edb --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/robot_localization/SetPose.h b/smart_device_protocol/ros_lib/ros_lib/robot_localization/SetPose.h new file mode 100644 index 000000000..d516af2c9 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/robot_localization/SetUTMZone.h b/smart_device_protocol/ros_lib/ros_lib/robot_localization/SetUTMZone.h new file mode 100644 index 000000000..c400fb7f4 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/robot_localization/ToLL.h b/smart_device_protocol/ros_lib/ros_lib/robot_localization/ToLL.h new file mode 100644 index 000000000..2d55ae9e4 --- /dev/null +++ b/smart_device_protocol/ros_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 "geographic_msgs/GeoPoint.h" +#include "geometry_msgs/Point.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/smart_device_protocol/ros_lib/ros_lib/robot_localization/ToggleFilterProcessing.h b/smart_device_protocol/ros_lib/ros_lib/robot_localization/ToggleFilterProcessing.h new file mode 100644 index 000000000..a8b34397e --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/robot_mechanism_controllers/JTCartesianControllerState.h b/smart_device_protocol/ros_lib/ros_lib/robot_mechanism_controllers/JTCartesianControllerState.h new file mode 100644 index 000000000..77f441151 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_mechanism_controllers/JTCartesianControllerState.h @@ -0,0 +1,168 @@ +#ifndef _ROS_robot_mechanism_controllers_JTCartesianControllerState_h +#define _ROS_robot_mechanism_controllers_JTCartesianControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseStamped.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" +#include "std_msgs/Float64MultiArray.h" + +namespace robot_mechanism_controllers +{ + + class JTCartesianControllerState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::PoseStamped _x_type; + _x_type x; + typedef geometry_msgs::PoseStamped _x_desi_type; + _x_desi_type x_desi; + typedef geometry_msgs::PoseStamped _x_desi_filtered_type; + _x_desi_filtered_type x_desi_filtered; + typedef geometry_msgs::Twist _x_err_type; + _x_err_type x_err; + typedef geometry_msgs::Twist _xd_type; + _xd_type xd; + typedef geometry_msgs::Twist _xd_desi_type; + _xd_desi_type xd_desi; + typedef geometry_msgs::Wrench _F_type; + _F_type F; + uint32_t tau_pose_length; + typedef float _tau_pose_type; + _tau_pose_type st_tau_pose; + _tau_pose_type * tau_pose; + uint32_t tau_posture_length; + typedef float _tau_posture_type; + _tau_posture_type st_tau_posture; + _tau_posture_type * tau_posture; + uint32_t tau_length; + typedef float _tau_type; + _tau_type st_tau; + _tau_type * tau; + typedef std_msgs::Float64MultiArray _J_type; + _J_type J; + typedef std_msgs::Float64MultiArray _N_type; + _N_type N; + + JTCartesianControllerState(): + header(), + x(), + x_desi(), + x_desi_filtered(), + x_err(), + xd(), + xd_desi(), + F(), + tau_pose_length(0), st_tau_pose(), tau_pose(nullptr), + tau_posture_length(0), st_tau_posture(), tau_posture(nullptr), + tau_length(0), st_tau(), tau(nullptr), + J(), + N() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->x.serialize(outbuffer + offset); + offset += this->x_desi.serialize(outbuffer + offset); + offset += this->x_desi_filtered.serialize(outbuffer + offset); + offset += this->x_err.serialize(outbuffer + offset); + offset += this->xd.serialize(outbuffer + offset); + offset += this->xd_desi.serialize(outbuffer + offset); + offset += this->F.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->tau_pose_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->tau_pose_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->tau_pose_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->tau_pose_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->tau_pose_length); + for( uint32_t i = 0; i < tau_pose_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->tau_pose[i]); + } + *(outbuffer + offset + 0) = (this->tau_posture_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->tau_posture_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->tau_posture_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->tau_posture_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->tau_posture_length); + for( uint32_t i = 0; i < tau_posture_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->tau_posture[i]); + } + *(outbuffer + offset + 0) = (this->tau_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->tau_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->tau_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->tau_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->tau_length); + for( uint32_t i = 0; i < tau_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->tau[i]); + } + offset += this->J.serialize(outbuffer + offset); + offset += this->N.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->x.deserialize(inbuffer + offset); + offset += this->x_desi.deserialize(inbuffer + offset); + offset += this->x_desi_filtered.deserialize(inbuffer + offset); + offset += this->x_err.deserialize(inbuffer + offset); + offset += this->xd.deserialize(inbuffer + offset); + offset += this->xd_desi.deserialize(inbuffer + offset); + offset += this->F.deserialize(inbuffer + offset); + uint32_t tau_pose_lengthT = ((uint32_t) (*(inbuffer + offset))); + tau_pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + tau_pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + tau_pose_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->tau_pose_length); + if(tau_pose_lengthT > tau_pose_length) + this->tau_pose = (float*)realloc(this->tau_pose, tau_pose_lengthT * sizeof(float)); + tau_pose_length = tau_pose_lengthT; + for( uint32_t i = 0; i < tau_pose_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_tau_pose)); + memcpy( &(this->tau_pose[i]), &(this->st_tau_pose), sizeof(float)); + } + uint32_t tau_posture_lengthT = ((uint32_t) (*(inbuffer + offset))); + tau_posture_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + tau_posture_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + tau_posture_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->tau_posture_length); + if(tau_posture_lengthT > tau_posture_length) + this->tau_posture = (float*)realloc(this->tau_posture, tau_posture_lengthT * sizeof(float)); + tau_posture_length = tau_posture_lengthT; + for( uint32_t i = 0; i < tau_posture_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_tau_posture)); + memcpy( &(this->tau_posture[i]), &(this->st_tau_posture), sizeof(float)); + } + uint32_t tau_lengthT = ((uint32_t) (*(inbuffer + offset))); + tau_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + tau_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + tau_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->tau_length); + if(tau_lengthT > tau_length) + this->tau = (float*)realloc(this->tau, tau_lengthT * sizeof(float)); + tau_length = tau_lengthT; + for( uint32_t i = 0; i < tau_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_tau)); + memcpy( &(this->tau[i]), &(this->st_tau), sizeof(float)); + } + offset += this->J.deserialize(inbuffer + offset); + offset += this->N.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "robot_mechanism_controllers/JTCartesianControllerState"; }; + virtual const char * getMD5() override { return "6ecdaa599ea0d27643819ae4cd4c43d0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/robot_pose_ekf/GetStatus.h b/smart_device_protocol/ros_lib/ros_lib/robot_pose_ekf/GetStatus.h new file mode 100644 index 000000000..b3c50f672 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/robot_pose_ekf/GetStatus.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_GetStatus_h +#define _ROS_SERVICE_GetStatus_h +#include +#include +#include +#include "ros/msg.h" + +namespace robot_pose_ekf +{ + +static const char GETSTATUS[] = "robot_pose_ekf/GetStatus"; + + class GetStatusRequest : public ros::Msg + { + public: + + GetStatusRequest() + { + } + + 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 GETSTATUS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetStatusResponse : public ros::Msg + { + public: + typedef const char* _status_type; + _status_type status; + + GetStatusResponse(): + status("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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; + 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 GETSTATUS; }; + virtual const char * getMD5() override { return "4fe5af303955c287688e7347e9b00278"; }; + + }; + + class GetStatus { + public: + typedef GetStatusRequest Request; + typedef GetStatusResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ros.h b/smart_device_protocol/ros_lib/ros_lib/ros.h new file mode 100644 index 000000000..8a2c71314 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ros.h @@ -0,0 +1,67 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_H_ +#define _ROS_H_ + +#include "ros/node_handle.h" + +#if defined(ESP8266) or defined(ESP32) or defined(ROSSERIAL_ARDUINO_TCP) + #include "ArduinoTcpHardware.h" +#else + #include "ArduinoHardware.h" +#endif + +namespace ros +{ +#if defined(__AVR_ATmega8__) or defined(__AVR_ATmega168__) + /* downsize our buffers */ + typedef NodeHandle_ NodeHandle; + +#elif defined(__AVR_ATmega328P__) + + typedef NodeHandle_ NodeHandle; + +#elif defined(SPARK) + + typedef NodeHandle_ NodeHandle; + +#else + + typedef NodeHandle_ NodeHandle; // default 25, 25, 512, 512 + +#endif +} + +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ros/duration.h b/smart_device_protocol/ros_lib/ros_lib/ros/duration.h new file mode 100644 index 000000000..5ec6d9003 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ros/duration.h @@ -0,0 +1,75 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_DURATION_H_ +#define _ROS_DURATION_H_ + +#include +#include + +namespace ros +{ + +void normalizeSecNSecSigned(int32_t& sec, int32_t& nsec); + +class Duration +{ +public: + int32_t sec, nsec; + + Duration() : sec(0), nsec(0) {} + Duration(int32_t _sec, int32_t _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSecSigned(sec, nsec); + } + + double toSec() const + { + return (double)sec + 1e-9 * (double)nsec; + }; + void fromSec(double t) + { + sec = (uint32_t) floor(t); + nsec = (uint32_t) round((t - sec) * 1e9); + }; + + Duration& operator+=(const Duration &rhs); + Duration& operator-=(const Duration &rhs); + Duration& operator*=(double scale); +}; + +} + +#endif + diff --git a/smart_device_protocol/ros_lib/ros_lib/ros/msg.h b/smart_device_protocol/ros_lib/ros_lib/ros/msg.h new file mode 100644 index 000000000..b9f62012b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ros/msg.h @@ -0,0 +1,207 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_MSG_H_ +#define _ROS_MSG_H_ + +#include +#include +#include + +namespace ros +{ + +/* Base Message Type */ +class Msg +{ +public: + virtual int serialize(unsigned char *outbuffer) const = 0; + virtual int deserialize(unsigned char *data) = 0; + virtual const char * getType() = 0; + virtual const char * getMD5() = 0; + + /** + * @brief This tricky function handles promoting a 32bit float to a 64bit + * double, so that AVR can publish messages containing float64 + * fields, despite AVR having no native support for double. + * + * @param[out] outbuffer pointer for buffer to serialize to. + * @param[in] f value to serialize. + * + * @return number of bytes to advance the buffer pointer. + * + */ + static int serializeAvrFloat64(unsigned char* outbuffer, const float f) + { + int32_t val; + memcpy(&val, &f, sizeof(val)); + + int16_t exp = ((val >> 23) & 255); + uint32_t mantissa = val & 0x7FFFFF; + + if (exp == 255) + { + exp = 2047; // Special value for NaN, infinity etc. + } + else if (exp != 0) + { + exp += 1023 - 127; // Normal case + } + else if (!mantissa) + { + exp = 0; // Zero + } + else + { + // Denormalized value in float, will fit as normalized value in double + exp += 1023 - 127; + mantissa <<= 1; + while (!(mantissa & 0x800000)) + { + mantissa <<= 1; + exp--; + } + mantissa &= 0x7FFFFF; + } + + *(outbuffer++) = 0; + *(outbuffer++) = 0; + *(outbuffer++) = 0; + *(outbuffer++) = (mantissa << 5) & 0xff; + *(outbuffer++) = (mantissa >> 3) & 0xff; + *(outbuffer++) = (mantissa >> 11) & 0xff; + *(outbuffer++) = ((exp << 4) & 0xF0) | ((mantissa >> 19) & 0x0F); + *(outbuffer++) = (exp >> 4) & 0x7F; + + // Mark negative bit as necessary. + if (f < 0) + { + *(outbuffer - 1) |= 0x80; + } + + return 8; + } + + /** + * @brief This tricky function handles demoting a 64bit double to a + * 32bit float, so that AVR can understand messages containing + * float64 fields, despite AVR having no native support for double. + * + * @param[in] inbuffer pointer for buffer to deserialize from. + * @param[out] f pointer to place the deserialized value in. + * + * @return number of bytes to advance the buffer pointer. + */ + static int deserializeAvrFloat64(const unsigned char* inbuffer, float* f) + { + int16_t exp; + uint32_t mantissa; + + // Skip lowest 24 bits + inbuffer += 3; + + // Copy truncated mantissa. + mantissa = ((uint32_t)(*(inbuffer++)) >> 4 & 0x0F); + mantissa |= ((uint32_t)(*(inbuffer++)) & 0xff) << 4; + mantissa |= ((uint32_t)(*(inbuffer++)) & 0xff) << 12; + mantissa |= ((uint32_t)(*inbuffer) & 0x0f) << 20; + + // Copy exponent. + exp = ((uint32_t)(*(inbuffer++)) & 0xf0) >> 4; + exp |= ((uint32_t)(*inbuffer) & 0x7f) << 4; + + if (exp == 2047) + { + exp = 255; // NaN, infinity etc. + } + else if (exp - 1023 > 127) + { + exp = 255; + mantissa = 0; // Too large for float, convert to infinity + } + else if (exp - 1023 >= -126) + { + exp -= 1023 - 127; // Normal case + } + else if (exp - 1023 < -150) + { + exp = 0; // Too small or zero + } + else + { + // Have to convert to denormalized representation for float + mantissa |= 0x1000000; + mantissa >>= ((-126 + 1023) - exp); + exp = 0; + } + + // Round off mantissa + if (mantissa != 0xFFFFFF) + mantissa += 1; + + mantissa >>= 1; + + // Put mantissa and exponent into place + uint32_t val = mantissa; + val |= static_cast(exp) << 23; + + // Copy negative sign. + val |= (static_cast(*(inbuffer++)) & 0x80) << 24; + + memcpy(f, &val, sizeof(val)); + return 8; + } + + // Copy data from variable into a byte array + template + static void varToArr(A arr, const V var) + { + for (size_t i = 0; i < sizeof(V); i++) + arr[i] = (var >> (8 * i)); + } + + // Copy data from a byte array into variable + template + static void arrToVar(V& var, const A arr) + { + var = 0; + for (size_t i = 0; i < sizeof(V); i++) + var |= (arr[i] << (8 * i)); + } + +}; + +} // namespace ros + +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ros/node_handle.h b/smart_device_protocol/ros_lib/ros_lib/ros/node_handle.h new file mode 100644 index 000000000..32a3562cb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ros/node_handle.h @@ -0,0 +1,644 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_NODE_HANDLE_H_ +#define ROS_NODE_HANDLE_H_ + +#include + +#include "std_msgs/Time.h" +#include "rosserial_msgs/TopicInfo.h" +#include "rosserial_msgs/Log.h" +#include "rosserial_msgs/RequestParam.h" + +#include "ros/msg.h" + +namespace ros +{ + +class NodeHandleBase_ +{ +public: + virtual int publish(int id, const Msg* msg) = 0; + virtual int spinOnce() = 0; + virtual bool connected() = 0; +}; +} + +#include "ros/publisher.h" +#include "ros/subscriber.h" +#include "ros/service_server.h" +#include "ros/service_client.h" + +namespace ros +{ + +const int SPIN_OK = 0; +const int SPIN_ERR = -1; +const int SPIN_TIMEOUT = -2; + +const uint8_t SYNC_SECONDS = 5; +const uint8_t MODE_FIRST_FF = 0; +/* + * The second sync byte is a protocol version. It's value is 0xff for the first + * version of the rosserial protocol (used up to hydro), 0xfe for the second version + * (introduced in hydro), 0xfd for the next, and so on. Its purpose is to enable + * detection of mismatched protocol versions (e.g. hydro rosserial_python with groovy + * rosserial_arduino. It must be changed in both this file and in + * rosserial_python/src/rosserial_python/SerialClient.py + */ +const uint8_t MODE_PROTOCOL_VER = 1; +const uint8_t PROTOCOL_VER1 = 0xff; // through groovy +const uint8_t PROTOCOL_VER2 = 0xfe; // in hydro +const uint8_t PROTOCOL_VER = PROTOCOL_VER2; +const uint8_t MODE_SIZE_L = 2; +const uint8_t MODE_SIZE_H = 3; +const uint8_t MODE_SIZE_CHECKSUM = 4; // checksum for msg size received from size L and H +const uint8_t MODE_TOPIC_L = 5; // waiting for topic id +const uint8_t MODE_TOPIC_H = 6; +const uint8_t MODE_MESSAGE = 7; +const uint8_t MODE_MSG_CHECKSUM = 8; // checksum for msg and topic id + + +const uint8_t SERIAL_MSG_TIMEOUT = 20; // 20 milliseconds to recieve all of message data + +using rosserial_msgs::TopicInfo; + +/* Node Handle */ +template +class NodeHandle_ : public NodeHandleBase_ +{ +protected: + Hardware hardware_{}; + + /* time used for syncing */ + uint32_t rt_time{0}; + + /* used for computing current time */ + uint32_t sec_offset{0}, nsec_offset{0}; + + /* Spinonce maximum work timeout */ + uint32_t spin_timeout_{0}; + + uint8_t message_in[INPUT_SIZE] = {0}; + uint8_t message_out[OUTPUT_SIZE] = {0}; + + Publisher * publishers[MAX_PUBLISHERS] = {nullptr}; + Subscriber_ * subscribers[MAX_SUBSCRIBERS] {nullptr}; + + /* + * Setup Functions + */ +public: + Hardware* getHardware() + { + return &hardware_; + } + + /* Start serial, initialize buffers */ + void initNode() + { + hardware_.init(); + mode_ = 0; + bytes_ = 0; + index_ = 0; + topic_ = 0; + }; + + /* Start a named port, which may be network server IP, initialize buffers */ + void initNode(char *portName) + { + hardware_.init(portName); + mode_ = 0; + bytes_ = 0; + index_ = 0; + topic_ = 0; + }; + + /** + * @brief Sets the maximum time in millisconds that spinOnce() can work. + * This will not effect the processing of the buffer, as spinOnce processes + * one byte at a time. It simply sets the maximum time that one call can + * process for. You can choose to clear the buffer if that is beneficial if + * SPIN_TIMEOUT is returned from spinOnce(). + * @param timeout The timeout in milliseconds that spinOnce will function. + */ + void setSpinTimeout(const uint32_t& timeout) + { + spin_timeout_ = timeout; + } + +protected: + // State machine variables for spinOnce + int mode_{0}; + int bytes_{0}; + int topic_{0}; + int index_{0}; + int checksum_{0}; + + bool configured_{false}; + + /* used for syncing the time */ + uint32_t last_sync_time{0}; + uint32_t last_sync_receive_time{0}; + uint32_t last_msg_timeout_time{0}; + +public: + /* This function goes in your loop() function, it handles + * serial input and callbacks for subscribers. + */ + + + virtual int spinOnce() override + { + /* restart if timed out */ + uint32_t c_time = hardware_.time(); + if ((c_time - last_sync_receive_time) > (SYNC_SECONDS * 2200)) + { + configured_ = false; + } + + /* reset if message has timed out */ + if (mode_ != MODE_FIRST_FF) + { + if (c_time > last_msg_timeout_time) + { + mode_ = MODE_FIRST_FF; + } + } + + /* while available buffer, read data */ + while (true) + { + // If a timeout has been specified, check how long spinOnce has been running. + if (spin_timeout_ > 0) + { + // If the maximum processing timeout has been exceeded, exit with error. + // The next spinOnce can continue where it left off, or optionally + // based on the application in use, the hardware buffer could be flushed + // and start fresh. + if ((hardware_.time() - c_time) > spin_timeout_) + { + // Exit the spin, processing timeout exceeded. + return SPIN_TIMEOUT; + } + } + int data = hardware_.read(); + if (data < 0) + break; + checksum_ += data; + if (mode_ == MODE_MESSAGE) /* message data being recieved */ + { + message_in[index_++] = data; + bytes_--; + if (bytes_ == 0) /* is message complete? if so, checksum */ + mode_ = MODE_MSG_CHECKSUM; + } + else if (mode_ == MODE_FIRST_FF) + { + if (data == 0xff) + { + mode_++; + last_msg_timeout_time = c_time + SERIAL_MSG_TIMEOUT; + } + else if (hardware_.time() - c_time > (SYNC_SECONDS * 1000)) + { + /* We have been stuck in spinOnce too long, return error */ + configured_ = false; + return SPIN_TIMEOUT; + } + } + else if (mode_ == MODE_PROTOCOL_VER) + { + if (data == PROTOCOL_VER) + { + mode_++; + } + else + { + mode_ = MODE_FIRST_FF; + if (configured_ == false) + requestSyncTime(); /* send a msg back showing our protocol version */ + } + } + else if (mode_ == MODE_SIZE_L) /* bottom half of message size */ + { + bytes_ = data; + index_ = 0; + mode_++; + checksum_ = data; /* first byte for calculating size checksum */ + } + else if (mode_ == MODE_SIZE_H) /* top half of message size */ + { + bytes_ += data << 8; + mode_++; + } + else if (mode_ == MODE_SIZE_CHECKSUM) + { + if ((checksum_ % 256) == 255) + mode_++; + else + mode_ = MODE_FIRST_FF; /* Abandon the frame if the msg len is wrong */ + } + else if (mode_ == MODE_TOPIC_L) /* bottom half of topic id */ + { + topic_ = data; + mode_++; + checksum_ = data; /* first byte included in checksum */ + } + else if (mode_ == MODE_TOPIC_H) /* top half of topic id */ + { + topic_ += data << 8; + mode_ = MODE_MESSAGE; + if (bytes_ == 0) + mode_ = MODE_MSG_CHECKSUM; + } + else if (mode_ == MODE_MSG_CHECKSUM) /* do checksum */ + { + mode_ = MODE_FIRST_FF; + if ((checksum_ % 256) == 255) + { + if (topic_ == TopicInfo::ID_PUBLISHER) + { + requestSyncTime(); + negotiateTopics(); + last_sync_time = c_time; + last_sync_receive_time = c_time; + return SPIN_ERR; + } + else if (topic_ == TopicInfo::ID_TIME) + { + syncTime(message_in); + } + else if (topic_ == TopicInfo::ID_PARAMETER_REQUEST) + { + req_param_resp.deserialize(message_in); + param_received = true; + } + else if (topic_ == TopicInfo::ID_TX_STOP) + { + configured_ = false; + } + else + { + if (subscribers[topic_ - 100]) + subscribers[topic_ - 100]->callback(message_in); + } + } + } + } + + /* occasionally sync time */ + if (configured_ && ((c_time - last_sync_time) > (SYNC_SECONDS * 500))) + { + requestSyncTime(); + last_sync_time = c_time; + } + + return SPIN_OK; + } + + + /* Are we connected to the PC? */ + virtual bool connected() override + { + return configured_; + }; + + /******************************************************************** + * Time functions + */ + + void requestSyncTime() + { + std_msgs::Time t; + publish(TopicInfo::ID_TIME, &t); + rt_time = hardware_.time(); + } + + void syncTime(uint8_t * data) + { + std_msgs::Time t; + uint32_t offset = hardware_.time() - rt_time; + + t.deserialize(data); + t.data.sec += offset / 1000; + t.data.nsec += (offset % 1000) * 1000000UL; + + this->setNow(t.data); + last_sync_receive_time = hardware_.time(); + } + + Time now() + { + uint32_t ms = hardware_.time(); + Time current_time; + current_time.sec = ms / 1000 + sec_offset; + current_time.nsec = (ms % 1000) * 1000000UL + nsec_offset; + normalizeSecNSec(current_time.sec, current_time.nsec); + return current_time; + } + + void setNow(const Time & new_now) + { + uint32_t ms = hardware_.time(); + sec_offset = new_now.sec - ms / 1000 - 1; + nsec_offset = new_now.nsec - (ms % 1000) * 1000000UL + 1000000000UL; + normalizeSecNSec(sec_offset, nsec_offset); + } + + /******************************************************************** + * Topic Management + */ + + /* Register a new publisher */ + bool advertise(Publisher & p) + { + for (int i = 0; i < MAX_PUBLISHERS; i++) + { + if (publishers[i] == 0) // empty slot + { + publishers[i] = &p; + p.id_ = i + 100 + MAX_SUBSCRIBERS; + p.nh_ = this; + return true; + } + } + return false; + } + + /* Register a new subscriber */ + bool subscribe(Subscriber_& s) + { + for (int i = 0; i < MAX_SUBSCRIBERS; i++) + { + if (subscribers[i] == 0) // empty slot + { + subscribers[i] = &s; + s.id_ = i + 100; + return true; + } + } + return false; + } + + /* Register a new Service Server */ + template + bool advertiseService(ServiceServer& srv) + { + bool v = advertise(srv.pub); + bool w = subscribe(srv); + return v && w; + } + + /* Register a new Service Client */ + template + bool serviceClient(ServiceClient& srv) + { + bool v = advertise(srv.pub); + bool w = subscribe(srv); + return v && w; + } + + void negotiateTopics() + { + rosserial_msgs::TopicInfo ti; + int i; + for (i = 0; i < MAX_PUBLISHERS; i++) + { + if (publishers[i] != 0) // non-empty slot + { + ti.topic_id = publishers[i]->id_; + ti.topic_name = (char *) publishers[i]->topic_; + ti.message_type = (char *) publishers[i]->msg_->getType(); + ti.md5sum = (char *) publishers[i]->msg_->getMD5(); + ti.buffer_size = OUTPUT_SIZE; + publish(publishers[i]->getEndpointType(), &ti); + } + } + for (i = 0; i < MAX_SUBSCRIBERS; i++) + { + if (subscribers[i] != 0) // non-empty slot + { + ti.topic_id = subscribers[i]->id_; + ti.topic_name = (char *) subscribers[i]->topic_; + ti.message_type = (char *) subscribers[i]->getMsgType(); + ti.md5sum = (char *) subscribers[i]->getMsgMD5(); + ti.buffer_size = INPUT_SIZE; + publish(subscribers[i]->getEndpointType(), &ti); + } + } + configured_ = true; + } + + virtual int publish(int id, const Msg * msg) override + { + if (id >= 100 && !configured_) + return 0; + + /* serialize message */ + int l = msg->serialize(message_out + 7); + + /* setup the header */ + message_out[0] = 0xff; + message_out[1] = PROTOCOL_VER; + message_out[2] = (uint8_t)((uint16_t)l & 255); + message_out[3] = (uint8_t)((uint16_t)l >> 8); + message_out[4] = 255 - ((message_out[2] + message_out[3]) % 256); + message_out[5] = (uint8_t)((int16_t)id & 255); + message_out[6] = (uint8_t)((int16_t)id >> 8); + + /* calculate checksum */ + int chk = 0; + for (int i = 5; i < l + 7; i++) + chk += message_out[i]; + l += 7; + message_out[l++] = 255 - (chk % 256); + + if (l <= OUTPUT_SIZE) + { + hardware_.write(message_out, l); + return l; + } + else + { + logerror("Message from device dropped: message larger than buffer."); + return -1; + } + } + + /******************************************************************** + * Logging + */ + +protected: + void log(char byte, const char * msg) + { + rosserial_msgs::Log l; + l.level = byte; + l.msg = (char*)msg; + publish(rosserial_msgs::TopicInfo::ID_LOG, &l); + } + +public: + void logdebug(const char* msg) + { + log(rosserial_msgs::Log::ROSDEBUG, msg); + } + void loginfo(const char * msg) + { + log(rosserial_msgs::Log::INFO, msg); + } + void logwarn(const char *msg) + { + log(rosserial_msgs::Log::WARN, msg); + } + void logerror(const char*msg) + { + log(rosserial_msgs::Log::ERROR, msg); + } + void logfatal(const char*msg) + { + log(rosserial_msgs::Log::FATAL, msg); + } + + /******************************************************************** + * Parameters + */ + +protected: + bool param_received{false}; + rosserial_msgs::RequestParamResponse req_param_resp{}; + + bool requestParam(const char * name, int time_out = 1000) + { + param_received = false; + rosserial_msgs::RequestParamRequest req; + req.name = (char*)name; + publish(TopicInfo::ID_PARAMETER_REQUEST, &req); + uint32_t end_time = hardware_.time() + time_out; + while (!param_received) + { + spinOnce(); + if (hardware_.time() > end_time) + { + logwarn("Failed to get param: timeout expired"); + return false; + } + } + return true; + } + +public: + bool getParam(const char* name, int* param, int length = 1, int timeout = 1000) + { + if (requestParam(name, timeout)) + { + if (length == req_param_resp.ints_length) + { + //copy it over + for (int i = 0; i < length; i++) + param[i] = req_param_resp.ints[i]; + return true; + } + else + { + logwarn("Failed to get param: length mismatch"); + } + } + return false; + } + bool getParam(const char* name, float* param, int length = 1, int timeout = 1000) + { + if (requestParam(name, timeout)) + { + if (length == req_param_resp.floats_length) + { + //copy it over + for (int i = 0; i < length; i++) + param[i] = req_param_resp.floats[i]; + return true; + } + else + { + logwarn("Failed to get param: length mismatch"); + } + } + return false; + } + bool getParam(const char* name, char** param, int length = 1, int timeout = 1000) + { + if (requestParam(name, timeout)) + { + if (length == req_param_resp.strings_length) + { + //copy it over + for (int i = 0; i < length; i++) + strcpy(param[i], req_param_resp.strings[i]); + return true; + } + else + { + logwarn("Failed to get param: length mismatch"); + } + } + return false; + } + bool getParam(const char* name, bool* param, int length = 1, int timeout = 1000) + { + if (requestParam(name, timeout)) + { + if (length == req_param_resp.ints_length) + { + //copy it over + for (int i = 0; i < length; i++) + param[i] = req_param_resp.ints[i]; + return true; + } + else + { + logwarn("Failed to get param: length mismatch"); + } + } + return false; + } +}; + +} + +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ros/publisher.h b/smart_device_protocol/ros_lib/ros_lib/ros/publisher.h new file mode 100644 index 000000000..6fd3b7a51 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ros/publisher.h @@ -0,0 +1,74 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_PUBLISHER_H_ +#define _ROS_PUBLISHER_H_ + +#include "rosserial_msgs/TopicInfo.h" +#include "ros/node_handle.h" + +namespace ros +{ + +/* Generic Publisher */ +class Publisher +{ +public: + Publisher(const char * topic_name, Msg * msg, int endpoint = rosserial_msgs::TopicInfo::ID_PUBLISHER) : + topic_(topic_name), + msg_(msg), + endpoint_(endpoint) {}; + + int publish(const Msg * msg) + { + return nh_->publish(id_, msg); + }; + int getEndpointType() + { + return endpoint_; + } + + const char * topic_; + Msg *msg_; + // id_ and no_ are set by NodeHandle when we advertise + int id_; + NodeHandleBase_* nh_; + +private: + int endpoint_; +}; + +} + +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ros/service_client.h b/smart_device_protocol/ros_lib/ros_lib/ros/service_client.h new file mode 100644 index 000000000..0b7e17b8e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ros/service_client.h @@ -0,0 +1,95 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_SERVICE_CLIENT_H_ +#define _ROS_SERVICE_CLIENT_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "ros/publisher.h" +#include "ros/subscriber.h" + +namespace ros +{ + +template +class ServiceClient : public Subscriber_ +{ +public: + ServiceClient(const char* topic_name) : + pub(topic_name, &req, rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_PUBLISHER) + { + this->topic_ = topic_name; + this->waiting = true; + } + + virtual void call(const MReq & request, MRes & response) override + { + if (!pub.nh_->connected()) return; + ret = &response; + waiting = true; + pub.publish(&request); + while (waiting && pub.nh_->connected()) + if (pub.nh_->spinOnce() < 0) break; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data) override + { + ret->deserialize(data); + waiting = false; + } + virtual const char * getMsgType() override + { + return this->resp.getType(); + } + virtual const char * getMsgMD5() override + { + return this->resp.getMD5(); + } + virtual int getEndpointType() override + { + return rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; + } + + MReq req; + MRes resp; + MRes * ret; + bool waiting; + Publisher pub; +}; + +} + +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ros/service_server.h b/smart_device_protocol/ros_lib/ros_lib/ros/service_server.h new file mode 100644 index 000000000..46d2bd773 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ros/service_server.h @@ -0,0 +1,130 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_SERVICE_SERVER_H_ +#define _ROS_SERVICE_SERVER_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "ros/publisher.h" +#include "ros/subscriber.h" + +namespace ros +{ + +template +class ServiceServer : public Subscriber_ +{ +public: + typedef void(ObjT::*CallbackT)(const MReq&, MRes&); + + ServiceServer(const char* topic_name, CallbackT cb, ObjT* obj) : + pub(topic_name, &resp, rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_PUBLISHER), + obj_(obj) + { + this->topic_ = topic_name; + this->cb_ = cb; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data) override + { + req.deserialize(data); + (obj_->*cb_)(req, resp); + pub.publish(&resp); + } + virtual const char * getMsgType() override + { + return this->req.getType(); + } + virtual const char * getMsgMD5() override + { + return this->req.getMD5(); + } + virtual int getEndpointType() override + { + return rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; + } + + MReq req; + MRes resp; + Publisher pub; +private: + CallbackT cb_; + ObjT* obj_; +}; + +template +class ServiceServer : public Subscriber_ +{ +public: + typedef void(*CallbackT)(const MReq&, MRes&); + + ServiceServer(const char* topic_name, CallbackT cb) : + pub(topic_name, &resp, rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_PUBLISHER) + { + this->topic_ = topic_name; + this->cb_ = cb; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data) override + { + req.deserialize(data); + cb_(req, resp); + pub.publish(&resp); + } + virtual const char * getMsgType() override + { + return this->req.getType(); + } + virtual const char * getMsgMD5() override + { + return this->req.getMD5(); + } + virtual int getEndpointType() override + { + return rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; + } + + MReq req; + MRes resp; + Publisher pub; +private: + CallbackT cb_; +}; + +} + +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ros/subscriber.h b/smart_device_protocol/ros_lib/ros_lib/ros/subscriber.h new file mode 100644 index 000000000..b37e6372c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ros/subscriber.h @@ -0,0 +1,140 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_SUBSCRIBER_H_ +#define ROS_SUBSCRIBER_H_ + +#include "rosserial_msgs/TopicInfo.h" + +namespace ros +{ + +/* Base class for objects subscribers. */ +class Subscriber_ +{ +public: + virtual void callback(unsigned char *data) = 0; + virtual int getEndpointType() = 0; + + // id_ is set by NodeHandle when we advertise + int id_; + + virtual const char * getMsgType() = 0; + virtual const char * getMsgMD5() = 0; + const char * topic_; +}; + +/* Bound function subscriber. */ +template +class Subscriber: public Subscriber_ +{ +public: + typedef void(ObjT::*CallbackT)(const MsgT&); + MsgT msg; + + Subscriber(const char * topic_name, CallbackT cb, ObjT* obj, int endpoint = rosserial_msgs::TopicInfo::ID_SUBSCRIBER) : + cb_(cb), + obj_(obj), + endpoint_(endpoint) + { + topic_ = topic_name; + }; + + virtual void callback(unsigned char* data) override + { + msg.deserialize(data); + (obj_->*cb_)(msg); + } + + virtual const char * getMsgType() override + { + return this->msg.getType(); + } + virtual const char * getMsgMD5() override + { + return this->msg.getMD5(); + } + virtual int getEndpointType() override + { + return endpoint_; + } + +private: + CallbackT cb_; + ObjT* obj_; + int endpoint_; +}; + +/* Standalone function subscriber. */ +template +class Subscriber: public Subscriber_ +{ +public: + typedef void(*CallbackT)(const MsgT&); + MsgT msg; + + Subscriber(const char * topic_name, CallbackT cb, int endpoint = rosserial_msgs::TopicInfo::ID_SUBSCRIBER) : + cb_(cb), + endpoint_(endpoint) + { + topic_ = topic_name; + }; + + virtual void callback(unsigned char* data) override + { + msg.deserialize(data); + this->cb_(msg); + } + + virtual const char * getMsgType() override + { + return this->msg.getType(); + } + virtual const char * getMsgMD5() override + { + return this->msg.getMD5(); + } + virtual int getEndpointType() override + { + return endpoint_; + } + +private: + CallbackT cb_; + int endpoint_; +}; + +} + +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/ros/time.h b/smart_device_protocol/ros_lib/ros_lib/ros/time.h new file mode 100644 index 000000000..e6af33c20 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/ros/time.h @@ -0,0 +1,83 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TIME_H_ +#define ROS_TIME_H_ + +#include "ros/duration.h" +#include +#include + +namespace ros +{ +void normalizeSecNSec(uint32_t &sec, uint32_t &nsec); + +class Time +{ +public: + uint32_t sec, nsec; + + Time() : sec(0), nsec(0) {} + Time(uint32_t _sec, uint32_t _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSec(sec, nsec); + } + + double toSec() const + { + return (double)sec + 1e-9 * (double)nsec; + }; + void fromSec(double t) + { + sec = (uint32_t) floor(t); + nsec = (uint32_t) round((t - sec) * 1e9); + }; + + uint32_t toNsec() + { + return (uint32_t)sec * 1000000000ull + (uint32_t)nsec; + }; + Time& fromNSec(int32_t t); + + Time& operator +=(const Duration &rhs); + Time& operator -=(const Duration &rhs); + Duration operator -(const Time &rhs) const; + + static Time now(); + static void setNow(Time & new_now); +}; + +} + +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/DeleteParam.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/DeleteParam.h new file mode 100644 index 000000000..d956bac63 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/DeleteParam.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_DeleteParam_h +#define _ROS_SERVICE_DeleteParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char DELETEPARAM[] = "rosapi/DeleteParam"; + + class DeleteParamRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + + DeleteParamRequest(): + 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 DELETEPARAM; }; + virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class DeleteParamResponse : public ros::Msg + { + public: + + DeleteParamResponse() + { + } + + 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 DELETEPARAM; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DeleteParam { + public: + typedef DeleteParamRequest Request; + typedef DeleteParamResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/GetActionServers.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/GetActionServers.h new file mode 100644 index 000000000..f03296347 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/GetActionServers.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_GetActionServers_h +#define _ROS_SERVICE_GetActionServers_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char GETACTIONSERVERS[] = "rosapi/GetActionServers"; + + class GetActionServersRequest : public ros::Msg + { + public: + + GetActionServersRequest() + { + } + + 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 GETACTIONSERVERS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetActionServersResponse : public ros::Msg + { + public: + uint32_t action_servers_length; + typedef char* _action_servers_type; + _action_servers_type st_action_servers; + _action_servers_type * action_servers; + + GetActionServersResponse(): + action_servers_length(0), st_action_servers(), action_servers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->action_servers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->action_servers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->action_servers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->action_servers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->action_servers_length); + for( uint32_t i = 0; i < action_servers_length; i++){ + uint32_t length_action_serversi = strlen(this->action_servers[i]); + varToArr(outbuffer + offset, length_action_serversi); + offset += 4; + memcpy(outbuffer + offset, this->action_servers[i], length_action_serversi); + offset += length_action_serversi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t action_servers_lengthT = ((uint32_t) (*(inbuffer + offset))); + action_servers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + action_servers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + action_servers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->action_servers_length); + if(action_servers_lengthT > action_servers_length) + this->action_servers = (char**)realloc(this->action_servers, action_servers_lengthT * sizeof(char*)); + action_servers_length = action_servers_lengthT; + for( uint32_t i = 0; i < action_servers_length; i++){ + uint32_t length_st_action_servers; + arrToVar(length_st_action_servers, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_action_servers; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_action_servers-1]=0; + this->st_action_servers = (char *)(inbuffer + offset-1); + offset += length_st_action_servers; + memcpy( &(this->action_servers[i]), &(this->st_action_servers), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return GETACTIONSERVERS; }; + virtual const char * getMD5() override { return "46807ba271844ac5ba4730a47556b236"; }; + + }; + + class GetActionServers { + public: + typedef GetActionServersRequest Request; + typedef GetActionServersResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/GetParam.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/GetParam.h new file mode 100644 index 000000000..c623581ea --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/GetParam.h @@ -0,0 +1,121 @@ +#ifndef _ROS_SERVICE_GetParam_h +#define _ROS_SERVICE_GetParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char GETPARAM[] = "rosapi/GetParam"; + + class GetParamRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _default_type; + _default_type default; + + GetParamRequest(): + name(""), + default("") + { + } + + 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_default = strlen(this->default); + varToArr(outbuffer + offset, length_default); + offset += 4; + memcpy(outbuffer + offset, this->default, length_default); + offset += length_default; + 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_default; + arrToVar(length_default, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_default; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_default-1]=0; + this->default = (char *)(inbuffer + offset-1); + offset += length_default; + return offset; + } + + virtual const char * getType() override { return GETPARAM; }; + virtual const char * getMD5() override { return "1cc3f281ee24ba9406c3e498e4da686f"; }; + + }; + + class GetParamResponse : public ros::Msg + { + public: + typedef const char* _value_type; + _value_type value; + + GetParamResponse(): + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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_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 GETPARAM; }; + virtual const char * getMD5() override { return "64e58419496c7248b4ef25731f88b8c3"; }; + + }; + + class GetParam { + public: + typedef GetParamRequest Request; + typedef GetParamResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/GetParamNames.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/GetParamNames.h new file mode 100644 index 000000000..4d8ea09d2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/GetParamNames.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_GetParamNames_h +#define _ROS_SERVICE_GetParamNames_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char GETPARAMNAMES[] = "rosapi/GetParamNames"; + + class GetParamNamesRequest : public ros::Msg + { + public: + + GetParamNamesRequest() + { + } + + 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 GETPARAMNAMES; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetParamNamesResponse : public ros::Msg + { + public: + uint32_t names_length; + typedef char* _names_type; + _names_type st_names; + _names_type * names; + + GetParamNamesResponse(): + names_length(0), st_names(), names(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->names_length); + for( uint32_t i = 0; i < names_length; i++){ + uint32_t length_namesi = strlen(this->names[i]); + varToArr(outbuffer + offset, length_namesi); + offset += 4; + memcpy(outbuffer + offset, this->names[i], length_namesi); + offset += length_namesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t names_lengthT = ((uint32_t) (*(inbuffer + offset))); + names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->names_length); + if(names_lengthT > names_length) + this->names = (char**)realloc(this->names, names_lengthT * sizeof(char*)); + names_length = names_lengthT; + for( uint32_t i = 0; i < names_length; i++){ + uint32_t length_st_names; + arrToVar(length_st_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_names-1]=0; + this->st_names = (char *)(inbuffer + offset-1); + offset += length_st_names; + memcpy( &(this->names[i]), &(this->st_names), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return GETPARAMNAMES; }; + virtual const char * getMD5() override { return "dc7ae3609524b18034e49294a4ce670e"; }; + + }; + + class GetParamNames { + public: + typedef GetParamNamesRequest Request; + typedef GetParamNamesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/GetTime.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/GetTime.h new file mode 100644 index 000000000..7736a2f46 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/GetTime.h @@ -0,0 +1,94 @@ +#ifndef _ROS_SERVICE_GetTime_h +#define _ROS_SERVICE_GetTime_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace rosapi +{ + +static const char GETTIME[] = "rosapi/GetTime"; + + class GetTimeRequest : public ros::Msg + { + public: + + GetTimeRequest() + { + } + + 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 GETTIME; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetTimeResponse : public ros::Msg + { + public: + typedef ros::Time _time_type; + _time_type time; + + GetTimeResponse(): + time() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.sec); + *(outbuffer + offset + 0) = (this->time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->time.sec = ((uint32_t) (*(inbuffer + offset))); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.sec); + this->time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.nsec); + return offset; + } + + virtual const char * getType() override { return GETTIME; }; + virtual const char * getMD5() override { return "556a4fb76023a469987922359d08a844"; }; + + }; + + class GetTime { + public: + typedef GetTimeRequest Request; + typedef GetTimeResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/HasParam.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/HasParam.h new file mode 100644 index 000000000..b154c25a3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/HasParam.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_HasParam_h +#define _ROS_SERVICE_HasParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char HASPARAM[] = "rosapi/HasParam"; + + class HasParamRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + + HasParamRequest(): + 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 HASPARAM; }; + virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class HasParamResponse : public ros::Msg + { + public: + typedef bool _exists_type; + _exists_type exists; + + HasParamResponse(): + exists(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_exists; + u_exists.real = this->exists; + *(outbuffer + offset + 0) = (u_exists.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->exists); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_exists; + u_exists.base = 0; + u_exists.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->exists = u_exists.real; + offset += sizeof(this->exists); + return offset; + } + + virtual const char * getType() override { return HASPARAM; }; + virtual const char * getMD5() override { return "e8c90de4adc1219c86af9c2874c0c1b5"; }; + + }; + + class HasParam { + public: + typedef HasParamRequest Request; + typedef HasParamResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/MessageDetails.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/MessageDetails.h new file mode 100644 index 000000000..d6765be39 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/MessageDetails.h @@ -0,0 +1,113 @@ +#ifndef _ROS_SERVICE_MessageDetails_h +#define _ROS_SERVICE_MessageDetails_h +#include +#include +#include +#include "ros/msg.h" +#include "rosapi/TypeDef.h" + +namespace rosapi +{ + +static const char MESSAGEDETAILS[] = "rosapi/MessageDetails"; + + class MessageDetailsRequest : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + + MessageDetailsRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return MESSAGEDETAILS; }; + virtual const char * getMD5() override { return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class MessageDetailsResponse : public ros::Msg + { + public: + uint32_t typedefs_length; + typedef rosapi::TypeDef _typedefs_type; + _typedefs_type st_typedefs; + _typedefs_type * typedefs; + + MessageDetailsResponse(): + typedefs_length(0), st_typedefs(), typedefs(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->typedefs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->typedefs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->typedefs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->typedefs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->typedefs_length); + for( uint32_t i = 0; i < typedefs_length; i++){ + offset += this->typedefs[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t typedefs_lengthT = ((uint32_t) (*(inbuffer + offset))); + typedefs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + typedefs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + typedefs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->typedefs_length); + if(typedefs_lengthT > typedefs_length) + this->typedefs = (rosapi::TypeDef*)realloc(this->typedefs, typedefs_lengthT * sizeof(rosapi::TypeDef)); + typedefs_length = typedefs_lengthT; + for( uint32_t i = 0; i < typedefs_length; i++){ + offset += this->st_typedefs.deserialize(inbuffer + offset); + memcpy( &(this->typedefs[i]), &(this->st_typedefs), sizeof(rosapi::TypeDef)); + } + return offset; + } + + virtual const char * getType() override { return MESSAGEDETAILS; }; + virtual const char * getMD5() override { return "a6b8995777f214f2ed97a1e4890feb10"; }; + + }; + + class MessageDetails { + public: + typedef MessageDetailsRequest Request; + typedef MessageDetailsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/NodeDetails.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/NodeDetails.h new file mode 100644 index 000000000..0fcac7fd9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/NodeDetails.h @@ -0,0 +1,198 @@ +#ifndef _ROS_SERVICE_NodeDetails_h +#define _ROS_SERVICE_NodeDetails_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char NODEDETAILS[] = "rosapi/NodeDetails"; + + class NodeDetailsRequest : public ros::Msg + { + public: + typedef const char* _node_type; + _node_type node; + + NodeDetailsRequest(): + node("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_node = strlen(this->node); + varToArr(outbuffer + offset, length_node); + offset += 4; + memcpy(outbuffer + offset, this->node, length_node); + offset += length_node; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_node; + arrToVar(length_node, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node-1]=0; + this->node = (char *)(inbuffer + offset-1); + offset += length_node; + return offset; + } + + virtual const char * getType() override { return NODEDETAILS; }; + virtual const char * getMD5() override { return "a94c40e70a4b82863e6e52ec16732447"; }; + + }; + + class NodeDetailsResponse : public ros::Msg + { + public: + uint32_t subscribing_length; + typedef char* _subscribing_type; + _subscribing_type st_subscribing; + _subscribing_type * subscribing; + uint32_t publishing_length; + typedef char* _publishing_type; + _publishing_type st_publishing; + _publishing_type * publishing; + uint32_t services_length; + typedef char* _services_type; + _services_type st_services; + _services_type * services; + + NodeDetailsResponse(): + subscribing_length(0), st_subscribing(), subscribing(nullptr), + publishing_length(0), st_publishing(), publishing(nullptr), + services_length(0), st_services(), services(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->subscribing_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->subscribing_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->subscribing_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->subscribing_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->subscribing_length); + for( uint32_t i = 0; i < subscribing_length; i++){ + uint32_t length_subscribingi = strlen(this->subscribing[i]); + varToArr(outbuffer + offset, length_subscribingi); + offset += 4; + memcpy(outbuffer + offset, this->subscribing[i], length_subscribingi); + offset += length_subscribingi; + } + *(outbuffer + offset + 0) = (this->publishing_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->publishing_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->publishing_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->publishing_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->publishing_length); + for( uint32_t i = 0; i < publishing_length; i++){ + uint32_t length_publishingi = strlen(this->publishing[i]); + varToArr(outbuffer + offset, length_publishingi); + offset += 4; + memcpy(outbuffer + offset, this->publishing[i], length_publishingi); + offset += length_publishingi; + } + *(outbuffer + offset + 0) = (this->services_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->services_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->services_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->services_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->services_length); + for( uint32_t i = 0; i < services_length; i++){ + uint32_t length_servicesi = strlen(this->services[i]); + varToArr(outbuffer + offset, length_servicesi); + offset += 4; + memcpy(outbuffer + offset, this->services[i], length_servicesi); + offset += length_servicesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t subscribing_lengthT = ((uint32_t) (*(inbuffer + offset))); + subscribing_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + subscribing_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + subscribing_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->subscribing_length); + if(subscribing_lengthT > subscribing_length) + this->subscribing = (char**)realloc(this->subscribing, subscribing_lengthT * sizeof(char*)); + subscribing_length = subscribing_lengthT; + for( uint32_t i = 0; i < subscribing_length; i++){ + uint32_t length_st_subscribing; + arrToVar(length_st_subscribing, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_subscribing; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_subscribing-1]=0; + this->st_subscribing = (char *)(inbuffer + offset-1); + offset += length_st_subscribing; + memcpy( &(this->subscribing[i]), &(this->st_subscribing), sizeof(char*)); + } + uint32_t publishing_lengthT = ((uint32_t) (*(inbuffer + offset))); + publishing_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + publishing_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + publishing_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->publishing_length); + if(publishing_lengthT > publishing_length) + this->publishing = (char**)realloc(this->publishing, publishing_lengthT * sizeof(char*)); + publishing_length = publishing_lengthT; + for( uint32_t i = 0; i < publishing_length; i++){ + uint32_t length_st_publishing; + arrToVar(length_st_publishing, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_publishing; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_publishing-1]=0; + this->st_publishing = (char *)(inbuffer + offset-1); + offset += length_st_publishing; + memcpy( &(this->publishing[i]), &(this->st_publishing), sizeof(char*)); + } + uint32_t services_lengthT = ((uint32_t) (*(inbuffer + offset))); + services_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + services_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + services_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->services_length); + if(services_lengthT > services_length) + this->services = (char**)realloc(this->services, services_lengthT * sizeof(char*)); + services_length = services_lengthT; + for( uint32_t i = 0; i < services_length; i++){ + uint32_t length_st_services; + arrToVar(length_st_services, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_services; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_services-1]=0; + this->st_services = (char *)(inbuffer + offset-1); + offset += length_st_services; + memcpy( &(this->services[i]), &(this->st_services), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return NODEDETAILS; }; + virtual const char * getMD5() override { return "3da1cb16c6ec5885ad291735b6244a48"; }; + + }; + + class NodeDetails { + public: + typedef NodeDetailsRequest Request; + typedef NodeDetailsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/Nodes.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/Nodes.h new file mode 100644 index 000000000..92e59f436 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/Nodes.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_Nodes_h +#define _ROS_SERVICE_Nodes_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char NODES[] = "rosapi/Nodes"; + + class NodesRequest : public ros::Msg + { + public: + + NodesRequest() + { + } + + 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 NODES; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class NodesResponse : public ros::Msg + { + public: + uint32_t nodes_length; + typedef char* _nodes_type; + _nodes_type st_nodes; + _nodes_type * nodes; + + NodesResponse(): + nodes_length(0), st_nodes(), nodes(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(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++){ + uint32_t length_nodesi = strlen(this->nodes[i]); + varToArr(outbuffer + offset, length_nodesi); + offset += 4; + memcpy(outbuffer + offset, this->nodes[i], length_nodesi); + offset += length_nodesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 = (char**)realloc(this->nodes, nodes_lengthT * sizeof(char*)); + nodes_length = nodes_lengthT; + for( uint32_t i = 0; i < nodes_length; i++){ + uint32_t length_st_nodes; + arrToVar(length_st_nodes, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_nodes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_nodes-1]=0; + this->st_nodes = (char *)(inbuffer + offset-1); + offset += length_st_nodes; + memcpy( &(this->nodes[i]), &(this->st_nodes), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return NODES; }; + virtual const char * getMD5() override { return "3d07bfda1268b4f76b16b7ba8a82665d"; }; + + }; + + class Nodes { + public: + typedef NodesRequest Request; + typedef NodesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/Publishers.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/Publishers.h new file mode 100644 index 000000000..0d49f8bba --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/Publishers.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_Publishers_h +#define _ROS_SERVICE_Publishers_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char PUBLISHERS[] = "rosapi/Publishers"; + + class PublishersRequest : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + + PublishersRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return PUBLISHERS; }; + virtual const char * getMD5() override { return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class PublishersResponse : public ros::Msg + { + public: + uint32_t publishers_length; + typedef char* _publishers_type; + _publishers_type st_publishers; + _publishers_type * publishers; + + PublishersResponse(): + publishers_length(0), st_publishers(), publishers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->publishers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->publishers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->publishers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->publishers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->publishers_length); + for( uint32_t i = 0; i < publishers_length; i++){ + uint32_t length_publishersi = strlen(this->publishers[i]); + varToArr(outbuffer + offset, length_publishersi); + offset += 4; + memcpy(outbuffer + offset, this->publishers[i], length_publishersi); + offset += length_publishersi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t publishers_lengthT = ((uint32_t) (*(inbuffer + offset))); + publishers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + publishers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + publishers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->publishers_length); + if(publishers_lengthT > publishers_length) + this->publishers = (char**)realloc(this->publishers, publishers_lengthT * sizeof(char*)); + publishers_length = publishers_lengthT; + for( uint32_t i = 0; i < publishers_length; i++){ + uint32_t length_st_publishers; + arrToVar(length_st_publishers, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_publishers; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_publishers-1]=0; + this->st_publishers = (char *)(inbuffer + offset-1); + offset += length_st_publishers; + memcpy( &(this->publishers[i]), &(this->st_publishers), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return PUBLISHERS; }; + virtual const char * getMD5() override { return "167d8030c4ca4018261dff8ae5083dc8"; }; + + }; + + class Publishers { + public: + typedef PublishersRequest Request; + typedef PublishersResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/SearchParam.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/SearchParam.h new file mode 100644 index 000000000..fba22827a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/SearchParam.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_SearchParam_h +#define _ROS_SERVICE_SearchParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char SEARCHPARAM[] = "rosapi/SearchParam"; + + class SearchParamRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + + SearchParamRequest(): + 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 SEARCHPARAM; }; + virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class SearchParamResponse : public ros::Msg + { + public: + typedef const char* _global_name_type; + _global_name_type global_name; + + SearchParamResponse(): + global_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_global_name = strlen(this->global_name); + varToArr(outbuffer + offset, length_global_name); + offset += 4; + memcpy(outbuffer + offset, this->global_name, length_global_name); + offset += length_global_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_global_name; + arrToVar(length_global_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_global_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_global_name-1]=0; + this->global_name = (char *)(inbuffer + offset-1); + offset += length_global_name; + return offset; + } + + virtual const char * getType() override { return SEARCHPARAM; }; + virtual const char * getMD5() override { return "87c264f142c2aeca13349d90aeec0386"; }; + + }; + + class SearchParam { + public: + typedef SearchParamRequest Request; + typedef SearchParamResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceHost.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceHost.h new file mode 100644 index 000000000..ec61cc361 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceHost.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_ServiceHost_h +#define _ROS_SERVICE_ServiceHost_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char SERVICEHOST[] = "rosapi/ServiceHost"; + + class ServiceHostRequest : public ros::Msg + { + public: + typedef const char* _service_type; + _service_type service; + + ServiceHostRequest(): + service("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_service = strlen(this->service); + varToArr(outbuffer + offset, length_service); + offset += 4; + memcpy(outbuffer + offset, this->service, length_service); + offset += length_service; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_service; + arrToVar(length_service, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service-1]=0; + this->service = (char *)(inbuffer + offset-1); + offset += length_service; + return offset; + } + + virtual const char * getType() override { return SERVICEHOST; }; + virtual const char * getMD5() override { return "1cbcfa13b08f6d36710b9af8741e6112"; }; + + }; + + class ServiceHostResponse : public ros::Msg + { + public: + typedef const char* _host_type; + _host_type host; + + ServiceHostResponse(): + host("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_host = strlen(this->host); + varToArr(outbuffer + offset, length_host); + offset += 4; + memcpy(outbuffer + offset, this->host, length_host); + offset += length_host; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_host; + arrToVar(length_host, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_host; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_host-1]=0; + this->host = (char *)(inbuffer + offset-1); + offset += length_host; + return offset; + } + + virtual const char * getType() override { return SERVICEHOST; }; + virtual const char * getMD5() override { return "092ff9f63242a37704ce411703ec5eaf"; }; + + }; + + class ServiceHost { + public: + typedef ServiceHostRequest Request; + typedef ServiceHostResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceNode.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceNode.h new file mode 100644 index 000000000..8f09d5817 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceNode.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_ServiceNode_h +#define _ROS_SERVICE_ServiceNode_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char SERVICENODE[] = "rosapi/ServiceNode"; + + class ServiceNodeRequest : public ros::Msg + { + public: + typedef const char* _service_type; + _service_type service; + + ServiceNodeRequest(): + service("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_service = strlen(this->service); + varToArr(outbuffer + offset, length_service); + offset += 4; + memcpy(outbuffer + offset, this->service, length_service); + offset += length_service; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_service; + arrToVar(length_service, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service-1]=0; + this->service = (char *)(inbuffer + offset-1); + offset += length_service; + return offset; + } + + virtual const char * getType() override { return SERVICENODE; }; + virtual const char * getMD5() override { return "1cbcfa13b08f6d36710b9af8741e6112"; }; + + }; + + class ServiceNodeResponse : public ros::Msg + { + public: + typedef const char* _node_type; + _node_type node; + + ServiceNodeResponse(): + node("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_node = strlen(this->node); + varToArr(outbuffer + offset, length_node); + offset += 4; + memcpy(outbuffer + offset, this->node, length_node); + offset += length_node; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_node; + arrToVar(length_node, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node-1]=0; + this->node = (char *)(inbuffer + offset-1); + offset += length_node; + return offset; + } + + virtual const char * getType() override { return SERVICENODE; }; + virtual const char * getMD5() override { return "a94c40e70a4b82863e6e52ec16732447"; }; + + }; + + class ServiceNode { + public: + typedef ServiceNodeRequest Request; + typedef ServiceNodeResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceProviders.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceProviders.h new file mode 100644 index 000000000..d66ce6177 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceProviders.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_ServiceProviders_h +#define _ROS_SERVICE_ServiceProviders_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char SERVICEPROVIDERS[] = "rosapi/ServiceProviders"; + + class ServiceProvidersRequest : public ros::Msg + { + public: + typedef const char* _service_type; + _service_type service; + + ServiceProvidersRequest(): + service("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_service = strlen(this->service); + varToArr(outbuffer + offset, length_service); + offset += 4; + memcpy(outbuffer + offset, this->service, length_service); + offset += length_service; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_service; + arrToVar(length_service, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service-1]=0; + this->service = (char *)(inbuffer + offset-1); + offset += length_service; + return offset; + } + + virtual const char * getType() override { return SERVICEPROVIDERS; }; + virtual const char * getMD5() override { return "1cbcfa13b08f6d36710b9af8741e6112"; }; + + }; + + class ServiceProvidersResponse : public ros::Msg + { + public: + uint32_t providers_length; + typedef char* _providers_type; + _providers_type st_providers; + _providers_type * providers; + + ServiceProvidersResponse(): + providers_length(0), st_providers(), providers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->providers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->providers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->providers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->providers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->providers_length); + for( uint32_t i = 0; i < providers_length; i++){ + uint32_t length_providersi = strlen(this->providers[i]); + varToArr(outbuffer + offset, length_providersi); + offset += 4; + memcpy(outbuffer + offset, this->providers[i], length_providersi); + offset += length_providersi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t providers_lengthT = ((uint32_t) (*(inbuffer + offset))); + providers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + providers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + providers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->providers_length); + if(providers_lengthT > providers_length) + this->providers = (char**)realloc(this->providers, providers_lengthT * sizeof(char*)); + providers_length = providers_lengthT; + for( uint32_t i = 0; i < providers_length; i++){ + uint32_t length_st_providers; + arrToVar(length_st_providers, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_providers; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_providers-1]=0; + this->st_providers = (char *)(inbuffer + offset-1); + offset += length_st_providers; + memcpy( &(this->providers[i]), &(this->st_providers), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return SERVICEPROVIDERS; }; + virtual const char * getMD5() override { return "945f6849f44f061c178ab393b12c1358"; }; + + }; + + class ServiceProviders { + public: + typedef ServiceProvidersRequest Request; + typedef ServiceProvidersResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceRequestDetails.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceRequestDetails.h new file mode 100644 index 000000000..3d39c9626 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceRequestDetails.h @@ -0,0 +1,113 @@ +#ifndef _ROS_SERVICE_ServiceRequestDetails_h +#define _ROS_SERVICE_ServiceRequestDetails_h +#include +#include +#include +#include "ros/msg.h" +#include "rosapi/TypeDef.h" + +namespace rosapi +{ + +static const char SERVICEREQUESTDETAILS[] = "rosapi/ServiceRequestDetails"; + + class ServiceRequestDetailsRequest : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + + ServiceRequestDetailsRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return SERVICEREQUESTDETAILS; }; + virtual const char * getMD5() override { return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class ServiceRequestDetailsResponse : public ros::Msg + { + public: + uint32_t typedefs_length; + typedef rosapi::TypeDef _typedefs_type; + _typedefs_type st_typedefs; + _typedefs_type * typedefs; + + ServiceRequestDetailsResponse(): + typedefs_length(0), st_typedefs(), typedefs(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->typedefs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->typedefs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->typedefs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->typedefs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->typedefs_length); + for( uint32_t i = 0; i < typedefs_length; i++){ + offset += this->typedefs[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t typedefs_lengthT = ((uint32_t) (*(inbuffer + offset))); + typedefs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + typedefs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + typedefs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->typedefs_length); + if(typedefs_lengthT > typedefs_length) + this->typedefs = (rosapi::TypeDef*)realloc(this->typedefs, typedefs_lengthT * sizeof(rosapi::TypeDef)); + typedefs_length = typedefs_lengthT; + for( uint32_t i = 0; i < typedefs_length; i++){ + offset += this->st_typedefs.deserialize(inbuffer + offset); + memcpy( &(this->typedefs[i]), &(this->st_typedefs), sizeof(rosapi::TypeDef)); + } + return offset; + } + + virtual const char * getType() override { return SERVICEREQUESTDETAILS; }; + virtual const char * getMD5() override { return "a6b8995777f214f2ed97a1e4890feb10"; }; + + }; + + class ServiceRequestDetails { + public: + typedef ServiceRequestDetailsRequest Request; + typedef ServiceRequestDetailsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceResponseDetails.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceResponseDetails.h new file mode 100644 index 000000000..93a3a49ba --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceResponseDetails.h @@ -0,0 +1,113 @@ +#ifndef _ROS_SERVICE_ServiceResponseDetails_h +#define _ROS_SERVICE_ServiceResponseDetails_h +#include +#include +#include +#include "ros/msg.h" +#include "rosapi/TypeDef.h" + +namespace rosapi +{ + +static const char SERVICERESPONSEDETAILS[] = "rosapi/ServiceResponseDetails"; + + class ServiceResponseDetailsRequest : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + + ServiceResponseDetailsRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return SERVICERESPONSEDETAILS; }; + virtual const char * getMD5() override { return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class ServiceResponseDetailsResponse : public ros::Msg + { + public: + uint32_t typedefs_length; + typedef rosapi::TypeDef _typedefs_type; + _typedefs_type st_typedefs; + _typedefs_type * typedefs; + + ServiceResponseDetailsResponse(): + typedefs_length(0), st_typedefs(), typedefs(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->typedefs_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->typedefs_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->typedefs_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->typedefs_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->typedefs_length); + for( uint32_t i = 0; i < typedefs_length; i++){ + offset += this->typedefs[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t typedefs_lengthT = ((uint32_t) (*(inbuffer + offset))); + typedefs_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + typedefs_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + typedefs_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->typedefs_length); + if(typedefs_lengthT > typedefs_length) + this->typedefs = (rosapi::TypeDef*)realloc(this->typedefs, typedefs_lengthT * sizeof(rosapi::TypeDef)); + typedefs_length = typedefs_lengthT; + for( uint32_t i = 0; i < typedefs_length; i++){ + offset += this->st_typedefs.deserialize(inbuffer + offset); + memcpy( &(this->typedefs[i]), &(this->st_typedefs), sizeof(rosapi::TypeDef)); + } + return offset; + } + + virtual const char * getType() override { return SERVICERESPONSEDETAILS; }; + virtual const char * getMD5() override { return "a6b8995777f214f2ed97a1e4890feb10"; }; + + }; + + class ServiceResponseDetails { + public: + typedef ServiceResponseDetailsRequest Request; + typedef ServiceResponseDetailsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceType.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceType.h new file mode 100644 index 000000000..c60c44bfd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServiceType.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_ServiceType_h +#define _ROS_SERVICE_ServiceType_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char SERVICETYPE[] = "rosapi/ServiceType"; + + class ServiceTypeRequest : public ros::Msg + { + public: + typedef const char* _service_type; + _service_type service; + + ServiceTypeRequest(): + service("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_service = strlen(this->service); + varToArr(outbuffer + offset, length_service); + offset += 4; + memcpy(outbuffer + offset, this->service, length_service); + offset += length_service; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_service; + arrToVar(length_service, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service-1]=0; + this->service = (char *)(inbuffer + offset-1); + offset += length_service; + return offset; + } + + virtual const char * getType() override { return SERVICETYPE; }; + virtual const char * getMD5() override { return "1cbcfa13b08f6d36710b9af8741e6112"; }; + + }; + + class ServiceTypeResponse : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + + ServiceTypeResponse(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return SERVICETYPE; }; + virtual const char * getMD5() override { return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class ServiceType { + public: + typedef ServiceTypeRequest Request; + typedef ServiceTypeResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/Services.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/Services.h new file mode 100644 index 000000000..99ba644f8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/Services.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_Services_h +#define _ROS_SERVICE_Services_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char SERVICES[] = "rosapi/Services"; + + class ServicesRequest : public ros::Msg + { + public: + + ServicesRequest() + { + } + + 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 SERVICES; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ServicesResponse : public ros::Msg + { + public: + uint32_t services_length; + typedef char* _services_type; + _services_type st_services; + _services_type * services; + + ServicesResponse(): + services_length(0), st_services(), services(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->services_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->services_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->services_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->services_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->services_length); + for( uint32_t i = 0; i < services_length; i++){ + uint32_t length_servicesi = strlen(this->services[i]); + varToArr(outbuffer + offset, length_servicesi); + offset += 4; + memcpy(outbuffer + offset, this->services[i], length_servicesi); + offset += length_servicesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t services_lengthT = ((uint32_t) (*(inbuffer + offset))); + services_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + services_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + services_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->services_length); + if(services_lengthT > services_length) + this->services = (char**)realloc(this->services, services_lengthT * sizeof(char*)); + services_length = services_lengthT; + for( uint32_t i = 0; i < services_length; i++){ + uint32_t length_st_services; + arrToVar(length_st_services, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_services; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_services-1]=0; + this->st_services = (char *)(inbuffer + offset-1); + offset += length_st_services; + memcpy( &(this->services[i]), &(this->st_services), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return SERVICES; }; + virtual const char * getMD5() override { return "e44a7e7bcb900acadbcc28b132378f0c"; }; + + }; + + class Services { + public: + typedef ServicesRequest Request; + typedef ServicesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/ServicesForType.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServicesForType.h new file mode 100644 index 000000000..32ad3ff99 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/ServicesForType.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_ServicesForType_h +#define _ROS_SERVICE_ServicesForType_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char SERVICESFORTYPE[] = "rosapi/ServicesForType"; + + class ServicesForTypeRequest : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + + ServicesForTypeRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return SERVICESFORTYPE; }; + virtual const char * getMD5() override { return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class ServicesForTypeResponse : public ros::Msg + { + public: + uint32_t services_length; + typedef char* _services_type; + _services_type st_services; + _services_type * services; + + ServicesForTypeResponse(): + services_length(0), st_services(), services(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->services_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->services_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->services_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->services_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->services_length); + for( uint32_t i = 0; i < services_length; i++){ + uint32_t length_servicesi = strlen(this->services[i]); + varToArr(outbuffer + offset, length_servicesi); + offset += 4; + memcpy(outbuffer + offset, this->services[i], length_servicesi); + offset += length_servicesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t services_lengthT = ((uint32_t) (*(inbuffer + offset))); + services_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + services_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + services_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->services_length); + if(services_lengthT > services_length) + this->services = (char**)realloc(this->services, services_lengthT * sizeof(char*)); + services_length = services_lengthT; + for( uint32_t i = 0; i < services_length; i++){ + uint32_t length_st_services; + arrToVar(length_st_services, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_services; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_services-1]=0; + this->st_services = (char *)(inbuffer + offset-1); + offset += length_st_services; + memcpy( &(this->services[i]), &(this->st_services), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return SERVICESFORTYPE; }; + virtual const char * getMD5() override { return "e44a7e7bcb900acadbcc28b132378f0c"; }; + + }; + + class ServicesForType { + public: + typedef ServicesForTypeRequest Request; + typedef ServicesForTypeResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/SetParam.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/SetParam.h new file mode 100644 index 000000000..ea1806b04 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/SetParam.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_SetParam_h +#define _ROS_SERVICE_SetParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char SETPARAM[] = "rosapi/SetParam"; + + class SetParamRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _value_type; + _value_type value; + + SetParamRequest(): + name(""), + value("") + { + } + + 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_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_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_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 SETPARAM; }; + virtual const char * getMD5() override { return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + + class SetParamResponse : public ros::Msg + { + public: + + SetParamResponse() + { + } + + 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 SETPARAM; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetParam { + public: + typedef SetParamRequest Request; + typedef SetParamResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/Subscribers.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/Subscribers.h new file mode 100644 index 000000000..a57afd640 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/Subscribers.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_Subscribers_h +#define _ROS_SERVICE_Subscribers_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char SUBSCRIBERS[] = "rosapi/Subscribers"; + + class SubscribersRequest : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + + SubscribersRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return SUBSCRIBERS; }; + virtual const char * getMD5() override { return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class SubscribersResponse : public ros::Msg + { + public: + uint32_t subscribers_length; + typedef char* _subscribers_type; + _subscribers_type st_subscribers; + _subscribers_type * subscribers; + + SubscribersResponse(): + subscribers_length(0), st_subscribers(), subscribers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->subscribers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->subscribers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->subscribers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->subscribers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->subscribers_length); + for( uint32_t i = 0; i < subscribers_length; i++){ + uint32_t length_subscribersi = strlen(this->subscribers[i]); + varToArr(outbuffer + offset, length_subscribersi); + offset += 4; + memcpy(outbuffer + offset, this->subscribers[i], length_subscribersi); + offset += length_subscribersi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t subscribers_lengthT = ((uint32_t) (*(inbuffer + offset))); + subscribers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + subscribers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + subscribers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->subscribers_length); + if(subscribers_lengthT > subscribers_length) + this->subscribers = (char**)realloc(this->subscribers, subscribers_lengthT * sizeof(char*)); + subscribers_length = subscribers_lengthT; + for( uint32_t i = 0; i < subscribers_length; i++){ + uint32_t length_st_subscribers; + arrToVar(length_st_subscribers, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_subscribers; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_subscribers-1]=0; + this->st_subscribers = (char *)(inbuffer + offset-1); + offset += length_st_subscribers; + memcpy( &(this->subscribers[i]), &(this->st_subscribers), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return SUBSCRIBERS; }; + virtual const char * getMD5() override { return "22418cab5ba9531d8c2b738b4e56153b"; }; + + }; + + class Subscribers { + public: + typedef SubscribersRequest Request; + typedef SubscribersResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/TopicType.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/TopicType.h new file mode 100644 index 000000000..4023fa421 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/TopicType.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_TopicType_h +#define _ROS_SERVICE_TopicType_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char TOPICTYPE[] = "rosapi/TopicType"; + + class TopicTypeRequest : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + + TopicTypeRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return TOPICTYPE; }; + virtual const char * getMD5() override { return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class TopicTypeResponse : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + + TopicTypeResponse(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return TOPICTYPE; }; + virtual const char * getMD5() override { return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class TopicType { + public: + typedef TopicTypeRequest Request; + typedef TopicTypeResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/Topics.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/Topics.h new file mode 100644 index 000000000..37a1cffb1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/Topics.h @@ -0,0 +1,144 @@ +#ifndef _ROS_SERVICE_Topics_h +#define _ROS_SERVICE_Topics_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char TOPICS[] = "rosapi/Topics"; + + class TopicsRequest : public ros::Msg + { + public: + + TopicsRequest() + { + } + + 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 TOPICS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TopicsResponse : public ros::Msg + { + public: + uint32_t topics_length; + typedef char* _topics_type; + _topics_type st_topics; + _topics_type * topics; + uint32_t types_length; + typedef char* _types_type; + _types_type st_types; + _types_type * types; + + TopicsResponse(): + topics_length(0), st_topics(), topics(nullptr), + types_length(0), st_types(), types(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topics_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topics_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->topics_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->topics_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->topics_length); + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + varToArr(outbuffer + offset, length_topicsi); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + *(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; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t topics_lengthT = ((uint32_t) (*(inbuffer + offset))); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->topics_length); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + topics_length = topics_lengthT; + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + arrToVar(length_st_topics, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + 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*)); + } + return offset; + } + + virtual const char * getType() override { return TOPICS; }; + virtual const char * getMD5() override { return "d966d98fc333fa1f3135af765eac1ba8"; }; + + }; + + class Topics { + public: + typedef TopicsRequest Request; + typedef TopicsResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/TopicsAndRawTypes.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/TopicsAndRawTypes.h new file mode 100644 index 000000000..cb5060061 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/TopicsAndRawTypes.h @@ -0,0 +1,181 @@ +#ifndef _ROS_SERVICE_TopicsAndRawTypes_h +#define _ROS_SERVICE_TopicsAndRawTypes_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char TOPICSANDRAWTYPES[] = "rosapi/TopicsAndRawTypes"; + + class TopicsAndRawTypesRequest : public ros::Msg + { + public: + + TopicsAndRawTypesRequest() + { + } + + 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 TOPICSANDRAWTYPES; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TopicsAndRawTypesResponse : public ros::Msg + { + public: + uint32_t topics_length; + typedef char* _topics_type; + _topics_type st_topics; + _topics_type * topics; + uint32_t types_length; + typedef char* _types_type; + _types_type st_types; + _types_type * types; + uint32_t typedefs_full_text_length; + typedef char* _typedefs_full_text_type; + _typedefs_full_text_type st_typedefs_full_text; + _typedefs_full_text_type * typedefs_full_text; + + TopicsAndRawTypesResponse(): + topics_length(0), st_topics(), topics(nullptr), + types_length(0), st_types(), types(nullptr), + typedefs_full_text_length(0), st_typedefs_full_text(), typedefs_full_text(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topics_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topics_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->topics_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->topics_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->topics_length); + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + varToArr(outbuffer + offset, length_topicsi); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + *(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->typedefs_full_text_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->typedefs_full_text_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->typedefs_full_text_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->typedefs_full_text_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->typedefs_full_text_length); + for( uint32_t i = 0; i < typedefs_full_text_length; i++){ + uint32_t length_typedefs_full_texti = strlen(this->typedefs_full_text[i]); + varToArr(outbuffer + offset, length_typedefs_full_texti); + offset += 4; + memcpy(outbuffer + offset, this->typedefs_full_text[i], length_typedefs_full_texti); + offset += length_typedefs_full_texti; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t topics_lengthT = ((uint32_t) (*(inbuffer + offset))); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->topics_length); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + topics_length = topics_lengthT; + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + arrToVar(length_st_topics, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + 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 typedefs_full_text_lengthT = ((uint32_t) (*(inbuffer + offset))); + typedefs_full_text_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + typedefs_full_text_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + typedefs_full_text_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->typedefs_full_text_length); + if(typedefs_full_text_lengthT > typedefs_full_text_length) + this->typedefs_full_text = (char**)realloc(this->typedefs_full_text, typedefs_full_text_lengthT * sizeof(char*)); + typedefs_full_text_length = typedefs_full_text_lengthT; + for( uint32_t i = 0; i < typedefs_full_text_length; i++){ + uint32_t length_st_typedefs_full_text; + arrToVar(length_st_typedefs_full_text, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_typedefs_full_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_typedefs_full_text-1]=0; + this->st_typedefs_full_text = (char *)(inbuffer + offset-1); + offset += length_st_typedefs_full_text; + memcpy( &(this->typedefs_full_text[i]), &(this->st_typedefs_full_text), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return TOPICSANDRAWTYPES; }; + virtual const char * getMD5() override { return "e1432466c8f64316723276ba07c59d12"; }; + + }; + + class TopicsAndRawTypes { + public: + typedef TopicsAndRawTypesRequest Request; + typedef TopicsAndRawTypesResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/TopicsForType.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/TopicsForType.h new file mode 100644 index 000000000..303efe2fe --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/TopicsForType.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_TopicsForType_h +#define _ROS_SERVICE_TopicsForType_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + +static const char TOPICSFORTYPE[] = "rosapi/TopicsForType"; + + class TopicsForTypeRequest : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + + TopicsForTypeRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_type = strlen(this->type); + varToArr(outbuffer + offset, length_type); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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; + return offset; + } + + virtual const char * getType() override { return TOPICSFORTYPE; }; + virtual const char * getMD5() override { return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class TopicsForTypeResponse : public ros::Msg + { + public: + uint32_t topics_length; + typedef char* _topics_type; + _topics_type st_topics; + _topics_type * topics; + + TopicsForTypeResponse(): + topics_length(0), st_topics(), topics(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topics_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topics_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->topics_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->topics_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->topics_length); + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + varToArr(outbuffer + offset, length_topicsi); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t topics_lengthT = ((uint32_t) (*(inbuffer + offset))); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->topics_length); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + topics_length = topics_lengthT; + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + arrToVar(length_st_topics, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return TOPICSFORTYPE; }; + virtual const char * getMD5() override { return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class TopicsForType { + public: + typedef TopicsForTypeRequest Request; + typedef TopicsForTypeResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosapi/TypeDef.h b/smart_device_protocol/ros_lib/ros_lib/rosapi/TypeDef.h new file mode 100644 index 000000000..c0414fd97 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosapi/TypeDef.h @@ -0,0 +1,284 @@ +#ifndef _ROS_rosapi_TypeDef_h +#define _ROS_rosapi_TypeDef_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosapi +{ + + class TypeDef : public ros::Msg + { + public: + typedef const char* _type_type; + _type_type type; + uint32_t fieldnames_length; + typedef char* _fieldnames_type; + _fieldnames_type st_fieldnames; + _fieldnames_type * fieldnames; + uint32_t fieldtypes_length; + typedef char* _fieldtypes_type; + _fieldtypes_type st_fieldtypes; + _fieldtypes_type * fieldtypes; + uint32_t fieldarraylen_length; + typedef int32_t _fieldarraylen_type; + _fieldarraylen_type st_fieldarraylen; + _fieldarraylen_type * fieldarraylen; + uint32_t examples_length; + typedef char* _examples_type; + _examples_type st_examples; + _examples_type * examples; + uint32_t constnames_length; + typedef char* _constnames_type; + _constnames_type st_constnames; + _constnames_type * constnames; + uint32_t constvalues_length; + typedef char* _constvalues_type; + _constvalues_type st_constvalues; + _constvalues_type * constvalues; + + TypeDef(): + type(""), + fieldnames_length(0), st_fieldnames(), fieldnames(nullptr), + fieldtypes_length(0), st_fieldtypes(), fieldtypes(nullptr), + fieldarraylen_length(0), st_fieldarraylen(), fieldarraylen(nullptr), + examples_length(0), st_examples(), examples(nullptr), + constnames_length(0), st_constnames(), constnames(nullptr), + constvalues_length(0), st_constvalues(), constvalues(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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->fieldnames_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fieldnames_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fieldnames_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fieldnames_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->fieldnames_length); + for( uint32_t i = 0; i < fieldnames_length; i++){ + uint32_t length_fieldnamesi = strlen(this->fieldnames[i]); + varToArr(outbuffer + offset, length_fieldnamesi); + offset += 4; + memcpy(outbuffer + offset, this->fieldnames[i], length_fieldnamesi); + offset += length_fieldnamesi; + } + *(outbuffer + offset + 0) = (this->fieldtypes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fieldtypes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fieldtypes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fieldtypes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->fieldtypes_length); + for( uint32_t i = 0; i < fieldtypes_length; i++){ + uint32_t length_fieldtypesi = strlen(this->fieldtypes[i]); + varToArr(outbuffer + offset, length_fieldtypesi); + offset += 4; + memcpy(outbuffer + offset, this->fieldtypes[i], length_fieldtypesi); + offset += length_fieldtypesi; + } + *(outbuffer + offset + 0) = (this->fieldarraylen_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fieldarraylen_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fieldarraylen_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fieldarraylen_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->fieldarraylen_length); + for( uint32_t i = 0; i < fieldarraylen_length; i++){ + union { + int32_t real; + uint32_t base; + } u_fieldarrayleni; + u_fieldarrayleni.real = this->fieldarraylen[i]; + *(outbuffer + offset + 0) = (u_fieldarrayleni.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_fieldarrayleni.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_fieldarrayleni.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_fieldarrayleni.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->fieldarraylen[i]); + } + *(outbuffer + offset + 0) = (this->examples_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->examples_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->examples_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->examples_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->examples_length); + for( uint32_t i = 0; i < examples_length; i++){ + uint32_t length_examplesi = strlen(this->examples[i]); + varToArr(outbuffer + offset, length_examplesi); + offset += 4; + memcpy(outbuffer + offset, this->examples[i], length_examplesi); + offset += length_examplesi; + } + *(outbuffer + offset + 0) = (this->constnames_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->constnames_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->constnames_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->constnames_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->constnames_length); + for( uint32_t i = 0; i < constnames_length; i++){ + uint32_t length_constnamesi = strlen(this->constnames[i]); + varToArr(outbuffer + offset, length_constnamesi); + offset += 4; + memcpy(outbuffer + offset, this->constnames[i], length_constnamesi); + offset += length_constnamesi; + } + *(outbuffer + offset + 0) = (this->constvalues_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->constvalues_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->constvalues_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->constvalues_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->constvalues_length); + for( uint32_t i = 0; i < constvalues_length; i++){ + uint32_t length_constvaluesi = strlen(this->constvalues[i]); + varToArr(outbuffer + offset, length_constvaluesi); + offset += 4; + memcpy(outbuffer + offset, this->constvalues[i], length_constvaluesi); + offset += length_constvaluesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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 fieldnames_lengthT = ((uint32_t) (*(inbuffer + offset))); + fieldnames_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + fieldnames_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + fieldnames_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fieldnames_length); + if(fieldnames_lengthT > fieldnames_length) + this->fieldnames = (char**)realloc(this->fieldnames, fieldnames_lengthT * sizeof(char*)); + fieldnames_length = fieldnames_lengthT; + for( uint32_t i = 0; i < fieldnames_length; i++){ + uint32_t length_st_fieldnames; + arrToVar(length_st_fieldnames, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_fieldnames; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_fieldnames-1]=0; + this->st_fieldnames = (char *)(inbuffer + offset-1); + offset += length_st_fieldnames; + memcpy( &(this->fieldnames[i]), &(this->st_fieldnames), sizeof(char*)); + } + uint32_t fieldtypes_lengthT = ((uint32_t) (*(inbuffer + offset))); + fieldtypes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + fieldtypes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + fieldtypes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fieldtypes_length); + if(fieldtypes_lengthT > fieldtypes_length) + this->fieldtypes = (char**)realloc(this->fieldtypes, fieldtypes_lengthT * sizeof(char*)); + fieldtypes_length = fieldtypes_lengthT; + for( uint32_t i = 0; i < fieldtypes_length; i++){ + uint32_t length_st_fieldtypes; + arrToVar(length_st_fieldtypes, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_fieldtypes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_fieldtypes-1]=0; + this->st_fieldtypes = (char *)(inbuffer + offset-1); + offset += length_st_fieldtypes; + memcpy( &(this->fieldtypes[i]), &(this->st_fieldtypes), sizeof(char*)); + } + uint32_t fieldarraylen_lengthT = ((uint32_t) (*(inbuffer + offset))); + fieldarraylen_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + fieldarraylen_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + fieldarraylen_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fieldarraylen_length); + if(fieldarraylen_lengthT > fieldarraylen_length) + this->fieldarraylen = (int32_t*)realloc(this->fieldarraylen, fieldarraylen_lengthT * sizeof(int32_t)); + fieldarraylen_length = fieldarraylen_lengthT; + for( uint32_t i = 0; i < fieldarraylen_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_fieldarraylen; + u_st_fieldarraylen.base = 0; + u_st_fieldarraylen.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_fieldarraylen.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_fieldarraylen.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_fieldarraylen.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_fieldarraylen = u_st_fieldarraylen.real; + offset += sizeof(this->st_fieldarraylen); + memcpy( &(this->fieldarraylen[i]), &(this->st_fieldarraylen), sizeof(int32_t)); + } + uint32_t examples_lengthT = ((uint32_t) (*(inbuffer + offset))); + examples_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + examples_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + examples_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->examples_length); + if(examples_lengthT > examples_length) + this->examples = (char**)realloc(this->examples, examples_lengthT * sizeof(char*)); + examples_length = examples_lengthT; + for( uint32_t i = 0; i < examples_length; i++){ + uint32_t length_st_examples; + arrToVar(length_st_examples, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_examples; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_examples-1]=0; + this->st_examples = (char *)(inbuffer + offset-1); + offset += length_st_examples; + memcpy( &(this->examples[i]), &(this->st_examples), sizeof(char*)); + } + uint32_t constnames_lengthT = ((uint32_t) (*(inbuffer + offset))); + constnames_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + constnames_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + constnames_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->constnames_length); + if(constnames_lengthT > constnames_length) + this->constnames = (char**)realloc(this->constnames, constnames_lengthT * sizeof(char*)); + constnames_length = constnames_lengthT; + for( uint32_t i = 0; i < constnames_length; i++){ + uint32_t length_st_constnames; + arrToVar(length_st_constnames, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_constnames; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_constnames-1]=0; + this->st_constnames = (char *)(inbuffer + offset-1); + offset += length_st_constnames; + memcpy( &(this->constnames[i]), &(this->st_constnames), sizeof(char*)); + } + uint32_t constvalues_lengthT = ((uint32_t) (*(inbuffer + offset))); + constvalues_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + constvalues_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + constvalues_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->constvalues_length); + if(constvalues_lengthT > constvalues_length) + this->constvalues = (char**)realloc(this->constvalues, constvalues_lengthT * sizeof(char*)); + constvalues_length = constvalues_lengthT; + for( uint32_t i = 0; i < constvalues_length; i++){ + uint32_t length_st_constvalues; + arrToVar(length_st_constvalues, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_constvalues; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_constvalues-1]=0; + this->st_constvalues = (char *)(inbuffer + offset-1); + offset += length_st_constvalues; + memcpy( &(this->constvalues[i]), &(this->st_constvalues), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "rosapi/TypeDef"; }; + virtual const char * getMD5() override { return "80597571d79bbeef6c9c4d98f30116a0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosauth/Authentication.h b/smart_device_protocol/ros_lib/ros_lib/rosauth/Authentication.h new file mode 100644 index 000000000..b01fcfcf6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosauth/Authentication.h @@ -0,0 +1,220 @@ +#ifndef _ROS_SERVICE_Authentication_h +#define _ROS_SERVICE_Authentication_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace rosauth +{ + +static const char AUTHENTICATION[] = "rosauth/Authentication"; + + class AuthenticationRequest : public ros::Msg + { + public: + typedef const char* _mac_type; + _mac_type mac; + typedef const char* _client_type; + _client_type client; + typedef const char* _dest_type; + _dest_type dest; + typedef const char* _rand_type; + _rand_type rand; + typedef ros::Time _t_type; + _t_type t; + typedef const char* _level_type; + _level_type level; + typedef ros::Time _end_type; + _end_type end; + + AuthenticationRequest(): + mac(""), + client(""), + dest(""), + rand(""), + t(), + level(""), + end() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_mac = strlen(this->mac); + varToArr(outbuffer + offset, length_mac); + offset += 4; + memcpy(outbuffer + offset, this->mac, length_mac); + offset += length_mac; + uint32_t length_client = strlen(this->client); + varToArr(outbuffer + offset, length_client); + offset += 4; + memcpy(outbuffer + offset, this->client, length_client); + offset += length_client; + uint32_t length_dest = strlen(this->dest); + varToArr(outbuffer + offset, length_dest); + offset += 4; + memcpy(outbuffer + offset, this->dest, length_dest); + offset += length_dest; + uint32_t length_rand = strlen(this->rand); + varToArr(outbuffer + offset, length_rand); + offset += 4; + memcpy(outbuffer + offset, this->rand, length_rand); + offset += length_rand; + *(outbuffer + offset + 0) = (this->t.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->t.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->t.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->t.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->t.sec); + *(outbuffer + offset + 0) = (this->t.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->t.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->t.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->t.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->t.nsec); + uint32_t length_level = strlen(this->level); + varToArr(outbuffer + offset, length_level); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + *(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; + uint32_t length_mac; + arrToVar(length_mac, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mac; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mac-1]=0; + this->mac = (char *)(inbuffer + offset-1); + offset += length_mac; + uint32_t length_client; + arrToVar(length_client, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_client; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_client-1]=0; + this->client = (char *)(inbuffer + offset-1); + offset += length_client; + uint32_t length_dest; + arrToVar(length_dest, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dest; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dest-1]=0; + this->dest = (char *)(inbuffer + offset-1); + offset += length_dest; + uint32_t length_rand; + arrToVar(length_rand, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_rand; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_rand-1]=0; + this->rand = (char *)(inbuffer + offset-1); + offset += length_rand; + this->t.sec = ((uint32_t) (*(inbuffer + offset))); + this->t.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->t.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->t.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->t.sec); + this->t.nsec = ((uint32_t) (*(inbuffer + offset))); + this->t.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->t.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->t.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->t.nsec); + uint32_t length_level; + arrToVar(length_level, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + 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 AUTHENTICATION; }; + virtual const char * getMD5() override { return "cad474945b8be70807460ba22a018b32"; }; + + }; + + class AuthenticationResponse : public ros::Msg + { + public: + typedef bool _authenticated_type; + _authenticated_type authenticated; + + AuthenticationResponse(): + authenticated(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_authenticated; + u_authenticated.real = this->authenticated; + *(outbuffer + offset + 0) = (u_authenticated.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->authenticated); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_authenticated; + u_authenticated.base = 0; + u_authenticated.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->authenticated = u_authenticated.real; + offset += sizeof(this->authenticated); + return offset; + } + + virtual const char * getType() override { return AUTHENTICATION; }; + virtual const char * getMD5() override { return "7eb9cf569b3e4581e3eff49da1ca4f39"; }; + + }; + + class Authentication { + public: + typedef AuthenticationRequest Request; + typedef AuthenticationResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosbridge_msgs/ConnectedClient.h b/smart_device_protocol/ros_lib/ros_lib/rosbridge_msgs/ConnectedClient.h new file mode 100644 index 000000000..e32e58b10 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosbridge_msgs/ConnectedClient.h @@ -0,0 +1,79 @@ +#ifndef _ROS_rosbridge_msgs_ConnectedClient_h +#define _ROS_rosbridge_msgs_ConnectedClient_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace rosbridge_msgs +{ + + class ConnectedClient : public ros::Msg + { + public: + typedef const char* _ip_address_type; + _ip_address_type ip_address; + typedef ros::Time _connection_time_type; + _connection_time_type connection_time; + + ConnectedClient(): + ip_address(""), + connection_time() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_ip_address = strlen(this->ip_address); + varToArr(outbuffer + offset, length_ip_address); + offset += 4; + memcpy(outbuffer + offset, this->ip_address, length_ip_address); + offset += length_ip_address; + *(outbuffer + offset + 0) = (this->connection_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->connection_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->connection_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->connection_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->connection_time.sec); + *(outbuffer + offset + 0) = (this->connection_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->connection_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->connection_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->connection_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->connection_time.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_ip_address; + arrToVar(length_ip_address, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ip_address; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ip_address-1]=0; + this->ip_address = (char *)(inbuffer + offset-1); + offset += length_ip_address; + this->connection_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->connection_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->connection_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->connection_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->connection_time.sec); + this->connection_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->connection_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->connection_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->connection_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->connection_time.nsec); + return offset; + } + + virtual const char * getType() override { return "rosbridge_msgs/ConnectedClient"; }; + virtual const char * getMD5() override { return "7f2187ce389b39b2b3bb2a3957e54c04"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosbridge_msgs/ConnectedClients.h b/smart_device_protocol/ros_lib/ros_lib/rosbridge_msgs/ConnectedClients.h new file mode 100644 index 000000000..79d11d2d7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosbridge_msgs/ConnectedClients.h @@ -0,0 +1,64 @@ +#ifndef _ROS_rosbridge_msgs_ConnectedClients_h +#define _ROS_rosbridge_msgs_ConnectedClients_h + +#include +#include +#include +#include "ros/msg.h" +#include "rosbridge_msgs/ConnectedClient.h" + +namespace rosbridge_msgs +{ + + class ConnectedClients : public ros::Msg + { + public: + uint32_t clients_length; + typedef rosbridge_msgs::ConnectedClient _clients_type; + _clients_type st_clients; + _clients_type * clients; + + ConnectedClients(): + clients_length(0), st_clients(), clients(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->clients_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clients_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clients_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clients_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->clients_length); + for( uint32_t i = 0; i < clients_length; i++){ + offset += this->clients[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t clients_lengthT = ((uint32_t) (*(inbuffer + offset))); + clients_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + clients_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + clients_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clients_length); + if(clients_lengthT > clients_length) + this->clients = (rosbridge_msgs::ConnectedClient*)realloc(this->clients, clients_lengthT * sizeof(rosbridge_msgs::ConnectedClient)); + clients_length = clients_lengthT; + for( uint32_t i = 0; i < clients_length; i++){ + offset += this->st_clients.deserialize(inbuffer + offset); + memcpy( &(this->clients[i]), &(this->st_clients), sizeof(rosbridge_msgs::ConnectedClient)); + } + return offset; + } + + virtual const char * getType() override { return "rosbridge_msgs/ConnectedClients"; }; + virtual const char * getMD5() override { return "d0d53b0c0aa23aa7e4cf52f49bca4b69"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roscpp/Empty.h b/smart_device_protocol/ros_lib/ros_lib/roscpp/Empty.h new file mode 100644 index 000000000..f612e403a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roscpp/Empty.h @@ -0,0 +1,70 @@ +#ifndef _ROS_SERVICE_Empty_h +#define _ROS_SERVICE_Empty_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + +static const char EMPTY[] = "roscpp/Empty"; + + class EmptyRequest : public ros::Msg + { + public: + + EmptyRequest() + { + } + + 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 EMPTY; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + EmptyResponse() + { + } + + 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 EMPTY; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roscpp/GetLoggers.h b/smart_device_protocol/ros_lib/ros_lib/roscpp/GetLoggers.h new file mode 100644 index 000000000..3b2425c09 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roscpp/GetLoggers.h @@ -0,0 +1,96 @@ +#ifndef _ROS_SERVICE_GetLoggers_h +#define _ROS_SERVICE_GetLoggers_h +#include +#include +#include +#include "ros/msg.h" +#include "roscpp/Logger.h" + +namespace roscpp +{ + +static const char GETLOGGERS[] = "roscpp/GetLoggers"; + + class GetLoggersRequest : public ros::Msg + { + public: + + GetLoggersRequest() + { + } + + 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 GETLOGGERS; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetLoggersResponse : public ros::Msg + { + public: + uint32_t loggers_length; + typedef roscpp::Logger _loggers_type; + _loggers_type st_loggers; + _loggers_type * loggers; + + GetLoggersResponse(): + loggers_length(0), st_loggers(), loggers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->loggers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->loggers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->loggers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->loggers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->loggers_length); + for( uint32_t i = 0; i < loggers_length; i++){ + offset += this->loggers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t loggers_lengthT = ((uint32_t) (*(inbuffer + offset))); + loggers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + loggers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + loggers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->loggers_length); + if(loggers_lengthT > loggers_length) + this->loggers = (roscpp::Logger*)realloc(this->loggers, loggers_lengthT * sizeof(roscpp::Logger)); + loggers_length = loggers_lengthT; + for( uint32_t i = 0; i < loggers_length; i++){ + offset += this->st_loggers.deserialize(inbuffer + offset); + memcpy( &(this->loggers[i]), &(this->st_loggers), sizeof(roscpp::Logger)); + } + return offset; + } + + virtual const char * getType() override { return GETLOGGERS; }; + virtual const char * getMD5() override { return "32e97e85527d4678a8f9279894bb64b0"; }; + + }; + + class GetLoggers { + public: + typedef GetLoggersRequest Request; + typedef GetLoggersResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roscpp/Logger.h b/smart_device_protocol/ros_lib/ros_lib/roscpp/Logger.h new file mode 100644 index 000000000..a9f55da5c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roscpp/Logger.h @@ -0,0 +1,72 @@ +#ifndef _ROS_roscpp_Logger_h +#define _ROS_roscpp_Logger_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + + class Logger : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _level_type; + _level_type level; + + Logger(): + name(""), + level("") + { + } + + 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_level = strlen(this->level); + varToArr(outbuffer + offset, length_level); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + 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_level; + arrToVar(length_level, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + virtual const char * getType() override { return "roscpp/Logger"; }; + virtual const char * getMD5() override { return "a6069a2ff40db7bd32143dd66e1f408e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roscpp/SetLoggerLevel.h b/smart_device_protocol/ros_lib/ros_lib/roscpp/SetLoggerLevel.h new file mode 100644 index 000000000..bbee8b3e8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roscpp/SetLoggerLevel.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_SetLoggerLevel_h +#define _ROS_SERVICE_SetLoggerLevel_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + +static const char SETLOGGERLEVEL[] = "roscpp/SetLoggerLevel"; + + class SetLoggerLevelRequest : public ros::Msg + { + public: + typedef const char* _logger_type; + _logger_type logger; + typedef const char* _level_type; + _level_type level; + + SetLoggerLevelRequest(): + logger(""), + level("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_logger = strlen(this->logger); + varToArr(outbuffer + offset, length_logger); + offset += 4; + memcpy(outbuffer + offset, this->logger, length_logger); + offset += length_logger; + uint32_t length_level = strlen(this->level); + varToArr(outbuffer + offset, length_level); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_logger; + arrToVar(length_logger, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_logger; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_logger-1]=0; + this->logger = (char *)(inbuffer + offset-1); + offset += length_logger; + uint32_t length_level; + arrToVar(length_level, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + virtual const char * getType() override { return SETLOGGERLEVEL; }; + virtual const char * getMD5() override { return "51da076440d78ca1684d36c868df61ea"; }; + + }; + + class SetLoggerLevelResponse : public ros::Msg + { + public: + + SetLoggerLevelResponse() + { + } + + 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 SETLOGGERLEVEL; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetLoggerLevel { + public: + typedef SetLoggerLevelRequest Request; + typedef SetLoggerLevelResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roscpp_tutorials/TwoInts.h b/smart_device_protocol/ros_lib/ros_lib/roscpp_tutorials/TwoInts.h new file mode 100644 index 000000000..1ae3a176c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roscpp_tutorials/TwoInts.h @@ -0,0 +1,166 @@ +#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/smart_device_protocol/ros_lib/ros_lib/roseus/AddTwoInts.h b/smart_device_protocol/ros_lib/ros_lib/roseus/AddTwoInts.h new file mode 100644 index 000000000..2812682b1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus/AddTwoInts.h @@ -0,0 +1,166 @@ +#ifndef _ROS_SERVICE_AddTwoInts_h +#define _ROS_SERVICE_AddTwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace roseus +{ + +static const char ADDTWOINTS[] = "roseus/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/smart_device_protocol/ros_lib/ros_lib/roseus/FixedArray.h b/smart_device_protocol/ros_lib/ros_lib/roseus/FixedArray.h new file mode 100644 index 000000000..7a8ec5230 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus/FixedArray.h @@ -0,0 +1,325 @@ +#ifndef _ROS_roseus_FixedArray_h +#define _ROS_roseus_FixedArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" +#include "std_msgs/String.h" + +namespace roseus +{ + + class FixedArray : public ros::Msg + { + public: + float float32_data[3]; + float float64_data[3]; + int16_t int16_data[3]; + int32_t int32_data[3]; + int64_t int64_data[3]; + int8_t int8_data[3]; + uint16_t uint16_data[3]; + uint32_t uint32_data[3]; + uint64_t uint64_data[3]; + uint8_t uint8_data[17]; + bool bool_data[2]; + ros::Time time_data[2]; + ros::Duration duration_data[2]; + std_msgs::String string_data[2]; + + FixedArray(): + float32_data(), + float64_data(), + int16_data(), + int32_data(), + int64_data(), + int8_data(), + uint16_data(), + uint32_data(), + uint64_data(), + uint8_data(), + bool_data(), + time_data(), + duration_data(), + string_data() + { + } + + 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_float32_datai; + u_float32_datai.real = this->float32_data[i]; + *(outbuffer + offset + 0) = (u_float32_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_float32_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_float32_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_float32_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->float32_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->float64_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + union { + int16_t real; + uint16_t base; + } u_int16_datai; + u_int16_datai.real = this->int16_data[i]; + *(outbuffer + offset + 0) = (u_int16_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_int16_datai.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->int16_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + union { + int32_t real; + uint32_t base; + } u_int32_datai; + u_int32_datai.real = this->int32_data[i]; + *(outbuffer + offset + 0) = (u_int32_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_int32_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_int32_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_int32_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->int32_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + union { + int64_t real; + uint64_t base; + } u_int64_datai; + u_int64_datai.real = this->int64_data[i]; + *(outbuffer + offset + 0) = (u_int64_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_int64_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_int64_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_int64_datai.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_int64_datai.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_int64_datai.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_int64_datai.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_int64_datai.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->int64_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + union { + int8_t real; + uint8_t base; + } u_int8_datai; + u_int8_datai.real = this->int8_data[i]; + *(outbuffer + offset + 0) = (u_int8_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->int8_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + *(outbuffer + offset + 0) = (this->uint16_data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint16_data[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->uint16_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + *(outbuffer + offset + 0) = (this->uint32_data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint32_data[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint32_data[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint32_data[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->uint32_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + *(outbuffer + offset + 0) = (this->uint64_data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint64_data[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint64_data[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint64_data[i] >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->uint64_data[i] >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->uint64_data[i] >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->uint64_data[i] >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->uint64_data[i] >> (8 * 7)) & 0xFF; + offset += sizeof(this->uint64_data[i]); + } + for( uint32_t i = 0; i < 17; i++){ + *(outbuffer + offset + 0) = (this->uint8_data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->uint8_data[i]); + } + for( uint32_t i = 0; i < 2; i++){ + union { + bool real; + uint8_t base; + } u_bool_datai; + u_bool_datai.real = this->bool_data[i]; + *(outbuffer + offset + 0) = (u_bool_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->bool_data[i]); + } + for( uint32_t i = 0; i < 2; i++){ + *(outbuffer + offset + 0) = (this->time_data[i].sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_data[i].sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_data[i].sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_data[i].sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_data[i].sec); + *(outbuffer + offset + 0) = (this->time_data[i].nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_data[i].nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_data[i].nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_data[i].nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_data[i].nsec); + } + for( uint32_t i = 0; i < 2; i++){ + *(outbuffer + offset + 0) = (this->duration_data[i].sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration_data[i].sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration_data[i].sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration_data[i].sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration_data[i].sec); + *(outbuffer + offset + 0) = (this->duration_data[i].nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration_data[i].nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration_data[i].nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration_data[i].nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration_data[i].nsec); + } + for( uint32_t i = 0; i < 2; i++){ + offset += this->string_data[i].serialize(outbuffer + offset); + } + 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_float32_datai; + u_float32_datai.base = 0; + u_float32_datai.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_float32_datai.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_float32_datai.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_float32_datai.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->float32_data[i] = u_float32_datai.real; + offset += sizeof(this->float32_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->float64_data[i])); + } + for( uint32_t i = 0; i < 3; i++){ + union { + int16_t real; + uint16_t base; + } u_int16_datai; + u_int16_datai.base = 0; + u_int16_datai.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_int16_datai.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->int16_data[i] = u_int16_datai.real; + offset += sizeof(this->int16_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + union { + int32_t real; + uint32_t base; + } u_int32_datai; + u_int32_datai.base = 0; + u_int32_datai.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_int32_datai.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_int32_datai.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_int32_datai.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->int32_data[i] = u_int32_datai.real; + offset += sizeof(this->int32_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + union { + int64_t real; + uint64_t base; + } u_int64_datai; + u_int64_datai.base = 0; + u_int64_datai.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_int64_datai.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_int64_datai.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_int64_datai.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_int64_datai.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_int64_datai.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_int64_datai.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_int64_datai.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->int64_data[i] = u_int64_datai.real; + offset += sizeof(this->int64_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + union { + int8_t real; + uint8_t base; + } u_int8_datai; + u_int8_datai.base = 0; + u_int8_datai.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->int8_data[i] = u_int8_datai.real; + offset += sizeof(this->int8_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + this->uint16_data[i] = ((uint16_t) (*(inbuffer + offset))); + this->uint16_data[i] |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->uint16_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + this->uint32_data[i] = ((uint32_t) (*(inbuffer + offset))); + this->uint32_data[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->uint32_data[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->uint32_data[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->uint32_data[i]); + } + for( uint32_t i = 0; i < 3; i++){ + this->uint64_data[i] = ((uint64_t) (*(inbuffer + offset))); + this->uint64_data[i] |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->uint64_data[i] |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->uint64_data[i] |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->uint64_data[i] |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->uint64_data[i] |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->uint64_data[i] |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->uint64_data[i] |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->uint64_data[i]); + } + for( uint32_t i = 0; i < 17; i++){ + this->uint8_data[i] = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->uint8_data[i]); + } + for( uint32_t i = 0; i < 2; i++){ + union { + bool real; + uint8_t base; + } u_bool_datai; + u_bool_datai.base = 0; + u_bool_datai.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->bool_data[i] = u_bool_datai.real; + offset += sizeof(this->bool_data[i]); + } + for( uint32_t i = 0; i < 2; i++){ + this->time_data[i].sec = ((uint32_t) (*(inbuffer + offset))); + this->time_data[i].sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_data[i].sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_data[i].sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_data[i].sec); + this->time_data[i].nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_data[i].nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_data[i].nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_data[i].nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_data[i].nsec); + } + for( uint32_t i = 0; i < 2; i++){ + this->duration_data[i].sec = ((uint32_t) (*(inbuffer + offset))); + this->duration_data[i].sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration_data[i].sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration_data[i].sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration_data[i].sec); + this->duration_data[i].nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration_data[i].nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration_data[i].nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration_data[i].nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration_data[i].nsec); + } + for( uint32_t i = 0; i < 2; i++){ + offset += this->string_data[i].deserialize(inbuffer + offset); + } + return offset; + } + + virtual const char * getType() override { return "roseus/FixedArray"; }; + virtual const char * getMD5() override { return "6b30ccf11bc7409743664778a763a8c9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus/String.h b/smart_device_protocol/ros_lib/ros_lib/roseus/String.h new file mode 100644 index 000000000..b94723cb8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus/String.h @@ -0,0 +1,55 @@ +#ifndef _ROS_roseus_String_h +#define _ROS_roseus_String_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roseus +{ + + class String : public ros::Msg + { + public: + typedef const char* _data_type; + _data_type data; + + String(): + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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; + 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 "roseus/String"; }; + virtual const char * getMD5() override { return "992ce8a1687cec8c8bd883ec73ca41d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus/StringStamped.h b/smart_device_protocol/ros_lib/ros_lib/roseus/StringStamped.h new file mode 100644 index 000000000..6a7bc894d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus/StringStamped.h @@ -0,0 +1,61 @@ +#ifndef _ROS_roseus_StringStamped_h +#define _ROS_roseus_StringStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace roseus +{ + + class StringStamped : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _data_type; + _data_type data; + + StringStamped(): + 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 "roseus/StringStamped"; }; + virtual const char * getMD5() override { return "c99a9440709e4d4a9716d55b8270d5e7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus/StringString.h b/smart_device_protocol/ros_lib/ros_lib/roseus/StringString.h new file mode 100644 index 000000000..80f383d7c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus/StringString.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_StringString_h +#define _ROS_SERVICE_StringString_h +#include +#include +#include +#include "ros/msg.h" + +namespace roseus +{ + +static const char STRINGSTRING[] = "roseus/StringString"; + + class StringStringRequest : public ros::Msg + { + public: + typedef const char* _str_type; + _str_type str; + + StringStringRequest(): + str("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_str = strlen(this->str); + varToArr(outbuffer + offset, length_str); + offset += 4; + memcpy(outbuffer + offset, this->str, length_str); + offset += length_str; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_str; + arrToVar(length_str, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_str; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_str-1]=0; + this->str = (char *)(inbuffer + offset-1); + offset += length_str; + return offset; + } + + virtual const char * getType() override { return STRINGSTRING; }; + virtual const char * getMD5() override { return "994972b6e03928b2476860ce6c4c8e17"; }; + + }; + + class StringStringResponse : public ros::Msg + { + public: + typedef const char* _str_type; + _str_type str; + + StringStringResponse(): + str("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_str = strlen(this->str); + varToArr(outbuffer + offset, length_str); + offset += 4; + memcpy(outbuffer + offset, this->str, length_str); + offset += length_str; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_str; + arrToVar(length_str, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_str; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_str-1]=0; + this->str = (char *)(inbuffer + offset-1); + offset += length_str; + return offset; + } + + virtual const char * getType() override { return STRINGSTRING; }; + virtual const char * getMD5() override { return "994972b6e03928b2476860ce6c4c8e17"; }; + + }; + + class StringString { + public: + typedef StringStringRequest Request; + typedef StringStringResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus/TestName.h b/smart_device_protocol/ros_lib/ros_lib/roseus/TestName.h new file mode 100644 index 000000000..8193994a7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus/TestName.h @@ -0,0 +1,44 @@ +#ifndef _ROS_roseus_TestName_h +#define _ROS_roseus_TestName_h + +#include +#include +#include +#include "ros/msg.h" +#include "roseus/StringStamped.h" + +namespace roseus +{ + + class TestName : public ros::Msg + { + public: + typedef roseus::StringStamped _name_type; + _name_type name; + + TestName(): + name() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->name.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->name.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "roseus/TestName"; }; + virtual const char * getMD5() override { return "70bc7fd92cd8428f6a02d7d0df4d9b80"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus/VariableArray.h b/smart_device_protocol/ros_lib/ros_lib/roseus/VariableArray.h new file mode 100644 index 000000000..102bdc2cb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus/VariableArray.h @@ -0,0 +1,563 @@ +#ifndef _ROS_roseus_VariableArray_h +#define _ROS_roseus_VariableArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" +#include "std_msgs/String.h" + +namespace roseus +{ + + class VariableArray : public ros::Msg + { + public: + uint32_t float32_data_length; + typedef float _float32_data_type; + _float32_data_type st_float32_data; + _float32_data_type * float32_data; + uint32_t float64_data_length; + typedef float _float64_data_type; + _float64_data_type st_float64_data; + _float64_data_type * float64_data; + uint32_t int16_data_length; + typedef int16_t _int16_data_type; + _int16_data_type st_int16_data; + _int16_data_type * int16_data; + uint32_t int32_data_length; + typedef int32_t _int32_data_type; + _int32_data_type st_int32_data; + _int32_data_type * int32_data; + uint32_t int64_data_length; + typedef int64_t _int64_data_type; + _int64_data_type st_int64_data; + _int64_data_type * int64_data; + uint32_t int8_data_length; + typedef int8_t _int8_data_type; + _int8_data_type st_int8_data; + _int8_data_type * int8_data; + uint32_t uint16_data_length; + typedef uint16_t _uint16_data_type; + _uint16_data_type st_uint16_data; + _uint16_data_type * uint16_data; + uint32_t uint32_data_length; + typedef uint32_t _uint32_data_type; + _uint32_data_type st_uint32_data; + _uint32_data_type * uint32_data; + uint32_t uint64_data_length; + typedef uint64_t _uint64_data_type; + _uint64_data_type st_uint64_data; + _uint64_data_type * uint64_data; + uint32_t uint8_data_length; + typedef uint8_t _uint8_data_type; + _uint8_data_type st_uint8_data; + _uint8_data_type * uint8_data; + uint32_t bool_data_length; + typedef bool _bool_data_type; + _bool_data_type st_bool_data; + _bool_data_type * bool_data; + uint32_t time_data_length; + typedef ros::Time _time_data_type; + _time_data_type st_time_data; + _time_data_type * time_data; + uint32_t duration_data_length; + typedef ros::Duration _duration_data_type; + _duration_data_type st_duration_data; + _duration_data_type * duration_data; + uint32_t string_data_length; + typedef std_msgs::String _string_data_type; + _string_data_type st_string_data; + _string_data_type * string_data; + + VariableArray(): + float32_data_length(0), st_float32_data(), float32_data(nullptr), + float64_data_length(0), st_float64_data(), float64_data(nullptr), + int16_data_length(0), st_int16_data(), int16_data(nullptr), + int32_data_length(0), st_int32_data(), int32_data(nullptr), + int64_data_length(0), st_int64_data(), int64_data(nullptr), + int8_data_length(0), st_int8_data(), int8_data(nullptr), + uint16_data_length(0), st_uint16_data(), uint16_data(nullptr), + uint32_data_length(0), st_uint32_data(), uint32_data(nullptr), + uint64_data_length(0), st_uint64_data(), uint64_data(nullptr), + uint8_data_length(0), st_uint8_data(), uint8_data(nullptr), + bool_data_length(0), st_bool_data(), bool_data(nullptr), + time_data_length(0), st_time_data(), time_data(nullptr), + duration_data_length(0), st_duration_data(), duration_data(nullptr), + string_data_length(0), st_string_data(), string_data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->float32_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->float32_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->float32_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->float32_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->float32_data_length); + for( uint32_t i = 0; i < float32_data_length; i++){ + union { + float real; + uint32_t base; + } u_float32_datai; + u_float32_datai.real = this->float32_data[i]; + *(outbuffer + offset + 0) = (u_float32_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_float32_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_float32_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_float32_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->float32_data[i]); + } + *(outbuffer + offset + 0) = (this->float64_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->float64_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->float64_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->float64_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->float64_data_length); + for( uint32_t i = 0; i < float64_data_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->float64_data[i]); + } + *(outbuffer + offset + 0) = (this->int16_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->int16_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->int16_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->int16_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->int16_data_length); + for( uint32_t i = 0; i < int16_data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_int16_datai; + u_int16_datai.real = this->int16_data[i]; + *(outbuffer + offset + 0) = (u_int16_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_int16_datai.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->int16_data[i]); + } + *(outbuffer + offset + 0) = (this->int32_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->int32_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->int32_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->int32_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->int32_data_length); + for( uint32_t i = 0; i < int32_data_length; i++){ + union { + int32_t real; + uint32_t base; + } u_int32_datai; + u_int32_datai.real = this->int32_data[i]; + *(outbuffer + offset + 0) = (u_int32_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_int32_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_int32_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_int32_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->int32_data[i]); + } + *(outbuffer + offset + 0) = (this->int64_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->int64_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->int64_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->int64_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->int64_data_length); + for( uint32_t i = 0; i < int64_data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_int64_datai; + u_int64_datai.real = this->int64_data[i]; + *(outbuffer + offset + 0) = (u_int64_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_int64_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_int64_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_int64_datai.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_int64_datai.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_int64_datai.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_int64_datai.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_int64_datai.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->int64_data[i]); + } + *(outbuffer + offset + 0) = (this->int8_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->int8_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->int8_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->int8_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->int8_data_length); + for( uint32_t i = 0; i < int8_data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_int8_datai; + u_int8_datai.real = this->int8_data[i]; + *(outbuffer + offset + 0) = (u_int8_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->int8_data[i]); + } + *(outbuffer + offset + 0) = (this->uint16_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint16_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint16_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint16_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->uint16_data_length); + for( uint32_t i = 0; i < uint16_data_length; i++){ + *(outbuffer + offset + 0) = (this->uint16_data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint16_data[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->uint16_data[i]); + } + *(outbuffer + offset + 0) = (this->uint32_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint32_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint32_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint32_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->uint32_data_length); + for( uint32_t i = 0; i < uint32_data_length; i++){ + *(outbuffer + offset + 0) = (this->uint32_data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint32_data[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint32_data[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint32_data[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->uint32_data[i]); + } + *(outbuffer + offset + 0) = (this->uint64_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint64_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint64_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint64_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->uint64_data_length); + for( uint32_t i = 0; i < uint64_data_length; i++){ + *(outbuffer + offset + 0) = (this->uint64_data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint64_data[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint64_data[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint64_data[i] >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->uint64_data[i] >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->uint64_data[i] >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->uint64_data[i] >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->uint64_data[i] >> (8 * 7)) & 0xFF; + offset += sizeof(this->uint64_data[i]); + } + *(outbuffer + offset + 0) = (this->uint8_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->uint8_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->uint8_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->uint8_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->uint8_data_length); + for( uint32_t i = 0; i < uint8_data_length; i++){ + *(outbuffer + offset + 0) = (this->uint8_data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->uint8_data[i]); + } + *(outbuffer + offset + 0) = (this->bool_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->bool_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->bool_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->bool_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->bool_data_length); + for( uint32_t i = 0; i < bool_data_length; i++){ + union { + bool real; + uint8_t base; + } u_bool_datai; + u_bool_datai.real = this->bool_data[i]; + *(outbuffer + offset + 0) = (u_bool_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->bool_data[i]); + } + *(outbuffer + offset + 0) = (this->time_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_data_length); + for( uint32_t i = 0; i < time_data_length; i++){ + *(outbuffer + offset + 0) = (this->time_data[i].sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_data[i].sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_data[i].sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_data[i].sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_data[i].sec); + *(outbuffer + offset + 0) = (this->time_data[i].nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_data[i].nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_data[i].nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_data[i].nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_data[i].nsec); + } + *(outbuffer + offset + 0) = (this->duration_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration_data_length); + for( uint32_t i = 0; i < duration_data_length; i++){ + *(outbuffer + offset + 0) = (this->duration_data[i].sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration_data[i].sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration_data[i].sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration_data[i].sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration_data[i].sec); + *(outbuffer + offset + 0) = (this->duration_data[i].nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration_data[i].nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration_data[i].nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration_data[i].nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration_data[i].nsec); + } + *(outbuffer + offset + 0) = (this->string_data_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->string_data_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->string_data_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->string_data_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->string_data_length); + for( uint32_t i = 0; i < string_data_length; i++){ + offset += this->string_data[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t float32_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + float32_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + float32_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + float32_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->float32_data_length); + if(float32_data_lengthT > float32_data_length) + this->float32_data = (float*)realloc(this->float32_data, float32_data_lengthT * sizeof(float)); + float32_data_length = float32_data_lengthT; + for( uint32_t i = 0; i < float32_data_length; i++){ + union { + float real; + uint32_t base; + } u_st_float32_data; + u_st_float32_data.base = 0; + u_st_float32_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_float32_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_float32_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_float32_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_float32_data = u_st_float32_data.real; + offset += sizeof(this->st_float32_data); + memcpy( &(this->float32_data[i]), &(this->st_float32_data), sizeof(float)); + } + uint32_t float64_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + float64_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + float64_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + float64_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->float64_data_length); + if(float64_data_lengthT > float64_data_length) + this->float64_data = (float*)realloc(this->float64_data, float64_data_lengthT * sizeof(float)); + float64_data_length = float64_data_lengthT; + for( uint32_t i = 0; i < float64_data_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_float64_data)); + memcpy( &(this->float64_data[i]), &(this->st_float64_data), sizeof(float)); + } + uint32_t int16_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + int16_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + int16_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + int16_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->int16_data_length); + if(int16_data_lengthT > int16_data_length) + this->int16_data = (int16_t*)realloc(this->int16_data, int16_data_lengthT * sizeof(int16_t)); + int16_data_length = int16_data_lengthT; + for( uint32_t i = 0; i < int16_data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_st_int16_data; + u_st_int16_data.base = 0; + u_st_int16_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_int16_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_int16_data = u_st_int16_data.real; + offset += sizeof(this->st_int16_data); + memcpy( &(this->int16_data[i]), &(this->st_int16_data), sizeof(int16_t)); + } + uint32_t int32_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + int32_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + int32_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + int32_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->int32_data_length); + if(int32_data_lengthT > int32_data_length) + this->int32_data = (int32_t*)realloc(this->int32_data, int32_data_lengthT * sizeof(int32_t)); + int32_data_length = int32_data_lengthT; + for( uint32_t i = 0; i < int32_data_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_int32_data; + u_st_int32_data.base = 0; + u_st_int32_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_int32_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_int32_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_int32_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_int32_data = u_st_int32_data.real; + offset += sizeof(this->st_int32_data); + memcpy( &(this->int32_data[i]), &(this->st_int32_data), sizeof(int32_t)); + } + uint32_t int64_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + int64_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + int64_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + int64_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->int64_data_length); + if(int64_data_lengthT > int64_data_length) + this->int64_data = (int64_t*)realloc(this->int64_data, int64_data_lengthT * sizeof(int64_t)); + int64_data_length = int64_data_lengthT; + for( uint32_t i = 0; i < int64_data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_st_int64_data; + u_st_int64_data.base = 0; + u_st_int64_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_int64_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_int64_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_int64_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_st_int64_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_st_int64_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_st_int64_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_st_int64_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->st_int64_data = u_st_int64_data.real; + offset += sizeof(this->st_int64_data); + memcpy( &(this->int64_data[i]), &(this->st_int64_data), sizeof(int64_t)); + } + uint32_t int8_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + int8_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + int8_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + int8_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->int8_data_length); + if(int8_data_lengthT > int8_data_length) + this->int8_data = (int8_t*)realloc(this->int8_data, int8_data_lengthT * sizeof(int8_t)); + int8_data_length = int8_data_lengthT; + for( uint32_t i = 0; i < int8_data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_int8_data; + u_st_int8_data.base = 0; + u_st_int8_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_int8_data = u_st_int8_data.real; + offset += sizeof(this->st_int8_data); + memcpy( &(this->int8_data[i]), &(this->st_int8_data), sizeof(int8_t)); + } + uint32_t uint16_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + uint16_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + uint16_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + uint16_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->uint16_data_length); + if(uint16_data_lengthT > uint16_data_length) + this->uint16_data = (uint16_t*)realloc(this->uint16_data, uint16_data_lengthT * sizeof(uint16_t)); + uint16_data_length = uint16_data_lengthT; + for( uint32_t i = 0; i < uint16_data_length; i++){ + this->st_uint16_data = ((uint16_t) (*(inbuffer + offset))); + this->st_uint16_data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->st_uint16_data); + memcpy( &(this->uint16_data[i]), &(this->st_uint16_data), sizeof(uint16_t)); + } + uint32_t uint32_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + uint32_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + uint32_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + uint32_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->uint32_data_length); + if(uint32_data_lengthT > uint32_data_length) + this->uint32_data = (uint32_t*)realloc(this->uint32_data, uint32_data_lengthT * sizeof(uint32_t)); + uint32_data_length = uint32_data_lengthT; + for( uint32_t i = 0; i < uint32_data_length; i++){ + this->st_uint32_data = ((uint32_t) (*(inbuffer + offset))); + this->st_uint32_data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_uint32_data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_uint32_data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_uint32_data); + memcpy( &(this->uint32_data[i]), &(this->st_uint32_data), sizeof(uint32_t)); + } + uint32_t uint64_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + uint64_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + uint64_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + uint64_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->uint64_data_length); + if(uint64_data_lengthT > uint64_data_length) + this->uint64_data = (uint64_t*)realloc(this->uint64_data, uint64_data_lengthT * sizeof(uint64_t)); + uint64_data_length = uint64_data_lengthT; + for( uint32_t i = 0; i < uint64_data_length; i++){ + this->st_uint64_data = ((uint64_t) (*(inbuffer + offset))); + this->st_uint64_data |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_uint64_data |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_uint64_data |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_uint64_data |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->st_uint64_data |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->st_uint64_data |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->st_uint64_data |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->st_uint64_data); + memcpy( &(this->uint64_data[i]), &(this->st_uint64_data), sizeof(uint64_t)); + } + uint32_t uint8_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + uint8_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + uint8_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + uint8_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->uint8_data_length); + if(uint8_data_lengthT > uint8_data_length) + this->uint8_data = (uint8_t*)realloc(this->uint8_data, uint8_data_lengthT * sizeof(uint8_t)); + uint8_data_length = uint8_data_lengthT; + for( uint32_t i = 0; i < uint8_data_length; i++){ + this->st_uint8_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_uint8_data); + memcpy( &(this->uint8_data[i]), &(this->st_uint8_data), sizeof(uint8_t)); + } + uint32_t bool_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + bool_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + bool_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + bool_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->bool_data_length); + if(bool_data_lengthT > bool_data_length) + this->bool_data = (bool*)realloc(this->bool_data, bool_data_lengthT * sizeof(bool)); + bool_data_length = bool_data_lengthT; + for( uint32_t i = 0; i < bool_data_length; i++){ + union { + bool real; + uint8_t base; + } u_st_bool_data; + u_st_bool_data.base = 0; + u_st_bool_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_bool_data = u_st_bool_data.real; + offset += sizeof(this->st_bool_data); + memcpy( &(this->bool_data[i]), &(this->st_bool_data), sizeof(bool)); + } + uint32_t time_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + time_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + time_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + time_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_data_length); + if(time_data_lengthT > time_data_length) + this->time_data = (ros::Time*)realloc(this->time_data, time_data_lengthT * sizeof(ros::Time)); + time_data_length = time_data_lengthT; + for( uint32_t i = 0; i < time_data_length; i++){ + this->st_time_data.sec = ((uint32_t) (*(inbuffer + offset))); + this->st_time_data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_time_data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_time_data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_time_data.sec); + this->st_time_data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->st_time_data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_time_data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_time_data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_time_data.nsec); + memcpy( &(this->time_data[i]), &(this->st_time_data), sizeof(ros::Time)); + } + uint32_t duration_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + duration_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + duration_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + duration_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration_data_length); + if(duration_data_lengthT > duration_data_length) + this->duration_data = (ros::Duration*)realloc(this->duration_data, duration_data_lengthT * sizeof(ros::Duration)); + duration_data_length = duration_data_lengthT; + for( uint32_t i = 0; i < duration_data_length; i++){ + this->st_duration_data.sec = ((uint32_t) (*(inbuffer + offset))); + this->st_duration_data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_duration_data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_duration_data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_duration_data.sec); + this->st_duration_data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->st_duration_data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_duration_data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_duration_data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_duration_data.nsec); + memcpy( &(this->duration_data[i]), &(this->st_duration_data), sizeof(ros::Duration)); + } + uint32_t string_data_lengthT = ((uint32_t) (*(inbuffer + offset))); + string_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + string_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + string_data_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->string_data_length); + if(string_data_lengthT > string_data_length) + this->string_data = (std_msgs::String*)realloc(this->string_data, string_data_lengthT * sizeof(std_msgs::String)); + string_data_length = string_data_lengthT; + for( uint32_t i = 0; i < string_data_length; i++){ + offset += this->st_string_data.deserialize(inbuffer + offset); + memcpy( &(this->string_data[i]), &(this->st_string_data), sizeof(std_msgs::String)); + } + return offset; + } + + virtual const char * getType() override { return "roseus/VariableArray"; }; + virtual const char * getMD5() override { return "aebf8af723dcbdb6782481457d175157"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Action.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Action.h new file mode 100644 index 000000000..85f5180ca --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Action.h @@ -0,0 +1,56 @@ +#ifndef _ROS_roseus_smach_Multiply10Action_h +#define _ROS_roseus_smach_Multiply10Action_h + +#include +#include +#include +#include "ros/msg.h" +#include "roseus_smach/Multiply10ActionGoal.h" +#include "roseus_smach/Multiply10ActionResult.h" +#include "roseus_smach/Multiply10ActionFeedback.h" + +namespace roseus_smach +{ + + class Multiply10Action : public ros::Msg + { + public: + typedef roseus_smach::Multiply10ActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef roseus_smach::Multiply10ActionResult _action_result_type; + _action_result_type action_result; + typedef roseus_smach::Multiply10ActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + Multiply10Action(): + 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 "roseus_smach/Multiply10Action"; }; + virtual const char * getMD5() override { return "649e5cd3d0369bfd72c1f24aed2b51ea"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionFeedback.h new file mode 100644 index 000000000..c26aa6f23 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_roseus_smach_Multiply10ActionFeedback_h +#define _ROS_roseus_smach_Multiply10ActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "roseus_smach/Multiply10Feedback.h" + +namespace roseus_smach +{ + + class Multiply10ActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef roseus_smach::Multiply10Feedback _feedback_type; + _feedback_type feedback; + + Multiply10ActionFeedback(): + 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 "roseus_smach/Multiply10ActionFeedback"; }; + virtual const char * getMD5() override { return "ce7bcc860ef310bc2edbb3a3a2388663"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionGoal.h new file mode 100644 index 000000000..10062ea14 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_roseus_smach_Multiply10ActionGoal_h +#define _ROS_roseus_smach_Multiply10ActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "roseus_smach/Multiply10Goal.h" + +namespace roseus_smach +{ + + class Multiply10ActionGoal : 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 roseus_smach::Multiply10Goal _goal_type; + _goal_type goal; + + Multiply10ActionGoal(): + 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 "roseus_smach/Multiply10ActionGoal"; }; + virtual const char * getMD5() override { return "dc1a763911ac8fed593b103b6d986502"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionResult.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionResult.h new file mode 100644 index 000000000..54a3342eb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10ActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_roseus_smach_Multiply10ActionResult_h +#define _ROS_roseus_smach_Multiply10ActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "roseus_smach/Multiply10Result.h" + +namespace roseus_smach +{ + + class Multiply10ActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef roseus_smach::Multiply10Result _result_type; + _result_type result; + + Multiply10ActionResult(): + 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 "roseus_smach/Multiply10ActionResult"; }; + virtual const char * getMD5() override { return "9599baaab13952d63dd1c52591805a79"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Feedback.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Feedback.h new file mode 100644 index 000000000..6c6406c77 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Feedback.h @@ -0,0 +1,62 @@ +#ifndef _ROS_roseus_smach_Multiply10Feedback_h +#define _ROS_roseus_smach_Multiply10Feedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roseus_smach +{ + + class Multiply10Feedback : public ros::Msg + { + public: + typedef int32_t _value_type; + _value_type value; + + Multiply10Feedback(): + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + virtual const char * getType() override { return "roseus_smach/Multiply10Feedback"; }; + virtual const char * getMD5() override { return "b3087778e93fcd34cc8d65bc54e850d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Goal.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Goal.h new file mode 100644 index 000000000..e691773f3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Goal.h @@ -0,0 +1,62 @@ +#ifndef _ROS_roseus_smach_Multiply10Goal_h +#define _ROS_roseus_smach_Multiply10Goal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roseus_smach +{ + + class Multiply10Goal : public ros::Msg + { + public: + typedef int32_t _value_type; + _value_type value; + + Multiply10Goal(): + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + virtual const char * getType() override { return "roseus_smach/Multiply10Goal"; }; + virtual const char * getMD5() override { return "b3087778e93fcd34cc8d65bc54e850d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Result.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Result.h new file mode 100644 index 000000000..2a0b97998 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Multiply10Result.h @@ -0,0 +1,62 @@ +#ifndef _ROS_roseus_smach_Multiply10Result_h +#define _ROS_roseus_smach_Multiply10Result_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roseus_smach +{ + + class Multiply10Result : public ros::Msg + { + public: + typedef int32_t _value_type; + _value_type value; + + Multiply10Result(): + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + virtual const char * getType() override { return "roseus_smach/Multiply10Result"; }; + virtual const char * getMD5() override { return "b3087778e93fcd34cc8d65bc54e850d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Action.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Action.h new file mode 100644 index 000000000..f759fdd99 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Action.h @@ -0,0 +1,56 @@ +#ifndef _ROS_roseus_smach_Sub5Action_h +#define _ROS_roseus_smach_Sub5Action_h + +#include +#include +#include +#include "ros/msg.h" +#include "roseus_smach/Sub5ActionGoal.h" +#include "roseus_smach/Sub5ActionResult.h" +#include "roseus_smach/Sub5ActionFeedback.h" + +namespace roseus_smach +{ + + class Sub5Action : public ros::Msg + { + public: + typedef roseus_smach::Sub5ActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef roseus_smach::Sub5ActionResult _action_result_type; + _action_result_type action_result; + typedef roseus_smach::Sub5ActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + Sub5Action(): + 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 "roseus_smach/Sub5Action"; }; + virtual const char * getMD5() override { return "649e5cd3d0369bfd72c1f24aed2b51ea"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionFeedback.h new file mode 100644 index 000000000..efff58bd9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_roseus_smach_Sub5ActionFeedback_h +#define _ROS_roseus_smach_Sub5ActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "roseus_smach/Sub5Feedback.h" + +namespace roseus_smach +{ + + class Sub5ActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef roseus_smach::Sub5Feedback _feedback_type; + _feedback_type feedback; + + Sub5ActionFeedback(): + 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 "roseus_smach/Sub5ActionFeedback"; }; + virtual const char * getMD5() override { return "ce7bcc860ef310bc2edbb3a3a2388663"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionGoal.h new file mode 100644 index 000000000..2ffacc5f1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_roseus_smach_Sub5ActionGoal_h +#define _ROS_roseus_smach_Sub5ActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "roseus_smach/Sub5Goal.h" + +namespace roseus_smach +{ + + class Sub5ActionGoal : 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 roseus_smach::Sub5Goal _goal_type; + _goal_type goal; + + Sub5ActionGoal(): + 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 "roseus_smach/Sub5ActionGoal"; }; + virtual const char * getMD5() override { return "dc1a763911ac8fed593b103b6d986502"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionResult.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionResult.h new file mode 100644 index 000000000..48039acba --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5ActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_roseus_smach_Sub5ActionResult_h +#define _ROS_roseus_smach_Sub5ActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "roseus_smach/Sub5Result.h" + +namespace roseus_smach +{ + + class Sub5ActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef roseus_smach::Sub5Result _result_type; + _result_type result; + + Sub5ActionResult(): + 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 "roseus_smach/Sub5ActionResult"; }; + virtual const char * getMD5() override { return "9599baaab13952d63dd1c52591805a79"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Feedback.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Feedback.h new file mode 100644 index 000000000..3610ecc28 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Feedback.h @@ -0,0 +1,62 @@ +#ifndef _ROS_roseus_smach_Sub5Feedback_h +#define _ROS_roseus_smach_Sub5Feedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roseus_smach +{ + + class Sub5Feedback : public ros::Msg + { + public: + typedef int32_t _value_type; + _value_type value; + + Sub5Feedback(): + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + virtual const char * getType() override { return "roseus_smach/Sub5Feedback"; }; + virtual const char * getMD5() override { return "b3087778e93fcd34cc8d65bc54e850d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Goal.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Goal.h new file mode 100644 index 000000000..52ce7c4f5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Goal.h @@ -0,0 +1,62 @@ +#ifndef _ROS_roseus_smach_Sub5Goal_h +#define _ROS_roseus_smach_Sub5Goal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roseus_smach +{ + + class Sub5Goal : public ros::Msg + { + public: + typedef int32_t _value_type; + _value_type value; + + Sub5Goal(): + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + virtual const char * getType() override { return "roseus_smach/Sub5Goal"; }; + virtual const char * getMD5() override { return "b3087778e93fcd34cc8d65bc54e850d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Result.h b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Result.h new file mode 100644 index 000000000..012b4b89e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/roseus_smach/Sub5Result.h @@ -0,0 +1,62 @@ +#ifndef _ROS_roseus_smach_Sub5Result_h +#define _ROS_roseus_smach_Sub5Result_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roseus_smach +{ + + class Sub5Result : public ros::Msg + { + public: + typedef int32_t _value_type; + _value_type value; + + Sub5Result(): + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + virtual const char * getType() override { return "roseus_smach/Sub5Result"; }; + virtual const char * getMD5() override { return "b3087778e93fcd34cc8d65bc54e850d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/Clock.h b/smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/Clock.h new file mode 100644 index 000000000..57e5db414 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/Clock.h @@ -0,0 +1,62 @@ +#ifndef _ROS_rosgraph_msgs_Clock_h +#define _ROS_rosgraph_msgs_Clock_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace rosgraph_msgs +{ + + class Clock : public ros::Msg + { + public: + typedef ros::Time _clock_type; + _clock_type clock; + + Clock(): + clock() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->clock.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clock.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clock.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clock.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->clock.sec); + *(outbuffer + offset + 0) = (this->clock.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clock.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clock.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clock.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->clock.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->clock.sec = ((uint32_t) (*(inbuffer + offset))); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clock.sec); + this->clock.nsec = ((uint32_t) (*(inbuffer + offset))); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clock.nsec); + return offset; + } + + virtual const char * getType() override { return "rosgraph_msgs/Clock"; }; + virtual const char * getMD5() override { return "a9c97c1d230cfc112e270351a944ee47"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/Log.h b/smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/Log.h new file mode 100644 index 000000000..2c3d58ca6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/Log.h @@ -0,0 +1,185 @@ +#ifndef _ROS_rosgraph_msgs_Log_h +#define _ROS_rosgraph_msgs_Log_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rosgraph_msgs +{ + + class Log : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int8_t _level_type; + _level_type level; + typedef const char* _name_type; + _name_type name; + typedef const char* _msg_type; + _msg_type msg; + typedef const char* _file_type; + _file_type file; + typedef const char* _function_type; + _function_type function; + typedef uint32_t _line_type; + _line_type line; + uint32_t topics_length; + typedef char* _topics_type; + _topics_type st_topics; + _topics_type * topics; + enum { DEBUG = 1 }; + enum { INFO = 2 }; + enum { WARN = 4 }; + enum { ERROR = 8 }; + enum { FATAL = 16 }; + + Log(): + header(), + level(0), + name(""), + msg(""), + file(""), + function(""), + line(0), + topics_length(0), st_topics(), topics(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_level; + u_level.real = this->level; + *(outbuffer + offset + 0) = (u_level.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + 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_msg = strlen(this->msg); + varToArr(outbuffer + offset, length_msg); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + uint32_t length_file = strlen(this->file); + varToArr(outbuffer + offset, length_file); + offset += 4; + memcpy(outbuffer + offset, this->file, length_file); + offset += length_file; + uint32_t length_function = strlen(this->function); + varToArr(outbuffer + offset, length_function); + offset += 4; + memcpy(outbuffer + offset, this->function, length_function); + offset += length_function; + *(outbuffer + offset + 0) = (this->line >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->line >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->line >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->line >> (8 * 3)) & 0xFF; + offset += sizeof(this->line); + *(outbuffer + offset + 0) = (this->topics_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topics_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->topics_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->topics_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->topics_length); + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + varToArr(outbuffer + offset, length_topicsi); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_level; + u_level.base = 0; + u_level.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->level = u_level.real; + offset += sizeof(this->level); + 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_msg; + arrToVar(length_msg, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + uint32_t length_file; + arrToVar(length_file, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file-1]=0; + this->file = (char *)(inbuffer + offset-1); + offset += length_file; + uint32_t length_function; + arrToVar(length_function, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_function; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_function-1]=0; + this->function = (char *)(inbuffer + offset-1); + offset += length_function; + this->line = ((uint32_t) (*(inbuffer + offset))); + this->line |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->line |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->line |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->line); + uint32_t topics_lengthT = ((uint32_t) (*(inbuffer + offset))); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->topics_length); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + topics_length = topics_lengthT; + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + arrToVar(length_st_topics, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "rosgraph_msgs/Log"; }; + virtual const char * getMD5() override { return "acffd30cd6b6de30f120938c17c593fb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/TopicStatistics.h b/smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/TopicStatistics.h new file mode 100644 index 000000000..b0a89af78 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosgraph_msgs/TopicStatistics.h @@ -0,0 +1,347 @@ +#ifndef _ROS_rosgraph_msgs_TopicStatistics_h +#define _ROS_rosgraph_msgs_TopicStatistics_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" + +namespace rosgraph_msgs +{ + + class TopicStatistics : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + typedef const char* _node_pub_type; + _node_pub_type node_pub; + typedef const char* _node_sub_type; + _node_sub_type node_sub; + typedef ros::Time _window_start_type; + _window_start_type window_start; + typedef ros::Time _window_stop_type; + _window_stop_type window_stop; + typedef int32_t _delivered_msgs_type; + _delivered_msgs_type delivered_msgs; + typedef int32_t _dropped_msgs_type; + _dropped_msgs_type dropped_msgs; + typedef int32_t _traffic_type; + _traffic_type traffic; + typedef ros::Duration _period_mean_type; + _period_mean_type period_mean; + typedef ros::Duration _period_stddev_type; + _period_stddev_type period_stddev; + typedef ros::Duration _period_max_type; + _period_max_type period_max; + typedef ros::Duration _stamp_age_mean_type; + _stamp_age_mean_type stamp_age_mean; + typedef ros::Duration _stamp_age_stddev_type; + _stamp_age_stddev_type stamp_age_stddev; + typedef ros::Duration _stamp_age_max_type; + _stamp_age_max_type stamp_age_max; + + TopicStatistics(): + topic(""), + node_pub(""), + node_sub(""), + window_start(), + window_stop(), + delivered_msgs(0), + dropped_msgs(0), + traffic(0), + period_mean(), + period_stddev(), + period_max(), + stamp_age_mean(), + stamp_age_stddev(), + stamp_age_max() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + uint32_t length_node_pub = strlen(this->node_pub); + varToArr(outbuffer + offset, length_node_pub); + offset += 4; + memcpy(outbuffer + offset, this->node_pub, length_node_pub); + offset += length_node_pub; + uint32_t length_node_sub = strlen(this->node_sub); + varToArr(outbuffer + offset, length_node_sub); + offset += 4; + memcpy(outbuffer + offset, this->node_sub, length_node_sub); + offset += length_node_sub; + *(outbuffer + offset + 0) = (this->window_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_start.sec); + *(outbuffer + offset + 0) = (this->window_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_start.nsec); + *(outbuffer + offset + 0) = (this->window_stop.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_stop.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_stop.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_stop.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_stop.sec); + *(outbuffer + offset + 0) = (this->window_stop.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_stop.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_stop.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_stop.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_stop.nsec); + union { + int32_t real; + uint32_t base; + } u_delivered_msgs; + u_delivered_msgs.real = this->delivered_msgs; + *(outbuffer + offset + 0) = (u_delivered_msgs.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_delivered_msgs.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_delivered_msgs.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_delivered_msgs.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->delivered_msgs); + union { + int32_t real; + uint32_t base; + } u_dropped_msgs; + u_dropped_msgs.real = this->dropped_msgs; + *(outbuffer + offset + 0) = (u_dropped_msgs.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dropped_msgs.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dropped_msgs.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dropped_msgs.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dropped_msgs); + union { + int32_t real; + uint32_t base; + } u_traffic; + u_traffic.real = this->traffic; + *(outbuffer + offset + 0) = (u_traffic.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_traffic.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_traffic.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_traffic.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->traffic); + *(outbuffer + offset + 0) = (this->period_mean.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_mean.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_mean.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_mean.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_mean.sec); + *(outbuffer + offset + 0) = (this->period_mean.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_mean.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_mean.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_mean.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_mean.nsec); + *(outbuffer + offset + 0) = (this->period_stddev.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_stddev.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_stddev.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_stddev.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_stddev.sec); + *(outbuffer + offset + 0) = (this->period_stddev.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_stddev.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_stddev.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_stddev.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_stddev.nsec); + *(outbuffer + offset + 0) = (this->period_max.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_max.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_max.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_max.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_max.sec); + *(outbuffer + offset + 0) = (this->period_max.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_max.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_max.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_max.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_max.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_mean.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_mean.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_mean.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_mean.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_mean.sec); + *(outbuffer + offset + 0) = (this->stamp_age_mean.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_mean.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_mean.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_mean.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_mean.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_stddev.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_stddev.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_stddev.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_stddev.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_stddev.sec); + *(outbuffer + offset + 0) = (this->stamp_age_stddev.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_stddev.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_stddev.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_stddev.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_stddev.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_max.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_max.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_max.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_max.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_max.sec); + *(outbuffer + offset + 0) = (this->stamp_age_max.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_max.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_max.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_max.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_max.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + uint32_t length_node_pub; + arrToVar(length_node_pub, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_pub; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_pub-1]=0; + this->node_pub = (char *)(inbuffer + offset-1); + offset += length_node_pub; + uint32_t length_node_sub; + arrToVar(length_node_sub, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_sub; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_sub-1]=0; + this->node_sub = (char *)(inbuffer + offset-1); + offset += length_node_sub; + this->window_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_start.sec); + this->window_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_start.nsec); + this->window_stop.sec = ((uint32_t) (*(inbuffer + offset))); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_stop.sec); + this->window_stop.nsec = ((uint32_t) (*(inbuffer + offset))); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_stop.nsec); + union { + int32_t real; + uint32_t base; + } u_delivered_msgs; + u_delivered_msgs.base = 0; + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->delivered_msgs = u_delivered_msgs.real; + offset += sizeof(this->delivered_msgs); + union { + int32_t real; + uint32_t base; + } u_dropped_msgs; + u_dropped_msgs.base = 0; + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dropped_msgs = u_dropped_msgs.real; + offset += sizeof(this->dropped_msgs); + union { + int32_t real; + uint32_t base; + } u_traffic; + u_traffic.base = 0; + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->traffic = u_traffic.real; + offset += sizeof(this->traffic); + this->period_mean.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_mean.sec); + this->period_mean.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_mean.nsec); + this->period_stddev.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_stddev.sec); + this->period_stddev.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_stddev.nsec); + this->period_max.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_max.sec); + this->period_max.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_max.nsec); + this->stamp_age_mean.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_mean.sec); + this->stamp_age_mean.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_mean.nsec); + this->stamp_age_stddev.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_stddev.sec); + this->stamp_age_stddev.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_stddev.nsec); + this->stamp_age_max.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_max.sec); + this->stamp_age_max.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_max.nsec); + return offset; + } + + virtual const char * getType() override { return "rosgraph_msgs/TopicStatistics"; }; + virtual const char * getMD5() override { return "10152ed868c5097a5e2e4a89d7daa710"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/AddTwoInts.h b/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/AddTwoInts.h new file mode 100644 index 000000000..f02f833c8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/AddTwoInts.h @@ -0,0 +1,166 @@ +#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/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/BadTwoInts.h b/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/BadTwoInts.h new file mode 100644 index 000000000..24a449fd8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/BadTwoInts.h @@ -0,0 +1,150 @@ +#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/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/Floats.h b/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/Floats.h new file mode 100644 index 000000000..77027c5ba --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/Floats.h @@ -0,0 +1,82 @@ +#ifndef _ROS_rospy_tutorials_Floats_h +#define _ROS_rospy_tutorials_Floats_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + + class Floats : public ros::Msg + { + public: + uint32_t data_length; + typedef float _data_type; + _data_type st_data; + _data_type * data; + + Floats(): + 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++){ + 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]); + } + 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 = (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)); + } + return offset; + } + + virtual const char * getType() override { return "rospy_tutorials/Floats"; }; + virtual const char * getMD5() override { return "420cd38b6b071cd49f2970c3e2cee511"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/HeaderString.h b/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/HeaderString.h new file mode 100644 index 000000000..762014f55 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rospy_tutorials/HeaderString.h @@ -0,0 +1,61 @@ +#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/smart_device_protocol/ros_lib/ros_lib/rosserial_arduino/Adc.h b/smart_device_protocol/ros_lib/ros_lib/rosserial_arduino/Adc.h new file mode 100644 index 000000000..d19f287ac --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosserial_arduino/Adc.h @@ -0,0 +1,92 @@ +#ifndef _ROS_rosserial_arduino_Adc_h +#define _ROS_rosserial_arduino_Adc_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_arduino +{ + + class Adc : public ros::Msg + { + public: + typedef uint16_t _adc0_type; + _adc0_type adc0; + typedef uint16_t _adc1_type; + _adc1_type adc1; + typedef uint16_t _adc2_type; + _adc2_type adc2; + typedef uint16_t _adc3_type; + _adc3_type adc3; + typedef uint16_t _adc4_type; + _adc4_type adc4; + typedef uint16_t _adc5_type; + _adc5_type adc5; + + Adc(): + adc0(0), + adc1(0), + adc2(0), + adc3(0), + adc4(0), + adc5(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->adc0 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc0 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc0); + *(outbuffer + offset + 0) = (this->adc1 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc1 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc1); + *(outbuffer + offset + 0) = (this->adc2 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc2 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc2); + *(outbuffer + offset + 0) = (this->adc3 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc3 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc3); + *(outbuffer + offset + 0) = (this->adc4 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc4 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc4); + *(outbuffer + offset + 0) = (this->adc5 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc5 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc5); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->adc0 = ((uint16_t) (*(inbuffer + offset))); + this->adc0 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc0); + this->adc1 = ((uint16_t) (*(inbuffer + offset))); + this->adc1 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc1); + this->adc2 = ((uint16_t) (*(inbuffer + offset))); + this->adc2 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc2); + this->adc3 = ((uint16_t) (*(inbuffer + offset))); + this->adc3 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc3); + this->adc4 = ((uint16_t) (*(inbuffer + offset))); + this->adc4 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc4); + this->adc5 = ((uint16_t) (*(inbuffer + offset))); + this->adc5 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc5); + return offset; + } + + virtual const char * getType() override { return "rosserial_arduino/Adc"; }; + virtual const char * getMD5() override { return "6d7853a614e2e821319068311f2af25b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosserial_arduino/Test.h b/smart_device_protocol/ros_lib/ros_lib/rosserial_arduino/Test.h new file mode 100644 index 000000000..efd4cdf50 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosserial_arduino/Test.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_Test_h +#define _ROS_SERVICE_Test_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_arduino +{ + +static const char TEST[] = "rosserial_arduino/Test"; + + class TestRequest : public ros::Msg + { + public: + typedef const char* _input_type; + _input_type input; + + TestRequest(): + input("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_input = strlen(this->input); + varToArr(outbuffer + offset, length_input); + offset += 4; + memcpy(outbuffer + offset, this->input, length_input); + offset += length_input; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_input; + arrToVar(length_input, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_input; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_input-1]=0; + this->input = (char *)(inbuffer + offset-1); + offset += length_input; + return offset; + } + + virtual const char * getType() override { return TEST; }; + virtual const char * getMD5() override { return "39e92f1778057359c64c7b8a7d7b19de"; }; + + }; + + class TestResponse : public ros::Msg + { + public: + typedef const char* _output_type; + _output_type output; + + TestResponse(): + output("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_output = strlen(this->output); + varToArr(outbuffer + offset, length_output); + offset += 4; + memcpy(outbuffer + offset, this->output, length_output); + offset += length_output; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_output; + arrToVar(length_output, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_output; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_output-1]=0; + this->output = (char *)(inbuffer + offset-1); + offset += length_output; + return offset; + } + + virtual const char * getType() override { return TEST; }; + virtual const char * getMD5() override { return "0825d95fdfa2c8f4bbb4e9c74bccd3fd"; }; + + }; + + class Test { + public: + typedef TestRequest Request; + typedef TestResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/Log.h b/smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/Log.h new file mode 100644 index 000000000..0aad0bd9d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/Log.h @@ -0,0 +1,67 @@ +#ifndef _ROS_rosserial_msgs_Log_h +#define _ROS_rosserial_msgs_Log_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + + class Log : public ros::Msg + { + public: + typedef uint8_t _level_type; + _level_type level; + typedef const char* _msg_type; + _msg_type msg; + enum { ROSDEBUG = 0 }; + enum { INFO = 1 }; + enum { WARN = 2 }; + enum { ERROR = 3 }; + enum { FATAL = 4 }; + + Log(): + level(0), + msg("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_msg = strlen(this->msg); + varToArr(outbuffer + offset, length_msg); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->level = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->level); + uint32_t length_msg; + arrToVar(length_msg, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + return offset; + } + + virtual const char * getType() override { return "rosserial_msgs/Log"; }; + virtual const char * getMD5() override { return "11abd731c25933261cd6183bd12d6295"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/RequestParam.h b/smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/RequestParam.h new file mode 100644 index 000000000..179608d9c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/RequestParam.h @@ -0,0 +1,212 @@ +#ifndef _ROS_SERVICE_RequestParam_h +#define _ROS_SERVICE_RequestParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTPARAM[] = "rosserial_msgs/RequestParam"; + + class RequestParamRequest : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + + RequestParamRequest(): + 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 REQUESTPARAM; }; + virtual const char * getMD5() override { return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class RequestParamResponse : public ros::Msg + { + public: + uint32_t ints_length; + typedef int32_t _ints_type; + _ints_type st_ints; + _ints_type * ints; + uint32_t floats_length; + typedef float _floats_type; + _floats_type st_floats; + _floats_type * floats; + uint32_t strings_length; + typedef char* _strings_type; + _strings_type st_strings; + _strings_type * strings; + + RequestParamResponse(): + ints_length(0), st_ints(), ints(nullptr), + floats_length(0), st_floats(), floats(nullptr), + strings_length(0), st_strings(), strings(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->ints_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ints_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ints_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ints_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ints_length); + for( uint32_t i = 0; i < ints_length; i++){ + union { + int32_t real; + uint32_t base; + } u_intsi; + u_intsi.real = this->ints[i]; + *(outbuffer + offset + 0) = (u_intsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ints[i]); + } + *(outbuffer + offset + 0) = (this->floats_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->floats_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->floats_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->floats_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->floats_length); + for( uint32_t i = 0; i < floats_length; i++){ + union { + float real; + uint32_t base; + } u_floatsi; + u_floatsi.real = this->floats[i]; + *(outbuffer + offset + 0) = (u_floatsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_floatsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_floatsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_floatsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->floats[i]); + } + *(outbuffer + offset + 0) = (this->strings_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->strings_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->strings_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->strings_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->strings_length); + for( uint32_t i = 0; i < strings_length; i++){ + uint32_t length_stringsi = strlen(this->strings[i]); + varToArr(outbuffer + offset, length_stringsi); + offset += 4; + memcpy(outbuffer + offset, this->strings[i], length_stringsi); + offset += length_stringsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t ints_lengthT = ((uint32_t) (*(inbuffer + offset))); + ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ints_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ints_length); + if(ints_lengthT > ints_length) + this->ints = (int32_t*)realloc(this->ints, ints_lengthT * sizeof(int32_t)); + ints_length = ints_lengthT; + for( uint32_t i = 0; i < ints_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_ints; + u_st_ints.base = 0; + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ints = u_st_ints.real; + offset += sizeof(this->st_ints); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(int32_t)); + } + uint32_t floats_lengthT = ((uint32_t) (*(inbuffer + offset))); + floats_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + floats_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + floats_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->floats_length); + if(floats_lengthT > floats_length) + this->floats = (float*)realloc(this->floats, floats_lengthT * sizeof(float)); + floats_length = floats_lengthT; + for( uint32_t i = 0; i < floats_length; i++){ + union { + float real; + uint32_t base; + } u_st_floats; + u_st_floats.base = 0; + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_floats = u_st_floats.real; + offset += sizeof(this->st_floats); + memcpy( &(this->floats[i]), &(this->st_floats), sizeof(float)); + } + uint32_t strings_lengthT = ((uint32_t) (*(inbuffer + offset))); + strings_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + strings_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + strings_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->strings_length); + if(strings_lengthT > strings_length) + this->strings = (char**)realloc(this->strings, strings_lengthT * sizeof(char*)); + strings_length = strings_lengthT; + for( uint32_t i = 0; i < strings_length; i++){ + uint32_t length_st_strings; + arrToVar(length_st_strings, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_strings; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_strings-1]=0; + this->st_strings = (char *)(inbuffer + offset-1); + offset += length_st_strings; + memcpy( &(this->strings[i]), &(this->st_strings), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return REQUESTPARAM; }; + virtual const char * getMD5() override { return "9f0e98bda65981986ddf53afa7a40e49"; }; + + }; + + class RequestParam { + public: + typedef RequestParamRequest Request; + typedef RequestParamResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/TopicInfo.h b/smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/TopicInfo.h new file mode 100644 index 000000000..fd9cafd04 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rosserial_msgs/TopicInfo.h @@ -0,0 +1,130 @@ +#ifndef _ROS_rosserial_msgs_TopicInfo_h +#define _ROS_rosserial_msgs_TopicInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + + class TopicInfo : public ros::Msg + { + public: + typedef uint16_t _topic_id_type; + _topic_id_type topic_id; + typedef const char* _topic_name_type; + _topic_name_type topic_name; + typedef const char* _message_type_type; + _message_type_type message_type; + typedef const char* _md5sum_type; + _md5sum_type md5sum; + typedef int32_t _buffer_size_type; + _buffer_size_type buffer_size; + enum { ID_PUBLISHER = 0 }; + enum { ID_SUBSCRIBER = 1 }; + enum { ID_SERVICE_SERVER = 2 }; + enum { ID_SERVICE_CLIENT = 4 }; + enum { ID_PARAMETER_REQUEST = 6 }; + enum { ID_LOG = 7 }; + enum { ID_TIME = 10 }; + enum { ID_TX_STOP = 11 }; + + TopicInfo(): + topic_id(0), + topic_name(""), + message_type(""), + md5sum(""), + buffer_size(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topic_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topic_id >> (8 * 1)) & 0xFF; + offset += sizeof(this->topic_id); + 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; + uint32_t length_message_type = strlen(this->message_type); + varToArr(outbuffer + offset, length_message_type); + offset += 4; + memcpy(outbuffer + offset, this->message_type, length_message_type); + offset += length_message_type; + uint32_t length_md5sum = strlen(this->md5sum); + varToArr(outbuffer + offset, length_md5sum); + offset += 4; + memcpy(outbuffer + offset, this->md5sum, length_md5sum); + offset += length_md5sum; + union { + int32_t real; + uint32_t base; + } u_buffer_size; + u_buffer_size.real = this->buffer_size; + *(outbuffer + offset + 0) = (u_buffer_size.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_buffer_size.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_buffer_size.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_buffer_size.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->buffer_size); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->topic_id = ((uint16_t) (*(inbuffer + offset))); + this->topic_id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->topic_id); + 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; + uint32_t length_message_type; + arrToVar(length_message_type, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message_type-1]=0; + this->message_type = (char *)(inbuffer + offset-1); + offset += length_message_type; + uint32_t length_md5sum; + arrToVar(length_md5sum, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_md5sum; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_md5sum-1]=0; + this->md5sum = (char *)(inbuffer + offset-1); + offset += length_md5sum; + union { + int32_t real; + uint32_t base; + } u_buffer_size; + u_buffer_size.base = 0; + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->buffer_size = u_buffer_size.real; + offset += sizeof(this->buffer_size); + return offset; + } + + virtual const char * getType() override { return "rosserial_msgs/TopicInfo"; }; + virtual const char * getMD5() override { return "0ad51f88fc44892f8c10684077646005"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetAction.h b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetAction.h new file mode 100644 index 000000000..1a49f071d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_rostwitter_TweetAction_h +#define _ROS_rostwitter_TweetAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "rostwitter/TweetActionGoal.h" +#include "rostwitter/TweetActionResult.h" +#include "rostwitter/TweetActionFeedback.h" + +namespace rostwitter +{ + + class TweetAction : public ros::Msg + { + public: + typedef rostwitter::TweetActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef rostwitter::TweetActionResult _action_result_type; + _action_result_type action_result; + typedef rostwitter::TweetActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + TweetAction(): + 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 "rostwitter/TweetAction"; }; + virtual const char * getMD5() override { return "2fbb8e01060b10f950ec4190c26ea523"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionFeedback.h new file mode 100644 index 000000000..934fbed68 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_rostwitter_TweetActionFeedback_h +#define _ROS_rostwitter_TweetActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "rostwitter/TweetFeedback.h" + +namespace rostwitter +{ + + class TweetActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef rostwitter::TweetFeedback _feedback_type; + _feedback_type feedback; + + TweetActionFeedback(): + 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 "rostwitter/TweetActionFeedback"; }; + virtual const char * getMD5() override { return "9c798914fab17285a34f89437b36b7b5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionGoal.h new file mode 100644 index 000000000..b84369c13 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_rostwitter_TweetActionGoal_h +#define _ROS_rostwitter_TweetActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "rostwitter/TweetGoal.h" + +namespace rostwitter +{ + + class TweetActionGoal : 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 rostwitter::TweetGoal _goal_type; + _goal_type goal; + + TweetActionGoal(): + 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 "rostwitter/TweetActionGoal"; }; + virtual const char * getMD5() override { return "515378c046e761a5c735095c222610b7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionResult.h b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionResult.h new file mode 100644 index 000000000..dfc35ae7d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_rostwitter_TweetActionResult_h +#define _ROS_rostwitter_TweetActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "rostwitter/TweetResult.h" + +namespace rostwitter +{ + + class TweetActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef rostwitter::TweetResult _result_type; + _result_type result; + + TweetActionResult(): + 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 "rostwitter/TweetActionResult"; }; + virtual const char * getMD5() override { return "0698ce25b2d595b82357c010557e935f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetFeedback.h b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetFeedback.h new file mode 100644 index 000000000..3b241788c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetFeedback.h @@ -0,0 +1,62 @@ +#ifndef _ROS_rostwitter_TweetFeedback_h +#define _ROS_rostwitter_TweetFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace rostwitter +{ + + class TweetFeedback : public ros::Msg + { + public: + typedef ros::Time _stamp_type; + _stamp_type stamp; + + TweetFeedback(): + stamp() + { + } + + 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); + 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); + return offset; + } + + virtual const char * getType() override { return "rostwitter/TweetFeedback"; }; + virtual const char * getMD5() override { return "84d365d08d5fc49dde870daba1c7992c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetGoal.h b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetGoal.h new file mode 100644 index 000000000..9ae0fa8ed --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetGoal.h @@ -0,0 +1,133 @@ +#ifndef _ROS_rostwitter_TweetGoal_h +#define _ROS_rostwitter_TweetGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rostwitter +{ + + class TweetGoal : public ros::Msg + { + public: + typedef bool _image_type; + _image_type image; + typedef const char* _image_topic_name_type; + _image_topic_name_type image_topic_name; + typedef bool _speak_type; + _speak_type speak; + typedef const char* _text_type; + _text_type text; + typedef bool _warning_type; + _warning_type warning; + typedef uint8_t _warning_time_type; + _warning_time_type warning_time; + + TweetGoal(): + image(0), + image_topic_name(""), + speak(0), + text(""), + warning(0), + warning_time(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_image; + u_image.real = this->image; + *(outbuffer + offset + 0) = (u_image.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->image); + uint32_t length_image_topic_name = strlen(this->image_topic_name); + varToArr(outbuffer + offset, length_image_topic_name); + offset += 4; + memcpy(outbuffer + offset, this->image_topic_name, length_image_topic_name); + offset += length_image_topic_name; + union { + bool real; + uint8_t base; + } u_speak; + u_speak.real = this->speak; + *(outbuffer + offset + 0) = (u_speak.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->speak); + uint32_t length_text = strlen(this->text); + varToArr(outbuffer + offset, length_text); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + union { + bool real; + uint8_t base; + } u_warning; + u_warning.real = this->warning; + *(outbuffer + offset + 0) = (u_warning.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->warning); + *(outbuffer + offset + 0) = (this->warning_time >> (8 * 0)) & 0xFF; + offset += sizeof(this->warning_time); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_image; + u_image.base = 0; + u_image.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->image = u_image.real; + offset += sizeof(this->image); + uint32_t length_image_topic_name; + arrToVar(length_image_topic_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_image_topic_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_image_topic_name-1]=0; + this->image_topic_name = (char *)(inbuffer + offset-1); + offset += length_image_topic_name; + union { + bool real; + uint8_t base; + } u_speak; + u_speak.base = 0; + u_speak.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->speak = u_speak.real; + offset += sizeof(this->speak); + 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; + union { + bool real; + uint8_t base; + } u_warning; + u_warning.base = 0; + u_warning.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->warning = u_warning.real; + offset += sizeof(this->warning); + this->warning_time = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->warning_time); + return offset; + } + + virtual const char * getType() override { return "rostwitter/TweetGoal"; }; + virtual const char * getMD5() override { return "577f0283150a250e0ca629c7c0d07aa9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetResult.h b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetResult.h new file mode 100644 index 000000000..c7f2e339a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rostwitter/TweetResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_rostwitter_TweetResult_h +#define _ROS_rostwitter_TweetResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rostwitter +{ + + class TweetResult : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + TweetResult(): + 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 "rostwitter/TweetResult"; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rtcm_msgs/Message.h b/smart_device_protocol/ros_lib/ros_lib/rtcm_msgs/Message.h new file mode 100644 index 000000000..40ce3b373 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rtcm_msgs/Message.h @@ -0,0 +1,71 @@ +#ifndef _ROS_rtcm_msgs_Message_h +#define _ROS_rtcm_msgs_Message_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rtcm_msgs +{ + + class Message : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t message_length; + typedef uint8_t _message_type; + _message_type st_message; + _message_type * message; + + Message(): + header(), + message_length(0), st_message(), message(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->message_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->message_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->message_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->message_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->message_length); + for( uint32_t i = 0; i < message_length; i++){ + *(outbuffer + offset + 0) = (this->message[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->message[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t message_lengthT = ((uint32_t) (*(inbuffer + offset))); + message_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + message_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + message_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->message_length); + if(message_lengthT > message_length) + this->message = (uint8_t*)realloc(this->message, message_lengthT * sizeof(uint8_t)); + message_length = message_lengthT; + for( uint32_t i = 0; i < message_length; i++){ + this->st_message = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_message); + memcpy( &(this->message[i]), &(this->st_message), sizeof(uint8_t)); + } + return offset; + } + + virtual const char * getType() override { return "rtcm_msgs/Message"; }; + virtual const char * getMD5() override { return "883b1fb65b83ccf75497c21f2d63052d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rviz/SendFilePath.h b/smart_device_protocol/ros_lib/ros_lib/rviz/SendFilePath.h new file mode 100644 index 000000000..733c5041e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rviz/SendFilePath.h @@ -0,0 +1,94 @@ +#ifndef _ROS_SERVICE_SendFilePath_h +#define _ROS_SERVICE_SendFilePath_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/String.h" + +namespace rviz +{ + +static const char SENDFILEPATH[] = "rviz/SendFilePath"; + + class SendFilePathRequest : public ros::Msg + { + public: + typedef std_msgs::String _path_type; + _path_type path; + + SendFilePathRequest(): + path() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->path.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->path.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SENDFILEPATH; }; + virtual const char * getMD5() override { return "8a631822f6e3078667af5e13f8ab06b7"; }; + + }; + + class SendFilePathResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + + SendFilePathResponse(): + 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 SENDFILEPATH; }; + virtual const char * getMD5() override { return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SendFilePath { + public: + typedef SendFilePathRequest Request; + typedef SendFilePathResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/rwt_image_view/RosbagRecordRequest.h b/smart_device_protocol/ros_lib/ros_lib/rwt_image_view/RosbagRecordRequest.h new file mode 100644 index 000000000..9176391a1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/rwt_image_view/RosbagRecordRequest.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_RosbagRecordRequest_h +#define _ROS_SERVICE_RosbagRecordRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace rwt_image_view +{ + +static const char ROSBAGRECORDREQUEST[] = "rwt_image_view/RosbagRecordRequest"; + + class RosbagRecordRequestRequest : public ros::Msg + { + public: + uint32_t topics_length; + typedef char* _topics_type; + _topics_type st_topics; + _topics_type * topics; + + RosbagRecordRequestRequest(): + topics_length(0), st_topics(), topics(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topics_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topics_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->topics_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->topics_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->topics_length); + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + varToArr(outbuffer + offset, length_topicsi); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t topics_lengthT = ((uint32_t) (*(inbuffer + offset))); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->topics_length); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + topics_length = topics_lengthT; + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + arrToVar(length_st_topics, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return ROSBAGRECORDREQUEST; }; + virtual const char * getMD5() override { return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class RosbagRecordRequestResponse : public ros::Msg + { + public: + + RosbagRecordRequestResponse() + { + } + + 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 ROSBAGRECORDREQUEST; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class RosbagRecordRequest { + public: + typedef RosbagRecordRequestRequest Request; + typedef RosbagRecordRequestResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/BatteryState.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/BatteryState.h new file mode 100644 index 000000000..c34a6520f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/BatteryState.h @@ -0,0 +1,394 @@ +#ifndef _ROS_sensor_msgs_BatteryState_h +#define _ROS_sensor_msgs_BatteryState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class BatteryState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _voltage_type; + _voltage_type voltage; + typedef float _temperature_type; + _temperature_type temperature; + typedef float _current_type; + _current_type current; + typedef float _charge_type; + _charge_type charge; + typedef float _capacity_type; + _capacity_type capacity; + typedef float _design_capacity_type; + _design_capacity_type design_capacity; + typedef float _percentage_type; + _percentage_type percentage; + typedef uint8_t _power_supply_status_type; + _power_supply_status_type power_supply_status; + typedef uint8_t _power_supply_health_type; + _power_supply_health_type power_supply_health; + typedef uint8_t _power_supply_technology_type; + _power_supply_technology_type power_supply_technology; + typedef bool _present_type; + _present_type present; + uint32_t cell_voltage_length; + typedef float _cell_voltage_type; + _cell_voltage_type st_cell_voltage; + _cell_voltage_type * cell_voltage; + uint32_t cell_temperature_length; + typedef float _cell_temperature_type; + _cell_temperature_type st_cell_temperature; + _cell_temperature_type * cell_temperature; + typedef const char* _location_type; + _location_type location; + typedef const char* _serial_number_type; + _serial_number_type serial_number; + enum { POWER_SUPPLY_STATUS_UNKNOWN = 0 }; + enum { POWER_SUPPLY_STATUS_CHARGING = 1 }; + enum { POWER_SUPPLY_STATUS_DISCHARGING = 2 }; + enum { POWER_SUPPLY_STATUS_NOT_CHARGING = 3 }; + enum { POWER_SUPPLY_STATUS_FULL = 4 }; + enum { POWER_SUPPLY_HEALTH_UNKNOWN = 0 }; + enum { POWER_SUPPLY_HEALTH_GOOD = 1 }; + enum { POWER_SUPPLY_HEALTH_OVERHEAT = 2 }; + enum { POWER_SUPPLY_HEALTH_DEAD = 3 }; + enum { POWER_SUPPLY_HEALTH_OVERVOLTAGE = 4 }; + enum { POWER_SUPPLY_HEALTH_UNSPEC_FAILURE = 5 }; + enum { POWER_SUPPLY_HEALTH_COLD = 6 }; + enum { POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE = 7 }; + enum { POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE = 8 }; + enum { POWER_SUPPLY_TECHNOLOGY_UNKNOWN = 0 }; + enum { POWER_SUPPLY_TECHNOLOGY_NIMH = 1 }; + enum { POWER_SUPPLY_TECHNOLOGY_LION = 2 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIPO = 3 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIFE = 4 }; + enum { POWER_SUPPLY_TECHNOLOGY_NICD = 5 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIMN = 6 }; + + BatteryState(): + header(), + voltage(0), + temperature(0), + current(0), + charge(0), + capacity(0), + design_capacity(0), + percentage(0), + power_supply_status(0), + power_supply_health(0), + power_supply_technology(0), + present(0), + cell_voltage_length(0), st_cell_voltage(), cell_voltage(nullptr), + cell_temperature_length(0), st_cell_temperature(), cell_temperature(nullptr), + location(""), + serial_number("") + { + } + + 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_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_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_charge; + u_charge.real = this->charge; + *(outbuffer + offset + 0) = (u_charge.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_charge.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_charge.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_charge.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->charge); + union { + float real; + uint32_t base; + } u_capacity; + u_capacity.real = this->capacity; + *(outbuffer + offset + 0) = (u_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->capacity); + union { + float real; + uint32_t base; + } u_design_capacity; + u_design_capacity.real = this->design_capacity; + *(outbuffer + offset + 0) = (u_design_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_design_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_design_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_design_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->design_capacity); + union { + float real; + uint32_t base; + } u_percentage; + u_percentage.real = this->percentage; + *(outbuffer + offset + 0) = (u_percentage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_percentage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_percentage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_percentage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->percentage); + *(outbuffer + offset + 0) = (this->power_supply_status >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_status); + *(outbuffer + offset + 0) = (this->power_supply_health >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_health); + *(outbuffer + offset + 0) = (this->power_supply_technology >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_technology); + union { + bool real; + uint8_t base; + } u_present; + u_present.real = this->present; + *(outbuffer + offset + 0) = (u_present.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->present); + *(outbuffer + offset + 0) = (this->cell_voltage_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cell_voltage_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cell_voltage_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cell_voltage_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_voltage_length); + for( uint32_t i = 0; i < cell_voltage_length; i++){ + union { + float real; + uint32_t base; + } u_cell_voltagei; + u_cell_voltagei.real = this->cell_voltage[i]; + *(outbuffer + offset + 0) = (u_cell_voltagei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_voltagei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_voltagei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_voltagei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_voltage[i]); + } + *(outbuffer + offset + 0) = (this->cell_temperature_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->cell_temperature_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->cell_temperature_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->cell_temperature_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_temperature_length); + for( uint32_t i = 0; i < cell_temperature_length; i++){ + union { + float real; + uint32_t base; + } u_cell_temperaturei; + u_cell_temperaturei.real = this->cell_temperature[i]; + *(outbuffer + offset + 0) = (u_cell_temperaturei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_temperaturei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_temperaturei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_temperaturei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_temperature[i]); + } + uint32_t length_location = strlen(this->location); + varToArr(outbuffer + offset, length_location); + offset += 4; + memcpy(outbuffer + offset, this->location, length_location); + offset += length_location; + 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; + 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_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_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_charge; + u_charge.base = 0; + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->charge = u_charge.real; + offset += sizeof(this->charge); + union { + float real; + uint32_t base; + } u_capacity; + u_capacity.base = 0; + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->capacity = u_capacity.real; + offset += sizeof(this->capacity); + union { + float real; + uint32_t base; + } u_design_capacity; + u_design_capacity.base = 0; + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->design_capacity = u_design_capacity.real; + offset += sizeof(this->design_capacity); + union { + float real; + uint32_t base; + } u_percentage; + u_percentage.base = 0; + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->percentage = u_percentage.real; + offset += sizeof(this->percentage); + this->power_supply_status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_status); + this->power_supply_health = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_health); + this->power_supply_technology = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_technology); + union { + bool real; + uint8_t base; + } u_present; + u_present.base = 0; + u_present.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->present = u_present.real; + offset += sizeof(this->present); + uint32_t cell_voltage_lengthT = ((uint32_t) (*(inbuffer + offset))); + cell_voltage_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cell_voltage_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cell_voltage_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cell_voltage_length); + if(cell_voltage_lengthT > cell_voltage_length) + this->cell_voltage = (float*)realloc(this->cell_voltage, cell_voltage_lengthT * sizeof(float)); + cell_voltage_length = cell_voltage_lengthT; + for( uint32_t i = 0; i < cell_voltage_length; i++){ + union { + float real; + uint32_t base; + } u_st_cell_voltage; + u_st_cell_voltage.base = 0; + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_cell_voltage = u_st_cell_voltage.real; + offset += sizeof(this->st_cell_voltage); + memcpy( &(this->cell_voltage[i]), &(this->st_cell_voltage), sizeof(float)); + } + uint32_t cell_temperature_lengthT = ((uint32_t) (*(inbuffer + offset))); + cell_temperature_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + cell_temperature_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + cell_temperature_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->cell_temperature_length); + if(cell_temperature_lengthT > cell_temperature_length) + this->cell_temperature = (float*)realloc(this->cell_temperature, cell_temperature_lengthT * sizeof(float)); + cell_temperature_length = cell_temperature_lengthT; + for( uint32_t i = 0; i < cell_temperature_length; i++){ + union { + float real; + uint32_t base; + } u_st_cell_temperature; + u_st_cell_temperature.base = 0; + u_st_cell_temperature.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_cell_temperature.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_cell_temperature.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_cell_temperature.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_cell_temperature = u_st_cell_temperature.real; + offset += sizeof(this->st_cell_temperature); + memcpy( &(this->cell_temperature[i]), &(this->st_cell_temperature), sizeof(float)); + } + uint32_t length_location; + arrToVar(length_location, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_location; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_location-1]=0; + this->location = (char *)(inbuffer + offset-1); + offset += length_location; + 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; + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/BatteryState"; }; + virtual const char * getMD5() override { return "4ddae7f048e32fda22cac764685e3974"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/CameraInfo.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/CameraInfo.h new file mode 100644 index 000000000..e863770ec --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/CameraInfo.h @@ -0,0 +1,168 @@ +#ifndef _ROS_sensor_msgs_CameraInfo_h +#define _ROS_sensor_msgs_CameraInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/RegionOfInterest.h" + +namespace sensor_msgs +{ + + class CameraInfo : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _height_type; + _height_type height; + typedef uint32_t _width_type; + _width_type width; + typedef const char* _distortion_model_type; + _distortion_model_type distortion_model; + uint32_t D_length; + typedef float _D_type; + _D_type st_D; + _D_type * D; + float K[9]; + float R[9]; + float P[12]; + 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; + + CameraInfo(): + header(), + height(0), + width(0), + distortion_model(""), + D_length(0), st_D(), D(nullptr), + K(), + R(), + P(), + binning_x(0), + binning_y(0), + roi() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + uint32_t length_distortion_model = strlen(this->distortion_model); + varToArr(outbuffer + offset, length_distortion_model); + offset += 4; + memcpy(outbuffer + offset, this->distortion_model, length_distortion_model); + offset += length_distortion_model; + *(outbuffer + offset + 0) = (this->D_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->D_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->D_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->D_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->D_length); + for( uint32_t i = 0; i < D_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->D[i]); + } + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->K[i]); + } + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->R[i]); + } + for( uint32_t i = 0; i < 12; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->P[i]); + } + *(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; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t length_distortion_model; + arrToVar(length_distortion_model, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_distortion_model; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_distortion_model-1]=0; + this->distortion_model = (char *)(inbuffer + offset-1); + offset += length_distortion_model; + uint32_t D_lengthT = ((uint32_t) (*(inbuffer + offset))); + D_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + D_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + D_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->D_length); + if(D_lengthT > D_length) + this->D = (float*)realloc(this->D, D_lengthT * sizeof(float)); + D_length = D_lengthT; + for( uint32_t i = 0; i < D_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_D)); + memcpy( &(this->D[i]), &(this->st_D), sizeof(float)); + } + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->K[i])); + } + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->R[i])); + } + for( uint32_t i = 0; i < 12; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->P[i])); + } + 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 "sensor_msgs/CameraInfo"; }; + virtual const char * getMD5() override { return "c9a58c1b0b154e0e6da7578cb991d214"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/ChannelFloat32.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/ChannelFloat32.h new file mode 100644 index 000000000..20e684840 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/ChannelFloat32.h @@ -0,0 +1,99 @@ +#ifndef _ROS_sensor_msgs_ChannelFloat32_h +#define _ROS_sensor_msgs_ChannelFloat32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class ChannelFloat32 : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + uint32_t values_length; + typedef float _values_type; + _values_type st_values; + _values_type * values; + + ChannelFloat32(): + name(""), + values_length(0), st_values(), values(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; + *(outbuffer + offset + 0) = (this->values_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->values_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->values_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->values_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->values_length); + for( uint32_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_valuesi; + u_valuesi.real = this->values[i]; + *(outbuffer + offset + 0) = (u_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->values[i]); + } + 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 values_lengthT = ((uint32_t) (*(inbuffer + offset))); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + values_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->values_length); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + values_length = values_lengthT; + for( uint32_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_st_values; + u_st_values.base = 0; + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_values = u_st_values.real; + offset += sizeof(this->st_values); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/ChannelFloat32"; }; + virtual const char * getMD5() override { return "3d40139cdd33dfedcb71ffeeeb42ae7f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/CompressedImage.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/CompressedImage.h new file mode 100644 index 000000000..ece9b21ad --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/CompressedImage.h @@ -0,0 +1,88 @@ +#ifndef _ROS_sensor_msgs_CompressedImage_h +#define _ROS_sensor_msgs_CompressedImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class CompressedImage : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _format_type; + _format_type format; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + CompressedImage(): + header(), + format(""), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_format = strlen(this->format); + varToArr(outbuffer + offset, length_format); + offset += 4; + memcpy(outbuffer + offset, this->format, length_format); + offset += length_format; + *(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 length_format; + arrToVar(length_format, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_format; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_format-1]=0; + this->format = (char *)(inbuffer + offset-1); + offset += length_format; + 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 "sensor_msgs/CompressedImage"; }; + virtual const char * getMD5() override { return "8f7a12909da2c9d3332d540a0977563f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/FluidPressure.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/FluidPressure.h new file mode 100644 index 000000000..055e907c2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/FluidPressure.h @@ -0,0 +1,54 @@ +#ifndef _ROS_sensor_msgs_FluidPressure_h +#define _ROS_sensor_msgs_FluidPressure_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class FluidPressure : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _fluid_pressure_type; + _fluid_pressure_type fluid_pressure; + typedef float _variance_type; + _variance_type variance; + + FluidPressure(): + header(), + fluid_pressure(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->fluid_pressure); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->fluid_pressure)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/FluidPressure"; }; + virtual const char * getMD5() override { return "804dc5cea1c5306d6a2eb80b9833befe"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Illuminance.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Illuminance.h new file mode 100644 index 000000000..d2e9d78db --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Illuminance.h @@ -0,0 +1,54 @@ +#ifndef _ROS_sensor_msgs_Illuminance_h +#define _ROS_sensor_msgs_Illuminance_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Illuminance : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _illuminance_type; + _illuminance_type illuminance; + typedef float _variance_type; + _variance_type variance; + + Illuminance(): + header(), + illuminance(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->illuminance); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->illuminance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/Illuminance"; }; + virtual const char * getMD5() override { return "8cf5febb0952fca9d650c3d11a81a188"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Image.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Image.h new file mode 100644 index 000000000..4ed8efff8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Image.h @@ -0,0 +1,134 @@ +#ifndef _ROS_sensor_msgs_Image_h +#define _ROS_sensor_msgs_Image_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Image : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _height_type; + _height_type height; + typedef uint32_t _width_type; + _width_type width; + typedef const char* _encoding_type; + _encoding_type encoding; + typedef uint8_t _is_bigendian_type; + _is_bigendian_type is_bigendian; + typedef uint32_t _step_type; + _step_type step; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + Image(): + header(), + height(0), + width(0), + encoding(""), + is_bigendian(0), + step(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->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + uint32_t length_encoding = strlen(this->encoding); + varToArr(outbuffer + offset, length_encoding); + offset += 4; + memcpy(outbuffer + offset, this->encoding, length_encoding); + offset += length_encoding; + *(outbuffer + offset + 0) = (this->is_bigendian >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_bigendian); + *(outbuffer + offset + 0) = (this->step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->step >> (8 * 3)) & 0xFF; + offset += sizeof(this->step); + *(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->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t length_encoding; + arrToVar(length_encoding, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_encoding; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_encoding-1]=0; + this->encoding = (char *)(inbuffer + offset-1); + offset += length_encoding; + this->is_bigendian = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->is_bigendian); + this->step = ((uint32_t) (*(inbuffer + offset))); + this->step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->step); + 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 "sensor_msgs/Image"; }; + virtual const char * getMD5() override { return "060021388200f6f0f447d0fcd9c64743"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Imu.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Imu.h new file mode 100644 index 000000000..6ae47b4b2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Imu.h @@ -0,0 +1,85 @@ +#ifndef _ROS_sensor_msgs_Imu_h +#define _ROS_sensor_msgs_Imu_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" +#include "geometry_msgs/Vector3.h" + +namespace sensor_msgs +{ + + class Imu : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Quaternion _orientation_type; + _orientation_type orientation; + float orientation_covariance[9]; + typedef geometry_msgs::Vector3 _angular_velocity_type; + _angular_velocity_type angular_velocity; + float angular_velocity_covariance[9]; + typedef geometry_msgs::Vector3 _linear_acceleration_type; + _linear_acceleration_type linear_acceleration; + float linear_acceleration_covariance[9]; + + Imu(): + header(), + orientation(), + orientation_covariance(), + angular_velocity(), + angular_velocity_covariance(), + linear_acceleration(), + linear_acceleration_covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->orientation_covariance[i]); + } + offset += this->angular_velocity.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->angular_velocity_covariance[i]); + } + offset += this->linear_acceleration.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->linear_acceleration_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->orientation_covariance[i])); + } + offset += this->angular_velocity.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->angular_velocity_covariance[i])); + } + offset += this->linear_acceleration.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->linear_acceleration_covariance[i])); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/Imu"; }; + virtual const char * getMD5() override { return "6a62c6daae103f4ff57a132d6f95cec2"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JointState.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JointState.h new file mode 100644 index 000000000..b10bd5713 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JointState.h @@ -0,0 +1,156 @@ +#ifndef _ROS_sensor_msgs_JointState_h +#define _ROS_sensor_msgs_JointState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class JointState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t name_length; + typedef char* _name_type; + _name_type st_name; + _name_type * name; + uint32_t position_length; + typedef float _position_type; + _position_type st_position; + _position_type * position; + uint32_t velocity_length; + typedef float _velocity_type; + _velocity_type st_velocity; + _velocity_type * velocity; + uint32_t effort_length; + typedef float _effort_type; + _effort_type st_effort; + _effort_type * effort; + + JointState(): + header(), + name_length(0), st_name(), name(nullptr), + position_length(0), st_position(), position(nullptr), + velocity_length(0), st_velocity(), velocity(nullptr), + effort_length(0), st_effort(), effort(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->name_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->name_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->name_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->name_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->name_length); + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + varToArr(outbuffer + offset, length_namei); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset + 0) = (this->position_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->position_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->position_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->position_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->position_length); + for( uint32_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset + 0) = (this->velocity_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->velocity_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->velocity_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->velocity_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->velocity_length); + for( uint32_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset + 0) = (this->effort_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->effort_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->effort_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->effort_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->effort_length); + for( uint32_t i = 0; i < effort_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->effort[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t name_lengthT = ((uint32_t) (*(inbuffer + offset))); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + name_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->name_length); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + name_length = name_lengthT; + for( uint32_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + arrToVar(length_st_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint32_t position_lengthT = ((uint32_t) (*(inbuffer + offset))); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + position_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->position_length); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + position_length = position_lengthT; + for( uint32_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint32_t velocity_lengthT = ((uint32_t) (*(inbuffer + offset))); + velocity_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + velocity_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + velocity_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->velocity_length); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + velocity_length = velocity_lengthT; + for( uint32_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint32_t effort_lengthT = ((uint32_t) (*(inbuffer + offset))); + effort_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + effort_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + effort_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->effort_length); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + effort_length = effort_lengthT; + for( uint32_t i = 0; i < effort_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_effort)); + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/JointState"; }; + virtual const char * getMD5() override { return "3066dcd76a6cfaef579bd0f34173e9fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Joy.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Joy.h new file mode 100644 index 000000000..d5de20ed3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Joy.h @@ -0,0 +1,132 @@ +#ifndef _ROS_sensor_msgs_Joy_h +#define _ROS_sensor_msgs_Joy_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Joy : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t axes_length; + typedef float _axes_type; + _axes_type st_axes; + _axes_type * axes; + uint32_t buttons_length; + typedef int32_t _buttons_type; + _buttons_type st_buttons; + _buttons_type * buttons; + + Joy(): + header(), + axes_length(0), st_axes(), axes(nullptr), + buttons_length(0), st_buttons(), buttons(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->axes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->axes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->axes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->axes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->axes_length); + for( uint32_t i = 0; i < axes_length; i++){ + union { + float real; + uint32_t base; + } u_axesi; + u_axesi.real = this->axes[i]; + *(outbuffer + offset + 0) = (u_axesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_axesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_axesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_axesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->axes[i]); + } + *(outbuffer + offset + 0) = (this->buttons_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->buttons_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->buttons_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->buttons_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->buttons_length); + for( uint32_t i = 0; i < buttons_length; i++){ + union { + int32_t real; + uint32_t base; + } u_buttonsi; + u_buttonsi.real = this->buttons[i]; + *(outbuffer + offset + 0) = (u_buttonsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_buttonsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_buttonsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_buttonsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->buttons[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t axes_lengthT = ((uint32_t) (*(inbuffer + offset))); + axes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + axes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + axes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->axes_length); + if(axes_lengthT > axes_length) + this->axes = (float*)realloc(this->axes, axes_lengthT * sizeof(float)); + axes_length = axes_lengthT; + for( uint32_t i = 0; i < axes_length; i++){ + union { + float real; + uint32_t base; + } u_st_axes; + u_st_axes.base = 0; + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_axes = u_st_axes.real; + offset += sizeof(this->st_axes); + memcpy( &(this->axes[i]), &(this->st_axes), sizeof(float)); + } + uint32_t buttons_lengthT = ((uint32_t) (*(inbuffer + offset))); + buttons_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + buttons_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + buttons_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->buttons_length); + if(buttons_lengthT > buttons_length) + this->buttons = (int32_t*)realloc(this->buttons, buttons_lengthT * sizeof(int32_t)); + buttons_length = buttons_lengthT; + for( uint32_t i = 0; i < buttons_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_buttons; + u_st_buttons.base = 0; + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_buttons = u_st_buttons.real; + offset += sizeof(this->st_buttons); + memcpy( &(this->buttons[i]), &(this->st_buttons), sizeof(int32_t)); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/Joy"; }; + virtual const char * getMD5() override { return "5a9ea5f83505693b71e785041e67a8bb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JoyFeedback.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JoyFeedback.h new file mode 100644 index 000000000..e00085abb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JoyFeedback.h @@ -0,0 +1,79 @@ +#ifndef _ROS_sensor_msgs_JoyFeedback_h +#define _ROS_sensor_msgs_JoyFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class JoyFeedback : public ros::Msg + { + public: + typedef uint8_t _type_type; + _type_type type; + typedef uint8_t _id_type; + _id_type id; + typedef float _intensity_type; + _intensity_type intensity; + enum { TYPE_LED = 0 }; + enum { TYPE_RUMBLE = 1 }; + enum { TYPE_BUZZER = 2 }; + + JoyFeedback(): + type(0), + id(0), + intensity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_intensity; + u_intensity.real = this->intensity; + *(outbuffer + offset + 0) = (u_intensity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intensity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intensity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intensity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + this->id = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_intensity; + u_intensity.base = 0; + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->intensity = u_intensity.real; + offset += sizeof(this->intensity); + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/JoyFeedback"; }; + virtual const char * getMD5() override { return "f4dcd73460360d98f36e55ee7f2e46f1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JoyFeedbackArray.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JoyFeedbackArray.h new file mode 100644 index 000000000..0e570207d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/JoyFeedbackArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_sensor_msgs_JoyFeedbackArray_h +#define _ROS_sensor_msgs_JoyFeedbackArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JoyFeedback.h" + +namespace sensor_msgs +{ + + class JoyFeedbackArray : public ros::Msg + { + public: + uint32_t array_length; + typedef sensor_msgs::JoyFeedback _array_type; + _array_type st_array; + _array_type * array; + + JoyFeedbackArray(): + array_length(0), st_array(), array(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->array_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->array_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->array_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->array_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->array_length); + for( uint32_t i = 0; i < array_length; i++){ + offset += this->array[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t array_lengthT = ((uint32_t) (*(inbuffer + offset))); + array_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + array_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + array_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->array_length); + if(array_lengthT > array_length) + this->array = (sensor_msgs::JoyFeedback*)realloc(this->array, array_lengthT * sizeof(sensor_msgs::JoyFeedback)); + array_length = array_lengthT; + for( uint32_t i = 0; i < array_length; i++){ + offset += this->st_array.deserialize(inbuffer + offset); + memcpy( &(this->array[i]), &(this->st_array), sizeof(sensor_msgs::JoyFeedback)); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/JoyFeedbackArray"; }; + virtual const char * getMD5() override { return "cde5730a895b1fc4dee6f91b754b213d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/LaserEcho.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/LaserEcho.h new file mode 100644 index 000000000..359bc8646 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/LaserEcho.h @@ -0,0 +1,82 @@ +#ifndef _ROS_sensor_msgs_LaserEcho_h +#define _ROS_sensor_msgs_LaserEcho_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class LaserEcho : public ros::Msg + { + public: + uint32_t echoes_length; + typedef float _echoes_type; + _echoes_type st_echoes; + _echoes_type * echoes; + + LaserEcho(): + echoes_length(0), st_echoes(), echoes(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->echoes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->echoes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->echoes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->echoes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->echoes_length); + for( uint32_t i = 0; i < echoes_length; i++){ + union { + float real; + uint32_t base; + } u_echoesi; + u_echoesi.real = this->echoes[i]; + *(outbuffer + offset + 0) = (u_echoesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_echoesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_echoesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_echoesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->echoes[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t echoes_lengthT = ((uint32_t) (*(inbuffer + offset))); + echoes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + echoes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + echoes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->echoes_length); + if(echoes_lengthT > echoes_length) + this->echoes = (float*)realloc(this->echoes, echoes_lengthT * sizeof(float)); + echoes_length = echoes_lengthT; + for( uint32_t i = 0; i < echoes_length; i++){ + union { + float real; + uint32_t base; + } u_st_echoes; + u_st_echoes.base = 0; + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_echoes = u_st_echoes.real; + offset += sizeof(this->st_echoes); + memcpy( &(this->echoes[i]), &(this->st_echoes), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/LaserEcho"; }; + virtual const char * getMD5() override { return "8bc5ae449b200fba4d552b4225586696"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/LaserScan.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/LaserScan.h new file mode 100644 index 000000000..5257b02e7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/LaserScan.h @@ -0,0 +1,300 @@ +#ifndef _ROS_sensor_msgs_LaserScan_h +#define _ROS_sensor_msgs_LaserScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class LaserScan : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _angle_min_type; + _angle_min_type angle_min; + typedef float _angle_max_type; + _angle_max_type angle_max; + typedef float _angle_increment_type; + _angle_increment_type angle_increment; + typedef float _time_increment_type; + _time_increment_type time_increment; + typedef float _scan_time_type; + _scan_time_type scan_time; + typedef float _range_min_type; + _range_min_type range_min; + typedef float _range_max_type; + _range_max_type range_max; + uint32_t ranges_length; + typedef float _ranges_type; + _ranges_type st_ranges; + _ranges_type * ranges; + uint32_t intensities_length; + typedef float _intensities_type; + _intensities_type st_intensities; + _intensities_type * intensities; + + LaserScan(): + header(), + angle_min(0), + angle_max(0), + angle_increment(0), + time_increment(0), + scan_time(0), + range_min(0), + range_max(0), + ranges_length(0), st_ranges(), ranges(nullptr), + intensities_length(0), st_intensities(), intensities(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.real = this->angle_min; + *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.real = this->angle_max; + *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.real = this->angle_increment; + *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.real = this->time_increment; + *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.real = this->scan_time; + *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.real = this->range_min; + *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.real = this->range_max; + *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_max); + *(outbuffer + offset + 0) = (this->ranges_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ranges_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ranges_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ranges_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ranges_length); + for( uint32_t i = 0; i < ranges_length; i++){ + union { + float real; + uint32_t base; + } u_rangesi; + u_rangesi.real = this->ranges[i]; + *(outbuffer + offset + 0) = (u_rangesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rangesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rangesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rangesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ranges[i]); + } + *(outbuffer + offset + 0) = (this->intensities_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->intensities_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->intensities_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->intensities_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensities_length); + for( uint32_t i = 0; i < intensities_length; i++){ + union { + float real; + uint32_t base; + } u_intensitiesi; + u_intensitiesi.real = this->intensities[i]; + *(outbuffer + offset + 0) = (u_intensitiesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intensitiesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intensitiesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intensitiesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensities[i]); + } + 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_angle_min; + u_angle_min.base = 0; + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_min = u_angle_min.real; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.base = 0; + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_max = u_angle_max.real; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.base = 0; + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_increment = u_angle_increment.real; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.base = 0; + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_increment = u_time_increment.real; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.base = 0; + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scan_time = u_scan_time.real; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.base = 0; + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_min = u_range_min.real; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.base = 0; + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_max = u_range_max.real; + offset += sizeof(this->range_max); + uint32_t ranges_lengthT = ((uint32_t) (*(inbuffer + offset))); + ranges_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ranges_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ranges_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ranges_length); + if(ranges_lengthT > ranges_length) + this->ranges = (float*)realloc(this->ranges, ranges_lengthT * sizeof(float)); + ranges_length = ranges_lengthT; + for( uint32_t i = 0; i < ranges_length; i++){ + union { + float real; + uint32_t base; + } u_st_ranges; + u_st_ranges.base = 0; + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ranges = u_st_ranges.real; + offset += sizeof(this->st_ranges); + memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(float)); + } + uint32_t intensities_lengthT = ((uint32_t) (*(inbuffer + offset))); + intensities_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + intensities_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + intensities_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->intensities_length); + if(intensities_lengthT > intensities_length) + this->intensities = (float*)realloc(this->intensities, intensities_lengthT * sizeof(float)); + intensities_length = intensities_lengthT; + for( uint32_t i = 0; i < intensities_length; i++){ + union { + float real; + uint32_t base; + } u_st_intensities; + u_st_intensities.base = 0; + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_intensities = u_st_intensities.real; + offset += sizeof(this->st_intensities); + memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/LaserScan"; }; + virtual const char * getMD5() override { return "90c7ef2dc6895d81024acba2ac42f369"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MagneticField.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MagneticField.h new file mode 100644 index 000000000..e5d4bed0c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MagneticField.h @@ -0,0 +1,58 @@ +#ifndef _ROS_sensor_msgs_MagneticField_h +#define _ROS_sensor_msgs_MagneticField_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace sensor_msgs +{ + + class MagneticField : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Vector3 _magnetic_field_type; + _magnetic_field_type magnetic_field; + float magnetic_field_covariance[9]; + + MagneticField(): + header(), + magnetic_field(), + magnetic_field_covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->magnetic_field.serialize(outbuffer + offset); + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->magnetic_field_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->magnetic_field.deserialize(inbuffer + offset); + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->magnetic_field_covariance[i])); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/MagneticField"; }; + virtual const char * getMD5() override { return "2f3b0b43eed0c9501de0fa3ff89a45aa"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MultiDOFJointState.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MultiDOFJointState.h new file mode 100644 index 000000000..e7f3fd523 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MultiDOFJointState.h @@ -0,0 +1,159 @@ +#ifndef _ROS_sensor_msgs_MultiDOFJointState_h +#define _ROS_sensor_msgs_MultiDOFJointState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" + +namespace sensor_msgs +{ + + class MultiDOFJointState : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t transforms_length; + typedef geometry_msgs::Transform _transforms_type; + _transforms_type st_transforms; + _transforms_type * transforms; + uint32_t twist_length; + typedef geometry_msgs::Twist _twist_type; + _twist_type st_twist; + _twist_type * twist; + uint32_t wrench_length; + typedef geometry_msgs::Wrench _wrench_type; + _wrench_type st_wrench; + _wrench_type * wrench; + + MultiDOFJointState(): + header(), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + transforms_length(0), st_transforms(), transforms(nullptr), + twist_length(0), st_twist(), twist(nullptr), + wrench_length(0), st_wrench(), wrench(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset + 0) = (this->transforms_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->transforms_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->transforms_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->transforms_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->transforms_length); + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->twist_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->twist_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->twist_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->twist_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->twist_length); + for( uint32_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->wrench_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->wrench_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->wrench_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->wrench_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->wrench_length); + for( uint32_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint32_t transforms_lengthT = ((uint32_t) (*(inbuffer + offset))); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->transforms_length); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + transforms_length = transforms_lengthT; + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::Transform)); + } + uint32_t twist_lengthT = ((uint32_t) (*(inbuffer + offset))); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + twist_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->twist_length); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + twist_length = twist_lengthT; + for( uint32_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + uint32_t wrench_lengthT = ((uint32_t) (*(inbuffer + offset))); + wrench_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + wrench_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + wrench_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->wrench_length); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + wrench_length = wrench_lengthT; + for( uint32_t i = 0; i < wrench_length; i++){ + offset += this->st_wrench.deserialize(inbuffer + offset); + memcpy( &(this->wrench[i]), &(this->st_wrench), sizeof(geometry_msgs::Wrench)); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/MultiDOFJointState"; }; + virtual const char * getMD5() override { return "690f272f0640d2631c305eeb8301e59d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h new file mode 100644 index 000000000..725e5e228 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h @@ -0,0 +1,263 @@ +#ifndef _ROS_sensor_msgs_MultiEchoLaserScan_h +#define _ROS_sensor_msgs_MultiEchoLaserScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/LaserEcho.h" + +namespace sensor_msgs +{ + + class MultiEchoLaserScan : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _angle_min_type; + _angle_min_type angle_min; + typedef float _angle_max_type; + _angle_max_type angle_max; + typedef float _angle_increment_type; + _angle_increment_type angle_increment; + typedef float _time_increment_type; + _time_increment_type time_increment; + typedef float _scan_time_type; + _scan_time_type scan_time; + typedef float _range_min_type; + _range_min_type range_min; + typedef float _range_max_type; + _range_max_type range_max; + uint32_t ranges_length; + typedef sensor_msgs::LaserEcho _ranges_type; + _ranges_type st_ranges; + _ranges_type * ranges; + uint32_t intensities_length; + typedef sensor_msgs::LaserEcho _intensities_type; + _intensities_type st_intensities; + _intensities_type * intensities; + + MultiEchoLaserScan(): + header(), + angle_min(0), + angle_max(0), + angle_increment(0), + time_increment(0), + scan_time(0), + range_min(0), + range_max(0), + ranges_length(0), st_ranges(), ranges(nullptr), + intensities_length(0), st_intensities(), intensities(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.real = this->angle_min; + *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.real = this->angle_max; + *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.real = this->angle_increment; + *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.real = this->time_increment; + *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.real = this->scan_time; + *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.real = this->range_min; + *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.real = this->range_max; + *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_max); + *(outbuffer + offset + 0) = (this->ranges_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->ranges_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->ranges_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->ranges_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->ranges_length); + for( uint32_t i = 0; i < ranges_length; i++){ + offset += this->ranges[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->intensities_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->intensities_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->intensities_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->intensities_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensities_length); + for( uint32_t i = 0; i < intensities_length; i++){ + offset += this->intensities[i].serialize(outbuffer + offset); + } + 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_angle_min; + u_angle_min.base = 0; + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_min = u_angle_min.real; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.base = 0; + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_max = u_angle_max.real; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.base = 0; + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_increment = u_angle_increment.real; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.base = 0; + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_increment = u_time_increment.real; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.base = 0; + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scan_time = u_scan_time.real; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.base = 0; + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_min = u_range_min.real; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.base = 0; + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_max = u_range_max.real; + offset += sizeof(this->range_max); + uint32_t ranges_lengthT = ((uint32_t) (*(inbuffer + offset))); + ranges_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + ranges_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + ranges_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->ranges_length); + if(ranges_lengthT > ranges_length) + this->ranges = (sensor_msgs::LaserEcho*)realloc(this->ranges, ranges_lengthT * sizeof(sensor_msgs::LaserEcho)); + ranges_length = ranges_lengthT; + for( uint32_t i = 0; i < ranges_length; i++){ + offset += this->st_ranges.deserialize(inbuffer + offset); + memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(sensor_msgs::LaserEcho)); + } + uint32_t intensities_lengthT = ((uint32_t) (*(inbuffer + offset))); + intensities_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + intensities_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + intensities_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->intensities_length); + if(intensities_lengthT > intensities_length) + this->intensities = (sensor_msgs::LaserEcho*)realloc(this->intensities, intensities_lengthT * sizeof(sensor_msgs::LaserEcho)); + intensities_length = intensities_lengthT; + for( uint32_t i = 0; i < intensities_length; i++){ + offset += this->st_intensities.deserialize(inbuffer + offset); + memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(sensor_msgs::LaserEcho)); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/MultiEchoLaserScan"; }; + virtual const char * getMD5() override { return "6fefb0c6da89d7c8abe4b339f5c2f8fb"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/NavSatFix.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/NavSatFix.h new file mode 100644 index 000000000..3ff80bd12 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/NavSatFix.h @@ -0,0 +1,84 @@ +#ifndef _ROS_sensor_msgs_NavSatFix_h +#define _ROS_sensor_msgs_NavSatFix_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/NavSatStatus.h" + +namespace sensor_msgs +{ + + class NavSatFix : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef sensor_msgs::NavSatStatus _status_type; + _status_type status; + typedef float _latitude_type; + _latitude_type latitude; + typedef float _longitude_type; + _longitude_type longitude; + typedef float _altitude_type; + _altitude_type altitude; + float position_covariance[9]; + typedef uint8_t _position_covariance_type_type; + _position_covariance_type_type position_covariance_type; + enum { COVARIANCE_TYPE_UNKNOWN = 0 }; + enum { COVARIANCE_TYPE_APPROXIMATED = 1 }; + enum { COVARIANCE_TYPE_DIAGONAL_KNOWN = 2 }; + enum { COVARIANCE_TYPE_KNOWN = 3 }; + + NavSatFix(): + header(), + status(), + latitude(0), + longitude(0), + altitude(0), + position_covariance(), + position_covariance_type(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->latitude); + offset += serializeAvrFloat64(outbuffer + offset, this->longitude); + offset += serializeAvrFloat64(outbuffer + offset, this->altitude); + for( uint32_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position_covariance[i]); + } + *(outbuffer + offset + 0) = (this->position_covariance_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->position_covariance_type); + 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 += deserializeAvrFloat64(inbuffer + offset, &(this->latitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->longitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->altitude)); + for( uint32_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position_covariance[i])); + } + this->position_covariance_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->position_covariance_type); + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/NavSatFix"; }; + virtual const char * getMD5() override { return "2d3a8cd499b9b4a0249fb98fd05cfa48"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/NavSatStatus.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/NavSatStatus.h new file mode 100644 index 000000000..3fa7a2952 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/NavSatStatus.h @@ -0,0 +1,73 @@ +#ifndef _ROS_sensor_msgs_NavSatStatus_h +#define _ROS_sensor_msgs_NavSatStatus_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class NavSatStatus : public ros::Msg + { + public: + typedef int8_t _status_type; + _status_type status; + typedef uint16_t _service_type; + _service_type service; + enum { STATUS_NO_FIX = -1 }; + enum { STATUS_FIX = 0 }; + enum { STATUS_SBAS_FIX = 1 }; + enum { STATUS_GBAS_FIX = 2 }; + enum { SERVICE_GPS = 1 }; + enum { SERVICE_GLONASS = 2 }; + enum { SERVICE_COMPASS = 4 }; + enum { SERVICE_GALILEO = 8 }; + + NavSatStatus(): + status(0), + service(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_status; + u_status.real = this->status; + *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + *(outbuffer + offset + 0) = (this->service >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->service >> (8 * 1)) & 0xFF; + offset += sizeof(this->service); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t 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); + this->service = ((uint16_t) (*(inbuffer + offset))); + this->service |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->service); + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/NavSatStatus"; }; + virtual const char * getMD5() override { return "331cdbddfa4bc96ffc3b9ad98900a54c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointCloud.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointCloud.h new file mode 100644 index 000000000..b19f1eaf3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointCloud.h @@ -0,0 +1,96 @@ +#ifndef _ROS_sensor_msgs_PointCloud_h +#define _ROS_sensor_msgs_PointCloud_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point32.h" +#include "sensor_msgs/ChannelFloat32.h" + +namespace sensor_msgs +{ + + class PointCloud : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t points_length; + typedef geometry_msgs::Point32 _points_type; + _points_type st_points; + _points_type * points; + uint32_t channels_length; + typedef sensor_msgs::ChannelFloat32 _channels_type; + _channels_type st_channels; + _channels_type * channels; + + PointCloud(): + header(), + points_length(0), st_points(), points(nullptr), + 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->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->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++){ + offset += this->channels[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.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 = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + 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(geometry_msgs::Point32)); + } + 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 = (sensor_msgs::ChannelFloat32*)realloc(this->channels, channels_lengthT * sizeof(sensor_msgs::ChannelFloat32)); + channels_length = channels_lengthT; + for( uint32_t i = 0; i < channels_length; i++){ + offset += this->st_channels.deserialize(inbuffer + offset); + memcpy( &(this->channels[i]), &(this->st_channels), sizeof(sensor_msgs::ChannelFloat32)); + } + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/PointCloud"; }; + virtual const char * getMD5() override { return "d8e9c3f5afbdd8a130fd1d2763945fca"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointCloud2.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointCloud2.h new file mode 100644 index 000000000..f2a25303f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointCloud2.h @@ -0,0 +1,185 @@ +#ifndef _ROS_sensor_msgs_PointCloud2_h +#define _ROS_sensor_msgs_PointCloud2_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointField.h" + +namespace sensor_msgs +{ + + class PointCloud2 : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint32_t _height_type; + _height_type height; + typedef uint32_t _width_type; + _width_type width; + uint32_t fields_length; + typedef sensor_msgs::PointField _fields_type; + _fields_type st_fields; + _fields_type * fields; + typedef bool _is_bigendian_type; + _is_bigendian_type is_bigendian; + typedef uint32_t _point_step_type; + _point_step_type point_step; + typedef uint32_t _row_step_type; + _row_step_type row_step; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + typedef bool _is_dense_type; + _is_dense_type is_dense; + + PointCloud2(): + header(), + height(0), + width(0), + fields_length(0), st_fields(), fields(nullptr), + is_bigendian(0), + point_step(0), + row_step(0), + data_length(0), st_data(), data(nullptr), + is_dense(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->fields_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->fields_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->fields_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->fields_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->fields_length); + for( uint32_t i = 0; i < fields_length; i++){ + offset += this->fields[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_is_bigendian; + u_is_bigendian.real = this->is_bigendian; + *(outbuffer + offset + 0) = (u_is_bigendian.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_bigendian); + *(outbuffer + offset + 0) = (this->point_step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->point_step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->point_step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->point_step >> (8 * 3)) & 0xFF; + offset += sizeof(this->point_step); + *(outbuffer + offset + 0) = (this->row_step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->row_step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->row_step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->row_step >> (8 * 3)) & 0xFF; + offset += sizeof(this->row_step); + *(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_is_dense; + u_is_dense.real = this->is_dense; + *(outbuffer + offset + 0) = (u_is_dense.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_dense); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t fields_lengthT = ((uint32_t) (*(inbuffer + offset))); + fields_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + fields_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + fields_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->fields_length); + if(fields_lengthT > fields_length) + this->fields = (sensor_msgs::PointField*)realloc(this->fields, fields_lengthT * sizeof(sensor_msgs::PointField)); + fields_length = fields_lengthT; + for( uint32_t i = 0; i < fields_length; i++){ + offset += this->st_fields.deserialize(inbuffer + offset); + memcpy( &(this->fields[i]), &(this->st_fields), sizeof(sensor_msgs::PointField)); + } + union { + bool real; + uint8_t base; + } u_is_bigendian; + u_is_bigendian.base = 0; + u_is_bigendian.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_bigendian = u_is_bigendian.real; + offset += sizeof(this->is_bigendian); + this->point_step = ((uint32_t) (*(inbuffer + offset))); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->point_step); + this->row_step = ((uint32_t) (*(inbuffer + offset))); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->row_step); + 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_is_dense; + u_is_dense.base = 0; + u_is_dense.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_dense = u_is_dense.real; + offset += sizeof(this->is_dense); + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/PointCloud2"; }; + virtual const char * getMD5() override { return "1158d486dd51d683ce2f1be655c3c181"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointField.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointField.h new file mode 100644 index 000000000..307b33321 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/PointField.h @@ -0,0 +1,96 @@ +#ifndef _ROS_sensor_msgs_PointField_h +#define _ROS_sensor_msgs_PointField_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class PointField : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef uint32_t _offset_type; + _offset_type offset; + typedef uint8_t _datatype_type; + _datatype_type datatype; + typedef uint32_t _count_type; + _count_type count; + enum { INT8 = 1 }; + enum { UINT8 = 2 }; + enum { INT16 = 3 }; + enum { UINT16 = 4 }; + enum { INT32 = 5 }; + enum { UINT32 = 6 }; + enum { FLOAT32 = 7 }; + enum { FLOAT64 = 8 }; + + PointField(): + name(""), + offset(0), + datatype(0), + count(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->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->datatype >> (8 * 0)) & 0xFF; + offset += sizeof(this->datatype); + *(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; + 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->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->datatype = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->datatype); + 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 "sensor_msgs/PointField"; }; + virtual const char * getMD5() override { return "268eacb2962780ceac86cbd17e328150"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Range.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Range.h new file mode 100644 index 000000000..cae1cfca4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Range.h @@ -0,0 +1,149 @@ +#ifndef _ROS_sensor_msgs_Range_h +#define _ROS_sensor_msgs_Range_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Range : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef uint8_t _radiation_type_type; + _radiation_type_type radiation_type; + typedef float _field_of_view_type; + _field_of_view_type field_of_view; + typedef float _min_range_type; + _min_range_type min_range; + typedef float _max_range_type; + _max_range_type max_range; + typedef float _range_type; + _range_type range; + enum { ULTRASOUND = 0 }; + enum { INFRARED = 1 }; + + Range(): + header(), + radiation_type(0), + field_of_view(0), + min_range(0), + max_range(0), + range(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->radiation_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->radiation_type); + union { + float real; + uint32_t base; + } u_field_of_view; + u_field_of_view.real = this->field_of_view; + *(outbuffer + offset + 0) = (u_field_of_view.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_field_of_view.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_field_of_view.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_field_of_view.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->field_of_view); + union { + float real; + uint32_t base; + } u_min_range; + u_min_range.real = this->min_range; + *(outbuffer + offset + 0) = (u_min_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_range); + 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 { + float real; + uint32_t base; + } u_range; + u_range.real = this->range; + *(outbuffer + offset + 0) = (u_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->radiation_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->radiation_type); + union { + float real; + uint32_t base; + } u_field_of_view; + u_field_of_view.base = 0; + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->field_of_view = u_field_of_view.real; + offset += sizeof(this->field_of_view); + union { + float real; + uint32_t base; + } u_min_range; + u_min_range.base = 0; + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_range = u_min_range.real; + offset += sizeof(this->min_range); + 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 { + float real; + uint32_t base; + } u_range; + u_range.base = 0; + u_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range = u_range.real; + offset += sizeof(this->range); + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/Range"; }; + virtual const char * getMD5() override { return "c005c34273dc426c67a020a87bc24148"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/RegionOfInterest.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/RegionOfInterest.h new file mode 100644 index 000000000..735485579 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/RegionOfInterest.h @@ -0,0 +1,108 @@ +#ifndef _ROS_sensor_msgs_RegionOfInterest_h +#define _ROS_sensor_msgs_RegionOfInterest_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class RegionOfInterest : public ros::Msg + { + public: + typedef uint32_t _x_offset_type; + _x_offset_type x_offset; + typedef uint32_t _y_offset_type; + _y_offset_type y_offset; + typedef uint32_t _height_type; + _height_type height; + typedef uint32_t _width_type; + _width_type width; + typedef bool _do_rectify_type; + _do_rectify_type do_rectify; + + RegionOfInterest(): + x_offset(0), + y_offset(0), + height(0), + width(0), + do_rectify(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->x_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->x_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->x_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->x_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->x_offset); + *(outbuffer + offset + 0) = (this->y_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->y_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->y_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->y_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->y_offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + union { + bool real; + uint8_t base; + } u_do_rectify; + u_do_rectify.real = this->do_rectify; + *(outbuffer + offset + 0) = (u_do_rectify.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->do_rectify); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->x_offset = ((uint32_t) (*(inbuffer + offset))); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->x_offset); + this->y_offset = ((uint32_t) (*(inbuffer + offset))); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->y_offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + union { + bool real; + uint8_t base; + } u_do_rectify; + u_do_rectify.base = 0; + u_do_rectify.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->do_rectify = u_do_rectify.real; + offset += sizeof(this->do_rectify); + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/RegionOfInterest"; }; + virtual const char * getMD5() override { return "bdb633039d588fcccb441a4d43ccfe09"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/RelativeHumidity.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/RelativeHumidity.h new file mode 100644 index 000000000..6886f97ad --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/RelativeHumidity.h @@ -0,0 +1,54 @@ +#ifndef _ROS_sensor_msgs_RelativeHumidity_h +#define _ROS_sensor_msgs_RelativeHumidity_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class RelativeHumidity : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _relative_humidity_type; + _relative_humidity_type relative_humidity; + typedef float _variance_type; + _variance_type variance; + + RelativeHumidity(): + header(), + relative_humidity(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->relative_humidity); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->relative_humidity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/RelativeHumidity"; }; + virtual const char * getMD5() override { return "8730015b05955b7e992ce29a2678d90f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/SetCameraInfo.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/SetCameraInfo.h new file mode 100644 index 000000000..1c23c950b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/SetCameraInfo.h @@ -0,0 +1,111 @@ +#ifndef _ROS_SERVICE_SetCameraInfo_h +#define _ROS_SERVICE_SetCameraInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/CameraInfo.h" + +namespace sensor_msgs +{ + +static const char SETCAMERAINFO[] = "sensor_msgs/SetCameraInfo"; + + class SetCameraInfoRequest : public ros::Msg + { + public: + typedef sensor_msgs::CameraInfo _camera_info_type; + _camera_info_type camera_info; + + SetCameraInfoRequest(): + camera_info() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->camera_info.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->camera_info.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SETCAMERAINFO; }; + virtual const char * getMD5() override { return "ee34be01fdeee563d0d99cd594d5581d"; }; + + }; + + class SetCameraInfoResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _status_message_type; + _status_message_type status_message; + + SetCameraInfoResponse(): + success(0), + status_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_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; + 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; + return offset; + } + + virtual const char * getType() override { return SETCAMERAINFO; }; + virtual const char * getMD5() override { return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetCameraInfo { + public: + typedef SetCameraInfoRequest Request; + typedef SetCameraInfoResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Temperature.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Temperature.h new file mode 100644 index 000000000..c9094cd83 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/Temperature.h @@ -0,0 +1,54 @@ +#ifndef _ROS_sensor_msgs_Temperature_h +#define _ROS_sensor_msgs_Temperature_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Temperature : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef float _temperature_type; + _temperature_type temperature; + typedef float _variance_type; + _variance_type variance; + + Temperature(): + header(), + temperature(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->temperature); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->temperature)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/Temperature"; }; + virtual const char * getMD5() override { return "ff71b307acdbe7c871a5a6d7ed359100"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/TimeReference.h b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/TimeReference.h new file mode 100644 index 000000000..2e2abb554 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sensor_msgs/TimeReference.h @@ -0,0 +1,85 @@ +#ifndef _ROS_sensor_msgs_TimeReference_h +#define _ROS_sensor_msgs_TimeReference_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/time.h" + +namespace sensor_msgs +{ + + class TimeReference : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef ros::Time _time_ref_type; + _time_ref_type time_ref; + typedef const char* _source_type; + _source_type source; + + TimeReference(): + header(), + time_ref(), + source("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->time_ref.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_ref.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_ref.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_ref.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_ref.sec); + *(outbuffer + offset + 0) = (this->time_ref.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_ref.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_ref.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_ref.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_ref.nsec); + uint32_t length_source = strlen(this->source); + varToArr(outbuffer + offset, length_source); + offset += 4; + memcpy(outbuffer + offset, this->source, length_source); + offset += length_source; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->time_ref.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_ref.sec); + this->time_ref.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_ref.nsec); + uint32_t length_source; + arrToVar(length_source, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_source; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_source-1]=0; + this->source = (char *)(inbuffer + offset-1); + offset += length_source; + return offset; + } + + virtual const char * getType() override { return "sensor_msgs/TimeReference"; }; + virtual const char * getMD5() override { return "fded64a0265108ba86c3d38fb11c0c16"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/shape_msgs/Mesh.h b/smart_device_protocol/ros_lib/ros_lib/shape_msgs/Mesh.h new file mode 100644 index 000000000..9c06eef00 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/shape_msgs/Mesh.h @@ -0,0 +1,90 @@ +#ifndef _ROS_shape_msgs_Mesh_h +#define _ROS_shape_msgs_Mesh_h + +#include +#include +#include +#include "ros/msg.h" +#include "shape_msgs/MeshTriangle.h" +#include "geometry_msgs/Point.h" + +namespace shape_msgs +{ + + class Mesh : public ros::Msg + { + public: + uint32_t triangles_length; + typedef shape_msgs::MeshTriangle _triangles_type; + _triangles_type st_triangles; + _triangles_type * triangles; + uint32_t vertices_length; + typedef geometry_msgs::Point _vertices_type; + _vertices_type st_vertices; + _vertices_type * vertices; + + Mesh(): + triangles_length(0), st_triangles(), triangles(nullptr), + vertices_length(0), st_vertices(), vertices(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->triangles_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->triangles_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->triangles_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->triangles_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->triangles_length); + for( uint32_t i = 0; i < triangles_length; i++){ + offset += this->triangles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->vertices_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertices_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertices_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertices_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertices_length); + for( uint32_t i = 0; i < vertices_length; i++){ + offset += this->vertices[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t triangles_lengthT = ((uint32_t) (*(inbuffer + offset))); + triangles_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + triangles_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + triangles_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->triangles_length); + if(triangles_lengthT > triangles_length) + this->triangles = (shape_msgs::MeshTriangle*)realloc(this->triangles, triangles_lengthT * sizeof(shape_msgs::MeshTriangle)); + triangles_length = triangles_lengthT; + for( uint32_t i = 0; i < triangles_length; i++){ + offset += this->st_triangles.deserialize(inbuffer + offset); + memcpy( &(this->triangles[i]), &(this->st_triangles), sizeof(shape_msgs::MeshTriangle)); + } + uint32_t vertices_lengthT = ((uint32_t) (*(inbuffer + offset))); + vertices_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + vertices_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + vertices_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vertices_length); + if(vertices_lengthT > vertices_length) + this->vertices = (geometry_msgs::Point*)realloc(this->vertices, vertices_lengthT * sizeof(geometry_msgs::Point)); + vertices_length = vertices_lengthT; + for( uint32_t i = 0; i < vertices_length; i++){ + offset += this->st_vertices.deserialize(inbuffer + offset); + memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(geometry_msgs::Point)); + } + return offset; + } + + virtual const char * getType() override { return "shape_msgs/Mesh"; }; + virtual const char * getMD5() override { return "1ffdae9486cd3316a121c578b47a85cc"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/shape_msgs/MeshTriangle.h b/smart_device_protocol/ros_lib/ros_lib/shape_msgs/MeshTriangle.h new file mode 100644 index 000000000..93dcf1731 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/shape_msgs/MeshTriangle.h @@ -0,0 +1,54 @@ +#ifndef _ROS_shape_msgs_MeshTriangle_h +#define _ROS_shape_msgs_MeshTriangle_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class MeshTriangle : public ros::Msg + { + public: + uint32_t vertex_indices[3]; + + MeshTriangle(): + vertex_indices() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 3; i++){ + *(outbuffer + offset + 0) = (this->vertex_indices[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertex_indices[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertex_indices[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertex_indices[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertex_indices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 3; i++){ + this->vertex_indices[i] = ((uint32_t) (*(inbuffer + offset))); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vertex_indices[i]); + } + return offset; + } + + virtual const char * getType() override { return "shape_msgs/MeshTriangle"; }; + virtual const char * getMD5() override { return "23688b2e6d2de3d32fe8af104a903253"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/shape_msgs/Plane.h b/smart_device_protocol/ros_lib/ros_lib/shape_msgs/Plane.h new file mode 100644 index 000000000..c25ac7fec --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/shape_msgs/Plane.h @@ -0,0 +1,46 @@ +#ifndef _ROS_shape_msgs_Plane_h +#define _ROS_shape_msgs_Plane_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class Plane : public ros::Msg + { + public: + float coef[4]; + + Plane(): + coef() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + for( uint32_t i = 0; i < 4; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->coef[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + for( uint32_t i = 0; i < 4; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->coef[i])); + } + return offset; + } + + virtual const char * getType() override { return "shape_msgs/Plane"; }; + virtual const char * getMD5() override { return "2c1b92ed8f31492f8e73f6a4a44ca796"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/shape_msgs/SolidPrimitive.h b/smart_device_protocol/ros_lib/ros_lib/shape_msgs/SolidPrimitive.h new file mode 100644 index 000000000..45c34023c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/shape_msgs/SolidPrimitive.h @@ -0,0 +1,82 @@ +#ifndef _ROS_shape_msgs_SolidPrimitive_h +#define _ROS_shape_msgs_SolidPrimitive_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class SolidPrimitive : public ros::Msg + { + public: + typedef uint8_t _type_type; + _type_type type; + uint32_t dimensions_length; + typedef float _dimensions_type; + _dimensions_type st_dimensions; + _dimensions_type * dimensions; + enum { BOX = 1 }; + enum { SPHERE = 2 }; + enum { CYLINDER = 3 }; + enum { CONE = 4 }; + enum { BOX_X = 0 }; + enum { BOX_Y = 1 }; + enum { BOX_Z = 2 }; + enum { SPHERE_RADIUS = 0 }; + enum { CYLINDER_HEIGHT = 0 }; + enum { CYLINDER_RADIUS = 1 }; + enum { CONE_HEIGHT = 0 }; + enum { CONE_RADIUS = 1 }; + + SolidPrimitive(): + type(0), + dimensions_length(0), st_dimensions(), dimensions(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->dimensions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->dimensions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->dimensions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->dimensions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->dimensions_length); + for( uint32_t i = 0; i < dimensions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->dimensions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint32_t dimensions_lengthT = ((uint32_t) (*(inbuffer + offset))); + dimensions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + dimensions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + dimensions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->dimensions_length); + if(dimensions_lengthT > dimensions_length) + this->dimensions = (float*)realloc(this->dimensions, dimensions_lengthT * sizeof(float)); + dimensions_length = dimensions_lengthT; + for( uint32_t i = 0; i < dimensions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_dimensions)); + memcpy( &(this->dimensions[i]), &(this->st_dimensions), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "shape_msgs/SolidPrimitive"; }; + virtual const char * getMD5() override { return "d8f8cbc74c5ff283fca29569ccefb45d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h b/smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h new file mode 100644 index 000000000..0e9b9e404 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h @@ -0,0 +1,109 @@ +#ifndef _ROS_smach_msgs_SmachContainerInitialStatusCmd_h +#define _ROS_smach_msgs_SmachContainerInitialStatusCmd_h + +#include +#include +#include +#include "ros/msg.h" + +namespace smach_msgs +{ + + class SmachContainerInitialStatusCmd : public ros::Msg + { + public: + typedef const char* _path_type; + _path_type path; + uint32_t initial_states_length; + typedef char* _initial_states_type; + _initial_states_type st_initial_states; + _initial_states_type * initial_states; + typedef const char* _local_data_type; + _local_data_type local_data; + + SmachContainerInitialStatusCmd(): + path(""), + initial_states_length(0), st_initial_states(), initial_states(nullptr), + local_data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_path = strlen(this->path); + varToArr(outbuffer + offset, length_path); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset + 0) = (this->initial_states_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->initial_states_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->initial_states_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->initial_states_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->initial_states_length); + for( uint32_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen(this->initial_states[i]); + varToArr(outbuffer + offset, length_initial_statesi); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + uint32_t length_local_data = strlen(this->local_data); + varToArr(outbuffer + offset, length_local_data); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_path; + arrToVar(length_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint32_t initial_states_lengthT = ((uint32_t) (*(inbuffer + offset))); + initial_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + initial_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + initial_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->initial_states_length); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + initial_states_length = initial_states_lengthT; + for( uint32_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + arrToVar(length_st_initial_states, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_initial_states-1]=0; + this->st_initial_states = (char *)(inbuffer + offset-1); + offset += length_st_initial_states; + memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); + } + uint32_t length_local_data; + arrToVar(length_local_data, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_local_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_local_data-1]=0; + this->local_data = (char *)(inbuffer + offset-1); + offset += length_local_data; + return offset; + } + + virtual const char * getType() override { return "smach_msgs/SmachContainerInitialStatusCmd"; }; + virtual const char * getMD5() override { return "45f8cf31fc29b829db77f23001f788d6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerStatus.h b/smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerStatus.h new file mode 100644 index 000000000..daf317a88 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerStatus.h @@ -0,0 +1,169 @@ +#ifndef _ROS_smach_msgs_SmachContainerStatus_h +#define _ROS_smach_msgs_SmachContainerStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smach_msgs +{ + + class SmachContainerStatus : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _path_type; + _path_type path; + uint32_t initial_states_length; + typedef char* _initial_states_type; + _initial_states_type st_initial_states; + _initial_states_type * initial_states; + uint32_t active_states_length; + typedef char* _active_states_type; + _active_states_type st_active_states; + _active_states_type * active_states; + typedef const char* _local_data_type; + _local_data_type local_data; + typedef const char* _info_type; + _info_type info; + + SmachContainerStatus(): + header(), + path(""), + initial_states_length(0), st_initial_states(), initial_states(nullptr), + active_states_length(0), st_active_states(), active_states(nullptr), + local_data(""), + info("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen(this->path); + varToArr(outbuffer + offset, length_path); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset + 0) = (this->initial_states_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->initial_states_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->initial_states_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->initial_states_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->initial_states_length); + for( uint32_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen(this->initial_states[i]); + varToArr(outbuffer + offset, length_initial_statesi); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + *(outbuffer + offset + 0) = (this->active_states_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->active_states_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->active_states_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->active_states_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->active_states_length); + for( uint32_t i = 0; i < active_states_length; i++){ + uint32_t length_active_statesi = strlen(this->active_states[i]); + varToArr(outbuffer + offset, length_active_statesi); + offset += 4; + memcpy(outbuffer + offset, this->active_states[i], length_active_statesi); + offset += length_active_statesi; + } + uint32_t length_local_data = strlen(this->local_data); + varToArr(outbuffer + offset, length_local_data); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + 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; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + arrToVar(length_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint32_t initial_states_lengthT = ((uint32_t) (*(inbuffer + offset))); + initial_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + initial_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + initial_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->initial_states_length); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + initial_states_length = initial_states_lengthT; + for( uint32_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + arrToVar(length_st_initial_states, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_initial_states-1]=0; + this->st_initial_states = (char *)(inbuffer + offset-1); + offset += length_st_initial_states; + memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); + } + uint32_t active_states_lengthT = ((uint32_t) (*(inbuffer + offset))); + active_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + active_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + active_states_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->active_states_length); + if(active_states_lengthT > active_states_length) + this->active_states = (char**)realloc(this->active_states, active_states_lengthT * sizeof(char*)); + active_states_length = active_states_lengthT; + for( uint32_t i = 0; i < active_states_length; i++){ + uint32_t length_st_active_states; + arrToVar(length_st_active_states, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_active_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_active_states-1]=0; + this->st_active_states = (char *)(inbuffer + offset-1); + offset += length_st_active_states; + memcpy( &(this->active_states[i]), &(this->st_active_states), sizeof(char*)); + } + uint32_t length_local_data; + arrToVar(length_local_data, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_local_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_local_data-1]=0; + this->local_data = (char *)(inbuffer + offset-1); + offset += length_local_data; + 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 "smach_msgs/SmachContainerStatus"; }; + virtual const char * getMD5() override { return "5ba2bb79ac19e3842d562a191f2a675b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerStructure.h b/smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerStructure.h new file mode 100644 index 000000000..9fc296242 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/smach_msgs/SmachContainerStructure.h @@ -0,0 +1,246 @@ +#ifndef _ROS_smach_msgs_SmachContainerStructure_h +#define _ROS_smach_msgs_SmachContainerStructure_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smach_msgs +{ + + class SmachContainerStructure : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _path_type; + _path_type path; + uint32_t children_length; + typedef char* _children_type; + _children_type st_children; + _children_type * children; + uint32_t internal_outcomes_length; + typedef char* _internal_outcomes_type; + _internal_outcomes_type st_internal_outcomes; + _internal_outcomes_type * internal_outcomes; + uint32_t outcomes_from_length; + typedef char* _outcomes_from_type; + _outcomes_from_type st_outcomes_from; + _outcomes_from_type * outcomes_from; + uint32_t outcomes_to_length; + typedef char* _outcomes_to_type; + _outcomes_to_type st_outcomes_to; + _outcomes_to_type * outcomes_to; + uint32_t container_outcomes_length; + typedef char* _container_outcomes_type; + _container_outcomes_type st_container_outcomes; + _container_outcomes_type * container_outcomes; + + SmachContainerStructure(): + header(), + path(""), + children_length(0), st_children(), children(nullptr), + internal_outcomes_length(0), st_internal_outcomes(), internal_outcomes(nullptr), + outcomes_from_length(0), st_outcomes_from(), outcomes_from(nullptr), + outcomes_to_length(0), st_outcomes_to(), outcomes_to(nullptr), + container_outcomes_length(0), st_container_outcomes(), container_outcomes(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen(this->path); + varToArr(outbuffer + offset, length_path); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset + 0) = (this->children_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->children_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->children_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->children_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->children_length); + for( uint32_t i = 0; i < children_length; i++){ + uint32_t length_childreni = strlen(this->children[i]); + varToArr(outbuffer + offset, length_childreni); + offset += 4; + memcpy(outbuffer + offset, this->children[i], length_childreni); + offset += length_childreni; + } + *(outbuffer + offset + 0) = (this->internal_outcomes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->internal_outcomes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->internal_outcomes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->internal_outcomes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->internal_outcomes_length); + for( uint32_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_internal_outcomesi = strlen(this->internal_outcomes[i]); + varToArr(outbuffer + offset, length_internal_outcomesi); + offset += 4; + memcpy(outbuffer + offset, this->internal_outcomes[i], length_internal_outcomesi); + offset += length_internal_outcomesi; + } + *(outbuffer + offset + 0) = (this->outcomes_from_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outcomes_from_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outcomes_from_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outcomes_from_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->outcomes_from_length); + for( uint32_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_outcomes_fromi = strlen(this->outcomes_from[i]); + varToArr(outbuffer + offset, length_outcomes_fromi); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_from[i], length_outcomes_fromi); + offset += length_outcomes_fromi; + } + *(outbuffer + offset + 0) = (this->outcomes_to_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outcomes_to_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outcomes_to_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outcomes_to_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->outcomes_to_length); + for( uint32_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_outcomes_toi = strlen(this->outcomes_to[i]); + varToArr(outbuffer + offset, length_outcomes_toi); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_to[i], length_outcomes_toi); + offset += length_outcomes_toi; + } + *(outbuffer + offset + 0) = (this->container_outcomes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->container_outcomes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->container_outcomes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->container_outcomes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->container_outcomes_length); + for( uint32_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_container_outcomesi = strlen(this->container_outcomes[i]); + varToArr(outbuffer + offset, length_container_outcomesi); + offset += 4; + memcpy(outbuffer + offset, this->container_outcomes[i], length_container_outcomesi); + offset += length_container_outcomesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + arrToVar(length_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint32_t children_lengthT = ((uint32_t) (*(inbuffer + offset))); + children_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + children_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + children_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->children_length); + if(children_lengthT > children_length) + this->children = (char**)realloc(this->children, children_lengthT * sizeof(char*)); + children_length = children_lengthT; + for( uint32_t i = 0; i < children_length; i++){ + uint32_t length_st_children; + arrToVar(length_st_children, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_children; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_children-1]=0; + this->st_children = (char *)(inbuffer + offset-1); + offset += length_st_children; + memcpy( &(this->children[i]), &(this->st_children), sizeof(char*)); + } + uint32_t internal_outcomes_lengthT = ((uint32_t) (*(inbuffer + offset))); + internal_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + internal_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + internal_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->internal_outcomes_length); + if(internal_outcomes_lengthT > internal_outcomes_length) + this->internal_outcomes = (char**)realloc(this->internal_outcomes, internal_outcomes_lengthT * sizeof(char*)); + internal_outcomes_length = internal_outcomes_lengthT; + for( uint32_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_st_internal_outcomes; + arrToVar(length_st_internal_outcomes, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_internal_outcomes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_internal_outcomes-1]=0; + this->st_internal_outcomes = (char *)(inbuffer + offset-1); + offset += length_st_internal_outcomes; + memcpy( &(this->internal_outcomes[i]), &(this->st_internal_outcomes), sizeof(char*)); + } + uint32_t outcomes_from_lengthT = ((uint32_t) (*(inbuffer + offset))); + outcomes_from_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + outcomes_from_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + outcomes_from_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outcomes_from_length); + if(outcomes_from_lengthT > outcomes_from_length) + this->outcomes_from = (char**)realloc(this->outcomes_from, outcomes_from_lengthT * sizeof(char*)); + outcomes_from_length = outcomes_from_lengthT; + for( uint32_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_st_outcomes_from; + arrToVar(length_st_outcomes_from, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_outcomes_from; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_outcomes_from-1]=0; + this->st_outcomes_from = (char *)(inbuffer + offset-1); + offset += length_st_outcomes_from; + memcpy( &(this->outcomes_from[i]), &(this->st_outcomes_from), sizeof(char*)); + } + uint32_t outcomes_to_lengthT = ((uint32_t) (*(inbuffer + offset))); + outcomes_to_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + outcomes_to_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + outcomes_to_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outcomes_to_length); + if(outcomes_to_lengthT > outcomes_to_length) + this->outcomes_to = (char**)realloc(this->outcomes_to, outcomes_to_lengthT * sizeof(char*)); + outcomes_to_length = outcomes_to_lengthT; + for( uint32_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_st_outcomes_to; + arrToVar(length_st_outcomes_to, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_outcomes_to; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_outcomes_to-1]=0; + this->st_outcomes_to = (char *)(inbuffer + offset-1); + offset += length_st_outcomes_to; + memcpy( &(this->outcomes_to[i]), &(this->st_outcomes_to), sizeof(char*)); + } + uint32_t container_outcomes_lengthT = ((uint32_t) (*(inbuffer + offset))); + container_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + container_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + container_outcomes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->container_outcomes_length); + if(container_outcomes_lengthT > container_outcomes_length) + this->container_outcomes = (char**)realloc(this->container_outcomes, container_outcomes_lengthT * sizeof(char*)); + container_outcomes_length = container_outcomes_lengthT; + for( uint32_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_st_container_outcomes; + arrToVar(length_st_container_outcomes, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_container_outcomes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_container_outcomes-1]=0; + this->st_container_outcomes = (char *)(inbuffer + offset-1); + offset += length_st_container_outcomes; + memcpy( &(this->container_outcomes[i]), &(this->st_container_outcomes), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "smach_msgs/SmachContainerStructure"; }; + virtual const char * getMD5() override { return "3d3d1e0d0f99779ee9e58101a5dcf7ea"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/smart_device_protocol/Packet.h b/smart_device_protocol/ros_lib/ros_lib/smart_device_protocol/Packet.h new file mode 100644 index 000000000..c83fbee22 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/smart_device_protocol/Packet.h @@ -0,0 +1,107 @@ +#ifndef _ROS_smart_device_protocol_Packet_h +#define _ROS_smart_device_protocol_Packet_h + +#include +#include +#include +#include "ros/msg.h" + +namespace smart_device_protocol +{ + + class Packet : public ros::Msg + { + public: + uint32_t mac_address_length; + typedef uint8_t _mac_address_type; + _mac_address_type st_mac_address; + _mac_address_type * mac_address; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + enum { PACKET_TYPE_NONE = 0 }; + enum { PACKET_TYPE_TEST = 1 }; + enum { PACKET_TYPE_NAMED_STRING = 11 }; + enum { PACKET_TYPE_NAMED_INT = 12 }; + enum { PACKET_TYPE_NAMED_FLOAT = 13 }; + enum { PACKET_TYPE_SENSOR_ENV_III = 21 }; + enum { PACKET_TYPE_SENSOR_UNITV2_PERSON_COUNTER = 22 }; + enum { PACKET_TYPE_EMERGENCY = 31 }; + enum { PACKET_TYPE_TASK_DISPATCHER = 32 }; + enum { PACKET_TYPE_TASK_RESULT = 33 }; + enum { PACKET_TYPE_TASK_RECEIVED = 34 }; + enum { PACKET_TYPE_DEVICE_MESSAGE_BOARD_META = 41 }; + enum { PACKET_TYPE_DEVICE_MESSAGE_BOARD_DATA = 42 }; + enum { PACKET_TYPE_META = 81 }; + enum { PACKET_TYPE_DATA = 82 }; + + Packet(): + mac_address_length(0), st_mac_address(), mac_address(nullptr), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->mac_address_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->mac_address_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->mac_address_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->mac_address_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->mac_address_length); + for( uint32_t i = 0; i < mac_address_length; i++){ + *(outbuffer + offset + 0) = (this->mac_address[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->mac_address[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; + uint32_t mac_address_lengthT = ((uint32_t) (*(inbuffer + offset))); + mac_address_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + mac_address_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + mac_address_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->mac_address_length); + if(mac_address_lengthT > mac_address_length) + this->mac_address = (uint8_t*)realloc(this->mac_address, mac_address_lengthT * sizeof(uint8_t)); + mac_address_length = mac_address_lengthT; + for( uint32_t i = 0; i < mac_address_length; i++){ + this->st_mac_address = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_mac_address); + memcpy( &(this->mac_address[i]), &(this->st_mac_address), 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 "smart_device_protocol/Packet"; }; + virtual const char * getMD5() override { return "dbab45830b3b1d11bc00c2acc0192a63"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/smart_device_protocol/UWBDistance.h b/smart_device_protocol/ros_lib/ros_lib/smart_device_protocol/UWBDistance.h new file mode 100644 index 000000000..57efef9a9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/smart_device_protocol/UWBDistance.h @@ -0,0 +1,86 @@ +#ifndef _ROS_smart_device_protocol_UWBDistance_h +#define _ROS_smart_device_protocol_UWBDistance_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smart_device_protocol +{ + + class UWBDistance : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef int8_t _id_type; + _id_type id; + typedef float _distance_type; + _distance_type distance; + + UWBDistance(): + header(), + id(0), + distance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->id); + 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); + union { + int8_t real; + uint8_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->id = u_id.real; + offset += sizeof(this->id); + 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 "smart_device_protocol/UWBDistance"; }; + virtual const char * getMD5() override { return "ae36538b2b731aed9d5d280b17416445"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequest.h b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequest.h new file mode 100644 index 000000000..a25f97532 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequest.h @@ -0,0 +1,143 @@ +#ifndef _ROS_sound_play_SoundRequest_h +#define _ROS_sound_play_SoundRequest_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sound_play +{ + + class SoundRequest : public ros::Msg + { + public: + typedef int8_t _sound_type; + _sound_type sound; + typedef int8_t _command_type; + _command_type command; + typedef float _volume_type; + _volume_type volume; + typedef const char* _arg_type; + _arg_type arg; + typedef const char* _arg2_type; + _arg2_type arg2; + enum { BACKINGUP = 1 }; + enum { NEEDS_UNPLUGGING = 2 }; + enum { NEEDS_PLUGGING = 3 }; + enum { NEEDS_UNPLUGGING_BADLY = 4 }; + enum { NEEDS_PLUGGING_BADLY = 5 }; + enum { ALL = -1 }; + enum { PLAY_FILE = -2 }; + enum { SAY = -3 }; + enum { PLAY_STOP = 0 }; + enum { PLAY_ONCE = 1 }; + enum { PLAY_START = 2 }; + + SoundRequest(): + sound(0), + command(0), + volume(0), + arg(""), + arg2("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_sound; + u_sound.real = this->sound; + *(outbuffer + offset + 0) = (u_sound.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->sound); + union { + int8_t real; + uint8_t base; + } u_command; + u_command.real = this->command; + *(outbuffer + offset + 0) = (u_command.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->command); + union { + float real; + uint32_t base; + } u_volume; + u_volume.real = this->volume; + *(outbuffer + offset + 0) = (u_volume.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_volume.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_volume.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_volume.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->volume); + uint32_t length_arg = strlen(this->arg); + varToArr(outbuffer + offset, length_arg); + offset += 4; + memcpy(outbuffer + offset, this->arg, length_arg); + offset += length_arg; + uint32_t length_arg2 = strlen(this->arg2); + varToArr(outbuffer + offset, length_arg2); + offset += 4; + memcpy(outbuffer + offset, this->arg2, length_arg2); + offset += length_arg2; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_sound; + u_sound.base = 0; + u_sound.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->sound = u_sound.real; + offset += sizeof(this->sound); + union { + int8_t real; + uint8_t base; + } u_command; + u_command.base = 0; + u_command.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->command = u_command.real; + offset += sizeof(this->command); + union { + float real; + uint32_t base; + } u_volume; + u_volume.base = 0; + u_volume.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_volume.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_volume.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_volume.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->volume = u_volume.real; + offset += sizeof(this->volume); + uint32_t length_arg; + arrToVar(length_arg, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_arg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_arg-1]=0; + this->arg = (char *)(inbuffer + offset-1); + offset += length_arg; + uint32_t length_arg2; + arrToVar(length_arg2, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_arg2; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_arg2-1]=0; + this->arg2 = (char *)(inbuffer + offset-1); + offset += length_arg2; + return offset; + } + + virtual const char * getType() override { return "sound_play/SoundRequest"; }; + virtual const char * getMD5() override { return "d098ce4a040686259137ece23a625167"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestAction.h b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestAction.h new file mode 100644 index 000000000..586e2407a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_sound_play_SoundRequestAction_h +#define _ROS_sound_play_SoundRequestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "sound_play/SoundRequestActionGoal.h" +#include "sound_play/SoundRequestActionResult.h" +#include "sound_play/SoundRequestActionFeedback.h" + +namespace sound_play +{ + + class SoundRequestAction : public ros::Msg + { + public: + typedef sound_play::SoundRequestActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef sound_play::SoundRequestActionResult _action_result_type; + _action_result_type action_result; + typedef sound_play::SoundRequestActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + SoundRequestAction(): + 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 "sound_play/SoundRequestAction"; }; + virtual const char * getMD5() override { return "f990cf5de6a2f8e514e825b2c1f4810b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionFeedback.h new file mode 100644 index 000000000..b695fa8de --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_sound_play_SoundRequestActionFeedback_h +#define _ROS_sound_play_SoundRequestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "sound_play/SoundRequestFeedback.h" + +namespace sound_play +{ + + class SoundRequestActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef sound_play::SoundRequestFeedback _feedback_type; + _feedback_type feedback; + + SoundRequestActionFeedback(): + 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 "sound_play/SoundRequestActionFeedback"; }; + virtual const char * getMD5() override { return "4577e8c5420cc167578de330a5e37d82"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionGoal.h new file mode 100644 index 000000000..674edf7c9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_sound_play_SoundRequestActionGoal_h +#define _ROS_sound_play_SoundRequestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "sound_play/SoundRequestGoal.h" + +namespace sound_play +{ + + class SoundRequestActionGoal : 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 sound_play::SoundRequestGoal _goal_type; + _goal_type goal; + + SoundRequestActionGoal(): + 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 "sound_play/SoundRequestActionGoal"; }; + virtual const char * getMD5() override { return "7ff89ce2a5f72c86a28be8ae82658bf8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionResult.h b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionResult.h new file mode 100644 index 000000000..138c30034 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_sound_play_SoundRequestActionResult_h +#define _ROS_sound_play_SoundRequestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "sound_play/SoundRequestResult.h" + +namespace sound_play +{ + + class SoundRequestActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef sound_play::SoundRequestResult _result_type; + _result_type result; + + SoundRequestActionResult(): + 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 "sound_play/SoundRequestActionResult"; }; + virtual const char * getMD5() override { return "73b66cac2bdbb689595274036eae528d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestFeedback.h b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestFeedback.h new file mode 100644 index 000000000..db2925a6d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestFeedback.h @@ -0,0 +1,80 @@ +#ifndef _ROS_sound_play_SoundRequestFeedback_h +#define _ROS_sound_play_SoundRequestFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace sound_play +{ + + class SoundRequestFeedback : public ros::Msg + { + public: + typedef bool _playing_type; + _playing_type playing; + typedef ros::Time _stamp_type; + _stamp_type stamp; + + SoundRequestFeedback(): + playing(0), + stamp() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_playing; + u_playing.real = this->playing; + *(outbuffer + offset + 0) = (u_playing.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->playing); + *(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_playing; + u_playing.base = 0; + u_playing.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->playing = u_playing.real; + offset += sizeof(this->playing); + 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 "sound_play/SoundRequestFeedback"; }; + virtual const char * getMD5() override { return "237faa3e32b21b083f32acf5260255a4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestGoal.h b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestGoal.h new file mode 100644 index 000000000..c1cd41294 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestGoal.h @@ -0,0 +1,44 @@ +#ifndef _ROS_sound_play_SoundRequestGoal_h +#define _ROS_sound_play_SoundRequestGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "sound_play/SoundRequest.h" + +namespace sound_play +{ + + class SoundRequestGoal : public ros::Msg + { + public: + typedef sound_play::SoundRequest _sound_request_type; + _sound_request_type sound_request; + + SoundRequestGoal(): + sound_request() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->sound_request.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->sound_request.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "sound_play/SoundRequestGoal"; }; + virtual const char * getMD5() override { return "3bd5e9e7f60b85cc6f1b7662fe6e1903"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestResult.h b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestResult.h new file mode 100644 index 000000000..78adf42ee --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/sound_play/SoundRequestResult.h @@ -0,0 +1,80 @@ +#ifndef _ROS_sound_play_SoundRequestResult_h +#define _ROS_sound_play_SoundRequestResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace sound_play +{ + + class SoundRequestResult : public ros::Msg + { + public: + typedef bool _playing_type; + _playing_type playing; + typedef ros::Time _stamp_type; + _stamp_type stamp; + + SoundRequestResult(): + playing(0), + stamp() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_playing; + u_playing.real = this->playing; + *(outbuffer + offset + 0) = (u_playing.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->playing); + *(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_playing; + u_playing.base = 0; + u_playing.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->playing = u_playing.real; + offset += sizeof(this->playing); + 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 "sound_play/SoundRequestResult"; }; + virtual const char * getMD5() override { return "237faa3e32b21b083f32acf5260255a4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/Grammar.h b/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/Grammar.h new file mode 100644 index 000000000..9109275e9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/Grammar.h @@ -0,0 +1,144 @@ +#ifndef _ROS_speech_recognition_msgs_Grammar_h +#define _ROS_speech_recognition_msgs_Grammar_h + +#include +#include +#include +#include "ros/msg.h" +#include "speech_recognition_msgs/PhraseRule.h" +#include "speech_recognition_msgs/Vocabulary.h" + +namespace speech_recognition_msgs +{ + + class Grammar : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + uint32_t rules_length; + typedef speech_recognition_msgs::PhraseRule _rules_type; + _rules_type st_rules; + _rules_type * rules; + uint32_t categories_length; + typedef char* _categories_type; + _categories_type st_categories; + _categories_type * categories; + uint32_t vocabularies_length; + typedef speech_recognition_msgs::Vocabulary _vocabularies_type; + _vocabularies_type st_vocabularies; + _vocabularies_type * vocabularies; + + Grammar(): + name(""), + rules_length(0), st_rules(), rules(nullptr), + categories_length(0), st_categories(), categories(nullptr), + vocabularies_length(0), st_vocabularies(), vocabularies(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; + *(outbuffer + offset + 0) = (this->rules_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->rules_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->rules_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->rules_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->rules_length); + for( uint32_t i = 0; i < rules_length; i++){ + offset += this->rules[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->categories_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->categories_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->categories_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->categories_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->categories_length); + for( uint32_t i = 0; i < categories_length; i++){ + uint32_t length_categoriesi = strlen(this->categories[i]); + varToArr(outbuffer + offset, length_categoriesi); + offset += 4; + memcpy(outbuffer + offset, this->categories[i], length_categoriesi); + offset += length_categoriesi; + } + *(outbuffer + offset + 0) = (this->vocabularies_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vocabularies_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vocabularies_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vocabularies_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->vocabularies_length); + for( uint32_t i = 0; i < vocabularies_length; i++){ + offset += this->vocabularies[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 rules_lengthT = ((uint32_t) (*(inbuffer + offset))); + rules_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + rules_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + rules_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->rules_length); + if(rules_lengthT > rules_length) + this->rules = (speech_recognition_msgs::PhraseRule*)realloc(this->rules, rules_lengthT * sizeof(speech_recognition_msgs::PhraseRule)); + rules_length = rules_lengthT; + for( uint32_t i = 0; i < rules_length; i++){ + offset += this->st_rules.deserialize(inbuffer + offset); + memcpy( &(this->rules[i]), &(this->st_rules), sizeof(speech_recognition_msgs::PhraseRule)); + } + uint32_t categories_lengthT = ((uint32_t) (*(inbuffer + offset))); + categories_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + categories_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + categories_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->categories_length); + if(categories_lengthT > categories_length) + this->categories = (char**)realloc(this->categories, categories_lengthT * sizeof(char*)); + categories_length = categories_lengthT; + for( uint32_t i = 0; i < categories_length; i++){ + uint32_t length_st_categories; + arrToVar(length_st_categories, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_categories; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_categories-1]=0; + this->st_categories = (char *)(inbuffer + offset-1); + offset += length_st_categories; + memcpy( &(this->categories[i]), &(this->st_categories), sizeof(char*)); + } + uint32_t vocabularies_lengthT = ((uint32_t) (*(inbuffer + offset))); + vocabularies_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + vocabularies_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + vocabularies_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vocabularies_length); + if(vocabularies_lengthT > vocabularies_length) + this->vocabularies = (speech_recognition_msgs::Vocabulary*)realloc(this->vocabularies, vocabularies_lengthT * sizeof(speech_recognition_msgs::Vocabulary)); + vocabularies_length = vocabularies_lengthT; + for( uint32_t i = 0; i < vocabularies_length; i++){ + offset += this->st_vocabularies.deserialize(inbuffer + offset); + memcpy( &(this->vocabularies[i]), &(this->st_vocabularies), sizeof(speech_recognition_msgs::Vocabulary)); + } + return offset; + } + + virtual const char * getType() override { return "speech_recognition_msgs/Grammar"; }; + virtual const char * getMD5() override { return "a8653cae3429492cb944a813429e7151"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/PhraseRule.h b/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/PhraseRule.h new file mode 100644 index 000000000..1825527d2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/PhraseRule.h @@ -0,0 +1,92 @@ +#ifndef _ROS_speech_recognition_msgs_PhraseRule_h +#define _ROS_speech_recognition_msgs_PhraseRule_h + +#include +#include +#include +#include "ros/msg.h" + +namespace speech_recognition_msgs +{ + + class PhraseRule : public ros::Msg + { + public: + typedef const char* _symbol_type; + _symbol_type symbol; + uint32_t definition_length; + typedef char* _definition_type; + _definition_type st_definition; + _definition_type * definition; + + PhraseRule(): + symbol(""), + definition_length(0), st_definition(), definition(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_symbol = strlen(this->symbol); + varToArr(outbuffer + offset, length_symbol); + offset += 4; + memcpy(outbuffer + offset, this->symbol, length_symbol); + offset += length_symbol; + *(outbuffer + offset + 0) = (this->definition_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->definition_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->definition_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->definition_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->definition_length); + for( uint32_t i = 0; i < definition_length; i++){ + uint32_t length_definitioni = strlen(this->definition[i]); + varToArr(outbuffer + offset, length_definitioni); + offset += 4; + memcpy(outbuffer + offset, this->definition[i], length_definitioni); + offset += length_definitioni; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_symbol; + arrToVar(length_symbol, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_symbol; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_symbol-1]=0; + this->symbol = (char *)(inbuffer + offset-1); + offset += length_symbol; + uint32_t definition_lengthT = ((uint32_t) (*(inbuffer + offset))); + definition_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + definition_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + definition_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->definition_length); + if(definition_lengthT > definition_length) + this->definition = (char**)realloc(this->definition, definition_lengthT * sizeof(char*)); + definition_length = definition_lengthT; + for( uint32_t i = 0; i < definition_length; i++){ + uint32_t length_st_definition; + arrToVar(length_st_definition, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_definition; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_definition-1]=0; + this->st_definition = (char *)(inbuffer + offset-1); + offset += length_st_definition; + memcpy( &(this->definition[i]), &(this->st_definition), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "speech_recognition_msgs/PhraseRule"; }; + virtual const char * getMD5() override { return "8184f0f93fdc3a6768ac26cd56040fdd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/SpeechRecognition.h b/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/SpeechRecognition.h new file mode 100644 index 000000000..42da80e93 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/SpeechRecognition.h @@ -0,0 +1,171 @@ +#ifndef _ROS_SERVICE_SpeechRecognition_h +#define _ROS_SERVICE_SpeechRecognition_h +#include +#include +#include +#include "ros/msg.h" +#include "speech_recognition_msgs/Vocabulary.h" +#include "speech_recognition_msgs/Grammar.h" +#include "speech_recognition_msgs/SpeechRecognitionCandidates.h" + +namespace speech_recognition_msgs +{ + +static const char SPEECHRECOGNITION[] = "speech_recognition_msgs/SpeechRecognition"; + + class SpeechRecognitionRequest : public ros::Msg + { + public: + typedef speech_recognition_msgs::Vocabulary _vocabulary_type; + _vocabulary_type vocabulary; + typedef speech_recognition_msgs::Grammar _grammar_type; + _grammar_type grammar; + typedef const char* _grammar_name_type; + _grammar_name_type grammar_name; + typedef float _duration_type; + _duration_type duration; + typedef bool _quiet_type; + _quiet_type quiet; + typedef float _threshold_type; + _threshold_type threshold; + + SpeechRecognitionRequest(): + vocabulary(), + grammar(), + grammar_name(""), + duration(0), + quiet(0), + threshold(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->vocabulary.serialize(outbuffer + offset); + offset += this->grammar.serialize(outbuffer + offset); + uint32_t length_grammar_name = strlen(this->grammar_name); + varToArr(outbuffer + offset, length_grammar_name); + offset += 4; + memcpy(outbuffer + offset, this->grammar_name, length_grammar_name); + offset += length_grammar_name; + union { + float real; + uint32_t base; + } u_duration; + u_duration.real = this->duration; + *(outbuffer + offset + 0) = (u_duration.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_duration.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_duration.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_duration.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration); + union { + bool real; + uint8_t base; + } u_quiet; + u_quiet.real = this->quiet; + *(outbuffer + offset + 0) = (u_quiet.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->quiet); + union { + float real; + uint32_t base; + } u_threshold; + u_threshold.real = this->threshold; + *(outbuffer + offset + 0) = (u_threshold.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_threshold.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_threshold.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_threshold.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->threshold); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->vocabulary.deserialize(inbuffer + offset); + offset += this->grammar.deserialize(inbuffer + offset); + uint32_t length_grammar_name; + arrToVar(length_grammar_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_grammar_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_grammar_name-1]=0; + this->grammar_name = (char *)(inbuffer + offset-1); + offset += length_grammar_name; + union { + float real; + uint32_t base; + } u_duration; + u_duration.base = 0; + u_duration.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_duration.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_duration.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_duration.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->duration = u_duration.real; + offset += sizeof(this->duration); + union { + bool real; + uint8_t base; + } u_quiet; + u_quiet.base = 0; + u_quiet.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->quiet = u_quiet.real; + offset += sizeof(this->quiet); + union { + float real; + uint32_t base; + } u_threshold; + u_threshold.base = 0; + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_threshold.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->threshold = u_threshold.real; + offset += sizeof(this->threshold); + return offset; + } + + virtual const char * getType() override { return SPEECHRECOGNITION; }; + virtual const char * getMD5() override { return "af5602408bd36e4d9a80cde6f4453023"; }; + + }; + + class SpeechRecognitionResponse : public ros::Msg + { + public: + typedef speech_recognition_msgs::SpeechRecognitionCandidates _result_type; + _result_type result; + + SpeechRecognitionResponse(): + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return SPEECHRECOGNITION; }; + virtual const char * getMD5() override { return "46fe009ac10a19a0e861b8792ad42e0b"; }; + + }; + + class SpeechRecognition { + public: + typedef SpeechRecognitionRequest Request; + typedef SpeechRecognitionResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/SpeechRecognitionCandidates.h b/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/SpeechRecognitionCandidates.h new file mode 100644 index 000000000..b7aa050cb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/SpeechRecognitionCandidates.h @@ -0,0 +1,119 @@ +#ifndef _ROS_speech_recognition_msgs_SpeechRecognitionCandidates_h +#define _ROS_speech_recognition_msgs_SpeechRecognitionCandidates_h + +#include +#include +#include +#include "ros/msg.h" + +namespace speech_recognition_msgs +{ + + class SpeechRecognitionCandidates : public ros::Msg + { + public: + uint32_t transcript_length; + typedef char* _transcript_type; + _transcript_type st_transcript; + _transcript_type * transcript; + uint32_t confidence_length; + typedef float _confidence_type; + _confidence_type st_confidence; + _confidence_type * confidence; + + SpeechRecognitionCandidates(): + transcript_length(0), st_transcript(), transcript(nullptr), + confidence_length(0), st_confidence(), confidence(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->transcript_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->transcript_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->transcript_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->transcript_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->transcript_length); + for( uint32_t i = 0; i < transcript_length; i++){ + uint32_t length_transcripti = strlen(this->transcript[i]); + varToArr(outbuffer + offset, length_transcripti); + offset += 4; + memcpy(outbuffer + offset, this->transcript[i], length_transcripti); + offset += length_transcripti; + } + *(outbuffer + offset + 0) = (this->confidence_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->confidence_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->confidence_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->confidence_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidence_length); + for( uint32_t i = 0; i < confidence_length; i++){ + union { + float real; + uint32_t base; + } u_confidencei; + u_confidencei.real = this->confidence[i]; + *(outbuffer + offset + 0) = (u_confidencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_confidencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_confidencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_confidencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->confidence[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t transcript_lengthT = ((uint32_t) (*(inbuffer + offset))); + transcript_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + transcript_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + transcript_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->transcript_length); + if(transcript_lengthT > transcript_length) + this->transcript = (char**)realloc(this->transcript, transcript_lengthT * sizeof(char*)); + transcript_length = transcript_lengthT; + for( uint32_t i = 0; i < transcript_length; i++){ + uint32_t length_st_transcript; + arrToVar(length_st_transcript, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_transcript; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_transcript-1]=0; + this->st_transcript = (char *)(inbuffer + offset-1); + offset += length_st_transcript; + memcpy( &(this->transcript[i]), &(this->st_transcript), sizeof(char*)); + } + uint32_t confidence_lengthT = ((uint32_t) (*(inbuffer + offset))); + confidence_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + confidence_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + confidence_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->confidence_length); + if(confidence_lengthT > confidence_length) + this->confidence = (float*)realloc(this->confidence, confidence_lengthT * sizeof(float)); + confidence_length = confidence_lengthT; + for( uint32_t i = 0; i < confidence_length; i++){ + union { + float real; + uint32_t base; + } u_st_confidence; + u_st_confidence.base = 0; + u_st_confidence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_confidence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_confidence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_confidence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_confidence = u_st_confidence.real; + offset += sizeof(this->st_confidence); + memcpy( &(this->confidence[i]), &(this->st_confidence), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "speech_recognition_msgs/SpeechRecognitionCandidates"; }; + virtual const char * getMD5() override { return "8bf91ae2b1d4cbc38dce17013599f915"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/Vocabulary.h b/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/Vocabulary.h new file mode 100644 index 000000000..23534425c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/speech_recognition_msgs/Vocabulary.h @@ -0,0 +1,129 @@ +#ifndef _ROS_speech_recognition_msgs_Vocabulary_h +#define _ROS_speech_recognition_msgs_Vocabulary_h + +#include +#include +#include +#include "ros/msg.h" + +namespace speech_recognition_msgs +{ + + class Vocabulary : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + uint32_t words_length; + typedef char* _words_type; + _words_type st_words; + _words_type * words; + uint32_t phonemes_length; + typedef char* _phonemes_type; + _phonemes_type st_phonemes; + _phonemes_type * phonemes; + + Vocabulary(): + name(""), + words_length(0), st_words(), words(nullptr), + phonemes_length(0), st_phonemes(), phonemes(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; + *(outbuffer + offset + 0) = (this->words_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->words_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->words_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->words_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->words_length); + for( uint32_t i = 0; i < words_length; i++){ + uint32_t length_wordsi = strlen(this->words[i]); + varToArr(outbuffer + offset, length_wordsi); + offset += 4; + memcpy(outbuffer + offset, this->words[i], length_wordsi); + offset += length_wordsi; + } + *(outbuffer + offset + 0) = (this->phonemes_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->phonemes_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->phonemes_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->phonemes_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->phonemes_length); + for( uint32_t i = 0; i < phonemes_length; i++){ + uint32_t length_phonemesi = strlen(this->phonemes[i]); + varToArr(outbuffer + offset, length_phonemesi); + offset += 4; + memcpy(outbuffer + offset, this->phonemes[i], length_phonemesi); + offset += length_phonemesi; + } + 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 words_lengthT = ((uint32_t) (*(inbuffer + offset))); + words_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + words_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + words_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->words_length); + if(words_lengthT > words_length) + this->words = (char**)realloc(this->words, words_lengthT * sizeof(char*)); + words_length = words_lengthT; + for( uint32_t i = 0; i < words_length; i++){ + uint32_t length_st_words; + arrToVar(length_st_words, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_words; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_words-1]=0; + this->st_words = (char *)(inbuffer + offset-1); + offset += length_st_words; + memcpy( &(this->words[i]), &(this->st_words), sizeof(char*)); + } + uint32_t phonemes_lengthT = ((uint32_t) (*(inbuffer + offset))); + phonemes_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + phonemes_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + phonemes_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->phonemes_length); + if(phonemes_lengthT > phonemes_length) + this->phonemes = (char**)realloc(this->phonemes, phonemes_lengthT * sizeof(char*)); + phonemes_length = phonemes_lengthT; + for( uint32_t i = 0; i < phonemes_length; i++){ + uint32_t length_st_phonemes; + arrToVar(length_st_phonemes, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_phonemes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_phonemes-1]=0; + this->st_phonemes = (char *)(inbuffer + offset-1); + offset += length_st_phonemes; + memcpy( &(this->phonemes[i]), &(this->st_phonemes), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "speech_recognition_msgs/Vocabulary"; }; + virtual const char * getMD5() override { return "20a1ff9e31d8f4dc29f230a64ed707d7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Bool.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Bool.h new file mode 100644 index 000000000..b15f5816c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Bool.h @@ -0,0 +1,56 @@ +#ifndef _ROS_std_msgs_Bool_h +#define _ROS_std_msgs_Bool_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Bool : public ros::Msg + { + public: + typedef bool _data_type; + _data_type data; + + Bool(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Bool"; }; + virtual const char * getMD5() override { return "8b94c1b53db61fb6aed406028ad6332a"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Byte.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Byte.h new file mode 100644 index 000000000..22d88d5d7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Byte.h @@ -0,0 +1,56 @@ +#ifndef _ROS_std_msgs_Byte_h +#define _ROS_std_msgs_Byte_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Byte : public ros::Msg + { + public: + typedef int8_t _data_type; + _data_type data; + + Byte(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Byte"; }; + virtual const char * getMD5() override { return "ad736a2e8818154c487bb80fe42ce43b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/ByteMultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/ByteMultiArray.h new file mode 100644 index 000000000..7283c0d41 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/ByteMultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_ByteMultiArray_h +#define _ROS_std_msgs_ByteMultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class ByteMultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef int8_t _data_type; + _data_type st_data; + _data_type * data; + + ByteMultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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 { + 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->layout.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 = (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 "std_msgs/ByteMultiArray"; }; + virtual const char * getMD5() override { return "70ea476cbcfd65ac2f68f3cda1e891fe"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Char.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Char.h new file mode 100644 index 000000000..300c0816c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Char.h @@ -0,0 +1,45 @@ +#ifndef _ROS_std_msgs_Char_h +#define _ROS_std_msgs_Char_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Char : public ros::Msg + { + public: + typedef uint8_t _data_type; + _data_type data; + + Char(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Char"; }; + virtual const char * getMD5() override { return "1bf77f25acecdedba0e224b162199717"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/ColorRGBA.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/ColorRGBA.h new file mode 100644 index 000000000..f43fe4e7c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/ColorRGBA.h @@ -0,0 +1,134 @@ +#ifndef _ROS_std_msgs_ColorRGBA_h +#define _ROS_std_msgs_ColorRGBA_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class ColorRGBA : public ros::Msg + { + public: + typedef float _r_type; + _r_type r; + typedef float _g_type; + _g_type g; + typedef float _b_type; + _b_type b; + typedef float _a_type; + _a_type a; + + ColorRGBA(): + r(0), + g(0), + b(0), + a(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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_g; + u_g.real = this->g; + *(outbuffer + offset + 0) = (u_g.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_g.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_g.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_g.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->g); + union { + float 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); + union { + float real; + uint32_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; + offset += sizeof(this->a); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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_g; + u_g.base = 0; + u_g.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->g = u_g.real; + offset += sizeof(this->g); + union { + float 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); + union { + float real; + uint32_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->a = u_a.real; + offset += sizeof(this->a); + return offset; + } + + virtual const char * getType() override { return "std_msgs/ColorRGBA"; }; + virtual const char * getMD5() override { return "a29a96539573343b1310c73607334b00"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Duration.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Duration.h new file mode 100644 index 000000000..583b95869 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Duration.h @@ -0,0 +1,62 @@ +#ifndef _ROS_std_msgs_Duration_h +#define _ROS_std_msgs_Duration_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace std_msgs +{ + + class Duration : public ros::Msg + { + public: + typedef ros::Duration _data_type; + _data_type data; + + Duration(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.sec); + *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->data.sec = ((uint32_t) (*(inbuffer + offset))); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.sec); + this->data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.nsec); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Duration"; }; + virtual const char * getMD5() override { return "3e286caf4241d664e55f3ad380e2ae46"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Empty.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Empty.h new file mode 100644 index 000000000..0e438c53c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Empty.h @@ -0,0 +1,38 @@ +#ifndef _ROS_std_msgs_Empty_h +#define _ROS_std_msgs_Empty_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Empty : public ros::Msg + { + public: + + Empty() + { + } + + 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 "std_msgs/Empty"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float32.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float32.h new file mode 100644 index 000000000..c6ff04045 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float32.h @@ -0,0 +1,62 @@ +#ifndef _ROS_std_msgs_Float32_h +#define _ROS_std_msgs_Float32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Float32 : public ros::Msg + { + public: + typedef float _data_type; + _data_type data; + + Float32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + 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); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Float32"; }; + virtual const char * getMD5() override { return "73fcbf46b49191e672908e50842a83d4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float32MultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float32MultiArray.h new file mode 100644 index 000000000..b1fac6aca --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float32MultiArray.h @@ -0,0 +1,88 @@ +#ifndef _ROS_std_msgs_Float32MultiArray_h +#define _ROS_std_msgs_Float32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Float32MultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef float _data_type; + _data_type st_data; + _data_type * data; + + Float32MultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->layout.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 = (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)); + } + return offset; + } + + virtual const char * getType() override { return "std_msgs/Float32MultiArray"; }; + virtual const char * getMD5() override { return "6a40e0ffa6a17a503ac3f8616991b1f6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float64.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float64.h new file mode 100644 index 000000000..85b2fc8f9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float64.h @@ -0,0 +1,43 @@ +#ifndef _ROS_std_msgs_Float64_h +#define _ROS_std_msgs_Float64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Float64 : public ros::Msg + { + public: + typedef float _data_type; + _data_type data; + + Float64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->data)); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Float64"; }; + virtual const char * getMD5() override { return "fdb28210bfa9d7c91146260178d9a584"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float64MultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float64MultiArray.h new file mode 100644 index 000000000..dc46bffb6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Float64MultiArray.h @@ -0,0 +1,69 @@ +#ifndef _ROS_std_msgs_Float64MultiArray_h +#define _ROS_std_msgs_Float64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Float64MultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef float _data_type; + _data_type st_data; + _data_type * data; + + Float64MultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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++){ + offset += serializeAvrFloat64(outbuffer + offset, this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->layout.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 = (float*)realloc(this->data, data_lengthT * sizeof(float)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_data)); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + virtual const char * getType() override { return "std_msgs/Float64MultiArray"; }; + virtual const char * getMD5() override { return "4b7d974086d4060e7db4613a7e6c3ba4"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Header.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Header.h new file mode 100644 index 000000000..040162952 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Header.h @@ -0,0 +1,92 @@ +#ifndef _ROS_std_msgs_Header_h +#define _ROS_std_msgs_Header_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace std_msgs +{ + + class Header : public ros::Msg + { + public: + typedef uint32_t _seq_type; + _seq_type seq; + typedef ros::Time _stamp_type; + _stamp_type stamp; + typedef const char* _frame_id_type; + _frame_id_type frame_id; + + Header(): + seq(0), + stamp(), + frame_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->seq >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->seq >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->seq >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->seq >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq); + *(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); + 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->seq = ((uint32_t) (*(inbuffer + offset))); + this->seq |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->seq |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->seq |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->seq); + 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); + 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 "std_msgs/Header"; }; + virtual const char * getMD5() override { return "2176decaecbce78abc3b96ef049fabed"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int16.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int16.h new file mode 100644 index 000000000..cece808c3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int16.h @@ -0,0 +1,58 @@ +#ifndef _ROS_std_msgs_Int16_h +#define _ROS_std_msgs_Int16_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int16 : public ros::Msg + { + public: + typedef int16_t _data_type; + _data_type data; + + Int16(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int16_t real; + uint16_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; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int16_t real; + uint16_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Int16"; }; + virtual const char * getMD5() override { return "8524586e34fbd7cb1c08c5f5f1ca0e57"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int16MultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int16MultiArray.h new file mode 100644 index 000000000..c134df126 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int16MultiArray.h @@ -0,0 +1,84 @@ +#ifndef _ROS_std_msgs_Int16MultiArray_h +#define _ROS_std_msgs_Int16MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int16MultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef int16_t _data_type; + _data_type st_data; + _data_type * data; + + Int16MultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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 { + int16_t real; + uint16_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; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->layout.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 = (int16_t*)realloc(this->data, data_lengthT * sizeof(int16_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int16_t)); + } + return offset; + } + + virtual const char * getType() override { return "std_msgs/Int16MultiArray"; }; + virtual const char * getMD5() override { return "d9338d7f523fcb692fae9d0a0e9f067c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int32.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int32.h new file mode 100644 index 000000000..6fe8cf938 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int32.h @@ -0,0 +1,62 @@ +#ifndef _ROS_std_msgs_Int32_h +#define _ROS_std_msgs_Int32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int32 : public ros::Msg + { + public: + typedef int32_t _data_type; + _data_type data; + + Int32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int32_t 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); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int32_t 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); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Int32"; }; + virtual const char * getMD5() override { return "da5909fbe378aeaf85e547e830cc1bb7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int32MultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int32MultiArray.h new file mode 100644 index 000000000..079ddaf01 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int32MultiArray.h @@ -0,0 +1,88 @@ +#ifndef _ROS_std_msgs_Int32MultiArray_h +#define _ROS_std_msgs_Int32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int32MultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef int32_t _data_type; + _data_type st_data; + _data_type * data; + + Int32MultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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 { + int32_t 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]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->layout.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 = (int32_t*)realloc(this->data, data_lengthT * sizeof(int32_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + union { + int32_t 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(int32_t)); + } + return offset; + } + + virtual const char * getType() override { return "std_msgs/Int32MultiArray"; }; + virtual const char * getMD5() override { return "1d99f79f8b325b44fee908053e9c945b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int64.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int64.h new file mode 100644 index 000000000..fd07d9d1a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int64.h @@ -0,0 +1,70 @@ +#ifndef _ROS_std_msgs_Int64_h +#define _ROS_std_msgs_Int64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int64 : public ros::Msg + { + public: + typedef int64_t _data_type; + _data_type data; + + Int64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int64_t real; + uint64_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; + *(outbuffer + offset + 4) = (u_data.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_data.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_data.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_data.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Int64"; }; + virtual const char * getMD5() override { return "34add168574510e6e17f5d23ecc077ef"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int64MultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int64MultiArray.h new file mode 100644 index 000000000..7962e2e73 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int64MultiArray.h @@ -0,0 +1,96 @@ +#ifndef _ROS_std_msgs_Int64MultiArray_h +#define _ROS_std_msgs_Int64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int64MultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef int64_t _data_type; + _data_type st_data; + _data_type * data; + + Int64MultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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 { + int64_t real; + uint64_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; + *(outbuffer + offset + 4) = (u_datai.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_datai.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_datai.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_datai.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->layout.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 = (int64_t*)realloc(this->data, data_lengthT * sizeof(int64_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int64_t)); + } + return offset; + } + + virtual const char * getType() override { return "std_msgs/Int64MultiArray"; }; + virtual const char * getMD5() override { return "54865aa6c65be0448113a2afc6a49270"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int8.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int8.h new file mode 100644 index 000000000..54ff2f744 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int8.h @@ -0,0 +1,56 @@ +#ifndef _ROS_std_msgs_Int8_h +#define _ROS_std_msgs_Int8_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int8 : public ros::Msg + { + public: + typedef int8_t _data_type; + _data_type data; + + Int8(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Int8"; }; + virtual const char * getMD5() override { return "27ffa0c9c4b8fb8492252bcad9e5c57b"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int8MultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int8MultiArray.h new file mode 100644 index 000000000..1ef42496f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Int8MultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_Int8MultiArray_h +#define _ROS_std_msgs_Int8MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int8MultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef int8_t _data_type; + _data_type st_data; + _data_type * data; + + Int8MultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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 { + 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->layout.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 = (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 "std_msgs/Int8MultiArray"; }; + virtual const char * getMD5() override { return "d7c1af35a1b4781bbe79e03dd94b7c13"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/MultiArrayDimension.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/MultiArrayDimension.h new file mode 100644 index 000000000..26bf3c803 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/MultiArrayDimension.h @@ -0,0 +1,81 @@ +#ifndef _ROS_std_msgs_MultiArrayDimension_h +#define _ROS_std_msgs_MultiArrayDimension_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class MultiArrayDimension : public ros::Msg + { + public: + typedef const char* _label_type; + _label_type label; + typedef uint32_t _size_type; + _size_type size; + typedef uint32_t _stride_type; + _stride_type stride; + + MultiArrayDimension(): + label(""), + size(0), + stride(0) + { + } + + 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; + *(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); + *(outbuffer + offset + 0) = (this->stride >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stride >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stride >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stride >> (8 * 3)) & 0xFF; + offset += sizeof(this->stride); + 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; + 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); + this->stride = ((uint32_t) (*(inbuffer + offset))); + this->stride |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stride |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stride |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stride); + return offset; + } + + virtual const char * getType() override { return "std_msgs/MultiArrayDimension"; }; + virtual const char * getMD5() override { return "4cd0c83a8683deae40ecdac60e53bfa8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/MultiArrayLayout.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/MultiArrayLayout.h new file mode 100644 index 000000000..c33e07eb3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/MultiArrayLayout.h @@ -0,0 +1,77 @@ +#ifndef _ROS_std_msgs_MultiArrayLayout_h +#define _ROS_std_msgs_MultiArrayLayout_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayDimension.h" + +namespace std_msgs +{ + + class MultiArrayLayout : public ros::Msg + { + public: + uint32_t dim_length; + typedef std_msgs::MultiArrayDimension _dim_type; + _dim_type st_dim; + _dim_type * dim; + typedef uint32_t _data_offset_type; + _data_offset_type data_offset; + + MultiArrayLayout(): + dim_length(0), st_dim(), dim(nullptr), + data_offset(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->dim_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->dim_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->dim_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->dim_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->dim_length); + for( uint32_t i = 0; i < dim_length; i++){ + offset += this->dim[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->data_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t dim_lengthT = ((uint32_t) (*(inbuffer + offset))); + dim_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + dim_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + dim_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->dim_length); + if(dim_lengthT > dim_length) + this->dim = (std_msgs::MultiArrayDimension*)realloc(this->dim, dim_lengthT * sizeof(std_msgs::MultiArrayDimension)); + dim_length = dim_lengthT; + for( uint32_t i = 0; i < dim_length; i++){ + offset += this->st_dim.deserialize(inbuffer + offset); + memcpy( &(this->dim[i]), &(this->st_dim), sizeof(std_msgs::MultiArrayDimension)); + } + this->data_offset = ((uint32_t) (*(inbuffer + offset))); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_offset); + return offset; + } + + virtual const char * getType() override { return "std_msgs/MultiArrayLayout"; }; + virtual const char * getMD5() override { return "0fed2a11c13e11c5571b4e2a995a91a3"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/String.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/String.h new file mode 100644 index 000000000..048fda61a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/String.h @@ -0,0 +1,55 @@ +#ifndef _ROS_std_msgs_String_h +#define _ROS_std_msgs_String_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class String : public ros::Msg + { + public: + typedef const char* _data_type; + _data_type data; + + String(): + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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; + 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 "std_msgs/String"; }; + virtual const char * getMD5() override { return "992ce8a1687cec8c8bd883ec73ca41d1"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/Time.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Time.h new file mode 100644 index 000000000..37c257aa3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/Time.h @@ -0,0 +1,62 @@ +#ifndef _ROS_std_msgs_Time_h +#define _ROS_std_msgs_Time_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace std_msgs +{ + + class Time : public ros::Msg + { + public: + typedef ros::Time _data_type; + _data_type data; + + Time(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.sec); + *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->data.sec = ((uint32_t) (*(inbuffer + offset))); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.sec); + this->data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.nsec); + return offset; + } + + virtual const char * getType() override { return "std_msgs/Time"; }; + virtual const char * getMD5() override { return "cd7166c74c552c311fbcc2fe5a7bc289"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt16.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt16.h new file mode 100644 index 000000000..539c703fa --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt16.h @@ -0,0 +1,47 @@ +#ifndef _ROS_std_msgs_UInt16_h +#define _ROS_std_msgs_UInt16_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt16 : public ros::Msg + { + public: + typedef uint16_t _data_type; + _data_type data; + + UInt16(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->data = ((uint16_t) (*(inbuffer + offset))); + this->data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "std_msgs/UInt16"; }; + virtual const char * getMD5() override { return "1df79edf208b629fe6b81923a544552d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt16MultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt16MultiArray.h new file mode 100644 index 000000000..c9351f495 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt16MultiArray.h @@ -0,0 +1,73 @@ +#ifndef _ROS_std_msgs_UInt16MultiArray_h +#define _ROS_std_msgs_UInt16MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt16MultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef uint16_t _data_type; + _data_type st_data; + _data_type * data; + + UInt16MultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->layout.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 = (uint16_t*)realloc(this->data, data_lengthT * sizeof(uint16_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + this->st_data = ((uint16_t) (*(inbuffer + offset))); + this->st_data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint16_t)); + } + return offset; + } + + virtual const char * getType() override { return "std_msgs/UInt16MultiArray"; }; + virtual const char * getMD5() override { return "52f264f1c973c4b73790d384c6cb4484"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt32.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt32.h new file mode 100644 index 000000000..f27318a7f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt32.h @@ -0,0 +1,51 @@ +#ifndef _ROS_std_msgs_UInt32_h +#define _ROS_std_msgs_UInt32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt32 : public ros::Msg + { + public: + typedef uint32_t _data_type; + _data_type data; + + UInt32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->data = ((uint32_t) (*(inbuffer + offset))); + this->data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "std_msgs/UInt32"; }; + virtual const char * getMD5() override { return "304a39449588c7f8ce2df6e8001c5fce"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt32MultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt32MultiArray.h new file mode 100644 index 000000000..baae7b626 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt32MultiArray.h @@ -0,0 +1,77 @@ +#ifndef _ROS_std_msgs_UInt32MultiArray_h +#define _ROS_std_msgs_UInt32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt32MultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef uint32_t _data_type; + _data_type st_data; + _data_type * data; + + UInt32MultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->layout.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)); + } + return offset; + } + + virtual const char * getType() override { return "std_msgs/UInt32MultiArray"; }; + virtual const char * getMD5() override { return "4d6a180abc9be191b96a7eda6c8a233d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt64.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt64.h new file mode 100644 index 000000000..da013b866 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt64.h @@ -0,0 +1,59 @@ +#ifndef _ROS_std_msgs_UInt64_h +#define _ROS_std_msgs_UInt64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt64 : public ros::Msg + { + public: + typedef uint64_t _data_type; + _data_type data; + + UInt64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->data >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->data >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->data >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->data >> (8 * 7)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->data = ((uint64_t) (*(inbuffer + offset))); + this->data |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->data |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->data |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->data |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "std_msgs/UInt64"; }; + virtual const char * getMD5() override { return "1b2a79973e8bf53d7b53acb71299cb57"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt64MultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt64MultiArray.h new file mode 100644 index 000000000..0ac6cc214 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt64MultiArray.h @@ -0,0 +1,85 @@ +#ifndef _ROS_std_msgs_UInt64MultiArray_h +#define _ROS_std_msgs_UInt64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt64MultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef uint64_t _data_type; + _data_type st_data; + _data_type * data; + + UInt64MultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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; + *(outbuffer + offset + 4) = (this->data[i] >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->data[i] >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->data[i] >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->data[i] >> (8 * 7)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->layout.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 = (uint64_t*)realloc(this->data, data_lengthT * sizeof(uint64_t)); + data_length = data_lengthT; + for( uint32_t i = 0; i < data_length; i++){ + this->st_data = ((uint64_t) (*(inbuffer + offset))); + this->st_data |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_data |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->st_data |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->st_data |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->st_data |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint64_t)); + } + return offset; + } + + virtual const char * getType() override { return "std_msgs/UInt64MultiArray"; }; + virtual const char * getMD5() override { return "6088f127afb1d6c72927aa1247e945af"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt8.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt8.h new file mode 100644 index 000000000..199629070 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt8.h @@ -0,0 +1,45 @@ +#ifndef _ROS_std_msgs_UInt8_h +#define _ROS_std_msgs_UInt8_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt8 : public ros::Msg + { + public: + typedef uint8_t _data_type; + _data_type data; + + UInt8(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return "std_msgs/UInt8"; }; + virtual const char * getMD5() override { return "7c8164229e7d2c17eb95e9231617fdee"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt8MultiArray.h b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt8MultiArray.h new file mode 100644 index 000000000..ab9aab12e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_msgs/UInt8MultiArray.h @@ -0,0 +1,71 @@ +#ifndef _ROS_std_msgs_UInt8MultiArray_h +#define _ROS_std_msgs_UInt8MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt8MultiArray : public ros::Msg + { + public: + typedef std_msgs::MultiArrayLayout _layout_type; + _layout_type layout; + uint32_t data_length; + typedef uint8_t _data_type; + _data_type st_data; + _data_type * data; + + UInt8MultiArray(): + layout(), + data_length(0), st_data(), data(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->layout.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->layout.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 "std_msgs/UInt8MultiArray"; }; + virtual const char * getMD5() override { return "82373f1612381bb6ee473b5cd6f5d89c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_srvs/Empty.h b/smart_device_protocol/ros_lib/ros_lib/std_srvs/Empty.h new file mode 100644 index 000000000..b72d5f396 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_srvs/Empty.h @@ -0,0 +1,70 @@ +#ifndef _ROS_SERVICE_Empty_h +#define _ROS_SERVICE_Empty_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char EMPTY[] = "std_srvs/Empty"; + + class EmptyRequest : public ros::Msg + { + public: + + EmptyRequest() + { + } + + 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 EMPTY; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + EmptyResponse() + { + } + + 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 EMPTY; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_srvs/SetBool.h b/smart_device_protocol/ros_lib/ros_lib/std_srvs/SetBool.h new file mode 100644 index 000000000..016cfef97 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_srvs/SetBool.h @@ -0,0 +1,123 @@ +#ifndef _ROS_SERVICE_SetBool_h +#define _ROS_SERVICE_SetBool_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char SETBOOL[] = "std_srvs/SetBool"; + + class SetBoolRequest : public ros::Msg + { + public: + typedef bool _data_type; + _data_type data; + + SetBoolRequest(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + virtual const char * getType() override { return SETBOOL; }; + virtual const char * getMD5() override { return "8b94c1b53db61fb6aed406028ad6332a"; }; + + }; + + class SetBoolResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _message_type; + _message_type message; + + SetBoolResponse(): + 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 SETBOOL; }; + virtual const char * getMD5() override { return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class SetBool { + public: + typedef SetBoolRequest Request; + typedef SetBoolResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/std_srvs/Trigger.h b/smart_device_protocol/ros_lib/ros_lib/std_srvs/Trigger.h new file mode 100644 index 000000000..69bf6ebac --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/std_srvs/Trigger.h @@ -0,0 +1,105 @@ +#ifndef _ROS_SERVICE_Trigger_h +#define _ROS_SERVICE_Trigger_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char TRIGGER[] = "std_srvs/Trigger"; + + class TriggerRequest : public ros::Msg + { + public: + + TriggerRequest() + { + } + + 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 TRIGGER; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TriggerResponse : public ros::Msg + { + public: + typedef bool _success_type; + _success_type success; + typedef const char* _message_type; + _message_type message; + + TriggerResponse(): + 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 TRIGGER; }; + virtual const char * getMD5() override { return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class Trigger { + public: + typedef TriggerRequest Request; + typedef TriggerResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/stereo_msgs/DisparityImage.h b/smart_device_protocol/ros_lib/ros_lib/stereo_msgs/DisparityImage.h new file mode 100644 index 000000000..e75608bc2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/stereo_msgs/DisparityImage.h @@ -0,0 +1,176 @@ +#ifndef _ROS_stereo_msgs_DisparityImage_h +#define _ROS_stereo_msgs_DisparityImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/RegionOfInterest.h" + +namespace stereo_msgs +{ + + class DisparityImage : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef sensor_msgs::Image _image_type; + _image_type image; + typedef float _f_type; + _f_type f; + typedef float _T_type; + _T_type T; + typedef sensor_msgs::RegionOfInterest _valid_window_type; + _valid_window_type valid_window; + typedef float _min_disparity_type; + _min_disparity_type min_disparity; + typedef float _max_disparity_type; + _max_disparity_type max_disparity; + typedef float _delta_d_type; + _delta_d_type delta_d; + + DisparityImage(): + header(), + image(), + f(0), + T(0), + valid_window(), + min_disparity(0), + max_disparity(0), + delta_d(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->image.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_f; + u_f.real = this->f; + *(outbuffer + offset + 0) = (u_f.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_f.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_f.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_f.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->f); + union { + float real; + uint32_t base; + } u_T; + u_T.real = this->T; + *(outbuffer + offset + 0) = (u_T.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_T.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_T.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_T.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->T); + offset += this->valid_window.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_min_disparity; + u_min_disparity.real = this->min_disparity; + *(outbuffer + offset + 0) = (u_min_disparity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_disparity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_disparity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_disparity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_disparity); + union { + float real; + uint32_t base; + } u_max_disparity; + u_max_disparity.real = this->max_disparity; + *(outbuffer + offset + 0) = (u_max_disparity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_disparity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_disparity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_disparity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_disparity); + union { + float real; + uint32_t base; + } u_delta_d; + u_delta_d.real = this->delta_d; + *(outbuffer + offset + 0) = (u_delta_d.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_delta_d.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_delta_d.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_delta_d.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->delta_d); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->image.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_f; + u_f.base = 0; + u_f.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->f = u_f.real; + offset += sizeof(this->f); + union { + float real; + uint32_t base; + } u_T; + u_T.base = 0; + u_T.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->T = u_T.real; + offset += sizeof(this->T); + offset += this->valid_window.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_min_disparity; + u_min_disparity.base = 0; + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_disparity = u_min_disparity.real; + offset += sizeof(this->min_disparity); + union { + float real; + uint32_t base; + } u_max_disparity; + u_max_disparity.base = 0; + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_disparity = u_max_disparity.real; + offset += sizeof(this->max_disparity); + union { + float real; + uint32_t base; + } u_delta_d; + u_delta_d.base = 0; + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->delta_d = u_delta_d.real; + offset += sizeof(this->delta_d); + return offset; + } + + virtual const char * getType() override { return "stereo_msgs/DisparityImage"; }; + virtual const char * getMD5() override { return "04a177815f75271039fa21f16acad8c9"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/Device.h b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/Device.h new file mode 100644 index 000000000..58ac43b77 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/Device.h @@ -0,0 +1,72 @@ +#ifndef _ROS_switchbot_ros_Device_h +#define _ROS_switchbot_ros_Device_h + +#include +#include +#include +#include "ros/msg.h" + +namespace switchbot_ros +{ + + class Device : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef const char* _type_type; + _type_type type; + + Device(): + name(""), + type("") + { + } + + 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; + 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; + return offset; + } + + virtual const char * getType() override { return "switchbot_ros/Device"; }; + virtual const char * getMD5() override { return "8f11915b22b276d2fb5587b35400289d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/DeviceArray.h b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/DeviceArray.h new file mode 100644 index 000000000..d8bbcf9c4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/DeviceArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_switchbot_ros_DeviceArray_h +#define _ROS_switchbot_ros_DeviceArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "switchbot_ros/Device.h" + +namespace switchbot_ros +{ + + class DeviceArray : public ros::Msg + { + public: + uint32_t devices_length; + typedef switchbot_ros::Device _devices_type; + _devices_type st_devices; + _devices_type * devices; + + DeviceArray(): + devices_length(0), st_devices(), devices(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->devices_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->devices_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->devices_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->devices_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->devices_length); + for( uint32_t i = 0; i < devices_length; i++){ + offset += this->devices[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t devices_lengthT = ((uint32_t) (*(inbuffer + offset))); + devices_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + devices_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + devices_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->devices_length); + if(devices_lengthT > devices_length) + this->devices = (switchbot_ros::Device*)realloc(this->devices, devices_lengthT * sizeof(switchbot_ros::Device)); + devices_length = devices_lengthT; + for( uint32_t i = 0; i < devices_length; i++){ + offset += this->st_devices.deserialize(inbuffer + offset); + memcpy( &(this->devices[i]), &(this->st_devices), sizeof(switchbot_ros::Device)); + } + return offset; + } + + virtual const char * getType() override { return "switchbot_ros/DeviceArray"; }; + virtual const char * getMD5() override { return "24b7884c0fb68c7417b906902c32b745"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandAction.h b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandAction.h new file mode 100644 index 000000000..bd812d116 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_switchbot_ros_SwitchBotCommandAction_h +#define _ROS_switchbot_ros_SwitchBotCommandAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "switchbot_ros/SwitchBotCommandActionGoal.h" +#include "switchbot_ros/SwitchBotCommandActionResult.h" +#include "switchbot_ros/SwitchBotCommandActionFeedback.h" + +namespace switchbot_ros +{ + + class SwitchBotCommandAction : public ros::Msg + { + public: + typedef switchbot_ros::SwitchBotCommandActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef switchbot_ros::SwitchBotCommandActionResult _action_result_type; + _action_result_type action_result; + typedef switchbot_ros::SwitchBotCommandActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + SwitchBotCommandAction(): + 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 "switchbot_ros/SwitchBotCommandAction"; }; + virtual const char * getMD5() override { return "bb09a80982618957781a83067b718d43"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionFeedback.h new file mode 100644 index 000000000..e4b75e2e0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_switchbot_ros_SwitchBotCommandActionFeedback_h +#define _ROS_switchbot_ros_SwitchBotCommandActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "switchbot_ros/SwitchBotCommandFeedback.h" + +namespace switchbot_ros +{ + + class SwitchBotCommandActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef switchbot_ros::SwitchBotCommandFeedback _feedback_type; + _feedback_type feedback; + + SwitchBotCommandActionFeedback(): + 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 "switchbot_ros/SwitchBotCommandActionFeedback"; }; + virtual const char * getMD5() override { return "82e97615735594b25e2cee3da22d3eb7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionGoal.h new file mode 100644 index 000000000..6ed466b10 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_switchbot_ros_SwitchBotCommandActionGoal_h +#define _ROS_switchbot_ros_SwitchBotCommandActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "switchbot_ros/SwitchBotCommandGoal.h" + +namespace switchbot_ros +{ + + class SwitchBotCommandActionGoal : 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 switchbot_ros::SwitchBotCommandGoal _goal_type; + _goal_type goal; + + SwitchBotCommandActionGoal(): + 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 "switchbot_ros/SwitchBotCommandActionGoal"; }; + virtual const char * getMD5() override { return "4a48aee4fa1fd1daf63f93b6466220d3"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionResult.h b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionResult.h new file mode 100644 index 000000000..093d8b7ff --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_switchbot_ros_SwitchBotCommandActionResult_h +#define _ROS_switchbot_ros_SwitchBotCommandActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "switchbot_ros/SwitchBotCommandResult.h" + +namespace switchbot_ros +{ + + class SwitchBotCommandActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef switchbot_ros::SwitchBotCommandResult _result_type; + _result_type result; + + SwitchBotCommandActionResult(): + 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 "switchbot_ros/SwitchBotCommandActionResult"; }; + virtual const char * getMD5() override { return "1539cd8d17435bb9eb218719c6a831b3"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandFeedback.h b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandFeedback.h new file mode 100644 index 000000000..0f435cca0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandFeedback.h @@ -0,0 +1,55 @@ +#ifndef _ROS_switchbot_ros_SwitchBotCommandFeedback_h +#define _ROS_switchbot_ros_SwitchBotCommandFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace switchbot_ros +{ + + class SwitchBotCommandFeedback : public ros::Msg + { + public: + typedef const char* _status_type; + _status_type status; + + SwitchBotCommandFeedback(): + status("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + 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; + 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 "switchbot_ros/SwitchBotCommandFeedback"; }; + virtual const char * getMD5() override { return "4fe5af303955c287688e7347e9b00278"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandGoal.h b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandGoal.h new file mode 100644 index 000000000..65b2b9b72 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandGoal.h @@ -0,0 +1,106 @@ +#ifndef _ROS_switchbot_ros_SwitchBotCommandGoal_h +#define _ROS_switchbot_ros_SwitchBotCommandGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace switchbot_ros +{ + + class SwitchBotCommandGoal : public ros::Msg + { + public: + typedef const char* _device_name_type; + _device_name_type device_name; + typedef const char* _command_type; + _command_type command; + typedef const char* _parameter_type; + _parameter_type parameter; + typedef const char* _command_type_type; + _command_type_type command_type; + + SwitchBotCommandGoal(): + device_name(""), + command(""), + parameter(""), + command_type("") + { + } + + 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_command = strlen(this->command); + varToArr(outbuffer + offset, length_command); + offset += 4; + memcpy(outbuffer + offset, this->command, length_command); + offset += length_command; + uint32_t length_parameter = strlen(this->parameter); + varToArr(outbuffer + offset, length_parameter); + offset += 4; + memcpy(outbuffer + offset, this->parameter, length_parameter); + offset += length_parameter; + uint32_t length_command_type = strlen(this->command_type); + varToArr(outbuffer + offset, length_command_type); + offset += 4; + memcpy(outbuffer + offset, this->command_type, length_command_type); + offset += length_command_type; + 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_command; + arrToVar(length_command, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command-1]=0; + this->command = (char *)(inbuffer + offset-1); + offset += length_command; + uint32_t length_parameter; + arrToVar(length_parameter, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parameter; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parameter-1]=0; + this->parameter = (char *)(inbuffer + offset-1); + offset += length_parameter; + uint32_t length_command_type; + arrToVar(length_command_type, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command_type-1]=0; + this->command_type = (char *)(inbuffer + offset-1); + offset += length_command_type; + return offset; + } + + virtual const char * getType() override { return "switchbot_ros/SwitchBotCommandGoal"; }; + virtual const char * getMD5() override { return "2c96c4dddec9221be5c5dc637b8e4f64"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandResult.h b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandResult.h new file mode 100644 index 000000000..c1fea4ce9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/switchbot_ros/SwitchBotCommandResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_switchbot_ros_SwitchBotCommandResult_h +#define _ROS_switchbot_ros_SwitchBotCommandResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace switchbot_ros +{ + + class SwitchBotCommandResult : public ros::Msg + { + public: + typedef bool _done_type; + _done_type done; + + SwitchBotCommandResult(): + 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 "switchbot_ros/SwitchBotCommandResult"; }; + virtual const char * getMD5() override { return "89bb254424e4cffedbf494e7b0ddbfea"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/teb_local_planner/FeedbackMsg.h b/smart_device_protocol/ros_lib/ros_lib/teb_local_planner/FeedbackMsg.h new file mode 100644 index 000000000..7abe9fd54 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/teb_local_planner/FeedbackMsg.h @@ -0,0 +1,85 @@ +#ifndef _ROS_teb_local_planner_FeedbackMsg_h +#define _ROS_teb_local_planner_FeedbackMsg_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "teb_local_planner/TrajectoryMsg.h" +#include "costmap_converter/ObstacleArrayMsg.h" + +namespace teb_local_planner +{ + + class FeedbackMsg : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t trajectories_length; + typedef teb_local_planner::TrajectoryMsg _trajectories_type; + _trajectories_type st_trajectories; + _trajectories_type * trajectories; + typedef uint16_t _selected_trajectory_idx_type; + _selected_trajectory_idx_type selected_trajectory_idx; + typedef costmap_converter::ObstacleArrayMsg _obstacles_msg_type; + _obstacles_msg_type obstacles_msg; + + FeedbackMsg(): + header(), + trajectories_length(0), st_trajectories(), trajectories(nullptr), + selected_trajectory_idx(0), + obstacles_msg() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->trajectories_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->trajectories_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->trajectories_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->trajectories_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->trajectories_length); + for( uint32_t i = 0; i < trajectories_length; i++){ + offset += this->trajectories[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->selected_trajectory_idx >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->selected_trajectory_idx >> (8 * 1)) & 0xFF; + offset += sizeof(this->selected_trajectory_idx); + offset += this->obstacles_msg.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t trajectories_lengthT = ((uint32_t) (*(inbuffer + offset))); + trajectories_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + trajectories_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + trajectories_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->trajectories_length); + if(trajectories_lengthT > trajectories_length) + this->trajectories = (teb_local_planner::TrajectoryMsg*)realloc(this->trajectories, trajectories_lengthT * sizeof(teb_local_planner::TrajectoryMsg)); + trajectories_length = trajectories_lengthT; + for( uint32_t i = 0; i < trajectories_length; i++){ + offset += this->st_trajectories.deserialize(inbuffer + offset); + memcpy( &(this->trajectories[i]), &(this->st_trajectories), sizeof(teb_local_planner::TrajectoryMsg)); + } + this->selected_trajectory_idx = ((uint16_t) (*(inbuffer + offset))); + this->selected_trajectory_idx |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->selected_trajectory_idx); + offset += this->obstacles_msg.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "teb_local_planner/FeedbackMsg"; }; + virtual const char * getMD5() override { return "e8086148d3a39de24ca2cc423f1e94e6"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/teb_local_planner/TrajectoryMsg.h b/smart_device_protocol/ros_lib/ros_lib/teb_local_planner/TrajectoryMsg.h new file mode 100644 index 000000000..38e1481fe --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/teb_local_planner/TrajectoryMsg.h @@ -0,0 +1,70 @@ +#ifndef _ROS_teb_local_planner_TrajectoryMsg_h +#define _ROS_teb_local_planner_TrajectoryMsg_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "teb_local_planner/TrajectoryPointMsg.h" + +namespace teb_local_planner +{ + + class TrajectoryMsg : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t trajectory_length; + typedef teb_local_planner::TrajectoryPointMsg _trajectory_type; + _trajectory_type st_trajectory; + _trajectory_type * trajectory; + + TrajectoryMsg(): + header(), + trajectory_length(0), st_trajectory(), trajectory(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->trajectory_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->trajectory_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->trajectory_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->trajectory_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->trajectory_length); + for( uint32_t i = 0; i < trajectory_length; i++){ + offset += this->trajectory[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t trajectory_lengthT = ((uint32_t) (*(inbuffer + offset))); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->trajectory_length); + if(trajectory_lengthT > trajectory_length) + this->trajectory = (teb_local_planner::TrajectoryPointMsg*)realloc(this->trajectory, trajectory_lengthT * sizeof(teb_local_planner::TrajectoryPointMsg)); + trajectory_length = trajectory_lengthT; + for( uint32_t i = 0; i < trajectory_length; i++){ + offset += this->st_trajectory.deserialize(inbuffer + offset); + memcpy( &(this->trajectory[i]), &(this->st_trajectory), sizeof(teb_local_planner::TrajectoryPointMsg)); + } + return offset; + } + + virtual const char * getType() override { return "teb_local_planner/TrajectoryMsg"; }; + virtual const char * getMD5() override { return "9dfdc1e62b3eb03a32af2423c5b7a0dd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/teb_local_planner/TrajectoryPointMsg.h b/smart_device_protocol/ros_lib/ros_lib/teb_local_planner/TrajectoryPointMsg.h new file mode 100644 index 000000000..f7bfcda46 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/teb_local_planner/TrajectoryPointMsg.h @@ -0,0 +1,79 @@ +#ifndef _ROS_teb_local_planner_TrajectoryPointMsg_h +#define _ROS_teb_local_planner_TrajectoryPointMsg_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" +#include "ros/duration.h" + +namespace teb_local_planner +{ + + class TrajectoryPointMsg : public ros::Msg + { + public: + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef geometry_msgs::Twist _velocity_type; + _velocity_type velocity; + typedef geometry_msgs::Twist _acceleration_type; + _acceleration_type acceleration; + typedef ros::Duration _time_from_start_type; + _time_from_start_type time_from_start; + + TrajectoryPointMsg(): + pose(), + velocity(), + acceleration(), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + offset += this->velocity.serialize(outbuffer + offset); + offset += this->acceleration.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->velocity.deserialize(inbuffer + offset); + offset += this->acceleration.deserialize(inbuffer + offset); + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual const char * getType() override { return "teb_local_planner/TrajectoryPointMsg"; }; + virtual const char * getMD5() override { return "4c309845772249e786605716950755c3"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tests/array_test/array_test.pde b/smart_device_protocol/ros_lib/ros_lib/tests/array_test/array_test.pde new file mode 100644 index 000000000..8aa72ded2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tests/array_test/array_test.pde @@ -0,0 +1,49 @@ +/* + * rosserial::geometry_msgs::PoseArray Test + * Sums an array, publishes sum + */ + +#include +#include +#include + + +ros::NodeHandle nh; + + +bool set_; + + +geometry_msgs::Pose sum_msg; +ros::Publisher p("sum", &sum_msg); + +void messageCb(const geometry_msgs::PoseArray& msg){ + sum_msg.position.x = 0; + sum_msg.position.y = 0; + sum_msg.position.z = 0; + for(int i = 0; i < msg.poses_length; i++) + { + sum_msg.position.x += msg.poses[i].position.x; + sum_msg.position.y += msg.poses[i].position.y; + sum_msg.position.z += msg.poses[i].position.z; + } + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber s("poses",messageCb); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(s); + nh.advertise(p); +} + +void loop() +{ + p.publish(&sum_msg); + nh.spinOnce(); + delay(10); +} + diff --git a/smart_device_protocol/ros_lib/ros_lib/tests/float64_test/float64_test.pde b/smart_device_protocol/ros_lib/ros_lib/tests/float64_test/float64_test.pde new file mode 100644 index 000000000..41a6f4aae --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tests/float64_test/float64_test.pde @@ -0,0 +1,38 @@ +/* + * rosserial::std_msgs::Float64 Test + * Receives a Float64 input, subtracts 1.0, and publishes it + */ + +#include +#include + + +ros::NodeHandle nh; + +float x; + +void messageCb( const std_msgs::Float64& msg){ + x = msg.data - 1.0; + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +std_msgs::Float64 test; +ros::Subscriber s("your_topic", &messageCb); +ros::Publisher p("my_topic", &test); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(p); + nh.subscribe(s); +} + +void loop() +{ + test.data = x; + p.publish( &test ); + nh.spinOnce(); + delay(10); +} + diff --git a/smart_device_protocol/ros_lib/ros_lib/tests/time_test/time_test.pde b/smart_device_protocol/ros_lib/ros_lib/tests/time_test/time_test.pde new file mode 100644 index 000000000..c5fa739fb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tests/time_test/time_test.pde @@ -0,0 +1,30 @@ +/* + * rosserial::std_msgs::Time Test + * Publishes current time + */ + +#include +#include +#include + + +ros::NodeHandle nh; + +std_msgs::Time test; +ros::Publisher p("my_topic", &test); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(p); +} + +void loop() +{ + test.data = nh.now(); + p.publish( &test ); + nh.spinOnce(); + delay(10); +} + diff --git a/smart_device_protocol/ros_lib/ros_lib/tf/FrameGraph.h b/smart_device_protocol/ros_lib/ros_lib/tf/FrameGraph.h new file mode 100644 index 000000000..6cface95f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf/FrameGraph.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_FrameGraph_h +#define _ROS_SERVICE_FrameGraph_h +#include +#include +#include +#include "ros/msg.h" + +namespace tf +{ + +static const char FRAMEGRAPH[] = "tf/FrameGraph"; + + class FrameGraphRequest : public ros::Msg + { + public: + + FrameGraphRequest() + { + } + + 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 FRAMEGRAPH; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + typedef const char* _dot_graph_type; + _dot_graph_type dot_graph; + + FrameGraphResponse(): + dot_graph("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_dot_graph = strlen(this->dot_graph); + varToArr(outbuffer + offset, length_dot_graph); + offset += 4; + memcpy(outbuffer + offset, this->dot_graph, length_dot_graph); + offset += length_dot_graph; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_dot_graph; + arrToVar(length_dot_graph, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dot_graph; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dot_graph-1]=0; + this->dot_graph = (char *)(inbuffer + offset-1); + offset += length_dot_graph; + return offset; + } + + virtual const char * getType() override { return FRAMEGRAPH; }; + virtual const char * getMD5() override { return "c4af9ac907e58e906eb0b6e3c58478c0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf/tf.h b/smart_device_protocol/ros_lib/ros_lib/tf/tf.h new file mode 100644 index 000000000..97858fe2e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf/tf.h @@ -0,0 +1,56 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TF_H_ +#define ROS_TF_H_ + +#include "geometry_msgs/TransformStamped.h" + +namespace tf +{ + +static inline geometry_msgs::Quaternion createQuaternionFromYaw(double yaw) +{ + geometry_msgs::Quaternion q; + q.x = 0; + q.y = 0; + q.z = sin(yaw * 0.5); + q.w = cos(yaw * 0.5); + return q; +} + +} + +#endif + diff --git a/smart_device_protocol/ros_lib/ros_lib/tf/tfMessage.h b/smart_device_protocol/ros_lib/ros_lib/tf/tfMessage.h new file mode 100644 index 000000000..5b8085fa4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf/tfMessage.h @@ -0,0 +1,64 @@ +#ifndef _ROS_tf_tfMessage_h +#define _ROS_tf_tfMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf +{ + + class tfMessage : public ros::Msg + { + public: + uint32_t transforms_length; + typedef geometry_msgs::TransformStamped _transforms_type; + _transforms_type st_transforms; + _transforms_type * transforms; + + tfMessage(): + transforms_length(0), st_transforms(), transforms(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->transforms_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->transforms_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->transforms_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->transforms_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->transforms_length); + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t transforms_lengthT = ((uint32_t) (*(inbuffer + offset))); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->transforms_length); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + transforms_length = transforms_lengthT; + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + virtual const char * getType() override { return "tf/tfMessage"; }; + virtual const char * getMD5() override { return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf/transform_broadcaster.h b/smart_device_protocol/ros_lib/ros_lib/tf/transform_broadcaster.h new file mode 100644 index 000000000..6c4e5fee7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf/transform_broadcaster.h @@ -0,0 +1,69 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TRANSFORM_BROADCASTER_H_ +#define ROS_TRANSFORM_BROADCASTER_H_ + +#include "ros.h" +#include "tfMessage.h" + +namespace tf +{ + +class TransformBroadcaster +{ +public: + TransformBroadcaster() : publisher_("/tf", &internal_msg) {} + + void init(ros::NodeHandle &nh) + { + nh.advertise(publisher_); + } + + void sendTransform(geometry_msgs::TransformStamped &transform) + { + internal_msg.transforms_length = 1; + internal_msg.transforms = &transform; + publisher_.publish(&internal_msg); + } + +private: + tf::tfMessage internal_msg; + ros::Publisher publisher_; +}; + +} + +#endif + diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/FrameGraph.h b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/FrameGraph.h new file mode 100644 index 000000000..504196add --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/FrameGraph.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_FrameGraph_h +#define _ROS_SERVICE_FrameGraph_h +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + +static const char FRAMEGRAPH[] = "tf2_msgs/FrameGraph"; + + class FrameGraphRequest : public ros::Msg + { + public: + + FrameGraphRequest() + { + } + + 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 FRAMEGRAPH; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + typedef const char* _frame_yaml_type; + _frame_yaml_type frame_yaml; + + FrameGraphResponse(): + frame_yaml("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_frame_yaml = strlen(this->frame_yaml); + varToArr(outbuffer + offset, length_frame_yaml); + offset += 4; + memcpy(outbuffer + offset, this->frame_yaml, length_frame_yaml); + offset += length_frame_yaml; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_frame_yaml; + arrToVar(length_frame_yaml, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_yaml; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_yaml-1]=0; + this->frame_yaml = (char *)(inbuffer + offset-1); + offset += length_frame_yaml; + return offset; + } + + virtual const char * getType() override { return FRAMEGRAPH; }; + virtual const char * getMD5() override { return "437ea58e9463815a0d511c7326b686b0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformAction.h b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformAction.h new file mode 100644 index 000000000..869a1c424 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_tf2_msgs_LookupTransformAction_h +#define _ROS_tf2_msgs_LookupTransformAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "tf2_msgs/LookupTransformActionGoal.h" +#include "tf2_msgs/LookupTransformActionResult.h" +#include "tf2_msgs/LookupTransformActionFeedback.h" + +namespace tf2_msgs +{ + + class LookupTransformAction : public ros::Msg + { + public: + typedef tf2_msgs::LookupTransformActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef tf2_msgs::LookupTransformActionResult _action_result_type; + _action_result_type action_result; + typedef tf2_msgs::LookupTransformActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + LookupTransformAction(): + 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 "tf2_msgs/LookupTransformAction"; }; + virtual const char * getMD5() override { return "7ee01ba91a56c2245c610992dbaa3c37"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h new file mode 100644 index 000000000..69f7d182e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionFeedback_h +#define _ROS_tf2_msgs_LookupTransformActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_msgs/LookupTransformFeedback.h" + +namespace tf2_msgs +{ + + class LookupTransformActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef tf2_msgs::LookupTransformFeedback _feedback_type; + _feedback_type feedback; + + LookupTransformActionFeedback(): + 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 "tf2_msgs/LookupTransformActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h new file mode 100644 index 000000000..a6d13dfd8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionGoal_h +#define _ROS_tf2_msgs_LookupTransformActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "tf2_msgs/LookupTransformGoal.h" + +namespace tf2_msgs +{ + + class LookupTransformActionGoal : 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 tf2_msgs::LookupTransformGoal _goal_type; + _goal_type goal; + + LookupTransformActionGoal(): + 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 "tf2_msgs/LookupTransformActionGoal"; }; + virtual const char * getMD5() override { return "f2e7bcdb75c847978d0351a13e699da5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionResult.h b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionResult.h new file mode 100644 index 000000000..14900f324 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionResult_h +#define _ROS_tf2_msgs_LookupTransformActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_msgs/LookupTransformResult.h" + +namespace tf2_msgs +{ + + class LookupTransformActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef tf2_msgs::LookupTransformResult _result_type; + _result_type result; + + LookupTransformActionResult(): + 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 "tf2_msgs/LookupTransformActionResult"; }; + virtual const char * getMD5() override { return "ac26ce75a41384fa8bb4dc10f491ab90"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformFeedback.h b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformFeedback.h new file mode 100644 index 000000000..b08b9b24d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_tf2_msgs_LookupTransformFeedback_h +#define _ROS_tf2_msgs_LookupTransformFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + + class LookupTransformFeedback : public ros::Msg + { + public: + + LookupTransformFeedback() + { + } + + 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 "tf2_msgs/LookupTransformFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformGoal.h b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformGoal.h new file mode 100644 index 000000000..57aaeb4e9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformGoal.h @@ -0,0 +1,178 @@ +#ifndef _ROS_tf2_msgs_LookupTransformGoal_h +#define _ROS_tf2_msgs_LookupTransformGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" + +namespace tf2_msgs +{ + + class LookupTransformGoal : public ros::Msg + { + public: + typedef const char* _target_frame_type; + _target_frame_type target_frame; + typedef const char* _source_frame_type; + _source_frame_type source_frame; + typedef ros::Time _source_time_type; + _source_time_type source_time; + typedef ros::Duration _timeout_type; + _timeout_type timeout; + typedef ros::Time _target_time_type; + _target_time_type target_time; + typedef const char* _fixed_frame_type; + _fixed_frame_type fixed_frame; + typedef bool _advanced_type; + _advanced_type advanced; + + LookupTransformGoal(): + target_frame(""), + source_frame(""), + source_time(), + timeout(), + target_time(), + fixed_frame(""), + advanced(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_target_frame = strlen(this->target_frame); + varToArr(outbuffer + offset, length_target_frame); + offset += 4; + memcpy(outbuffer + offset, this->target_frame, length_target_frame); + offset += length_target_frame; + uint32_t length_source_frame = strlen(this->source_frame); + varToArr(outbuffer + offset, length_source_frame); + offset += 4; + memcpy(outbuffer + offset, this->source_frame, length_source_frame); + offset += length_source_frame; + *(outbuffer + offset + 0) = (this->source_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_time.sec); + *(outbuffer + offset + 0) = (this->source_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_time.nsec); + *(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->target_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_time.sec); + *(outbuffer + offset + 0) = (this->target_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_time.nsec); + uint32_t length_fixed_frame = strlen(this->fixed_frame); + varToArr(outbuffer + offset, length_fixed_frame); + offset += 4; + memcpy(outbuffer + offset, this->fixed_frame, length_fixed_frame); + offset += length_fixed_frame; + union { + bool real; + uint8_t base; + } u_advanced; + u_advanced.real = this->advanced; + *(outbuffer + offset + 0) = (u_advanced.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->advanced); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_target_frame; + arrToVar(length_target_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_frame-1]=0; + this->target_frame = (char *)(inbuffer + offset-1); + offset += length_target_frame; + uint32_t length_source_frame; + arrToVar(length_source_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_source_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_source_frame-1]=0; + this->source_frame = (char *)(inbuffer + offset-1); + offset += length_source_frame; + this->source_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_time.sec); + this->source_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_time.nsec); + 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->target_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_time.sec); + this->target_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_time.nsec); + uint32_t length_fixed_frame; + arrToVar(length_fixed_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_fixed_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_fixed_frame-1]=0; + this->fixed_frame = (char *)(inbuffer + offset-1); + offset += length_fixed_frame; + union { + bool real; + uint8_t base; + } u_advanced; + u_advanced.base = 0; + u_advanced.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->advanced = u_advanced.real; + offset += sizeof(this->advanced); + return offset; + } + + virtual const char * getType() override { return "tf2_msgs/LookupTransformGoal"; }; + virtual const char * getMD5() override { return "35e3720468131d675a18bb6f3e5f22f8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformResult.h b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformResult.h new file mode 100644 index 000000000..c3f148b54 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/LookupTransformResult.h @@ -0,0 +1,50 @@ +#ifndef _ROS_tf2_msgs_LookupTransformResult_h +#define _ROS_tf2_msgs_LookupTransformResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" +#include "tf2_msgs/TF2Error.h" + +namespace tf2_msgs +{ + + class LookupTransformResult : public ros::Msg + { + public: + typedef geometry_msgs::TransformStamped _transform_type; + _transform_type transform; + typedef tf2_msgs::TF2Error _error_type; + _error_type error; + + LookupTransformResult(): + transform(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->transform.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->transform.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + virtual const char * getType() override { return "tf2_msgs/LookupTransformResult"; }; + virtual const char * getMD5() override { return "3fe5db6a19ca9cfb675418c5ad875c36"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/TF2Error.h b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/TF2Error.h new file mode 100644 index 000000000..cc3de492a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/TF2Error.h @@ -0,0 +1,69 @@ +#ifndef _ROS_tf2_msgs_TF2Error_h +#define _ROS_tf2_msgs_TF2Error_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + + class TF2Error : public ros::Msg + { + public: + typedef uint8_t _error_type; + _error_type error; + typedef const char* _error_string_type; + _error_string_type error_string; + enum { NO_ERROR = 0 }; + enum { LOOKUP_ERROR = 1 }; + enum { CONNECTIVITY_ERROR = 2 }; + enum { EXTRAPOLATION_ERROR = 3 }; + enum { INVALID_ARGUMENT_ERROR = 4 }; + enum { TIMEOUT_ERROR = 5 }; + enum { TRANSFORM_ERROR = 6 }; + + TF2Error(): + error(0), + error_string("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF; + offset += sizeof(this->error); + uint32_t length_error_string = strlen(this->error_string); + varToArr(outbuffer + offset, length_error_string); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->error = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->error); + uint32_t length_error_string; + arrToVar(length_error_string, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_string; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_string-1]=0; + this->error_string = (char *)(inbuffer + offset-1); + offset += length_error_string; + return offset; + } + + virtual const char * getType() override { return "tf2_msgs/TF2Error"; }; + virtual const char * getMD5() override { return "bc6848fd6fd750c92e38575618a4917d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/TFMessage.h b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/TFMessage.h new file mode 100644 index 000000000..f55e34cbd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_msgs/TFMessage.h @@ -0,0 +1,64 @@ +#ifndef _ROS_tf2_msgs_TFMessage_h +#define _ROS_tf2_msgs_TFMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf2_msgs +{ + + class TFMessage : public ros::Msg + { + public: + uint32_t transforms_length; + typedef geometry_msgs::TransformStamped _transforms_type; + _transforms_type st_transforms; + _transforms_type * transforms; + + TFMessage(): + transforms_length(0), st_transforms(), transforms(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->transforms_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->transforms_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->transforms_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->transforms_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->transforms_length); + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t transforms_lengthT = ((uint32_t) (*(inbuffer + offset))); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->transforms_length); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + transforms_length = transforms_lengthT; + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + virtual const char * getType() override { return "tf2_msgs/TFMessage"; }; + virtual const char * getMD5() override { return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFArray.h b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFArray.h new file mode 100644 index 000000000..9edfba2a6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_tf2_web_republisher_TFArray_h +#define _ROS_tf2_web_republisher_TFArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf2_web_republisher +{ + + class TFArray : public ros::Msg + { + public: + uint32_t transforms_length; + typedef geometry_msgs::TransformStamped _transforms_type; + _transforms_type st_transforms; + _transforms_type * transforms; + + TFArray(): + transforms_length(0), st_transforms(), transforms(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->transforms_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->transforms_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->transforms_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->transforms_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->transforms_length); + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t transforms_lengthT = ((uint32_t) (*(inbuffer + offset))); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->transforms_length); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + transforms_length = transforms_lengthT; + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + virtual const char * getType() override { return "tf2_web_republisher/TFArray"; }; + virtual const char * getMD5() override { return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionAction.h b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionAction.h new file mode 100644 index 000000000..1354a709b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_tf2_web_republisher_TFSubscriptionAction_h +#define _ROS_tf2_web_republisher_TFSubscriptionAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "tf2_web_republisher/TFSubscriptionActionGoal.h" +#include "tf2_web_republisher/TFSubscriptionActionResult.h" +#include "tf2_web_republisher/TFSubscriptionActionFeedback.h" + +namespace tf2_web_republisher +{ + + class TFSubscriptionAction : public ros::Msg + { + public: + typedef tf2_web_republisher::TFSubscriptionActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef tf2_web_republisher::TFSubscriptionActionResult _action_result_type; + _action_result_type action_result; + typedef tf2_web_republisher::TFSubscriptionActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + TFSubscriptionAction(): + 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 "tf2_web_republisher/TFSubscriptionAction"; }; + virtual const char * getMD5() override { return "15787ffd6a2492c0022abe990c898794"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionFeedback.h new file mode 100644 index 000000000..c8c385d88 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_tf2_web_republisher_TFSubscriptionActionFeedback_h +#define _ROS_tf2_web_republisher_TFSubscriptionActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_web_republisher/TFSubscriptionFeedback.h" + +namespace tf2_web_republisher +{ + + class TFSubscriptionActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef tf2_web_republisher::TFSubscriptionFeedback _feedback_type; + _feedback_type feedback; + + TFSubscriptionActionFeedback(): + 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 "tf2_web_republisher/TFSubscriptionActionFeedback"; }; + virtual const char * getMD5() override { return "de686654be3ef0f8970616dd702bb360"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionGoal.h new file mode 100644 index 000000000..a4730b424 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_tf2_web_republisher_TFSubscriptionActionGoal_h +#define _ROS_tf2_web_republisher_TFSubscriptionActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "tf2_web_republisher/TFSubscriptionGoal.h" + +namespace tf2_web_republisher +{ + + class TFSubscriptionActionGoal : 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 tf2_web_republisher::TFSubscriptionGoal _goal_type; + _goal_type goal; + + TFSubscriptionActionGoal(): + 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 "tf2_web_republisher/TFSubscriptionActionGoal"; }; + virtual const char * getMD5() override { return "ef8da891ba3ba9b13d97bca8154eaeb5"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionResult.h b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionResult.h new file mode 100644 index 000000000..a9a7bf51f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_tf2_web_republisher_TFSubscriptionActionResult_h +#define _ROS_tf2_web_republisher_TFSubscriptionActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_web_republisher/TFSubscriptionResult.h" + +namespace tf2_web_republisher +{ + + class TFSubscriptionActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef tf2_web_republisher::TFSubscriptionResult _result_type; + _result_type result; + + TFSubscriptionActionResult(): + 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 "tf2_web_republisher/TFSubscriptionActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionFeedback.h new file mode 100644 index 000000000..e422923a3 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionFeedback.h @@ -0,0 +1,64 @@ +#ifndef _ROS_tf2_web_republisher_TFSubscriptionFeedback_h +#define _ROS_tf2_web_republisher_TFSubscriptionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf2_web_republisher +{ + + class TFSubscriptionFeedback : public ros::Msg + { + public: + uint32_t transforms_length; + typedef geometry_msgs::TransformStamped _transforms_type; + _transforms_type st_transforms; + _transforms_type * transforms; + + TFSubscriptionFeedback(): + transforms_length(0), st_transforms(), transforms(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->transforms_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->transforms_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->transforms_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->transforms_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->transforms_length); + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t transforms_lengthT = ((uint32_t) (*(inbuffer + offset))); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->transforms_length); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + transforms_length = transforms_lengthT; + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + virtual const char * getType() override { return "tf2_web_republisher/TFSubscriptionFeedback"; }; + virtual const char * getMD5() override { return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionGoal.h b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionGoal.h new file mode 100644 index 000000000..6eb4ad91e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionGoal.h @@ -0,0 +1,164 @@ +#ifndef _ROS_tf2_web_republisher_TFSubscriptionGoal_h +#define _ROS_tf2_web_republisher_TFSubscriptionGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_web_republisher +{ + + class TFSubscriptionGoal : public ros::Msg + { + public: + uint32_t source_frames_length; + typedef char* _source_frames_type; + _source_frames_type st_source_frames; + _source_frames_type * source_frames; + typedef const char* _target_frame_type; + _target_frame_type target_frame; + typedef float _angular_thres_type; + _angular_thres_type angular_thres; + typedef float _trans_thres_type; + _trans_thres_type trans_thres; + typedef float _rate_type; + _rate_type rate; + + TFSubscriptionGoal(): + source_frames_length(0), st_source_frames(), source_frames(nullptr), + target_frame(""), + angular_thres(0), + trans_thres(0), + rate(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->source_frames_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_frames_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_frames_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_frames_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_frames_length); + for( uint32_t i = 0; i < source_frames_length; i++){ + uint32_t length_source_framesi = strlen(this->source_frames[i]); + varToArr(outbuffer + offset, length_source_framesi); + offset += 4; + memcpy(outbuffer + offset, this->source_frames[i], length_source_framesi); + offset += length_source_framesi; + } + uint32_t length_target_frame = strlen(this->target_frame); + varToArr(outbuffer + offset, length_target_frame); + offset += 4; + memcpy(outbuffer + offset, this->target_frame, length_target_frame); + offset += length_target_frame; + union { + float real; + uint32_t base; + } u_angular_thres; + u_angular_thres.real = this->angular_thres; + *(outbuffer + offset + 0) = (u_angular_thres.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular_thres.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular_thres.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular_thres.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular_thres); + union { + float real; + uint32_t base; + } u_trans_thres; + u_trans_thres.real = this->trans_thres; + *(outbuffer + offset + 0) = (u_trans_thres.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_trans_thres.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_trans_thres.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_trans_thres.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->trans_thres); + union { + float real; + uint32_t base; + } u_rate; + u_rate.real = this->rate; + *(outbuffer + offset + 0) = (u_rate.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rate.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rate.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rate.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->rate); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t source_frames_lengthT = ((uint32_t) (*(inbuffer + offset))); + source_frames_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + source_frames_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + source_frames_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_frames_length); + if(source_frames_lengthT > source_frames_length) + this->source_frames = (char**)realloc(this->source_frames, source_frames_lengthT * sizeof(char*)); + source_frames_length = source_frames_lengthT; + for( uint32_t i = 0; i < source_frames_length; i++){ + uint32_t length_st_source_frames; + arrToVar(length_st_source_frames, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_source_frames; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_source_frames-1]=0; + this->st_source_frames = (char *)(inbuffer + offset-1); + offset += length_st_source_frames; + memcpy( &(this->source_frames[i]), &(this->st_source_frames), sizeof(char*)); + } + uint32_t length_target_frame; + arrToVar(length_target_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_frame-1]=0; + this->target_frame = (char *)(inbuffer + offset-1); + offset += length_target_frame; + union { + float real; + uint32_t base; + } u_angular_thres; + u_angular_thres.base = 0; + u_angular_thres.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular_thres.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular_thres.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular_thres.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular_thres = u_angular_thres.real; + offset += sizeof(this->angular_thres); + union { + float real; + uint32_t base; + } u_trans_thres; + u_trans_thres.base = 0; + u_trans_thres.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_trans_thres.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_trans_thres.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_trans_thres.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->trans_thres = u_trans_thres.real; + offset += sizeof(this->trans_thres); + union { + float real; + uint32_t base; + } u_rate; + u_rate.base = 0; + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_rate.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->rate = u_rate.real; + offset += sizeof(this->rate); + return offset; + } + + virtual const char * getType() override { return "tf2_web_republisher/TFSubscriptionGoal"; }; + virtual const char * getMD5() override { return "b2dae39608227a5c1c4a91ad77023a27"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionResult.h b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionResult.h new file mode 100644 index 000000000..bd08e853c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/tf2_web_republisher/TFSubscriptionResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_tf2_web_republisher_TFSubscriptionResult_h +#define _ROS_tf2_web_republisher_TFSubscriptionResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_web_republisher +{ + + class TFSubscriptionResult : public ros::Msg + { + public: + + TFSubscriptionResult() + { + } + + 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 "tf2_web_republisher/TFSubscriptionResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/theora_image_transport/Packet.h b/smart_device_protocol/ros_lib/ros_lib/theora_image_transport/Packet.h new file mode 100644 index 000000000..f4a16f650 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/theora_image_transport/Packet.h @@ -0,0 +1,183 @@ +#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/smart_device_protocol/ros_lib/ros_lib/time.cpp b/smart_device_protocol/ros_lib/ros_lib/time.cpp new file mode 100644 index 000000000..47bb0a3b4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/time.cpp @@ -0,0 +1,79 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "ros/time.h" + +namespace ros +{ +void normalizeSecNSec(uint32_t& sec, uint32_t& nsec) +{ + uint32_t nsec_part = nsec % 1000000000UL; + uint32_t sec_part = nsec / 1000000000UL; + sec += sec_part; + nsec = nsec_part; +} + +Time& Time::fromNSec(int32_t t) +{ + sec = t / 1000000000; + nsec = t % 1000000000; + normalizeSecNSec(sec, nsec); + return *this; +} + +Time& Time::operator +=(const Duration &rhs) +{ + sec = sec - 1 + rhs.sec; + nsec = nsec + 1000000000UL + rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; +} + +Time& Time::operator -=(const Duration &rhs){ + sec = sec - 1 - rhs.sec; + nsec = nsec + 1000000000UL - rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; +} + +Duration Time::operator-(const Time &rhs) const { + // Note: Considers wrap around as a continuation of time, e.g., + // (0,0) - (0xFFFFFFFF, 0) = (1, 0) + Duration d; + d.sec = sec > rhs.sec ? sec - rhs.sec : -(rhs.sec - sec); + d.nsec = nsec > rhs.nsec ? nsec - rhs.nsec : -(rhs.nsec - nsec); + normalizeSecNSecSigned(d.sec, d.nsec); + return d; +} +} diff --git a/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxAdd.h b/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxAdd.h new file mode 100644 index 000000000..90ec122db --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxAdd.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_DemuxAdd_h +#define _ROS_SERVICE_DemuxAdd_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXADD[] = "topic_tools/DemuxAdd"; + + class DemuxAddRequest : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + + DemuxAddRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return DEMUXADD; }; + virtual const char * getMD5() override { return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxAddResponse : public ros::Msg + { + public: + + DemuxAddResponse() + { + } + + 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 DEMUXADD; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxAdd { + public: + typedef DemuxAddRequest Request; + typedef DemuxAddResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxDelete.h b/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxDelete.h new file mode 100644 index 000000000..50e957914 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxDelete.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_DemuxDelete_h +#define _ROS_SERVICE_DemuxDelete_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXDELETE[] = "topic_tools/DemuxDelete"; + + class DemuxDeleteRequest : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + + DemuxDeleteRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return DEMUXDELETE; }; + virtual const char * getMD5() override { return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxDeleteResponse : public ros::Msg + { + public: + + DemuxDeleteResponse() + { + } + + 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 DEMUXDELETE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxDelete { + public: + typedef DemuxDeleteRequest Request; + typedef DemuxDeleteResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxList.h b/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxList.h new file mode 100644 index 000000000..82b00293c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxList.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_DemuxList_h +#define _ROS_SERVICE_DemuxList_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXLIST[] = "topic_tools/DemuxList"; + + class DemuxListRequest : public ros::Msg + { + public: + + DemuxListRequest() + { + } + + 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 DEMUXLIST; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxListResponse : public ros::Msg + { + public: + uint32_t topics_length; + typedef char* _topics_type; + _topics_type st_topics; + _topics_type * topics; + + DemuxListResponse(): + topics_length(0), st_topics(), topics(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topics_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topics_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->topics_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->topics_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->topics_length); + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + varToArr(outbuffer + offset, length_topicsi); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t topics_lengthT = ((uint32_t) (*(inbuffer + offset))); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->topics_length); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + topics_length = topics_lengthT; + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + arrToVar(length_st_topics, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return DEMUXLIST; }; + virtual const char * getMD5() override { return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class DemuxList { + public: + typedef DemuxListRequest Request; + typedef DemuxListResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxSelect.h b/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxSelect.h new file mode 100644 index 000000000..9d4fbd7a8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/topic_tools/DemuxSelect.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_DemuxSelect_h +#define _ROS_SERVICE_DemuxSelect_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXSELECT[] = "topic_tools/DemuxSelect"; + + class DemuxSelectRequest : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + + DemuxSelectRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return DEMUXSELECT; }; + virtual const char * getMD5() override { return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxSelectResponse : public ros::Msg + { + public: + typedef const char* _prev_topic_type; + _prev_topic_type prev_topic; + + DemuxSelectResponse(): + prev_topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_prev_topic = strlen(this->prev_topic); + varToArr(outbuffer + offset, length_prev_topic); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_prev_topic; + arrToVar(length_prev_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_prev_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_prev_topic-1]=0; + this->prev_topic = (char *)(inbuffer + offset-1); + offset += length_prev_topic; + return offset; + } + + virtual const char * getType() override { return DEMUXSELECT; }; + virtual const char * getMD5() override { return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class DemuxSelect { + public: + typedef DemuxSelectRequest Request; + typedef DemuxSelectResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxAdd.h b/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxAdd.h new file mode 100644 index 000000000..b629cd6c8 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxAdd.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_MuxAdd_h +#define _ROS_SERVICE_MuxAdd_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXADD[] = "topic_tools/MuxAdd"; + + class MuxAddRequest : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + + MuxAddRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return MUXADD; }; + virtual const char * getMD5() override { return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxAddResponse : public ros::Msg + { + public: + + MuxAddResponse() + { + } + + 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 MUXADD; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxAdd { + public: + typedef MuxAddRequest Request; + typedef MuxAddResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxDelete.h b/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxDelete.h new file mode 100644 index 000000000..2194a5655 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxDelete.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_MuxDelete_h +#define _ROS_SERVICE_MuxDelete_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXDELETE[] = "topic_tools/MuxDelete"; + + class MuxDeleteRequest : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + + MuxDeleteRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return MUXDELETE; }; + virtual const char * getMD5() override { return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxDeleteResponse : public ros::Msg + { + public: + + MuxDeleteResponse() + { + } + + 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 MUXDELETE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxDelete { + public: + typedef MuxDeleteRequest Request; + typedef MuxDeleteResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxList.h b/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxList.h new file mode 100644 index 000000000..20af44f35 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxList.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_MuxList_h +#define _ROS_SERVICE_MuxList_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXLIST[] = "topic_tools/MuxList"; + + class MuxListRequest : public ros::Msg + { + public: + + MuxListRequest() + { + } + + 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 MUXLIST; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxListResponse : public ros::Msg + { + public: + uint32_t topics_length; + typedef char* _topics_type; + _topics_type st_topics; + _topics_type * topics; + + MuxListResponse(): + topics_length(0), st_topics(), topics(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topics_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topics_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->topics_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->topics_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->topics_length); + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + varToArr(outbuffer + offset, length_topicsi); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t topics_lengthT = ((uint32_t) (*(inbuffer + offset))); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + topics_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->topics_length); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + topics_length = topics_lengthT; + for( uint32_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + arrToVar(length_st_topics, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return MUXLIST; }; + virtual const char * getMD5() override { return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class MuxList { + public: + typedef MuxListRequest Request; + typedef MuxListResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxSelect.h b/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxSelect.h new file mode 100644 index 000000000..911741a6e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/topic_tools/MuxSelect.h @@ -0,0 +1,104 @@ +#ifndef _ROS_SERVICE_MuxSelect_h +#define _ROS_SERVICE_MuxSelect_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXSELECT[] = "topic_tools/MuxSelect"; + + class MuxSelectRequest : public ros::Msg + { + public: + typedef const char* _topic_type; + _topic_type topic; + + MuxSelectRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + varToArr(outbuffer + offset, length_topic); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_topic; + arrToVar(length_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + virtual const char * getType() override { return MUXSELECT; }; + virtual const char * getMD5() override { return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxSelectResponse : public ros::Msg + { + public: + typedef const char* _prev_topic_type; + _prev_topic_type prev_topic; + + MuxSelectResponse(): + prev_topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_prev_topic = strlen(this->prev_topic); + varToArr(outbuffer + offset, length_prev_topic); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_prev_topic; + arrToVar(length_prev_topic, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_prev_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_prev_topic-1]=0; + this->prev_topic = (char *)(inbuffer + offset-1); + offset += length_prev_topic; + return offset; + } + + virtual const char * getType() override { return MUXSELECT; }; + virtual const char * getMD5() override { return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class MuxSelect { + public: + typedef MuxSelectRequest Request; + typedef MuxSelectResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/JointTrajectory.h b/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/JointTrajectory.h new file mode 100644 index 000000000..6ad0590b9 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/JointTrajectory.h @@ -0,0 +1,107 @@ +#ifndef _ROS_trajectory_msgs_JointTrajectory_h +#define _ROS_trajectory_msgs_JointTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace trajectory_msgs +{ + + class JointTrajectory : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t points_length; + typedef trajectory_msgs::JointTrajectoryPoint _points_type; + _points_type st_points; + _points_type * points; + + JointTrajectory(): + header(), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + points_length(0), st_points(), points(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + 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 = (trajectory_msgs::JointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::JointTrajectoryPoint)); + 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(trajectory_msgs::JointTrajectoryPoint)); + } + return offset; + } + + virtual const char * getType() override { return "trajectory_msgs/JointTrajectory"; }; + virtual const char * getMD5() override { return "65b4f94a94d1ed67169da35a02f33d3f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h b/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h new file mode 100644 index 000000000..6d582f956 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h @@ -0,0 +1,162 @@ +#ifndef _ROS_trajectory_msgs_JointTrajectoryPoint_h +#define _ROS_trajectory_msgs_JointTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace trajectory_msgs +{ + + class JointTrajectoryPoint : public ros::Msg + { + public: + uint32_t positions_length; + typedef float _positions_type; + _positions_type st_positions; + _positions_type * positions; + uint32_t velocities_length; + typedef float _velocities_type; + _velocities_type st_velocities; + _velocities_type * velocities; + uint32_t accelerations_length; + typedef float _accelerations_type; + _accelerations_type st_accelerations; + _accelerations_type * accelerations; + uint32_t effort_length; + typedef float _effort_type; + _effort_type st_effort; + _effort_type * effort; + typedef ros::Duration _time_from_start_type; + _time_from_start_type time_from_start; + + JointTrajectoryPoint(): + positions_length(0), st_positions(), positions(nullptr), + velocities_length(0), st_velocities(), velocities(nullptr), + accelerations_length(0), st_accelerations(), accelerations(nullptr), + effort_length(0), st_effort(), effort(nullptr), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->positions_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->positions_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->positions_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->positions_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->positions_length); + for( uint32_t i = 0; i < positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->positions[i]); + } + *(outbuffer + offset + 0) = (this->velocities_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->velocities_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->velocities_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->velocities_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->velocities_length); + for( uint32_t i = 0; i < velocities_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocities[i]); + } + *(outbuffer + offset + 0) = (this->accelerations_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->accelerations_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->accelerations_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->accelerations_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->accelerations_length); + for( uint32_t i = 0; i < accelerations_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->accelerations[i]); + } + *(outbuffer + offset + 0) = (this->effort_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->effort_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->effort_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->effort_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->effort_length); + for( uint32_t i = 0; i < effort_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->effort[i]); + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t positions_lengthT = ((uint32_t) (*(inbuffer + offset))); + positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + positions_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->positions_length); + if(positions_lengthT > positions_length) + this->positions = (float*)realloc(this->positions, positions_lengthT * sizeof(float)); + positions_length = positions_lengthT; + for( uint32_t i = 0; i < positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_positions)); + memcpy( &(this->positions[i]), &(this->st_positions), sizeof(float)); + } + uint32_t velocities_lengthT = ((uint32_t) (*(inbuffer + offset))); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->velocities_length); + if(velocities_lengthT > velocities_length) + this->velocities = (float*)realloc(this->velocities, velocities_lengthT * sizeof(float)); + velocities_length = velocities_lengthT; + for( uint32_t i = 0; i < velocities_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocities)); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(float)); + } + uint32_t accelerations_lengthT = ((uint32_t) (*(inbuffer + offset))); + accelerations_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + accelerations_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + accelerations_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->accelerations_length); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (float*)realloc(this->accelerations, accelerations_lengthT * sizeof(float)); + accelerations_length = accelerations_lengthT; + for( uint32_t i = 0; i < accelerations_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_accelerations)); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(float)); + } + uint32_t effort_lengthT = ((uint32_t) (*(inbuffer + offset))); + effort_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + effort_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + effort_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->effort_length); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + effort_length = effort_lengthT; + for( uint32_t i = 0; i < effort_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_effort)); + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual const char * getType() override { return "trajectory_msgs/JointTrajectoryPoint"; }; + virtual const char * getMD5() override { return "f3cd1e1c4d320c79d6985c904ae5dcd3"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h b/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h new file mode 100644 index 000000000..a18e97a82 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h @@ -0,0 +1,107 @@ +#ifndef _ROS_trajectory_msgs_MultiDOFJointTrajectory_h +#define _ROS_trajectory_msgs_MultiDOFJointTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/MultiDOFJointTrajectoryPoint.h" + +namespace trajectory_msgs +{ + + class MultiDOFJointTrajectory : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t joint_names_length; + typedef char* _joint_names_type; + _joint_names_type st_joint_names; + _joint_names_type * joint_names; + uint32_t points_length; + typedef trajectory_msgs::MultiDOFJointTrajectoryPoint _points_type; + _points_type st_points; + _points_type * points; + + MultiDOFJointTrajectory(): + header(), + joint_names_length(0), st_joint_names(), joint_names(nullptr), + points_length(0), st_points(), points(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->joint_names_length); + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + varToArr(outbuffer + offset, length_joint_namesi); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(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); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->joint_names_length); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + joint_names_length = joint_names_lengthT; + for( uint32_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + arrToVar(length_st_joint_names, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + 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 = (trajectory_msgs::MultiDOFJointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + 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(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + } + return offset; + } + + virtual const char * getType() override { return "trajectory_msgs/MultiDOFJointTrajectory"; }; + virtual const char * getMD5() override { return "ef145a45a5f47b77b7f5cdde4b16c942"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h b/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h new file mode 100644 index 000000000..8c99683f2 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h @@ -0,0 +1,139 @@ +#ifndef _ROS_trajectory_msgs_MultiDOFJointTrajectoryPoint_h +#define _ROS_trajectory_msgs_MultiDOFJointTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Twist.h" +#include "ros/duration.h" + +namespace trajectory_msgs +{ + + class MultiDOFJointTrajectoryPoint : public ros::Msg + { + public: + uint32_t transforms_length; + typedef geometry_msgs::Transform _transforms_type; + _transforms_type st_transforms; + _transforms_type * transforms; + uint32_t velocities_length; + typedef geometry_msgs::Twist _velocities_type; + _velocities_type st_velocities; + _velocities_type * velocities; + uint32_t accelerations_length; + typedef geometry_msgs::Twist _accelerations_type; + _accelerations_type st_accelerations; + _accelerations_type * accelerations; + typedef ros::Duration _time_from_start_type; + _time_from_start_type time_from_start; + + MultiDOFJointTrajectoryPoint(): + transforms_length(0), st_transforms(), transforms(nullptr), + velocities_length(0), st_velocities(), velocities(nullptr), + accelerations_length(0), st_accelerations(), accelerations(nullptr), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->transforms_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->transforms_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->transforms_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->transforms_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->transforms_length); + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->velocities_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->velocities_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->velocities_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->velocities_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->velocities_length); + for( uint32_t i = 0; i < velocities_length; i++){ + offset += this->velocities[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->accelerations_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->accelerations_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->accelerations_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->accelerations_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->accelerations_length); + for( uint32_t i = 0; i < accelerations_length; i++){ + offset += this->accelerations[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t transforms_lengthT = ((uint32_t) (*(inbuffer + offset))); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + transforms_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->transforms_length); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + transforms_length = transforms_lengthT; + for( uint32_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::Transform)); + } + uint32_t velocities_lengthT = ((uint32_t) (*(inbuffer + offset))); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + velocities_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->velocities_length); + if(velocities_lengthT > velocities_length) + this->velocities = (geometry_msgs::Twist*)realloc(this->velocities, velocities_lengthT * sizeof(geometry_msgs::Twist)); + velocities_length = velocities_lengthT; + for( uint32_t i = 0; i < velocities_length; i++){ + offset += this->st_velocities.deserialize(inbuffer + offset); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(geometry_msgs::Twist)); + } + uint32_t accelerations_lengthT = ((uint32_t) (*(inbuffer + offset))); + accelerations_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + accelerations_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + accelerations_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->accelerations_length); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (geometry_msgs::Twist*)realloc(this->accelerations, accelerations_lengthT * sizeof(geometry_msgs::Twist)); + accelerations_length = accelerations_lengthT; + for( uint32_t i = 0; i < accelerations_length; i++){ + offset += this->st_accelerations.deserialize(inbuffer + offset); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(geometry_msgs::Twist)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual const char * getType() override { return "trajectory_msgs/MultiDOFJointTrajectoryPoint"; }; + virtual const char * getMD5() override { return "3ebe08d1abd5b65862d50e09430db776"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeAction.h b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeAction.h new file mode 100644 index 000000000..4239af153 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_turtle_actionlib_ShapeAction_h +#define _ROS_turtle_actionlib_ShapeAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "turtle_actionlib/ShapeActionGoal.h" +#include "turtle_actionlib/ShapeActionResult.h" +#include "turtle_actionlib/ShapeActionFeedback.h" + +namespace turtle_actionlib +{ + + class ShapeAction : public ros::Msg + { + public: + typedef turtle_actionlib::ShapeActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef turtle_actionlib::ShapeActionResult _action_result_type; + _action_result_type action_result; + typedef turtle_actionlib::ShapeActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + ShapeAction(): + 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 "turtle_actionlib/ShapeAction"; }; + virtual const char * getMD5() override { return "d73b17d6237a925511f5d7727a1dc903"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h new file mode 100644 index 000000000..8f1122dc5 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionFeedback_h +#define _ROS_turtle_actionlib_ShapeActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "turtle_actionlib/ShapeFeedback.h" + +namespace turtle_actionlib +{ + + class ShapeActionFeedback : 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; + _feedback_type feedback; + + ShapeActionFeedback(): + 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 "turtle_actionlib/ShapeActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionGoal.h new file mode 100644 index 000000000..bd0d19cc0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionGoal_h +#define _ROS_turtle_actionlib_ShapeActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "turtle_actionlib/ShapeGoal.h" + +namespace turtle_actionlib +{ + + class ShapeActionGoal : 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; + _goal_type goal; + + ShapeActionGoal(): + 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 "turtle_actionlib/ShapeActionGoal"; }; + virtual const char * getMD5() override { return "dbfccd187f2ec9c593916447ffd6cc77"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionResult.h b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionResult.h new file mode 100644 index 000000000..a0079ae9a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionResult_h +#define _ROS_turtle_actionlib_ShapeActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "turtle_actionlib/ShapeResult.h" + +namespace turtle_actionlib +{ + + class ShapeActionResult : 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; + _result_type result; + + ShapeActionResult(): + 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 "turtle_actionlib/ShapeActionResult"; }; + virtual const char * getMD5() override { return "c8d13d5d140f1047a2e4d3bf5c045822"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeFeedback.h b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeFeedback.h new file mode 100644 index 000000000..0f86541ea --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_turtle_actionlib_ShapeFeedback_h +#define _ROS_turtle_actionlib_ShapeFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeFeedback : public ros::Msg + { + public: + + ShapeFeedback() + { + } + + 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 "turtle_actionlib/ShapeFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeGoal.h b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeGoal.h new file mode 100644 index 000000000..b40fd6854 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeGoal.h @@ -0,0 +1,86 @@ +#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/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeResult.h b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeResult.h new file mode 100644 index 000000000..deddd6192 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/ShapeResult.h @@ -0,0 +1,86 @@ +#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/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/Velocity.h b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/Velocity.h new file mode 100644 index 000000000..1e62c28b0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtle_actionlib/Velocity.h @@ -0,0 +1,86 @@ +#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/smart_device_protocol/ros_lib/ros_lib/turtlesim/Color.h b/smart_device_protocol/ros_lib/ros_lib/turtlesim/Color.h new file mode 100644 index 000000000..1e26d3aac --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtlesim/Color.h @@ -0,0 +1,59 @@ +#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/smart_device_protocol/ros_lib/ros_lib/turtlesim/Kill.h b/smart_device_protocol/ros_lib/ros_lib/turtlesim/Kill.h new file mode 100644 index 000000000..fd98abe27 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtlesim/Kill.h @@ -0,0 +1,87 @@ +#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/smart_device_protocol/ros_lib/ros_lib/turtlesim/Pose.h b/smart_device_protocol/ros_lib/ros_lib/turtlesim/Pose.h new file mode 100644 index 000000000..97fd863e7 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtlesim/Pose.h @@ -0,0 +1,158 @@ +#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/smart_device_protocol/ros_lib/ros_lib/turtlesim/SetPen.h b/smart_device_protocol/ros_lib/ros_lib/turtlesim/SetPen.h new file mode 100644 index 000000000..013a8f052 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtlesim/SetPen.h @@ -0,0 +1,105 @@ +#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/smart_device_protocol/ros_lib/ros_lib/turtlesim/Spawn.h b/smart_device_protocol/ros_lib/ros_lib/turtlesim/Spawn.h new file mode 100644 index 000000000..269097e99 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtlesim/Spawn.h @@ -0,0 +1,176 @@ +#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/smart_device_protocol/ros_lib/ros_lib/turtlesim/TeleportAbsolute.h b/smart_device_protocol/ros_lib/ros_lib/turtlesim/TeleportAbsolute.h new file mode 100644 index 000000000..63699656e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtlesim/TeleportAbsolute.h @@ -0,0 +1,142 @@ +#ifndef _ROS_SERVICE_TeleportAbsolute_h +#define _ROS_SERVICE_TeleportAbsolute_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char TELEPORTABSOLUTE[] = "turtlesim/TeleportAbsolute"; + + class TeleportAbsoluteRequest : 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; + + TeleportAbsoluteRequest(): + x(0), + y(0), + theta(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); + 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); + 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; + return offset; + } + + virtual const char * getType() override { return TELEPORTABSOLUTE; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportAbsolute { + public: + typedef TeleportAbsoluteRequest Request; + typedef TeleportAbsoluteResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/turtlesim/TeleportRelative.h b/smart_device_protocol/ros_lib/ros_lib/turtlesim/TeleportRelative.h new file mode 100644 index 000000000..fa6667f3d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/turtlesim/TeleportRelative.h @@ -0,0 +1,118 @@ +#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/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityAction.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityAction.h new file mode 100644 index 000000000..5dce15985 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_twist_mux_msgs_JoyPriorityAction_h +#define _ROS_twist_mux_msgs_JoyPriorityAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "twist_mux_msgs/JoyPriorityActionGoal.h" +#include "twist_mux_msgs/JoyPriorityActionResult.h" +#include "twist_mux_msgs/JoyPriorityActionFeedback.h" + +namespace twist_mux_msgs +{ + + class JoyPriorityAction : public ros::Msg + { + public: + typedef twist_mux_msgs::JoyPriorityActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef twist_mux_msgs::JoyPriorityActionResult _action_result_type; + _action_result_type action_result; + typedef twist_mux_msgs::JoyPriorityActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + JoyPriorityAction(): + 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 "twist_mux_msgs/JoyPriorityAction"; }; + virtual const char * getMD5() override { return "d5a016b49f278075666fbc901debbd08"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionFeedback.h new file mode 100644 index 000000000..c72e1f3fc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_twist_mux_msgs_JoyPriorityActionFeedback_h +#define _ROS_twist_mux_msgs_JoyPriorityActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "twist_mux_msgs/JoyPriorityFeedback.h" + +namespace twist_mux_msgs +{ + + class JoyPriorityActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef twist_mux_msgs::JoyPriorityFeedback _feedback_type; + _feedback_type feedback; + + JoyPriorityActionFeedback(): + 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 "twist_mux_msgs/JoyPriorityActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionGoal.h new file mode 100644 index 000000000..6fc3faa3e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_twist_mux_msgs_JoyPriorityActionGoal_h +#define _ROS_twist_mux_msgs_JoyPriorityActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "twist_mux_msgs/JoyPriorityGoal.h" + +namespace twist_mux_msgs +{ + + class JoyPriorityActionGoal : 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 twist_mux_msgs::JoyPriorityGoal _goal_type; + _goal_type goal; + + JoyPriorityActionGoal(): + 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 "twist_mux_msgs/JoyPriorityActionGoal"; }; + virtual const char * getMD5() override { return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionResult.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionResult.h new file mode 100644 index 000000000..db79625ce --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_twist_mux_msgs_JoyPriorityActionResult_h +#define _ROS_twist_mux_msgs_JoyPriorityActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "twist_mux_msgs/JoyPriorityResult.h" + +namespace twist_mux_msgs +{ + + class JoyPriorityActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef twist_mux_msgs::JoyPriorityResult _result_type; + _result_type result; + + JoyPriorityActionResult(): + 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 "twist_mux_msgs/JoyPriorityActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityFeedback.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityFeedback.h new file mode 100644 index 000000000..c0347fa8b --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_twist_mux_msgs_JoyPriorityFeedback_h +#define _ROS_twist_mux_msgs_JoyPriorityFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace twist_mux_msgs +{ + + class JoyPriorityFeedback : public ros::Msg + { + public: + + JoyPriorityFeedback() + { + } + + 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 "twist_mux_msgs/JoyPriorityFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityGoal.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityGoal.h new file mode 100644 index 000000000..fcfbd67eb --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_twist_mux_msgs_JoyPriorityGoal_h +#define _ROS_twist_mux_msgs_JoyPriorityGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace twist_mux_msgs +{ + + class JoyPriorityGoal : public ros::Msg + { + public: + + JoyPriorityGoal() + { + } + + 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 "twist_mux_msgs/JoyPriorityGoal"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityResult.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityResult.h new file mode 100644 index 000000000..e66ceac2d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyPriorityResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_twist_mux_msgs_JoyPriorityResult_h +#define _ROS_twist_mux_msgs_JoyPriorityResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace twist_mux_msgs +{ + + class JoyPriorityResult : public ros::Msg + { + public: + + JoyPriorityResult() + { + } + + 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 "twist_mux_msgs/JoyPriorityResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboAction.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboAction.h new file mode 100644 index 000000000..5b2f12295 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboAction.h @@ -0,0 +1,56 @@ +#ifndef _ROS_twist_mux_msgs_JoyTurboAction_h +#define _ROS_twist_mux_msgs_JoyTurboAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "twist_mux_msgs/JoyTurboActionGoal.h" +#include "twist_mux_msgs/JoyTurboActionResult.h" +#include "twist_mux_msgs/JoyTurboActionFeedback.h" + +namespace twist_mux_msgs +{ + + class JoyTurboAction : public ros::Msg + { + public: + typedef twist_mux_msgs::JoyTurboActionGoal _action_goal_type; + _action_goal_type action_goal; + typedef twist_mux_msgs::JoyTurboActionResult _action_result_type; + _action_result_type action_result; + typedef twist_mux_msgs::JoyTurboActionFeedback _action_feedback_type; + _action_feedback_type action_feedback; + + JoyTurboAction(): + 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 "twist_mux_msgs/JoyTurboAction"; }; + virtual const char * getMD5() override { return "d5a016b49f278075666fbc901debbd08"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionFeedback.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionFeedback.h new file mode 100644 index 000000000..f5297f6c4 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_twist_mux_msgs_JoyTurboActionFeedback_h +#define _ROS_twist_mux_msgs_JoyTurboActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "twist_mux_msgs/JoyTurboFeedback.h" + +namespace twist_mux_msgs +{ + + class JoyTurboActionFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef twist_mux_msgs::JoyTurboFeedback _feedback_type; + _feedback_type feedback; + + JoyTurboActionFeedback(): + 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 "twist_mux_msgs/JoyTurboActionFeedback"; }; + virtual const char * getMD5() override { return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionGoal.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionGoal.h new file mode 100644 index 000000000..1682bb733 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_twist_mux_msgs_JoyTurboActionGoal_h +#define _ROS_twist_mux_msgs_JoyTurboActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "twist_mux_msgs/JoyTurboGoal.h" + +namespace twist_mux_msgs +{ + + class JoyTurboActionGoal : 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 twist_mux_msgs::JoyTurboGoal _goal_type; + _goal_type goal; + + JoyTurboActionGoal(): + 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 "twist_mux_msgs/JoyTurboActionGoal"; }; + virtual const char * getMD5() override { return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionResult.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionResult.h new file mode 100644 index 000000000..37c6c409e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboActionResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_twist_mux_msgs_JoyTurboActionResult_h +#define _ROS_twist_mux_msgs_JoyTurboActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "twist_mux_msgs/JoyTurboResult.h" + +namespace twist_mux_msgs +{ + + class JoyTurboActionResult : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef actionlib_msgs::GoalStatus _status_type; + _status_type status; + typedef twist_mux_msgs::JoyTurboResult _result_type; + _result_type result; + + JoyTurboActionResult(): + 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 "twist_mux_msgs/JoyTurboActionResult"; }; + virtual const char * getMD5() override { return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboFeedback.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboFeedback.h new file mode 100644 index 000000000..7b710042c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_twist_mux_msgs_JoyTurboFeedback_h +#define _ROS_twist_mux_msgs_JoyTurboFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace twist_mux_msgs +{ + + class JoyTurboFeedback : public ros::Msg + { + public: + + JoyTurboFeedback() + { + } + + 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 "twist_mux_msgs/JoyTurboFeedback"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboGoal.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboGoal.h new file mode 100644 index 000000000..cad56f458 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_twist_mux_msgs_JoyTurboGoal_h +#define _ROS_twist_mux_msgs_JoyTurboGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace twist_mux_msgs +{ + + class JoyTurboGoal : public ros::Msg + { + public: + + JoyTurboGoal() + { + } + + 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 "twist_mux_msgs/JoyTurboGoal"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboResult.h b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboResult.h new file mode 100644 index 000000000..820abe15e --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/twist_mux_msgs/JoyTurboResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_twist_mux_msgs_JoyTurboResult_h +#define _ROS_twist_mux_msgs_JoyTurboResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace twist_mux_msgs +{ + + class JoyTurboResult : public ros::Msg + { + public: + + JoyTurboResult() + { + } + + 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 "twist_mux_msgs/JoyTurboResult"; }; + virtual const char * getMD5() override { return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/urg_node/Status.h b/smart_device_protocol/ros_lib/ros_lib/urg_node/Status.h new file mode 100644 index 000000000..73d4ca4bd --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/urg_node/Status.h @@ -0,0 +1,136 @@ +#ifndef _ROS_urg_node_Status_h +#define _ROS_urg_node_Status_h + +#include +#include +#include +#include "ros/msg.h" + +namespace urg_node +{ + + class Status : public ros::Msg + { + public: + typedef uint16_t _operating_mode_type; + _operating_mode_type operating_mode; + typedef uint16_t _area_number_type; + _area_number_type area_number; + typedef bool _error_status_type; + _error_status_type error_status; + typedef uint16_t _error_code_type; + _error_code_type error_code; + typedef bool _lockout_status_type; + _lockout_status_type lockout_status; + typedef uint16_t _distance_type; + _distance_type distance; + typedef float _angle_type; + _angle_type angle; + enum { NORMAL = 0 }; + enum { SETTING = 1 }; + + Status(): + operating_mode(0), + area_number(0), + error_status(0), + error_code(0), + lockout_status(0), + distance(0), + angle(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->operating_mode >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->operating_mode >> (8 * 1)) & 0xFF; + offset += sizeof(this->operating_mode); + *(outbuffer + offset + 0) = (this->area_number >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->area_number >> (8 * 1)) & 0xFF; + offset += sizeof(this->area_number); + union { + bool real; + uint8_t base; + } u_error_status; + u_error_status.real = this->error_status; + *(outbuffer + offset + 0) = (u_error_status.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->error_status); + *(outbuffer + offset + 0) = (this->error_code >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->error_code >> (8 * 1)) & 0xFF; + offset += sizeof(this->error_code); + union { + bool real; + uint8_t base; + } u_lockout_status; + u_lockout_status.real = this->lockout_status; + *(outbuffer + offset + 0) = (u_lockout_status.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->lockout_status); + *(outbuffer + offset + 0) = (this->distance >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->distance >> (8 * 1)) & 0xFF; + offset += sizeof(this->distance); + 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); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->operating_mode = ((uint16_t) (*(inbuffer + offset))); + this->operating_mode |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->operating_mode); + this->area_number = ((uint16_t) (*(inbuffer + offset))); + this->area_number |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->area_number); + union { + bool real; + uint8_t base; + } u_error_status; + u_error_status.base = 0; + u_error_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->error_status = u_error_status.real; + offset += sizeof(this->error_status); + this->error_code = ((uint16_t) (*(inbuffer + offset))); + this->error_code |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->error_code); + union { + bool real; + uint8_t base; + } u_lockout_status; + u_lockout_status.base = 0; + u_lockout_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->lockout_status = u_lockout_status.real; + offset += sizeof(this->lockout_status); + this->distance = ((uint16_t) (*(inbuffer + offset))); + this->distance |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->distance); + 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); + return offset; + } + + virtual const char * getType() override { return "urg_node/Status"; }; + virtual const char * getMD5() override { return "b393072b65230b373302bfe803e80784"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/uuid_msgs/UniqueID.h b/smart_device_protocol/ros_lib/ros_lib/uuid_msgs/UniqueID.h new file mode 100644 index 000000000..b35e693a6 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/velodyne_msgs/VelodynePacket.h b/smart_device_protocol/ros_lib/ros_lib/velodyne_msgs/VelodynePacket.h new file mode 100644 index 000000000..9c45fce3b --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/velodyne_msgs/VelodyneScan.h b/smart_device_protocol/ros_lib/ros_lib/velodyne_msgs/VelodyneScan.h new file mode 100644 index 000000000..c7c73db12 --- /dev/null +++ b/smart_device_protocol/ros_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/smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraMovement.h b/smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraMovement.h new file mode 100644 index 000000000..13cd64f90 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraMovement.h @@ -0,0 +1,90 @@ +#ifndef _ROS_view_controller_msgs_CameraMovement_h +#define _ROS_view_controller_msgs_CameraMovement_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PointStamped.h" +#include "geometry_msgs/Vector3Stamped.h" +#include "ros/duration.h" + +namespace view_controller_msgs +{ + + class CameraMovement : public ros::Msg + { + public: + typedef geometry_msgs::PointStamped _eye_type; + _eye_type eye; + typedef geometry_msgs::PointStamped _focus_type; + _focus_type focus; + typedef geometry_msgs::Vector3Stamped _up_type; + _up_type up; + typedef ros::Duration _transition_duration_type; + _transition_duration_type transition_duration; + typedef uint8_t _interpolation_speed_type; + _interpolation_speed_type interpolation_speed; + enum { RISING = 0 }; + enum { DECLINING = 1 }; + enum { FULL = 2 }; + enum { WAVE = 3 }; + + CameraMovement(): + eye(), + focus(), + up(), + transition_duration(), + interpolation_speed(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->eye.serialize(outbuffer + offset); + offset += this->focus.serialize(outbuffer + offset); + offset += this->up.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->transition_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->transition_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->transition_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->transition_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->transition_duration.sec); + *(outbuffer + offset + 0) = (this->transition_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->transition_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->transition_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->transition_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->transition_duration.nsec); + *(outbuffer + offset + 0) = (this->interpolation_speed >> (8 * 0)) & 0xFF; + offset += sizeof(this->interpolation_speed); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->eye.deserialize(inbuffer + offset); + offset += this->focus.deserialize(inbuffer + offset); + offset += this->up.deserialize(inbuffer + offset); + this->transition_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->transition_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->transition_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->transition_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->transition_duration.sec); + this->transition_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->transition_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->transition_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->transition_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->transition_duration.nsec); + this->interpolation_speed = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->interpolation_speed); + return offset; + } + + virtual const char * getType() override { return "view_controller_msgs/CameraMovement"; }; + virtual const char * getMD5() override { return "fc7aac4a39426fb5e8b2dbb6e85bfc66"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraPlacement.h b/smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraPlacement.h new file mode 100644 index 000000000..49b4e7991 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraPlacement.h @@ -0,0 +1,151 @@ +#ifndef _ROS_view_controller_msgs_CameraPlacement_h +#define _ROS_view_controller_msgs_CameraPlacement_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "geometry_msgs/PointStamped.h" +#include "geometry_msgs/Vector3Stamped.h" + +namespace view_controller_msgs +{ + + class CameraPlacement : public ros::Msg + { + public: + typedef uint8_t _interpolation_mode_type; + _interpolation_mode_type interpolation_mode; + typedef const char* _target_frame_type; + _target_frame_type target_frame; + typedef ros::Duration _time_from_start_type; + _time_from_start_type time_from_start; + typedef geometry_msgs::PointStamped _eye_type; + _eye_type eye; + typedef geometry_msgs::PointStamped _focus_type; + _focus_type focus; + typedef geometry_msgs::Vector3Stamped _up_type; + _up_type up; + typedef uint8_t _mouse_interaction_mode_type; + _mouse_interaction_mode_type mouse_interaction_mode; + typedef bool _interaction_disabled_type; + _interaction_disabled_type interaction_disabled; + typedef bool _allow_free_yaw_axis_type; + _allow_free_yaw_axis_type allow_free_yaw_axis; + enum { LINEAR = 0 }; + enum { SPHERICAL = 1 }; + enum { NO_CHANGE = 0 }; + enum { ORBIT = 1 }; + enum { FPS = 2 }; + + CameraPlacement(): + interpolation_mode(0), + target_frame(""), + time_from_start(), + eye(), + focus(), + up(), + mouse_interaction_mode(0), + interaction_disabled(0), + allow_free_yaw_axis(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->interpolation_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->interpolation_mode); + uint32_t length_target_frame = strlen(this->target_frame); + varToArr(outbuffer + offset, length_target_frame); + offset += 4; + memcpy(outbuffer + offset, this->target_frame, length_target_frame); + offset += length_target_frame; + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + offset += this->eye.serialize(outbuffer + offset); + offset += this->focus.serialize(outbuffer + offset); + offset += this->up.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->mouse_interaction_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->mouse_interaction_mode); + union { + bool real; + uint8_t base; + } u_interaction_disabled; + u_interaction_disabled.real = this->interaction_disabled; + *(outbuffer + offset + 0) = (u_interaction_disabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->interaction_disabled); + union { + bool real; + uint8_t base; + } u_allow_free_yaw_axis; + u_allow_free_yaw_axis.real = this->allow_free_yaw_axis; + *(outbuffer + offset + 0) = (u_allow_free_yaw_axis.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->allow_free_yaw_axis); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->interpolation_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->interpolation_mode); + uint32_t length_target_frame; + arrToVar(length_target_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_frame-1]=0; + this->target_frame = (char *)(inbuffer + offset-1); + offset += length_target_frame; + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + offset += this->eye.deserialize(inbuffer + offset); + offset += this->focus.deserialize(inbuffer + offset); + offset += this->up.deserialize(inbuffer + offset); + this->mouse_interaction_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->mouse_interaction_mode); + union { + bool real; + uint8_t base; + } u_interaction_disabled; + u_interaction_disabled.base = 0; + u_interaction_disabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->interaction_disabled = u_interaction_disabled.real; + offset += sizeof(this->interaction_disabled); + union { + bool real; + uint8_t base; + } u_allow_free_yaw_axis; + u_allow_free_yaw_axis.base = 0; + u_allow_free_yaw_axis.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->allow_free_yaw_axis = u_allow_free_yaw_axis.real; + offset += sizeof(this->allow_free_yaw_axis); + return offset; + } + + virtual const char * getType() override { return "view_controller_msgs/CameraPlacement"; }; + virtual const char * getMD5() override { return "38be6efe15caa86e2c835dd05ab88393"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraTrajectory.h b/smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraTrajectory.h new file mode 100644 index 000000000..72254befc --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/view_controller_msgs/CameraTrajectory.h @@ -0,0 +1,163 @@ +#ifndef _ROS_view_controller_msgs_CameraTrajectory_h +#define _ROS_view_controller_msgs_CameraTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "view_controller_msgs/CameraMovement.h" + +namespace view_controller_msgs +{ + + class CameraTrajectory : public ros::Msg + { + public: + uint32_t trajectory_length; + typedef view_controller_msgs::CameraMovement _trajectory_type; + _trajectory_type st_trajectory; + _trajectory_type * trajectory; + typedef const char* _target_frame_type; + _target_frame_type target_frame; + typedef bool _allow_free_yaw_axis_type; + _allow_free_yaw_axis_type allow_free_yaw_axis; + typedef uint8_t _mouse_interaction_mode_type; + _mouse_interaction_mode_type mouse_interaction_mode; + typedef bool _interaction_disabled_type; + _interaction_disabled_type interaction_disabled; + typedef bool _render_frame_by_frame_type; + _render_frame_by_frame_type render_frame_by_frame; + typedef int8_t _frames_per_second_type; + _frames_per_second_type frames_per_second; + enum { NO_CHANGE = 0 }; + enum { ORBIT = 1 }; + enum { FPS = 2 }; + + CameraTrajectory(): + trajectory_length(0), st_trajectory(), trajectory(nullptr), + target_frame(""), + allow_free_yaw_axis(0), + mouse_interaction_mode(0), + interaction_disabled(0), + render_frame_by_frame(0), + frames_per_second(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->trajectory_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->trajectory_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->trajectory_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->trajectory_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->trajectory_length); + for( uint32_t i = 0; i < trajectory_length; i++){ + offset += this->trajectory[i].serialize(outbuffer + offset); + } + uint32_t length_target_frame = strlen(this->target_frame); + varToArr(outbuffer + offset, length_target_frame); + offset += 4; + memcpy(outbuffer + offset, this->target_frame, length_target_frame); + offset += length_target_frame; + union { + bool real; + uint8_t base; + } u_allow_free_yaw_axis; + u_allow_free_yaw_axis.real = this->allow_free_yaw_axis; + *(outbuffer + offset + 0) = (u_allow_free_yaw_axis.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->allow_free_yaw_axis); + *(outbuffer + offset + 0) = (this->mouse_interaction_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->mouse_interaction_mode); + union { + bool real; + uint8_t base; + } u_interaction_disabled; + u_interaction_disabled.real = this->interaction_disabled; + *(outbuffer + offset + 0) = (u_interaction_disabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->interaction_disabled); + union { + bool real; + uint8_t base; + } u_render_frame_by_frame; + u_render_frame_by_frame.real = this->render_frame_by_frame; + *(outbuffer + offset + 0) = (u_render_frame_by_frame.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->render_frame_by_frame); + union { + int8_t real; + uint8_t base; + } u_frames_per_second; + u_frames_per_second.real = this->frames_per_second; + *(outbuffer + offset + 0) = (u_frames_per_second.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->frames_per_second); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t trajectory_lengthT = ((uint32_t) (*(inbuffer + offset))); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + trajectory_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->trajectory_length); + if(trajectory_lengthT > trajectory_length) + this->trajectory = (view_controller_msgs::CameraMovement*)realloc(this->trajectory, trajectory_lengthT * sizeof(view_controller_msgs::CameraMovement)); + trajectory_length = trajectory_lengthT; + for( uint32_t i = 0; i < trajectory_length; i++){ + offset += this->st_trajectory.deserialize(inbuffer + offset); + memcpy( &(this->trajectory[i]), &(this->st_trajectory), sizeof(view_controller_msgs::CameraMovement)); + } + uint32_t length_target_frame; + arrToVar(length_target_frame, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_frame-1]=0; + this->target_frame = (char *)(inbuffer + offset-1); + offset += length_target_frame; + union { + bool real; + uint8_t base; + } u_allow_free_yaw_axis; + u_allow_free_yaw_axis.base = 0; + u_allow_free_yaw_axis.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->allow_free_yaw_axis = u_allow_free_yaw_axis.real; + offset += sizeof(this->allow_free_yaw_axis); + this->mouse_interaction_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->mouse_interaction_mode); + union { + bool real; + uint8_t base; + } u_interaction_disabled; + u_interaction_disabled.base = 0; + u_interaction_disabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->interaction_disabled = u_interaction_disabled.real; + offset += sizeof(this->interaction_disabled); + union { + bool real; + uint8_t base; + } u_render_frame_by_frame; + u_render_frame_by_frame.base = 0; + u_render_frame_by_frame.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->render_frame_by_frame = u_render_frame_by_frame.real; + offset += sizeof(this->render_frame_by_frame); + union { + int8_t real; + uint8_t base; + } u_frames_per_second; + u_frames_per_second.base = 0; + u_frames_per_second.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->frames_per_second = u_frames_per_second.real; + offset += sizeof(this->frames_per_second); + return offset; + } + + virtual const char * getType() override { return "view_controller_msgs/CameraTrajectory"; }; + virtual const char * getMD5() override { return "c56d6e838f60da69466a74c60cf627d7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/ImageMarker.h b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/ImageMarker.h new file mode 100644 index 000000000..db13caf1f --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/ImageMarker.h @@ -0,0 +1,262 @@ +#ifndef _ROS_visualization_msgs_ImageMarker_h +#define _ROS_visualization_msgs_ImageMarker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" + +namespace visualization_msgs +{ + + class ImageMarker : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _ns_type; + _ns_type ns; + typedef int32_t _id_type; + _id_type id; + typedef int32_t _type_type; + _type_type type; + typedef int32_t _action_type; + _action_type action; + typedef geometry_msgs::Point _position_type; + _position_type position; + typedef float _scale_type; + _scale_type scale; + typedef std_msgs::ColorRGBA _outline_color_type; + _outline_color_type outline_color; + typedef uint8_t _filled_type; + _filled_type filled; + typedef std_msgs::ColorRGBA _fill_color_type; + _fill_color_type fill_color; + typedef ros::Duration _lifetime_type; + _lifetime_type lifetime; + uint32_t points_length; + typedef geometry_msgs::Point _points_type; + _points_type st_points; + _points_type * points; + uint32_t outline_colors_length; + typedef std_msgs::ColorRGBA _outline_colors_type; + _outline_colors_type st_outline_colors; + _outline_colors_type * outline_colors; + enum { CIRCLE = 0 }; + enum { LINE_STRIP = 1 }; + enum { LINE_LIST = 2 }; + enum { POLYGON = 3 }; + enum { POINTS = 4 }; + enum { ADD = 0 }; + enum { REMOVE = 1 }; + + ImageMarker(): + header(), + ns(""), + id(0), + type(0), + action(0), + position(), + scale(0), + outline_color(), + filled(0), + fill_color(), + lifetime(), + points_length(0), st_points(), points(nullptr), + outline_colors_length(0), st_outline_colors(), outline_colors(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + varToArr(outbuffer + offset, length_ns); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + 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_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_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->position.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + offset += this->outline_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->filled >> (8 * 0)) & 0xFF; + offset += sizeof(this->filled); + offset += this->fill_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + *(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->outline_colors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->outline_colors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->outline_colors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->outline_colors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->outline_colors_length); + for( uint32_t i = 0; i < outline_colors_length; i++){ + offset += this->outline_colors[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + arrToVar(length_ns, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + 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_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_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->position.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + offset += this->outline_color.deserialize(inbuffer + offset); + this->filled = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->filled); + offset += this->fill_color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + 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 = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + 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(geometry_msgs::Point)); + } + uint32_t outline_colors_lengthT = ((uint32_t) (*(inbuffer + offset))); + outline_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + outline_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + outline_colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->outline_colors_length); + if(outline_colors_lengthT > outline_colors_length) + this->outline_colors = (std_msgs::ColorRGBA*)realloc(this->outline_colors, outline_colors_lengthT * sizeof(std_msgs::ColorRGBA)); + outline_colors_length = outline_colors_lengthT; + for( uint32_t i = 0; i < outline_colors_length; i++){ + offset += this->st_outline_colors.deserialize(inbuffer + offset); + memcpy( &(this->outline_colors[i]), &(this->st_outline_colors), sizeof(std_msgs::ColorRGBA)); + } + return offset; + } + + virtual const char * getType() override { return "visualization_msgs/ImageMarker"; }; + virtual const char * getMD5() override { return "1de93c67ec8858b831025a08fbf1b35c"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarker.h b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarker.h new file mode 100644 index 000000000..3cf69328c --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarker.h @@ -0,0 +1,160 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarker_h +#define _ROS_visualization_msgs_InteractiveMarker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "visualization_msgs/MenuEntry.h" +#include "visualization_msgs/InteractiveMarkerControl.h" + +namespace visualization_msgs +{ + + class InteractiveMarker : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef const char* _name_type; + _name_type name; + typedef const char* _description_type; + _description_type description; + typedef float _scale_type; + _scale_type scale; + uint32_t menu_entries_length; + typedef visualization_msgs::MenuEntry _menu_entries_type; + _menu_entries_type st_menu_entries; + _menu_entries_type * menu_entries; + uint32_t controls_length; + typedef visualization_msgs::InteractiveMarkerControl _controls_type; + _controls_type st_controls; + _controls_type * controls; + + InteractiveMarker(): + header(), + pose(), + name(""), + description(""), + scale(0), + menu_entries_length(0), st_menu_entries(), menu_entries(nullptr), + controls_length(0), st_controls(), controls(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + 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_description = strlen(this->description); + varToArr(outbuffer + offset, length_description); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + *(outbuffer + offset + 0) = (this->menu_entries_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->menu_entries_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->menu_entries_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->menu_entries_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->menu_entries_length); + for( uint32_t i = 0; i < menu_entries_length; i++){ + offset += this->menu_entries[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->controls_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->controls_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->controls_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->controls_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->controls_length); + for( uint32_t i = 0; i < controls_length; i++){ + offset += this->controls[i].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); + 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_description; + arrToVar(length_description, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + uint32_t menu_entries_lengthT = ((uint32_t) (*(inbuffer + offset))); + menu_entries_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + menu_entries_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + menu_entries_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->menu_entries_length); + if(menu_entries_lengthT > menu_entries_length) + this->menu_entries = (visualization_msgs::MenuEntry*)realloc(this->menu_entries, menu_entries_lengthT * sizeof(visualization_msgs::MenuEntry)); + menu_entries_length = menu_entries_lengthT; + for( uint32_t i = 0; i < menu_entries_length; i++){ + offset += this->st_menu_entries.deserialize(inbuffer + offset); + memcpy( &(this->menu_entries[i]), &(this->st_menu_entries), sizeof(visualization_msgs::MenuEntry)); + } + uint32_t controls_lengthT = ((uint32_t) (*(inbuffer + offset))); + controls_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + controls_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + controls_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->controls_length); + if(controls_lengthT > controls_length) + this->controls = (visualization_msgs::InteractiveMarkerControl*)realloc(this->controls, controls_lengthT * sizeof(visualization_msgs::InteractiveMarkerControl)); + controls_length = controls_lengthT; + for( uint32_t i = 0; i < controls_length; i++){ + offset += this->st_controls.deserialize(inbuffer + offset); + memcpy( &(this->controls[i]), &(this->st_controls), sizeof(visualization_msgs::InteractiveMarkerControl)); + } + return offset; + } + + virtual const char * getType() override { return "visualization_msgs/InteractiveMarker"; }; + virtual const char * getMD5() override { return "dd86d22909d5a3364b384492e35c10af"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h new file mode 100644 index 000000000..a26801868 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h @@ -0,0 +1,167 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerControl_h +#define _ROS_visualization_msgs_InteractiveMarkerControl_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Quaternion.h" +#include "visualization_msgs/Marker.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerControl : public ros::Msg + { + public: + typedef const char* _name_type; + _name_type name; + typedef geometry_msgs::Quaternion _orientation_type; + _orientation_type orientation; + typedef uint8_t _orientation_mode_type; + _orientation_mode_type orientation_mode; + typedef uint8_t _interaction_mode_type; + _interaction_mode_type interaction_mode; + typedef bool _always_visible_type; + _always_visible_type always_visible; + uint32_t markers_length; + typedef visualization_msgs::Marker _markers_type; + _markers_type st_markers; + _markers_type * markers; + typedef bool _independent_marker_orientation_type; + _independent_marker_orientation_type independent_marker_orientation; + typedef const char* _description_type; + _description_type description; + enum { INHERIT = 0 }; + enum { FIXED = 1 }; + enum { VIEW_FACING = 2 }; + enum { NONE = 0 }; + enum { MENU = 1 }; + enum { BUTTON = 2 }; + enum { MOVE_AXIS = 3 }; + enum { MOVE_PLANE = 4 }; + enum { ROTATE_AXIS = 5 }; + enum { MOVE_ROTATE = 6 }; + enum { MOVE_3D = 7 }; + enum { ROTATE_3D = 8 }; + enum { MOVE_ROTATE_3D = 9 }; + + InteractiveMarkerControl(): + name(""), + orientation(), + orientation_mode(0), + interaction_mode(0), + always_visible(0), + markers_length(0), st_markers(), markers(nullptr), + independent_marker_orientation(0), + description("") + { + } + + 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; + offset += this->orientation.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->orientation_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->orientation_mode); + *(outbuffer + offset + 0) = (this->interaction_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->interaction_mode); + union { + bool real; + uint8_t base; + } u_always_visible; + u_always_visible.real = this->always_visible; + *(outbuffer + offset + 0) = (u_always_visible.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->always_visible); + *(outbuffer + offset + 0) = (this->markers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->markers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->markers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->markers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->markers_length); + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_independent_marker_orientation; + u_independent_marker_orientation.real = this->independent_marker_orientation; + *(outbuffer + offset + 0) = (u_independent_marker_orientation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->independent_marker_orientation); + uint32_t length_description = strlen(this->description); + varToArr(outbuffer + offset, length_description); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + 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; + offset += this->orientation.deserialize(inbuffer + offset); + this->orientation_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->orientation_mode); + this->interaction_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->interaction_mode); + union { + bool real; + uint8_t base; + } u_always_visible; + u_always_visible.base = 0; + u_always_visible.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->always_visible = u_always_visible.real; + offset += sizeof(this->always_visible); + uint32_t markers_lengthT = ((uint32_t) (*(inbuffer + offset))); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->markers_length); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + markers_length = markers_lengthT; + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + union { + bool real; + uint8_t base; + } u_independent_marker_orientation; + u_independent_marker_orientation.base = 0; + u_independent_marker_orientation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->independent_marker_orientation = u_independent_marker_orientation.real; + offset += sizeof(this->independent_marker_orientation); + uint32_t length_description; + arrToVar(length_description, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + return offset; + } + + virtual const char * getType() override { return "visualization_msgs/InteractiveMarkerControl"; }; + virtual const char * getMD5() override { return "b3c81e785788195d1840b86c28da1aac"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h new file mode 100644 index 000000000..807158a88 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h @@ -0,0 +1,151 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerFeedback_h +#define _ROS_visualization_msgs_InteractiveMarkerFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Point.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerFeedback : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _client_id_type; + _client_id_type client_id; + typedef const char* _marker_name_type; + _marker_name_type marker_name; + typedef const char* _control_name_type; + _control_name_type control_name; + typedef uint8_t _event_type_type; + _event_type_type event_type; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef uint32_t _menu_entry_id_type; + _menu_entry_id_type menu_entry_id; + typedef geometry_msgs::Point _mouse_point_type; + _mouse_point_type mouse_point; + typedef bool _mouse_point_valid_type; + _mouse_point_valid_type mouse_point_valid; + enum { KEEP_ALIVE = 0 }; + enum { POSE_UPDATE = 1 }; + enum { MENU_SELECT = 2 }; + enum { BUTTON_CLICK = 3 }; + enum { MOUSE_DOWN = 4 }; + enum { MOUSE_UP = 5 }; + + InteractiveMarkerFeedback(): + header(), + client_id(""), + marker_name(""), + control_name(""), + event_type(0), + pose(), + menu_entry_id(0), + mouse_point(), + mouse_point_valid(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_client_id = strlen(this->client_id); + varToArr(outbuffer + offset, length_client_id); + offset += 4; + memcpy(outbuffer + offset, this->client_id, length_client_id); + offset += length_client_id; + uint32_t length_marker_name = strlen(this->marker_name); + varToArr(outbuffer + offset, length_marker_name); + offset += 4; + memcpy(outbuffer + offset, this->marker_name, length_marker_name); + offset += length_marker_name; + uint32_t length_control_name = strlen(this->control_name); + varToArr(outbuffer + offset, length_control_name); + offset += 4; + memcpy(outbuffer + offset, this->control_name, length_control_name); + offset += length_control_name; + *(outbuffer + offset + 0) = (this->event_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->event_type); + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->menu_entry_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->menu_entry_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->menu_entry_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->menu_entry_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->menu_entry_id); + offset += this->mouse_point.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_mouse_point_valid; + u_mouse_point_valid.real = this->mouse_point_valid; + *(outbuffer + offset + 0) = (u_mouse_point_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mouse_point_valid); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_client_id; + arrToVar(length_client_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_client_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_client_id-1]=0; + this->client_id = (char *)(inbuffer + offset-1); + offset += length_client_id; + uint32_t length_marker_name; + arrToVar(length_marker_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_marker_name-1]=0; + this->marker_name = (char *)(inbuffer + offset-1); + offset += length_marker_name; + uint32_t length_control_name; + arrToVar(length_control_name, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_control_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_control_name-1]=0; + this->control_name = (char *)(inbuffer + offset-1); + offset += length_control_name; + this->event_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->event_type); + offset += this->pose.deserialize(inbuffer + offset); + this->menu_entry_id = ((uint32_t) (*(inbuffer + offset))); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->menu_entry_id); + offset += this->mouse_point.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_mouse_point_valid; + u_mouse_point_valid.base = 0; + u_mouse_point_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mouse_point_valid = u_mouse_point_valid.real; + offset += sizeof(this->mouse_point_valid); + return offset; + } + + virtual const char * getType() override { return "visualization_msgs/InteractiveMarkerFeedback"; }; + virtual const char * getMD5() override { return "ab0f1eee058667e28c19ff3ffc3f4b78"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h new file mode 100644 index 000000000..243f0f9b6 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h @@ -0,0 +1,102 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerInit_h +#define _ROS_visualization_msgs_InteractiveMarkerInit_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/InteractiveMarker.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerInit : public ros::Msg + { + public: + typedef const char* _server_id_type; + _server_id_type server_id; + typedef uint64_t _seq_num_type; + _seq_num_type seq_num; + uint32_t markers_length; + typedef visualization_msgs::InteractiveMarker _markers_type; + _markers_type st_markers; + _markers_type * markers; + + InteractiveMarkerInit(): + server_id(""), + seq_num(0), + markers_length(0), st_markers(), markers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_server_id = strlen(this->server_id); + varToArr(outbuffer + offset, length_server_id); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + *(outbuffer + offset + 0) = (this->seq_num >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->seq_num >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->seq_num >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->seq_num >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->seq_num >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->seq_num >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->seq_num >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->seq_num >> (8 * 7)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset + 0) = (this->markers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->markers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->markers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->markers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->markers_length); + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_server_id; + arrToVar(length_server_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_server_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_server_id-1]=0; + this->server_id = (char *)(inbuffer + offset-1); + offset += length_server_id; + this->seq_num = ((uint64_t) (*(inbuffer + offset))); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->seq_num); + uint32_t markers_lengthT = ((uint32_t) (*(inbuffer + offset))); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->markers_length); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + markers_length = markers_lengthT; + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::InteractiveMarker)); + } + return offset; + } + + virtual const char * getType() override { return "visualization_msgs/InteractiveMarkerInit"; }; + virtual const char * getMD5() override { return "d5f2c5045a72456d228676ab91048734"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h new file mode 100644 index 000000000..700f2db10 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h @@ -0,0 +1,67 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerPose_h +#define _ROS_visualization_msgs_InteractiveMarkerPose_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerPose : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef const char* _name_type; + _name_type name; + + InteractiveMarkerPose(): + header(), + pose(), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + 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; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + 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 "visualization_msgs/InteractiveMarkerPose"; }; + virtual const char * getMD5() override { return "a6e6833209a196a38d798dadb02c81f8"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h new file mode 100644 index 000000000..5aac8411a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h @@ -0,0 +1,174 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerUpdate_h +#define _ROS_visualization_msgs_InteractiveMarkerUpdate_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/InteractiveMarker.h" +#include "visualization_msgs/InteractiveMarkerPose.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerUpdate : public ros::Msg + { + public: + typedef const char* _server_id_type; + _server_id_type server_id; + typedef uint64_t _seq_num_type; + _seq_num_type seq_num; + typedef uint8_t _type_type; + _type_type type; + uint32_t markers_length; + typedef visualization_msgs::InteractiveMarker _markers_type; + _markers_type st_markers; + _markers_type * markers; + uint32_t poses_length; + typedef visualization_msgs::InteractiveMarkerPose _poses_type; + _poses_type st_poses; + _poses_type * poses; + uint32_t erases_length; + typedef char* _erases_type; + _erases_type st_erases; + _erases_type * erases; + enum { KEEP_ALIVE = 0 }; + enum { UPDATE = 1 }; + + InteractiveMarkerUpdate(): + server_id(""), + seq_num(0), + type(0), + markers_length(0), st_markers(), markers(nullptr), + poses_length(0), st_poses(), poses(nullptr), + erases_length(0), st_erases(), erases(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_server_id = strlen(this->server_id); + varToArr(outbuffer + offset, length_server_id); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + *(outbuffer + offset + 0) = (this->seq_num >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->seq_num >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->seq_num >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->seq_num >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (this->seq_num >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (this->seq_num >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (this->seq_num >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (this->seq_num >> (8 * 7)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->markers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->markers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->markers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->markers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->markers_length); + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->markers[i].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); + } + *(outbuffer + offset + 0) = (this->erases_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->erases_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->erases_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->erases_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->erases_length); + for( uint32_t i = 0; i < erases_length; i++){ + uint32_t length_erasesi = strlen(this->erases[i]); + varToArr(outbuffer + offset, length_erasesi); + offset += 4; + memcpy(outbuffer + offset, this->erases[i], length_erasesi); + offset += length_erasesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_server_id; + arrToVar(length_server_id, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_server_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_server_id-1]=0; + this->server_id = (char *)(inbuffer + offset-1); + offset += length_server_id; + this->seq_num = ((uint64_t) (*(inbuffer + offset))); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + this->seq_num |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + offset += sizeof(this->seq_num); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint32_t markers_lengthT = ((uint32_t) (*(inbuffer + offset))); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->markers_length); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + markers_length = markers_lengthT; + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::InteractiveMarker)); + } + 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 = (visualization_msgs::InteractiveMarkerPose*)realloc(this->poses, poses_lengthT * sizeof(visualization_msgs::InteractiveMarkerPose)); + 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(visualization_msgs::InteractiveMarkerPose)); + } + uint32_t erases_lengthT = ((uint32_t) (*(inbuffer + offset))); + erases_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + erases_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + erases_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->erases_length); + if(erases_lengthT > erases_length) + this->erases = (char**)realloc(this->erases, erases_lengthT * sizeof(char*)); + erases_length = erases_lengthT; + for( uint32_t i = 0; i < erases_length; i++){ + uint32_t length_st_erases; + arrToVar(length_st_erases, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_erases; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_erases-1]=0; + this->st_erases = (char *)(inbuffer + offset-1); + offset += length_st_erases; + memcpy( &(this->erases[i]), &(this->st_erases), sizeof(char*)); + } + return offset; + } + + virtual const char * getType() override { return "visualization_msgs/InteractiveMarkerUpdate"; }; + virtual const char * getMD5() override { return "710d308d0a9276d65945e92dd30b3946"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/Marker.h b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/Marker.h new file mode 100644 index 000000000..3053d4b0d --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/Marker.h @@ -0,0 +1,312 @@ +#ifndef _ROS_visualization_msgs_Marker_h +#define _ROS_visualization_msgs_Marker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Vector3.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" +#include "geometry_msgs/Point.h" + +namespace visualization_msgs +{ + + class Marker : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + typedef const char* _ns_type; + _ns_type ns; + typedef int32_t _id_type; + _id_type id; + typedef int32_t _type_type; + _type_type type; + typedef int32_t _action_type; + _action_type action; + typedef geometry_msgs::Pose _pose_type; + _pose_type pose; + typedef geometry_msgs::Vector3 _scale_type; + _scale_type scale; + typedef std_msgs::ColorRGBA _color_type; + _color_type color; + typedef ros::Duration _lifetime_type; + _lifetime_type lifetime; + typedef bool _frame_locked_type; + _frame_locked_type frame_locked; + uint32_t points_length; + typedef geometry_msgs::Point _points_type; + _points_type st_points; + _points_type * points; + uint32_t colors_length; + typedef std_msgs::ColorRGBA _colors_type; + _colors_type st_colors; + _colors_type * colors; + typedef const char* _text_type; + _text_type text; + typedef const char* _mesh_resource_type; + _mesh_resource_type mesh_resource; + typedef bool _mesh_use_embedded_materials_type; + _mesh_use_embedded_materials_type mesh_use_embedded_materials; + enum { ARROW = 0 }; + enum { CUBE = 1 }; + enum { SPHERE = 2 }; + enum { CYLINDER = 3 }; + enum { LINE_STRIP = 4 }; + enum { LINE_LIST = 5 }; + enum { CUBE_LIST = 6 }; + enum { SPHERE_LIST = 7 }; + enum { POINTS = 8 }; + enum { TEXT_VIEW_FACING = 9 }; + enum { MESH_RESOURCE = 10 }; + enum { TRIANGLE_LIST = 11 }; + enum { ADD = 0 }; + enum { MODIFY = 0 }; + enum { DELETE = 2 }; + enum { DELETEALL = 3 }; + + Marker(): + header(), + ns(""), + id(0), + type(0), + action(0), + pose(), + scale(), + color(), + lifetime(), + frame_locked(0), + points_length(0), st_points(), points(nullptr), + colors_length(0), st_colors(), colors(nullptr), + text(""), + mesh_resource(""), + mesh_use_embedded_materials(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + varToArr(outbuffer + offset, length_ns); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + 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_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_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->pose.serialize(outbuffer + offset); + offset += this->scale.serialize(outbuffer + offset); + offset += this->color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + union { + bool real; + uint8_t base; + } u_frame_locked; + u_frame_locked.real = this->frame_locked; + *(outbuffer + offset + 0) = (u_frame_locked.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->frame_locked); + *(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->colors_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->colors_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->colors_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->colors_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->colors_length); + for( uint32_t i = 0; i < colors_length; i++){ + offset += this->colors[i].serialize(outbuffer + offset); + } + uint32_t length_text = strlen(this->text); + varToArr(outbuffer + offset, length_text); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + uint32_t length_mesh_resource = strlen(this->mesh_resource); + varToArr(outbuffer + offset, length_mesh_resource); + offset += 4; + memcpy(outbuffer + offset, this->mesh_resource, length_mesh_resource); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.real = this->mesh_use_embedded_materials; + *(outbuffer + offset + 0) = (u_mesh_use_embedded_materials.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + arrToVar(length_ns, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + 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_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_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->pose.deserialize(inbuffer + offset); + offset += this->scale.deserialize(inbuffer + offset); + offset += this->color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + union { + bool real; + uint8_t base; + } u_frame_locked; + u_frame_locked.base = 0; + u_frame_locked.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->frame_locked = u_frame_locked.real; + offset += sizeof(this->frame_locked); + 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 = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + 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(geometry_msgs::Point)); + } + uint32_t colors_lengthT = ((uint32_t) (*(inbuffer + offset))); + colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + colors_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->colors_length); + if(colors_lengthT > colors_length) + this->colors = (std_msgs::ColorRGBA*)realloc(this->colors, colors_lengthT * sizeof(std_msgs::ColorRGBA)); + colors_length = colors_lengthT; + for( uint32_t i = 0; i < colors_length; i++){ + offset += this->st_colors.deserialize(inbuffer + offset); + memcpy( &(this->colors[i]), &(this->st_colors), sizeof(std_msgs::ColorRGBA)); + } + 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; + uint32_t length_mesh_resource; + arrToVar(length_mesh_resource, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mesh_resource; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mesh_resource-1]=0; + this->mesh_resource = (char *)(inbuffer + offset-1); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.base = 0; + u_mesh_use_embedded_materials.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mesh_use_embedded_materials = u_mesh_use_embedded_materials.real; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + virtual const char * getType() override { return "visualization_msgs/Marker"; }; + virtual const char * getMD5() override { return "4048c9de2a16f4ae8e0538085ebf1b97"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/MarkerArray.h b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/MarkerArray.h new file mode 100644 index 000000000..5c632b808 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/MarkerArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_visualization_msgs_MarkerArray_h +#define _ROS_visualization_msgs_MarkerArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/Marker.h" + +namespace visualization_msgs +{ + + class MarkerArray : public ros::Msg + { + public: + uint32_t markers_length; + typedef visualization_msgs::Marker _markers_type; + _markers_type st_markers; + _markers_type * markers; + + MarkerArray(): + markers_length(0), st_markers(), markers(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->markers_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->markers_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->markers_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->markers_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->markers_length); + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t markers_lengthT = ((uint32_t) (*(inbuffer + offset))); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + markers_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->markers_length); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + markers_length = markers_lengthT; + for( uint32_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + return offset; + } + + virtual const char * getType() override { return "visualization_msgs/MarkerArray"; }; + virtual const char * getMD5() override { return "d155b9ce5188fbaf89745847fd5882d7"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/MenuEntry.h b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/MenuEntry.h new file mode 100644 index 000000000..0b9211f80 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/visualization_msgs/MenuEntry.h @@ -0,0 +1,108 @@ +#ifndef _ROS_visualization_msgs_MenuEntry_h +#define _ROS_visualization_msgs_MenuEntry_h + +#include +#include +#include +#include "ros/msg.h" + +namespace visualization_msgs +{ + + class MenuEntry : public ros::Msg + { + public: + typedef uint32_t _id_type; + _id_type id; + typedef uint32_t _parent_id_type; + _parent_id_type parent_id; + typedef const char* _title_type; + _title_type title; + typedef const char* _command_type; + _command_type command; + typedef uint8_t _command_type_type; + _command_type_type command_type; + enum { FEEDBACK = 0 }; + enum { ROSRUN = 1 }; + enum { ROSLAUNCH = 2 }; + + MenuEntry(): + id(0), + parent_id(0), + title(""), + command(""), + command_type(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; + *(outbuffer + offset + 2) = (this->id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->id >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + *(outbuffer + offset + 0) = (this->parent_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->parent_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->parent_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->parent_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent_id); + uint32_t length_title = strlen(this->title); + varToArr(outbuffer + offset, length_title); + offset += 4; + memcpy(outbuffer + offset, this->title, length_title); + offset += length_title; + uint32_t length_command = strlen(this->command); + varToArr(outbuffer + offset, length_command); + offset += 4; + memcpy(outbuffer + offset, this->command, length_command); + offset += length_command; + *(outbuffer + offset + 0) = (this->command_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->command_type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->id = ((uint32_t) (*(inbuffer + offset))); + this->id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->id); + this->parent_id = ((uint32_t) (*(inbuffer + offset))); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->parent_id); + uint32_t length_title; + arrToVar(length_title, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_title; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_title-1]=0; + this->title = (char *)(inbuffer + offset-1); + offset += length_title; + uint32_t length_command; + arrToVar(length_command, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command-1]=0; + this->command = (char *)(inbuffer + offset-1); + offset += length_command; + this->command_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->command_type); + return offset; + } + + virtual const char * getType() override { return "visualization_msgs/MenuEntry"; }; + virtual const char * getMD5() override { return "b90ec63024573de83b57aa93eb39be2d"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/voice_text/TextToSpeech.h b/smart_device_protocol/ros_lib/ros_lib/voice_text/TextToSpeech.h new file mode 100644 index 000000000..34abb7019 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/voice_text/TextToSpeech.h @@ -0,0 +1,122 @@ +#ifndef _ROS_SERVICE_TextToSpeech_h +#define _ROS_SERVICE_TextToSpeech_h +#include +#include +#include +#include "ros/msg.h" + +namespace voice_text +{ + +static const char TEXTTOSPEECH[] = "voice_text/TextToSpeech"; + + class TextToSpeechRequest : public ros::Msg + { + public: + typedef const char* _text_path_type; + _text_path_type text_path; + typedef const char* _wave_path_type; + _wave_path_type wave_path; + + TextToSpeechRequest(): + text_path(""), + wave_path("") + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_text_path = strlen(this->text_path); + varToArr(outbuffer + offset, length_text_path); + offset += 4; + memcpy(outbuffer + offset, this->text_path, length_text_path); + offset += length_text_path; + uint32_t length_wave_path = strlen(this->wave_path); + varToArr(outbuffer + offset, length_wave_path); + offset += 4; + memcpy(outbuffer + offset, this->wave_path, length_wave_path); + offset += length_wave_path; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_text_path; + arrToVar(length_text_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text_path-1]=0; + this->text_path = (char *)(inbuffer + offset-1); + offset += length_text_path; + uint32_t length_wave_path; + arrToVar(length_wave_path, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_wave_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_wave_path-1]=0; + this->wave_path = (char *)(inbuffer + offset-1); + offset += length_wave_path; + return offset; + } + + virtual const char * getType() override { return TEXTTOSPEECH; }; + virtual const char * getMD5() override { return "2313d9c56eb0e0571a953bf2b40316f4"; }; + + }; + + class TextToSpeechResponse : public ros::Msg + { + public: + typedef bool _ok_type; + _ok_type ok; + + TextToSpeechResponse(): + 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 TEXTTOSPEECH; }; + virtual const char * getMD5() override { return "6f6da3883749771fac40d6deb24a8c02"; }; + + }; + + class TextToSpeech { + public: + typedef TextToSpeechRequest Request; + typedef TextToSpeechResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/wge100_camera/BoardConfig.h b/smart_device_protocol/ros_lib/ros_lib/wge100_camera/BoardConfig.h new file mode 100644 index 000000000..2ad21c2a1 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/wge100_camera/BoardConfig.h @@ -0,0 +1,117 @@ +#ifndef _ROS_SERVICE_BoardConfig_h +#define _ROS_SERVICE_BoardConfig_h +#include +#include +#include +#include "ros/msg.h" + +namespace wge100_camera +{ + +static const char BOARDCONFIG[] = "wge100_camera/BoardConfig"; + + class BoardConfigRequest : public ros::Msg + { + public: + typedef uint32_t _serial_type; + _serial_type serial; + uint32_t mac_length; + typedef uint8_t _mac_type; + _mac_type st_mac; + _mac_type * mac; + + BoardConfigRequest(): + serial(0), + mac_length(0), st_mac(), mac(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->serial >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->serial >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->serial >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->serial >> (8 * 3)) & 0xFF; + offset += sizeof(this->serial); + *(outbuffer + offset + 0) = (this->mac_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->mac_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->mac_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->mac_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->mac_length); + for( uint32_t i = 0; i < mac_length; i++){ + *(outbuffer + offset + 0) = (this->mac[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->mac[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->serial = ((uint32_t) (*(inbuffer + offset))); + this->serial |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->serial |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->serial |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->serial); + uint32_t mac_lengthT = ((uint32_t) (*(inbuffer + offset))); + mac_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + mac_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + mac_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->mac_length); + if(mac_lengthT > mac_length) + this->mac = (uint8_t*)realloc(this->mac, mac_lengthT * sizeof(uint8_t)); + mac_length = mac_lengthT; + for( uint32_t i = 0; i < mac_length; i++){ + this->st_mac = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_mac); + memcpy( &(this->mac[i]), &(this->st_mac), sizeof(uint8_t)); + } + return offset; + } + + virtual const char * getType() override { return BOARDCONFIG; }; + virtual const char * getMD5() override { return "ec9bad54b410ebc79183d761c609dd76"; }; + + }; + + class BoardConfigResponse : public ros::Msg + { + public: + typedef uint8_t _success_type; + _success_type success; + + BoardConfigResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + *(outbuffer + offset + 0) = (this->success >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + this->success = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->success); + return offset; + } + + virtual const char * getType() override { return BOARDCONFIG; }; + virtual const char * getMD5() override { return "6cca7c80398b8b31af04b80534923f16"; }; + + }; + + class BoardConfig { + public: + typedef BoardConfigRequest Request; + typedef BoardConfigResponse Response; + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/wifi_ddwrt/Network.h b/smart_device_protocol/ros_lib/ros_lib/wifi_ddwrt/Network.h new file mode 100644 index 000000000..7f6bbddd0 --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/wifi_ddwrt/Network.h @@ -0,0 +1,168 @@ +#ifndef _ROS_wifi_ddwrt_Network_h +#define _ROS_wifi_ddwrt_Network_h + +#include +#include +#include +#include "ros/msg.h" + +namespace wifi_ddwrt +{ + + class Network : public ros::Msg + { + public: + typedef const char* _macattr_type; + _macattr_type macattr; + typedef const char* _essid_type; + _essid_type essid; + typedef int32_t _channel_type; + _channel_type channel; + typedef int32_t _rssi_type; + _rssi_type rssi; + typedef int32_t _noise_type; + _noise_type noise; + typedef int32_t _beacon_type; + _beacon_type beacon; + + Network(): + macattr(""), + essid(""), + channel(0), + rssi(0), + noise(0), + beacon(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + uint32_t length_macattr = strlen(this->macattr); + varToArr(outbuffer + offset, length_macattr); + offset += 4; + memcpy(outbuffer + offset, this->macattr, length_macattr); + offset += length_macattr; + uint32_t length_essid = strlen(this->essid); + varToArr(outbuffer + offset, length_essid); + offset += 4; + memcpy(outbuffer + offset, this->essid, length_essid); + offset += length_essid; + union { + int32_t real; + uint32_t base; + } u_channel; + u_channel.real = this->channel; + *(outbuffer + offset + 0) = (u_channel.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_channel.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_channel.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_channel.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->channel); + union { + int32_t real; + uint32_t base; + } u_rssi; + u_rssi.real = this->rssi; + *(outbuffer + offset + 0) = (u_rssi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rssi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rssi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rssi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->rssi); + union { + int32_t real; + uint32_t base; + } u_noise; + u_noise.real = this->noise; + *(outbuffer + offset + 0) = (u_noise.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_noise.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_noise.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_noise.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->noise); + union { + int32_t real; + uint32_t base; + } u_beacon; + u_beacon.real = this->beacon; + *(outbuffer + offset + 0) = (u_beacon.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_beacon.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_beacon.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_beacon.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->beacon); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + uint32_t length_macattr; + arrToVar(length_macattr, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_macattr; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_macattr-1]=0; + this->macattr = (char *)(inbuffer + offset-1); + offset += length_macattr; + uint32_t length_essid; + arrToVar(length_essid, (inbuffer + offset)); + offset += 4; + for(unsigned int k= offset; k< offset+length_essid; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_essid-1]=0; + this->essid = (char *)(inbuffer + offset-1); + offset += length_essid; + union { + int32_t real; + uint32_t base; + } u_channel; + u_channel.base = 0; + u_channel.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_channel.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_channel.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_channel.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->channel = u_channel.real; + offset += sizeof(this->channel); + union { + int32_t real; + uint32_t base; + } u_rssi; + u_rssi.base = 0; + u_rssi.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_rssi.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_rssi.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_rssi.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->rssi = u_rssi.real; + offset += sizeof(this->rssi); + union { + int32_t real; + uint32_t base; + } u_noise; + u_noise.base = 0; + u_noise.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_noise.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_noise.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_noise.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->noise = u_noise.real; + offset += sizeof(this->noise); + union { + int32_t real; + uint32_t base; + } u_beacon; + u_beacon.base = 0; + u_beacon.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_beacon.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_beacon.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_beacon.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->beacon = u_beacon.real; + offset += sizeof(this->beacon); + return offset; + } + + virtual const char * getType() override { return "wifi_ddwrt/Network"; }; + virtual const char * getMD5() override { return "b0854419660dc197dd94305843bee07f"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/ros_lib/ros_lib/wifi_ddwrt/SiteSurvey.h b/smart_device_protocol/ros_lib/ros_lib/wifi_ddwrt/SiteSurvey.h new file mode 100644 index 000000000..f987b249a --- /dev/null +++ b/smart_device_protocol/ros_lib/ros_lib/wifi_ddwrt/SiteSurvey.h @@ -0,0 +1,70 @@ +#ifndef _ROS_wifi_ddwrt_SiteSurvey_h +#define _ROS_wifi_ddwrt_SiteSurvey_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "wifi_ddwrt/Network.h" + +namespace wifi_ddwrt +{ + + class SiteSurvey : public ros::Msg + { + public: + typedef std_msgs::Header _header_type; + _header_type header; + uint32_t networks_length; + typedef wifi_ddwrt::Network _networks_type; + _networks_type st_networks; + _networks_type * networks; + + SiteSurvey(): + header(), + networks_length(0), st_networks(), networks(nullptr) + { + } + + virtual int serialize(unsigned char *outbuffer) const override + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->networks_length >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->networks_length >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->networks_length >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->networks_length >> (8 * 3)) & 0xFF; + offset += sizeof(this->networks_length); + for( uint32_t i = 0; i < networks_length; i++){ + offset += this->networks[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) override + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t networks_lengthT = ((uint32_t) (*(inbuffer + offset))); + networks_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + networks_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + networks_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->networks_length); + if(networks_lengthT > networks_length) + this->networks = (wifi_ddwrt::Network*)realloc(this->networks, networks_lengthT * sizeof(wifi_ddwrt::Network)); + networks_length = networks_lengthT; + for( uint32_t i = 0; i < networks_length; i++){ + offset += this->st_networks.deserialize(inbuffer + offset); + memcpy( &(this->networks[i]), &(this->st_networks), sizeof(wifi_ddwrt::Network)); + } + return offset; + } + + virtual const char * getType() override { return "wifi_ddwrt/SiteSurvey"; }; + virtual const char * getMD5() override { return "f1063b16bb121ef190ae5edfe09d94ec"; }; + + }; + +} +#endif diff --git a/smart_device_protocol/setup.py b/smart_device_protocol/setup.py new file mode 100644 index 000000000..2a219015d --- /dev/null +++ b/smart_device_protocol/setup.py @@ -0,0 +1,6 @@ +from distutils.core import setup +from catkin_pkg.python_setup import generate_distutils_setup + +d = generate_distutils_setup(packages=["smart_device_protocol"], package_dir={"": "python"}) + +setup(**d) diff --git a/smart_device_protocol/sketchbooks/README.md b/smart_device_protocol/sketchbooks/README.md new file mode 100644 index 000000000..a3f50aeb4 --- /dev/null +++ b/smart_device_protocol/sketchbooks/README.md @@ -0,0 +1,3 @@ +# Smart Device Procotol Devices + +This directory contains firmwares for Smart Device Protocol devices. \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/enr_dps310_interface/.gitignore b/smart_device_protocol/sketchbooks/enr_dps310_interface/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_dps310_interface/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/enr_dps310_interface/include/README b/smart_device_protocol/sketchbooks/enr_dps310_interface/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_dps310_interface/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/enr_dps310_interface/platformio.ini b/smart_device_protocol/sketchbooks/enr_dps310_interface/platformio.ini new file mode 100644 index 000000000..86a942d03 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_dps310_interface/platformio.ini @@ -0,0 +1,21 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-core2] +platform = espressif32 +board = m5stack-core2 +framework = arduino +lib_deps = + m5stack/M5Core2 @ ^0.1.5 + infineon/DigitalPressureSensor @ ^1.0.6 + lovyan03/LovyanGFX @ ^1.1.5 +monitor_speed=115200 +build_flags = -std=gnu++17 +build_unflags = -std=gnu++11 \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/enr_dps310_interface/src/main.cpp b/smart_device_protocol/sketchbooks/enr_dps310_interface/src/main.cpp new file mode 100644 index 000000000..7fe718c65 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_dps310_interface/src/main.cpp @@ -0,0 +1,141 @@ +#include +#include + +#include + +#include +#include + +#include +#include + +#include + +#include "sdp/packet_creator.h" +#include "sdp/packet_parser.h" + +static LGFX lcd; +static LGFX_Sprite sprite_header(&lcd); +static LGFX_Sprite sprite_sensor(&lcd); + +Dps310 Dps310PressureSensor = Dps310(); + +// SDP +esp_now_peer_info_t peer; +uint8_t packet[240]; +String packet_description_config = "Elevator status config"; +String serialization_format_config = "S"; + +// Sensor values +float accX = 0.0F; +float accY = 0.0F; +float accZ = 0.0F; +float gyroX = 0.0F; +float gyroY = 0.0F; +float gyroZ = 0.0F; +float pitch = 0.0F; +float roll = 0.0F; +float yaw = 0.0F; +float temp_mpu = 0.0F; +float temp_dps = 0; +float pressure = 0; + +char module_name[64]; + +void OnDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len) +{ + uint16_t packet_type = get_packet_type(data); + if (packet_type == smart_device_protocol::Packet::PACKET_TYPE_NAMED_STRING) + { + char name[64]; + char temp_module_name[64]; + parse_packet_as_named_string_packet(data, packet_type, name, temp_module_name); + if (strncmp(name, "module_name", 10)) + { + strncpy(module_name, temp_module_name, 64); + Serial.printf("module_name is updated to %s\n", module_name); + } + } +} + +void setup() +{ + // Read device mac address + uint8_t device_mac_address[6] = {0}; + esp_read_mac(device_mac_address, ESP_MAC_WIFI_STA); + + // Device Initialization + M5.begin(true, false, true, true); + Serial.begin(115200); + M5.IMU.Init(); + Dps310PressureSensor.begin(Wire, 0x77); + + // Set default name + strncpy(module_name, "default", 64); + + // LCD + lcd.init(); + lcd.setRotation(1); + lcd.setBrightness(128); + lcd.setColorDepth(24); + lcd.fillScreen(0xFFFFFF); + + sprite_header.createSprite(320, 80); + sprite_sensor.createSprite(320, 160); + + sprite_header.fillScreen(0xFFFFFF); + sprite_header.setTextColor(0x000000); + sprite_header.setTextSize(1.5, 1.5); + sprite_sensor.fillScreen(0xFFFFFF); + sprite_sensor.setTextColor(0x000000); + + sprite_header.println("ENR DPS310 Interface"); + sprite_header.printf("MAC ADDR: %02X:%02X:%02X:%02X:%02X:%02X\n", device_mac_address[0], device_mac_address[1], + device_mac_address[2], device_mac_address[3], device_mac_address[4], device_mac_address[5]); + sprite_header.pushSprite(0, 0); + + // Initialize ESP-NOW + WiFi.mode(WIFI_STA); + WiFi.disconnect(); + if (esp_now_init() == ESP_OK) + { + Serial.println("ESPNow Init Success"); + } + else + { + Serial.println("ESPNow Init Failed"); + ESP.restart(); + } + esp_now_register_recv_cb(OnDataRecv); +} + +void loop() +{ + M5.IMU.getGyroData(&gyroX, &gyroY, &gyroZ); + M5.IMU.getAccelData(&accX, &accY, &accZ); + M5.IMU.getAhrsData(&pitch, &roll, &yaw); + M5.IMU.getTempData(&temp_mpu); + + Dps310PressureSensor.measurePressureOnce(pressure); + Dps310PressureSensor.measureTempOnce(temp_dps); + + sprite_sensor.fillScreen(0xFFFFFF); + sprite_sensor.setCursor(0, 0); + Serial.println("==== measured ===="); + Serial.printf("acc: %f %f %f\n", accX, accY, accZ); + sprite_sensor.printf("acc: %f %f %f\n", accX, accY, accZ); + Serial.printf("gyro: %f %f %f\n", gyroX, gyroY, gyroZ); + sprite_sensor.printf("gyro: %f %f %f\n", gyroX, gyroY, gyroZ); + Serial.printf("rpy: %f %f %f\n", roll, pitch, yaw); + sprite_sensor.printf("rpy: %f %f %f\n", roll, pitch, yaw); + Serial.printf("temp(mpu): %f\n", temp_mpu); + sprite_sensor.printf("temp(mpu): %f\n", temp_mpu); + Serial.printf("pressure: %f\n", pressure); + sprite_sensor.printf("pressure: %f\n", pressure); + Serial.printf("temp(dps): %f\n", temp_dps); + sprite_sensor.printf("temp(dps): %f\n", temp_dps); + sprite_sensor.pushSprite(0, 80); + + create_sensor_enviii_packet(packet, module_name, pressure); + esp_err_t result = esp_now_send(peer.peer_addr, (uint8_t *)packet, sizeof(packet) / sizeof(packet[0])); +} diff --git a/smart_device_protocol/sketchbooks/enr_dps310_interface/test/README b/smart_device_protocol/sketchbooks/enr_dps310_interface/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_dps310_interface/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/enr_message_board/.gitignore b/smart_device_protocol/sketchbooks/enr_message_board/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_message_board/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/enr_message_board/README.md b/smart_device_protocol/sketchbooks/enr_message_board/README.md new file mode 100644 index 000000000..af98b4503 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_message_board/README.md @@ -0,0 +1,7 @@ +# enr_message_board + +## How to burn + +```bash +pio run +``` diff --git a/smart_device_protocol/sketchbooks/enr_message_board/include/README b/smart_device_protocol/sketchbooks/enr_message_board/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_message_board/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/enr_message_board/include/message.h b/smart_device_protocol/sketchbooks/enr_message_board/include/message.h new file mode 100644 index 000000000..0157988cd --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_message_board/include/message.h @@ -0,0 +1,84 @@ +#include +#include + +#include + +#include "sdp/packet_creator.h" +#include "sdp/packet_parser.h" + +class Message +{ +public: + inline static std::string packet_description_write = "Message Board to write"; + inline static std::string serialization_format_write = "siS"; + inline static std::string packet_description_message = "Message Board message"; + + char message[64]; + char source_name[64]; + unsigned long deadline; + + Message(const uint8_t *data) + { + + strncpy(this->source_name, "None", 16); + strncpy(this->source_name, "None", 64); + this->deadline = 0; + + if (get_packet_type(data) == smart_device_protocol::Packet::PACKET_TYPE_DEVICE_MESSAGE_BOARD_DATA) + { + uint16_t packet_type; + uint64_t timeout_duration; + parse_packet_as_message_board_data_packet(data, packet_type, source_name, timeout_duration, message); + this->deadline = millis() + timeout_duration; + } + else if (get_packet_type(data) == smart_device_protocol::Packet::PACKET_TYPE_DATA) + { + auto ret = parse_packet_as_data_packet(data); + SDPInterfaceDescription packet_description_and_serialization_format = std::get<0>(ret); + std::string packet_description = std::get<0>(packet_description_and_serialization_format); + std::string serialization_format = std::get<1>(packet_description_and_serialization_format); + std::vector data = std::get<1>(ret); + + if (packet_description == packet_description_write and serialization_format == serialization_format_write and get_serialization_format(data) == serialization_format_write) + { + std::string source_name = std::get(data[0]); + int32_t duration_until_deletion = std::get(data[1]); + std::string message = std::get(data[2]); + strncpy(this->source_name, source_name.c_str(), 16); + strncpy(this->message, message.c_str(), 64); + this->deadline = millis() + duration_until_deletion; + } + } + } + + Message(char *source_name, char *message, int32_t timeout_duration) + { + strncpy(this->source_name, source_name, 16); + strncpy(this->message, message, 64); + this->deadline = (int32_t)millis() + timeout_duration; + } + + void to_v1_packet(uint8_t *data) + { + create_device_message_board_data_packet(data, source_name, deadline - millis(), message); + } + + void to_v2_packet(uint8_t *data) + { + std::vector> data_vector; + data_vector.push_back(std::variant(std::string(source_name))); + data_vector.push_back(std::variant((int32_t)(this->deadline - millis()))); + data_vector.push_back(std::variant(std::string(message))); + generate_data_frame(data, packet_description_message.c_str(), data_vector); + } + + static void generate_v2_meta_packet(uint8_t *data, const char *device_name) + { + generate_meta_frame(data, device_name, packet_description_write.c_str(), serialization_format_write.c_str(), "", "", "", ""); + } + + static SDPInterfaceDescription get_interface_description() + { + return std::make_tuple(packet_description_message, serialization_format_write); + } +}; diff --git a/smart_device_protocol/sketchbooks/enr_message_board/platformio.ini b/smart_device_protocol/sketchbooks/enr_message_board/platformio.ini new file mode 100644 index 000000000..1a4121dca --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_message_board/platformio.ini @@ -0,0 +1,20 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-fire] +platform = espressif32 +board = m5stack-fire +framework = arduino +lib_deps = + m5stack/M5EPD @ ^0.1.4 + bblanchon/ArduinoJson @ ^6.21.3 +monitor_speed = 115200 +build_flags = -std=gnu++17 +build_unflags = -std=gnu++11 \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/enr_message_board/src/main.cpp b/smart_device_protocol/sketchbooks/enr_message_board/src/main.cpp new file mode 100644 index 000000000..054ea8db9 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_message_board/src/main.cpp @@ -0,0 +1,176 @@ + +#include + +#include + +#include +#include +#include + +#include + +#include "sdp/sdp.h" +#include "utils/config_loader.h" + +#include "message.h" + +// CONFIG +String device_name = "msg_board"; + +// CANVAS +M5EPD_Canvas canvas_title(&M5.EPD); +M5EPD_Canvas canvas_status(&M5.EPD); +M5EPD_Canvas canvas_message(&M5.EPD); + +// SDP +uint8_t mac_address[6] = {0}; + +// MSG BUFFER +std::vector message_board; + +// Others +int loop_counter = 0; + +void OnDataRecvV1(const uint8_t *mac_addr, const uint8_t *data, int data_len) +{ + uint8_t packet_type = get_packet_type(data); + if (packet_type == smart_device_protocol::Packet::PACKET_TYPE_DEVICE_MESSAGE_BOARD_DATA) + { + auto m = Message(data); + message_board.push_back(m); + Serial.printf("Push message from V1 Data\n"); + } +} + +void callback_for_v2(const uint8_t *mac_addr, const std::vector &body) +{ + std::string source_name = std::get(body[0]); + int32_t duration_until_deletion = std::get(body[1]); + std::string message = std::get(body[2]); + + auto m = Message((char *)source_name.c_str(), (char *)message.c_str(), duration_until_deletion); + message_board.push_back(m); + Serial.printf("Push message from V2 Data\n"); +} + +void load_config() +{ + StaticJsonDocument<1024> doc; + if (not load_json_from_FS<1024>(SD, "/config.json", doc)) + { + return; + } + if (doc.containsKey("device_name")) + device_name = doc["device_name"].as(); +} + +void clear_canvas(M5EPD_Canvas &canvas) +{ + canvas.clear(); + canvas.setCursor(0, 0); +} + +void init_epd(M5EPD_Canvas &canvas_title, M5EPD_Canvas &canvas_status, M5EPD_Canvas &canvas_message) +{ + canvas_title.createCanvas(540, 100); + canvas_status.createCanvas(540, 60); + canvas_message.createCanvas(540, 800); + canvas_title.setTextSize(3); + canvas_status.setTextSize(2); + canvas_message.setTextSize(2); + clear_canvas(canvas_title); + clear_canvas(canvas_status); + clear_canvas(canvas_message); +} + +void update_epd(M5EPD_Canvas &canvas_title, M5EPD_Canvas &canvas_status, M5EPD_Canvas &canvas_message) +{ + canvas_title.pushCanvas(0, 0, UPDATE_MODE_DU4); + canvas_status.pushCanvas(0, 100, UPDATE_MODE_DU4); + canvas_message.pushCanvas(0, 160, UPDATE_MODE_DU4); +} + +void setup() +{ + esp_read_mac(mac_address, ESP_MAC_WIFI_STA); + + // Init M5Paper + M5.begin(false, true, true, true, false); + M5.EPD.SetRotation(90); + M5.EPD.Clear(true); + M5.RTC.begin(); + init_epd(canvas_title, canvas_status, canvas_message); + Serial.println("Start init"); + + // Load config + load_config(); + + // Init SDP + init_sdp(mac_address, device_name); + register_sdp_esp_now_recv_callback(OnDataRecvV1); + register_sdp_interface_callback(Message::get_interface_description(), callback_for_v2); + Serial.println("SDP Initialized!"); + + // Show device info + canvas_title.printf("ENR & SDP MESSAGE BOARD\n"); + canvas_title.printf("Name: %s\n", device_name.c_str()); + canvas_title.printf("ADDR: %2x:%2x:%2x:%2x:%2x:%2x\n", + mac_address[0], mac_address[1], + mac_address[2], mac_address[3], + mac_address[4], mac_address[5]); + update_epd(canvas_title, canvas_status, canvas_message); +} + +void loop() +{ + Serial.printf("Loop %d\n", loop_counter); + uint8_t buf[250]; + + // Manually Send V1 Meta Packet + create_device_message_board_meta_packet(buf, device_name.c_str()); + broadcast_sdp_esp_now_packet((uint8_t *)buf, sizeof(buf)); + + // Show Battery voltage + uint32_t battery_voltage = M5.getBatteryVoltage(); + clear_canvas(canvas_status); + if (loop_counter % 2 == 0) + { + canvas_status.printf("+ Battery: %u\n", battery_voltage); + } + else + { + canvas_status.printf("x Battery: %u\n", battery_voltage); + } + + // Shoe messages + clear_canvas(canvas_message); + for (auto m = message_board.begin(); m != message_board.end();) + { + if (millis() > m->deadline) + { + m = message_board.erase(m); + } + else + { + m++; + } + } + for (auto m = message_board.rbegin(); m != message_board.rend(); m++) + { + canvas_message.println("------------------------------------"); + canvas_message.printf("From: %s\n", m->source_name); + canvas_message.printf("Duration until deletion(sec): %d\n", (int)((m->deadline - millis()) / 1000)); + canvas_message.printf("Message: %s\n\n", m->message); + + m->to_v1_packet(buf); + broadcast_sdp_esp_now_packet((uint8_t *)buf, sizeof(buf)); + delay(10); + m->to_v2_packet(buf); + broadcast_sdp_esp_now_packet((uint8_t *)buf, sizeof(buf)); + delay(10); + } + update_epd(canvas_title, canvas_status, canvas_message); + + delay(100); + loop_counter++; +} diff --git a/smart_device_protocol/sketchbooks/enr_message_board/test/README b/smart_device_protocol/sketchbooks/enr_message_board/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_message_board/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/enr_stickv2_interface/.gitignore b/smart_device_protocol/sketchbooks/enr_stickv2_interface/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_stickv2_interface/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/enr_stickv2_interface/include/README b/smart_device_protocol/sketchbooks/enr_stickv2_interface/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_stickv2_interface/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/enr_stickv2_interface/platformio.ini b/smart_device_protocol/sketchbooks/enr_stickv2_interface/platformio.ini new file mode 100644 index 000000000..aa3aaca17 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_stickv2_interface/platformio.ini @@ -0,0 +1,21 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-core2] +platform = espressif32 +board = m5stack-core2 +framework = arduino +lib_deps = + m5stack/M5Core2 @ ^0.1.5 + lovyan03/LovyanGFX @ ^1.1.5 + bblanchon/ArduinoJson @ ^6.21.1 +monitor_speed = 115200 +build_flags = -std=gnu++17 +build_unflags = -std=gnu++11 \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/enr_stickv2_interface/src/main.cpp b/smart_device_protocol/sketchbooks/enr_stickv2_interface/src/main.cpp new file mode 100644 index 000000000..290e66578 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_stickv2_interface/src/main.cpp @@ -0,0 +1,140 @@ +#include +#include + +#include +#include + +#include +#include + +#include + +#include + +#include "sdp/packet_creator.h" + +#define BUFSIZE 2048 + +const char place[] = "73B2_TV_Front"; + +static LGFX lcd; +static LGFX_Sprite sprite_header(&lcd); +static LGFX_Sprite sprite_json(&lcd); + +char buf[BUFSIZE]; + +esp_now_peer_info_t peer; + +uint8_t packet[240]; + +StaticJsonDocument doc; + +void setup() +{ + // Initialize + M5.begin(true, false, true, false); + Serial1.begin(115200, SERIAL_8N1, 32, 33); + + Serial.begin(115200); + + // Display Initialization + lcd.init(); + lcd.setRotation(1); + lcd.setBrightness(128); + lcd.setColorDepth(24); + lcd.fillScreen(0xFFFFFF); + sprite_header.createSprite(320, 40); + sprite_header.fillScreen(0xFFFFFF); + sprite_header.setTextColor(0x000000); + sprite_header.setTextSize(1.5, 1.5); + sprite_json.createSprite(320, 200); + sprite_json.fillScreen(0xFFFFFF); + sprite_json.setTextColor(0x000000); + sprite_header.println("ENR StickV2 Interface"); + sprite_header.pushSprite(0, 0); + + // ESP-NOW initialization + WiFi.mode(WIFI_STA); + WiFi.disconnect(); + if (esp_now_init() == ESP_OK) + { + Serial.println("ESPNow Init Success"); + } + else + { + Serial.println("ESPNow Init Failed"); + ESP.restart(); + } + // Peer initialization + for (int i = 0; i < 6; i++) + { + peer.peer_addr[i] = 0xff; + } + esp_err_t add_status = esp_now_add_peer(&peer); +} + +void loop() +{ + auto last_read_stamp = millis(); + while (true) + { + if (not Serial1.available()) + { + if (millis() > last_read_stamp + 10000) + { + Serial1.println("{\"function\": \"object_recognition\", \"args\": [\"./uploads/models/nanodet_80class\"]}"); + Serial.println("Send function command JSON."); + last_read_stamp = millis(); + } + } + else + { + last_read_stamp = millis(); + + int actual_length = Serial1.readBytesUntil('\n', buf, BUFSIZE); + buf[actual_length] = 0; + + sprite_json.fillScreen(0xFFFFF); + sprite_json.setCursor(0, 0); + sprite_json.println("Read text:"); + sprite_json.println(buf); + sprite_json.pushSprite(0, 40); + + Serial.print("Read text:"); + Serial.print(buf); + Serial.print("\n"); + + DeserializationError error = deserializeJson(doc, buf); + if (error) + { + Serial.print("JSON deserialization Failed: "); + Serial.println(error.f_str()); + continue; + } + + if (doc.containsKey("num") and doc.containsKey("obj")) + { + int num_of_person = 0; + long num_of_objects = doc["num"]; + for (int i = 0; i < num_of_objects; i++) + { + if (strncmp(doc["obj"][i]["type"], "person", 3) == 0) + { + ++num_of_person; + } + } + Serial.print("Detection result:\n"); + Serial.printf("number of objects: %ld\n", num_of_objects); + Serial.printf("number of people: %d\n", num_of_person); + Serial.print("\n"); + + create_sensor_stickv2_packet(packet, num_of_person, place); + esp_err_t result = esp_now_send(peer.peer_addr, (uint8_t *)packet, sizeof(packet) / sizeof(packet[0])); + } + else + { + Serial.println("Unknown JSON Structure."); + } + } + } +} diff --git a/smart_device_protocol/sketchbooks/enr_stickv2_interface/test/README b/smart_device_protocol/sketchbooks/enr_stickv2_interface/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/enr_stickv2_interface/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/.gitignore b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/README.md b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/README.md new file mode 100644 index 000000000..84e6c1ab5 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/README.md @@ -0,0 +1,54 @@ +# M5AtomS3 Sesami Client + +This sketch is for sesami client with M5AtomS3. + +## How to use + +First, update parameters in the skectch below + +- SSID +- Password +- device UUID +- secret key +- api key + +Then, burn the sketch to M5AtomS3 + +## Serial Interface + +This device can be controlled with serial command via GROVE port. + +example is + +``` +{"command": "toggle"}\n +``` + +``` +{"command": "lock"}\n +``` + +``` +{"command": "unlock"}\n +``` + +``` +{"command": "status"}\n +``` + +``` +{"command": "history"}\n +``` + +And result will be sent via serial port like + +``` +{"success":true,"message":"toggle success"}\n +``` + +## Notice + +See the pages below if you have a problem with WiFiClientSecure. + +- https://www.mgo-tec.com/blog-entry-arduino-esp32-wificlientsecure-hangup-solution.html +- https://www.1ft-seabass.jp/memo/2017/07/31/esp32-developer-aws-iot-tips/ diff --git a/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/include/README b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/platformio.ini b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/platformio.ini new file mode 100644 index 000000000..487aa8283 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/platformio.ini @@ -0,0 +1,30 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-atoms3] +platform = espressif32 +board = m5stack-atoms3 +framework = arduino +lib_ldf_mode = deep +lib_deps = + lovyan03/LovyanGFX @ ^1.1.12 + m5stack/M5AtomS3@^0.0.3 + fastled/FastLED@^3.4.0 + obsttube/AES_CMAC @ ^1.0.0 + operatorfoundation/Crypto @ ^0.4.0 + bblanchon/ArduinoJson @ ^6.21.3 + marian-craciunescu/ESP32Ping @ ^1.7 +build_flags = + -std=gnu++17 + -DARDUINO_LOOP_STACK_SIZE=36768 + ;-DUSBMODE +build_unflags = + -std=gnu++11 +monitor_speed = 115200 diff --git a/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/src/main.cpp b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/src/main.cpp new file mode 100644 index 000000000..a8d46dbd3 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/src/main.cpp @@ -0,0 +1,249 @@ +#include + +#include + +#include +#include +#include + +#include + +#define LGFX_AUTODETECT +#include +#include + +#include "iot_com_util/Time.h" +#include "iot_com_util/iot_client_util.h" +#include "web_services/sesami_util.h" + +/* Mofidy below */ +String ssid = ""; +String password = ""; +String device_uuid = ""; +String secret_key = ""; +String api_key = ""; + +// +WiFiMulti WiFiMulti; +static LGFX lcd; +static LGFX_Sprite sprite_device_info(&lcd); +static LGFX_Sprite sprite_event_info(&lcd); + +void setup() +{ + M5.begin(false, true, false, false); + Serial2.begin(115200, SERIAL_8N1, 2, 1); + + // LovyanGFX Initialization + init_screen(lcd, sprite_device_info, sprite_event_info); + + sprite_device_info.setCursor(0, 0); + sprite_device_info.println("SESAMI Client"); + sprite_device_info.pushSprite(0, 0); + + if (ssid != "" and password != "") + { + initWiFi(ssid.c_str(), password.c_str(), sprite_event_info, lcd, WiFiMulti); + } +} + +void loop() +{ + delay(50); + String bufstring; + StaticJsonDocument<1024> input_json; + StaticJsonDocument<1024> result_json; + StaticJsonDocument<2048> response_json; + if (USBSerial.available() or Serial2.available()) + { + if (USBSerial.available()) + { + bufstring = USBSerial.readStringUntil('\n'); + } + else + { + bufstring = Serial2.readStringUntil('\n'); + } + DeserializationError error = deserializeJson(input_json, bufstring.c_str()); + + if (error) + { + String message = "deserializeJson() failed: " + String(error.c_str()); + USBSerial.println(message); + show_device_info(message.c_str(), sprite_event_info, lcd); + response_json["success"] = false; + response_json["message"] = message; + Serial2.printf("%s\n", response_json.as().c_str()); + return; + } + + if (not input_json.containsKey("command")) + { + String message = "command key not found"; + USBSerial.println(message); + show_device_info(message.c_str(), sprite_event_info, lcd); + response_json["success"] = false; + response_json["message"] = message; + Serial2.printf("%s\n", response_json.as().c_str()); + return; + } + + String command = input_json["command"]; + if (command == String("toggle") or command == String("lock") or command == String("unlock")) + { + std::optional ret; + if (command == String("toggle")) + { + ret = operation_sesami(device_uuid, api_key, 88, secret_key); + } + else if (command == String("lock")) + { + ret = operation_sesami(device_uuid, api_key, 82, secret_key); + } + else if (command == String("unlock")) + { + ret = operation_sesami(device_uuid, api_key, 83, secret_key); + } + if (ret) + { + DeserializationError error = deserializeJson(result_json, ret.value().c_str()); + if (error) + { + response_json["success"] = false; + response_json["message"] = "deserializeJson() failed during operation_sesami: " + String(error.c_str()) + ", result: " + ret.value(); + } + else + { + response_json["success"] = true; + response_json["message"] = command + " success"; + response_json["result"] = result_json; + } + } + else + { + response_json["success"] = false; + response_json["message"] = command + " failed"; + } + } + else if (command == String("status")) + { + std::optional ret = get_sesami_status(device_uuid, api_key); + if (ret) + { + DeserializationError error = deserializeJson(result_json, ret.value().c_str()); + if (error) + { + response_json["success"] = false; + response_json["message"] = "deserializeJson() failed during get_sesami_status: " + String(error.c_str()) + ", result: " + ret.value(); + } + else + { + response_json["success"] = true; + response_json["message"] = "get_sesami_status() success"; + response_json["result"] = result_json; + } + } + else + { + response_json["success"] = false; + response_json["message"] = "get_sesami_status() failed"; + } + } + else if (command == String("history")) + { + std::optional ret = get_sesami_history(device_uuid, api_key); + if (ret) + { + String result = ret.value(); + DeserializationError error = deserializeJson(result_json, result.c_str()); + if (error) + { + response_json["success"] = false; + response_json["message"] = "deserializeJson() failed during get_sesami_history: " + String(error.c_str()) + ", result: " + result; + } + else + { + response_json["success"] = true; + response_json["message"] = "get sesami history success"; + response_json["result"] = result_json; + } + } + else + { + response_json["success"] = false; + response_json["message"] = "get_sesami_history() failed"; + } + } + else if (command == "get_time") + { + uint32_t t = (uint32_t)std::time(nullptr); + response_json["success"] = true; + response_json["message"] = "get_time success: " + String(t); + } + else if (command == String("config_wifi")) + { + if (not input_json.containsKey("ssid") or not input_json.containsKey("password")) + { + response_json["success"] = false; + response_json["message"] = "ssid or password key not found"; + } + else + { + String new_ssid = input_json["ssid"].as(); + String new_password = input_json["password"].as(); + if (new_ssid != "") + ssid = new_ssid; + if (new_password != "") + password = new_password; + bool success = initWiFi(ssid.c_str(), password.c_str(), sprite_event_info, lcd, WiFiMulti); + String message; + if (success) + { + message = "config_wifi success. SSID: " + ssid + ", password: " + password + ", IP: " + WiFi.localIP().toString(); + } + else + { + message = "config_wifi failed"; + } + response_json["success"] = success; + response_json["message"] = message; + } + } + else if (command == String("config_sesami")) + { + if (not input_json.containsKey("device_uuid") or not input_json.containsKey("secret_key") or not input_json.containsKey("api_key")) + { + response_json["success"] = false; + response_json["message"] = "device_uuid or secret_key or api_key key not found"; + } + else + { + device_uuid = input_json["device_uuid"].as(); + secret_key = input_json["secret_key"].as(); + api_key = input_json["api_key"].as(); + response_json["success"] = true; + response_json["message"] = "config_sesami success"; + } + } + else if (command == String("get_device_config")) + { + result_json["ssid"] = ssid; + result_json["password"] = password; + result_json["device_uuid"] = device_uuid; + result_json["secret_key"] = secret_key; + result_json["api_key"] = api_key; + result_json["ip"] = WiFi.localIP().toString(); + response_json["success"] = true; + response_json["message"] = "get_device_config success"; + response_json["result"] = result_json; + } + else + { + response_json["success"] = false; + response_json["message"] = "Unknown command error: " + command; + } + USBSerial.printf("response_json: %s\n", response_json.as().c_str()); + show_device_info((String("response_json") + response_json.as()).c_str(), sprite_event_info, lcd); + Serial2.printf("%s\n", response_json.as().c_str()); + } +} diff --git a/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/test/README b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_sesami_client/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/.gitignore b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/README.md b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/README.md new file mode 100644 index 000000000..bca07db43 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/README.md @@ -0,0 +1,38 @@ +# M5AtomS3 Switchbot Client + +This sketch is for switchbot client with M5AtomS3. + +## How to use + +First, update parameters in the skectch below + +- SSID +- Password +- token +- secret + +Then, burn the sketch to M5AtomS3 + +## Serial Interface + +This device can be controlled with serial command via GROVE port. + +example is + +``` +{"command": "get_device_list"}\n +``` + +``` +{"command": "get_device_status", "device_id": ""}\n +``` + +``` +{"command": "send_device_command", "device_id": "", "pb_command_type": "", "pb_command": ""}\n +``` + +And result will be sent via serial port like + +``` +{"success":true,"message":"get_device_list success"}\n +``` \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/include/README b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/platformio.ini b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/platformio.ini new file mode 100644 index 000000000..a135ded2c --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/platformio.ini @@ -0,0 +1,28 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-atoms3] +platform = espressif32 +board = m5stack-atoms3 +framework = arduino +lib_ldf_mode = deep +lib_deps = + lovyan03/LovyanGFX @ ^1.1.12 + m5stack/M5AtomS3@^0.0.3 + fastled/FastLED@^3.4.0 + obsttube/AES_CMAC @ ^1.0.0 + operatorfoundation/Crypto @ ^0.4.0 + bblanchon/ArduinoJson @ ^6.21.3 + marian-craciunescu/ESP32Ping @ ^1.7 +build_flags = + -std=gnu++17 + -DARDUINO_LOOP_STACK_SIZE=36768 +build_unflags = -std=gnu++11 +monitor_speed = 115200 diff --git a/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/src/main.cpp b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/src/main.cpp new file mode 100644 index 000000000..f4465ceb1 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/src/main.cpp @@ -0,0 +1,253 @@ +#include + +#include + +#include +#include +#include + +#include + +#define LGFX_AUTODETECT +#include +#include + +#include "iot_com_util/Time.h" +#include "iot_com_util/iot_client_util.h" +#include "web_services/switchbot_util.h" + +/* Mofidy below */ +String ssid = ""; +String password = ""; +String token = ""; +String secret = ""; + +// +WiFiMulti WiFiMulti; +static LGFX lcd; +static LGFX_Sprite sprite_device_info(&lcd); +static LGFX_Sprite sprite_event_info(&lcd); + +void setup() +{ + M5.begin(false, true, false, false); + Serial2.begin(115200, SERIAL_8N1, 2, 1); + + // LovyanGFX Initialization + init_screen(lcd, sprite_device_info, sprite_event_info); + + sprite_device_info.setCursor(0, 0); + sprite_device_info.println("Switchbot Client"); + sprite_device_info.pushSprite(0, 0); + + if (ssid != "" and password != "") + { + initWiFi(ssid.c_str(), password.c_str(), sprite_event_info, lcd, WiFiMulti); + } +} + +void loop() +{ + delay(50); + String bufstring; + StaticJsonDocument<1024> input_json; + StaticJsonDocument<1024> result_json; + StaticJsonDocument<2048> response_json; + if (USBSerial.available() or Serial2.available()) + { + if (USBSerial.available()) + { + bufstring = USBSerial.readStringUntil('\n'); + } + else + { + bufstring = Serial2.readStringUntil('\n'); + } + DeserializationError error = deserializeJson(input_json, bufstring.c_str()); + + if (error) + { + String message = "deserializeJson() failed: " + String(error.c_str()); + USBSerial.println(message); + show_device_info(message.c_str(), sprite_event_info, lcd); + response_json["success"] = false; + response_json["message"] = message; + Serial2.printf("%s\n", response_json.as().c_str()); + return; + } + + if (not input_json.containsKey("command")) + { + String message = "command key not found"; + USBSerial.println(message); + show_device_info(message.c_str(), sprite_event_info, lcd); + response_json["success"] = false; + response_json["message"] = message; + Serial2.printf("%s\n", response_json.as().c_str()); + return; + } + + String command = input_json["command"]; + if (command == String("get_device_list")) + { + std::optional ret = get_device_list(token, secret); + if (ret) + { + DeserializationError error = deserializeJson(result_json, ret.value().c_str()); + if (error) + { + response_json["success"] = false; + response_json["message"] = "deserializeJson() failed during get_device_list: " + String(error.c_str()) + ", ret: " + ret.value(); + } + else + { + response_json["success"] = true; + response_json["message"] = "get_device_list success"; + response_json["result"] = result_json; + } + } + else + { + response_json["success"] = false; + response_json["message"] = "get_device_list failed"; + } + } + else if (command == String("get_device_status")) + { + if (not input_json.containsKey("device_id")) + { + response_json["success"] = false; + response_json["message"] = "device_id key not found for get_device_status"; + } + else + { + String device_id = input_json["device_id"]; + std::optional ret = get_device_status(token, secret, device_id); + if (ret) + { + DeserializationError error = deserializeJson(result_json, ret.value().c_str()); + if (error) + { + response_json["success"] = false; + response_json["message"] = "deserializeJson() failed during get_device_status: " + String(error.c_str()) + ", ret: " + ret.value(); + } + else + { + response_json["success"] = true; + response_json["message"] = "get_device_status success"; + response_json["result"] = result_json; + } + } + else + { + response_json["success"] = false; + response_json["message"] = "get_device_status failed"; + } + } + } + else if (command == "send_device_command") + { + if (not input_json.containsKey("device_id") or not input_json.containsKey("sb_command_type") or not input_json.containsKey("sb_command")) + { + response_json["success"] = false; + response_json["message"] = "device_id or sb_command_type or sb_command key not found for send_device_command"; + } + else + { + String device_id = input_json["device_id"]; + String sb_command_type = input_json["sb_command_type"]; + String sb_command = input_json["sb_command"]; + std::optional ret = send_device_command(token, secret, device_id, sb_command_type, sb_command); + if (ret) + { + DeserializationError error = deserializeJson(result_json, ret.value().c_str()); + if (error) + { + response_json["success"] = false; + response_json["message"] = "deserializeJson() failed during send_device_command: " + String(error.c_str()) + ", ret: " + ret.value(); + } + else + { + response_json["success"] = true; + response_json["message"] = "send_device_command success"; + response_json["result"] = result_json; + } + } + else + { + response_json["success"] = false; + response_json["message"] = "send_device_command failed"; + } + } + } + else if (command == "get_time") + { + uint32_t t = (uint32_t)std::time(nullptr); + response_json["success"] = true; + response_json["message"] = "get_time success: " + String(t); + } + else if (command == String("config_wifi")) + { + if (not input_json.containsKey("ssid") or not input_json.containsKey("password")) + { + response_json["success"] = false; + response_json["message"] = "ssid or password key not found"; + } + else + { + String new_ssid = input_json["ssid"].as(); + String new_password = input_json["password"].as(); + if (new_ssid != "") + ssid = new_ssid; + if (new_password != "") + password = new_password; + bool success = initWiFi(ssid.c_str(), password.c_str(), sprite_event_info, lcd, WiFiMulti); + String message; + if (success) + { + message = "config_wifi success. SSID: " + ssid + ", password: " + password + ", IP: " + WiFi.localIP().toString(); + } + else + { + message = "config_wifi failed"; + } + response_json["success"] = success; + response_json["message"] = message; + } + } + else if (command == String("config_switchbot")) + { + if (not input_json.containsKey("token") or not input_json.containsKey("secret")) + { + response_json["success"] = false; + response_json["message"] = "token or secret key not found"; + } + else + { + token = input_json["token"].as(); + secret = input_json["secret"].as(); + response_json["success"] = true; + response_json["message"] = "config_switchbot success"; + } + } + else if (command == String("get_device_config")) + { + result_json["ssid"] = ssid; + result_json["password"] = password; + result_json["token"] = token; + result_json["secret"] = secret; + result_json["ip"] = WiFi.localIP().toString(); + response_json["success"] = true; + response_json["message"] = "get_device_config success"; + response_json["result"] = result_json; + } + else + { + response_json["success"] = false; + response_json["message"] = "Unknown command error: " + command; + } + USBSerial.printf("response_json: %s\n", response_json.as().c_str()); + show_device_info((String("response_json") + response_json.as()).c_str(), sprite_event_info, lcd); + Serial2.printf("%s\n", response_json.as().c_str()); + } +} diff --git a/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/test/README b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/m5atoms3_switchbot_client/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sample_aes_cmac/.gitignore b/smart_device_protocol/sketchbooks/sample_aes_cmac/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_aes_cmac/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sample_aes_cmac/include/README b/smart_device_protocol/sketchbooks/sample_aes_cmac/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_aes_cmac/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sample_aes_cmac/platformio.ini b/smart_device_protocol/sketchbooks/sample_aes_cmac/platformio.ini new file mode 100644 index 000000000..e14dc3844 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_aes_cmac/platformio.ini @@ -0,0 +1,22 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-atoms3] +platform = espressif32 +board = m5stack-atoms3 +framework = arduino +lib_ldf_mode = deep +lib_deps = + obsttube/AES_CMAC @ ^1.0.0 + operatorfoundation/Crypto @ ^0.4.0 +build_flags = + ; -DARDUINO_USB_CDC_ON_BOOT=1 + ; -DARDUINO_USB_MODE=1 +monitor_speed = 115200 diff --git a/smart_device_protocol/sketchbooks/sample_aes_cmac/src/main.cpp b/smart_device_protocol/sketchbooks/sample_aes_cmac/src/main.cpp new file mode 100644 index 000000000..cf1bfa80d --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_aes_cmac/src/main.cpp @@ -0,0 +1,116 @@ +// AES_CMAC library example +// by Industrial Shields + +#include + +// Required AES.h from arduino Crypto library https://www.arduino.cc/reference/en/libraries/crypto/ +#include + +// Key and data from https://tools.ietf.org/html/rfc4493#section-4 +const uint8_t key[16] = { + 0x2b, + 0x7e, + 0x15, + 0x16, + 0x28, + 0xae, + 0xd2, + 0xa6, + 0xab, + 0xf7, + 0x15, + 0x88, + 0x09, + 0xcf, + 0x4f, + 0x3c, +}; +const uint8_t data_raw[] = { + 0x6b, + 0xc1, + 0xbe, + 0xe2, + 0x2e, + 0x40, + 0x9f, + 0x96, + 0xe9, + 0x3d, + 0x7e, + 0x11, + 0x73, + 0x93, + 0x17, + 0x2a, + 0xae, + 0x2d, + 0x8a, + 0x57, + 0x1e, + 0x03, + 0xac, + 0x9c, + 0x9e, + 0xb7, + 0x6f, + 0xac, + 0x45, + 0xaf, + 0x8e, + 0x51, + 0x30, + 0xc8, + 0x1c, + 0x46, + 0xa3, + 0x5c, + 0xe4, + 0x11, +}; + +// The output +uint8_t mac[16]; + +AESTiny128 aes128; +AES_CMAC cmac(aes128); + +//////////////////////////////////////////////////////////////////////////////////////////////////// +void setup() +{ + USBSerial.begin(115200); + delay(1000); + USBSerial.println("AES_CMAC example"); + + // Generate the MAC from data_raw, using the key. The result is stored into mac + cmac.generateMAC(mac, key, data_raw, sizeof(data_raw)); + + // Print the result + USBSerial.print("MAC: "); + for (int i = 0; i < sizeof(mac); ++i) + { + if (mac[i] < 0x10) + { + USBSerial.print('0'); + } + USBSerial.print(mac[i], HEX); + USBSerial.print(' '); + } + USBSerial.println(); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +void loop() +{ + delay(100); + USBSerial.print("MAC: "); + for (int i = 0; i < sizeof(mac); ++i) + { + if (mac[i] < 0x10) + { + USBSerial.print('0'); + } + USBSerial.print(mac[i], HEX); + USBSerial.print(' '); + } + USBSerial.println(); +} \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sample_aes_cmac/test/README b/smart_device_protocol/sketchbooks/sample_aes_cmac/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_aes_cmac/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/.gitignore b/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/include/README b/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/platformio.ini b/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/platformio.ini new file mode 100644 index 000000000..7fc93ac67 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/platformio.ini @@ -0,0 +1,17 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-fire] +platform = espressif32 +board = m5stack-fire +framework = arduino +lib_deps = + m5stack/M5Stack@^0.4.3 + lovyan03/LovyanGFX@^0.4.18 diff --git a/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/src/main.cpp b/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/src/main.cpp new file mode 100644 index 000000000..04ad6cd4f --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/src/main.cpp @@ -0,0 +1,105 @@ +#define LGFX_M5STACK +#define LGFX_USE_V1 +#include +#include +#include + +#include +#include +#include + +static LGFX lcd; +static LGFX_Sprite sprite_device_info(&lcd); +static LGFX_Sprite sprite_packet_info(&lcd); +static LGFX_Sprite sprite_send_result(&lcd); + +uint8_t mac_address[6] = {0}; +const char message[] = "Hello, World!"; +esp_now_peer_info_t peer_broadcast; + +void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) { + sprite_packet_info.fillScreen(0xFFFFFF); + sprite_packet_info.setCursor(0, 0); + sprite_packet_info.print("Last Packet Sent to: "); + sprite_packet_info.printf("%02X:%02X:%02X:%02X:%02X:%02X\n", mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); + sprite_packet_info.print("Last Packet Send Status: "); + sprite_packet_info.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail"); +} + +void setup() { + Serial.begin(115200); + + esp_read_mac(mac_address, ESP_MAC_WIFI_STA); + + lcd.init(); + lcd.setRotation(1); + lcd.setBrightness(128); + lcd.setColorDepth(24); + lcd.fillScreen(0xFFFFFF); + + sprite_device_info.createSprite(300, 50); + sprite_packet_info.createSprite(300, 50); + sprite_send_result.createSprite(300, 50); + + sprite_device_info.fillScreen(0xFFFFFF); + sprite_device_info.setTextColor(0x000000); + sprite_packet_info.fillScreen(0xFFFFFF); + sprite_packet_info.setTextColor(0x000000); + sprite_send_result.fillScreen(0xFFFFFF); + sprite_send_result.setTextColor(0x000000); + + sprite_device_info.println("ESP_NOW broadcast example"); + sprite_device_info.printf( + "MAC: %02X:%02X:%02X:%02X:%02X:%02X", + mac_address[0], + mac_address[1], + mac_address[2], + mac_address[3], + mac_address[4], + mac_address[5] + ); + sprite_device_info.pushSprite(0, 0); + + sprite_packet_info.pushSprite(0, 60); + sprite_send_result.pushSprite(0, 120); + + // ESP-NOW初期化 + WiFi.mode(WIFI_STA); + WiFi.disconnect(); + if (not esp_now_init() == ESP_OK) { + ESP.restart(); + } + + memset(&peer_broadcast, 0, sizeof(peer_broadcast)); + for (int i = 0; i < 6; ++i) { + peer_broadcast.peer_addr[i] = (uint8_t)0xff; + } + esp_err_t addStatus = esp_now_add_peer(&peer_broadcast); + + esp_now_register_send_cb(OnDataSent); +} +void loop() { + Serial.println("Broadcasted!"); + esp_err_t result = esp_now_send(peer_broadcast.peer_addr, (uint8_t*)message, sizeof(message)); + sprite_send_result.fillScreen(0xFFFFFF); + sprite_send_result.setCursor(0, 0); + sprite_send_result.print("Send Status: "); + if (result == ESP_OK) { + sprite_send_result.println("Success"); + } else if (result == ESP_ERR_ESPNOW_NOT_INIT) { + sprite_send_result.println("ESPNOW not Init."); + } else if (result == ESP_ERR_ESPNOW_ARG) { + sprite_send_result.println("Invalid Argument"); + } else if (result == ESP_ERR_ESPNOW_INTERNAL) { + sprite_send_result.println("Internal Error"); + } else if (result == ESP_ERR_ESPNOW_NO_MEM) { + sprite_send_result.println("ESP_ERR_ESPNOW_NO_MEM"); + } else if (result == ESP_ERR_ESPNOW_NOT_FOUND) { + sprite_send_result.println("Peer not found."); + } else { + sprite_send_result.println("Not sure what happened"); + } + sprite_packet_info.pushSprite(0, 60); + sprite_send_result.pushSprite(0, 120); + delay(5000); +} diff --git a/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/test/README b/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_esp_now_broadcaster/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sample_esp_now_receiver/.gitignore b/smart_device_protocol/sketchbooks/sample_esp_now_receiver/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_esp_now_receiver/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sample_esp_now_receiver/include/README b/smart_device_protocol/sketchbooks/sample_esp_now_receiver/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_esp_now_receiver/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sample_esp_now_receiver/platformio.ini b/smart_device_protocol/sketchbooks/sample_esp_now_receiver/platformio.ini new file mode 100644 index 000000000..7fc93ac67 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_esp_now_receiver/platformio.ini @@ -0,0 +1,17 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-fire] +platform = espressif32 +board = m5stack-fire +framework = arduino +lib_deps = + m5stack/M5Stack@^0.4.3 + lovyan03/LovyanGFX@^0.4.18 diff --git a/smart_device_protocol/sketchbooks/sample_esp_now_receiver/src/main.cpp b/smart_device_protocol/sketchbooks/sample_esp_now_receiver/src/main.cpp new file mode 100644 index 000000000..2a516feea --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_esp_now_receiver/src/main.cpp @@ -0,0 +1,84 @@ +#define LGFX_M5STACK +#define LGFX_USE_V1 +#include +#include +#include + +#include +#include +#include + +static LGFX lcd; +static LGFX_Sprite sprite_device_info(&lcd); +static LGFX_Sprite sprite_packet_info(&lcd); + +uint8_t mac_address[6] = {0}; + +void OnDataRecv(const uint8_t *mac_addr, const uint8_t *data, int data_len) { + sprite_packet_info.fillScreen(0xFFFFFF); + sprite_packet_info.setCursor(0, 0); + sprite_packet_info.print("Last Packet Recv from: "); + sprite_packet_info.printf("%02X:%02X:%02X:%02X:%02X:%02X\n", mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); + sprite_packet_info.printf("Last Packet Recv Data(%d) (HEX): ", data_len); + for ( int i = 0; i < data_len; i++ ) { + sprite_packet_info.printf("%#d ", data[i]); + } + sprite_packet_info.println(""); + sprite_packet_info.printf("Last Packet Recv Data(%d) (string): ", data_len); + for ( int i = 0; i < data_len; i++ ) { + sprite_packet_info.printf("%c", (char)data[i]); + } + sprite_packet_info.println(""); +} + +void setup() { + Serial.begin(115200); + + esp_read_mac(mac_address, ESP_MAC_WIFI_STA); + + lcd.init(); + lcd.setRotation(1); + lcd.setBrightness(128); + lcd.setColorDepth(24); + lcd.fillScreen(0xFFFFFF); + + sprite_device_info.createSprite(320, 50); + sprite_packet_info.createSprite(320, 150); + + sprite_device_info.fillScreen(0xFFFFFF); + sprite_device_info.setTextColor(0x000000); + sprite_device_info.setTextSize(1.5, 1.5); + sprite_packet_info.fillScreen(0xFFFFFF); + sprite_packet_info.setTextColor(0x000000); + //sprite_packet_info.setTextSize(1.5, 1.5) + + sprite_device_info.println("ESP_NOW broadcast example"); + sprite_device_info.printf( + "MAC: %02X:%02X:%02X:%02X:%02X:%02X", + mac_address[0], + mac_address[1], + mac_address[2], + mac_address[3], + mac_address[4], + mac_address[5] + ); + sprite_device_info.pushSprite(0, 0); + sprite_packet_info.pushSprite(0, 50); + + // ESP-NOW初期化 + WiFi.mode(WIFI_STA); + WiFi.disconnect(); + if (not esp_now_init() == ESP_OK) { + ESP.restart(); + } + + // Register Callback + esp_now_register_recv_cb(OnDataRecv); + + lcd.startWrite(); +} +void loop() { + sprite_packet_info.pushSprite(0, 50); + Serial.println("Update LCD!"); + delay(100); +} diff --git a/smart_device_protocol/sketchbooks/sample_esp_now_receiver/test/README b/smart_device_protocol/sketchbooks/sample_esp_now_receiver/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_esp_now_receiver/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sample_sesami/.gitignore b/smart_device_protocol/sketchbooks/sample_sesami/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_sesami/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sample_sesami/include/README b/smart_device_protocol/sketchbooks/sample_sesami/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_sesami/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sample_sesami/platformio.ini b/smart_device_protocol/sketchbooks/sample_sesami/platformio.ini new file mode 100644 index 000000000..30f820e31 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_sesami/platformio.ini @@ -0,0 +1,28 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-atoms3] +platform = espressif32 +board = m5stack-atoms3 +framework = arduino +lib_ldf_mode=deep ; https://github.com/me-no-dev/ESPAsyncWebServer/issues/520 +lib_deps = + m5stack/M5AtomS3@^0.0.3 + fastled/FastLED@^3.4.0 + obsttube/AES_CMAC @ ^1.0.0 + operatorfoundation/Crypto @ ^0.4.0 +build_flags = + -std=gnu++17 + ; -DARDUINO_USB_CDC_ON_BOOT=1 + ; -DARDUINO_USB_MODE=1 + ; https://lang-ship.com/blog/work/m5stack-atoms3-2/#toc2 +build_unflags = + -std=gnu++11 +monitor_speed = 115200 \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sample_sesami/src/main.cpp b/smart_device_protocol/sketchbooks/sample_sesami/src/main.cpp new file mode 100644 index 000000000..874889a3a --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_sesami/src/main.cpp @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include + +#include "iot_com_util/Time.h" +#include "web_services/sesami_util.h" + +const char *ssid = ""; +const char *password = ""; +WiFiMulti WiFiMulti; + +String device_uuid = ""; +String secret_key = ""; +String api_key = ""; + +void setup() +{ + int sum = 0; + M5.begin(true, true, false, false); + WiFiMulti.addAP(ssid, password); + M5.lcd.printf("Waiting connect to WiFi: %s ...", ssid); + while (WiFiMulti.run() != WL_CONNECTED) + { + M5.lcd.print("."); + delay(1000); + sum += 1; + if (sum == 8) + M5.lcd.print("Conncet failed!"); + } + M5.lcd.println("\nWiFi connected"); + M5.lcd.print("IP address: "); + M5.lcd.println(WiFi.localIP()); + delay(500); + + Time.set_time(); +} + +void loop() +{ + delay(1000); + get_sesami_status( + device_uuid, + api_key); + USBSerial.println(); + + delay(1000); + get_sesami_history( + device_uuid, + api_key); + USBSerial.println(); + + delay(1000); + operation_sesami( + device_uuid, + api_key, + 88, + secret_key); + USBSerial.println(); +} diff --git a/smart_device_protocol/sketchbooks/sample_sesami/test/README b/smart_device_protocol/sketchbooks/sample_sesami/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_sesami/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sample_uwb/.gitignore b/smart_device_protocol/sketchbooks/sample_uwb/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_uwb/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sample_uwb/README.md b/smart_device_protocol/sketchbooks/sample_uwb/README.md new file mode 100644 index 000000000..4dfd4fa51 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_uwb/README.md @@ -0,0 +1,6 @@ +# smart_device_protocol + +Support + +- M5Stack Fire +- M5Stack Core2 diff --git a/smart_device_protocol/sketchbooks/sample_uwb/include/README b/smart_device_protocol/sketchbooks/sample_uwb/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_uwb/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sample_uwb/platformio.ini b/smart_device_protocol/sketchbooks/sample_uwb/platformio.ini new file mode 100644 index 000000000..f53b2ebf7 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_uwb/platformio.ini @@ -0,0 +1,26 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-atoms3] +platform = espressif32 +board = m5stack-atoms3 +framework = arduino +lib_ldf_mode = deep +lib_deps = + lovyan03/LovyanGFX @ ^1.1.2 + ; m5stack/M5AtomS3 @ ^0.0.3 + ; fastled/FastLED @ ^3.6.0 +build_flags = + -DARDUINO_USB_CDC_ON_BOOT=1 + -DARDUINO_USB_MODE=1 + -std=gnu++17 +build_unflags = + -std=gnu++11 +monitor_speed = 115200 \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sample_uwb/src/main.cpp b/smart_device_protocol/sketchbooks/sample_uwb/src/main.cpp new file mode 100644 index 000000000..c1d4d4b1a --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_uwb/src/main.cpp @@ -0,0 +1,75 @@ +#include +#include + +#include +#include + +#define LGFX_AUTODETECT +#include +#include + +#include "devices/uwb_module_util.h" + +static LGFX lcd; +static LGFX_Sprite sprite_device_info(&lcd); +static LGFX_Sprite sprite_event_info(&lcd); + +void setup() +{ + // Read device mac address + uint8_t device_mac_address[6] = {0}; + esp_read_mac(device_mac_address, ESP_MAC_WIFI_STA); + + // LCD Initialization + lcd.init(); + lcd.setRotation(1); + lcd.setBrightness(128); + lcd.setColorDepth(24); + lcd.fillScreen(0xFFFFFF); + + sprite_device_info.createSprite(lcd.width(), lcd.height() / 3); + sprite_event_info.createSprite(lcd.width(), lcd.height() * 2 / 3); + + sprite_device_info.fillScreen(0xFFFFFF); + sprite_device_info.setTextColor(0x000000); + sprite_device_info.setTextSize(1.0, 1.0); + sprite_event_info.setTextSize(1.0, 1.0); + sprite_event_info.fillScreen(0xFFFFFF); + sprite_event_info.setTextColor(0x000000); + + sprite_device_info.println("SDP UWB Sample"); + sprite_device_info.printf("MAC ADDR: %02X:%02X:%02X:%02X:%02X:%02X\n", device_mac_address[0], device_mac_address[1], + device_mac_address[2], device_mac_address[3], device_mac_address[4], device_mac_address[5]); + sprite_device_info.pushSprite(0, 0); + + Serial.begin(115200); + Serial2.begin(115200, SERIAL_8N1, 1, 2); + delay(100); + + // initUWB(true, 0); + initUWB(false, 1, Serial2); +} + +void loop() +{ + delay(100); + auto ret = readUWB(Serial2); + if (ret) + { + Serial.println(*ret); + + sprite_event_info.fillScreen(0xFFFFFF); + sprite_event_info.setCursor(0, 0); + sprite_event_info.println(*ret); + sprite_event_info.pushSprite(0, lcd.height() / 3); + } + else + { + Serial.println("No response"); + + sprite_event_info.fillScreen(0xFFFFFF); + sprite_event_info.setCursor(0, 0); + sprite_event_info.println("No response"); + sprite_event_info.pushSprite(0, lcd.height() / 3); + } +} diff --git a/smart_device_protocol/sketchbooks/sample_uwb/test/README b/smart_device_protocol/sketchbooks/sample_uwb/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sample_uwb/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sdp_debug_board/.gitignore b/smart_device_protocol/sketchbooks/sdp_debug_board/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_debug_board/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sdp_debug_board/README.md b/smart_device_protocol/sketchbooks/sdp_debug_board/README.md new file mode 100644 index 000000000..af98b4503 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_debug_board/README.md @@ -0,0 +1,7 @@ +# enr_message_board + +## How to burn + +```bash +pio run +``` diff --git a/smart_device_protocol/sketchbooks/sdp_debug_board/include/README b/smart_device_protocol/sketchbooks/sdp_debug_board/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_debug_board/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sdp_debug_board/include/epd.h b/smart_device_protocol/sketchbooks/sdp_debug_board/include/epd.h new file mode 100644 index 000000000..c678f3901 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_debug_board/include/epd.h @@ -0,0 +1,33 @@ +#include + +void clear_epd(M5EPD_Canvas &canvas) +{ + canvas.clear(); + canvas.setCursor(0, 0); +} + +void init_epd(M5EPD_Canvas &canvas_title, M5EPD_Canvas &canvas_info, M5EPD_Canvas &canvas_device_interfaces, M5EPD_Canvas &canvas_data_frame) +{ + canvas_title.createCanvas(540, 100); + canvas_info.createCanvas(540, 60); + canvas_device_interfaces.createCanvas(540, 300); + canvas_data_frame.createCanvas(540, 500); + + canvas_title.setTextSize(3); + canvas_info.setTextSize(2); + canvas_device_interfaces.setTextSize(2); + canvas_data_frame.setTextSize(2); + + clear_epd(canvas_title); + clear_epd(canvas_info); + clear_epd(canvas_device_interfaces); + clear_epd(canvas_data_frame); +} + +void update_epd(M5EPD_Canvas &canvas_title, M5EPD_Canvas &canvas_info, M5EPD_Canvas &canvas_device_interfaces, M5EPD_Canvas &canvas_data_frame) +{ + canvas_title.pushCanvas(0, 0, UPDATE_MODE_DU4); + canvas_info.pushCanvas(0, 100, UPDATE_MODE_DU4); + canvas_device_interfaces.pushCanvas(0, 160, UPDATE_MODE_DU4); + canvas_data_frame.pushCanvas(0, 460, UPDATE_MODE_DU4); +} diff --git a/smart_device_protocol/sketchbooks/sdp_debug_board/platformio.ini b/smart_device_protocol/sketchbooks/sdp_debug_board/platformio.ini new file mode 100644 index 000000000..7fd943b5c --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_debug_board/platformio.ini @@ -0,0 +1,20 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-fire] +platform = espressif32 +board = m5stack-fire +framework = arduino +lib_deps = + m5stack/M5EPD @ ^0.1.4 + bblanchon/ArduinoJson @ ^6.21.3 +monitor_speed = 115200 +build_flags = -std=gnu++17 +build_unflags = -std=gnu++11 diff --git a/smart_device_protocol/sketchbooks/sdp_debug_board/src/main.cpp b/smart_device_protocol/sketchbooks/sdp_debug_board/src/main.cpp new file mode 100644 index 000000000..f84741a3a --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_debug_board/src/main.cpp @@ -0,0 +1,177 @@ +#include + +#include + +#include "sdp/sdp.h" +#include "utils/config_loader.h" + +#include "epd.h" + +String device_name = "SDP_DEBUG_BOARD"; +unsigned long duration_timeout = 30 * 1000; + +// EPD Canvas +M5EPD_Canvas canvas_title(&M5.EPD); +M5EPD_Canvas canvas_info(&M5.EPD); +M5EPD_Canvas canvas_device_interfaces(&M5.EPD); +M5EPD_Canvas canvas_data_frame(&M5.EPD); + +uint8_t mac_address[6] = {0}; + +// SDP Packet Buffer +const int packets_buffer_length = 5; +std::vector>> data_packets; + +// Other +int loop_counter = 0; + +void callback_data_packet(const uint8_t *mac_addr, const SDPInterfaceDescription &interface_description, const std::vector &body) +{ + if (data_packets.size() >= packets_buffer_length) + { + data_packets.erase(data_packets.begin()); + } + data_packets.push_back(std::make_tuple(millis(), interface_description, body)); +} + +void load_config() +{ + StaticJsonDocument<1024> doc; + if (not load_json_from_FS<1024>(SD, "/config.json", doc)) + { + return; + } + if (doc.containsKey("device_name")) + device_name = doc["device_name"].as(); + if (doc.containsKey("timeout_sec")) + duration_timeout = (unsigned long)(doc["timeout_sec"].as()) * 1000; +} + +void setup() +{ + M5.begin(false, true, true, true, false); + M5.EPD.SetRotation(90); + M5.EPD.Clear(true); + M5.RTC.begin(); + + // Initialization of EPD + init_epd(canvas_title, canvas_info, canvas_device_interfaces, canvas_data_frame); + canvas_title.printf("SDP PACKET PRINTER\n"); + canvas_info.printf("Display initialized!\n"); + update_epd(canvas_title, canvas_info, canvas_device_interfaces, canvas_data_frame); + Serial.println("Display initialized!"); + + // Load config + load_config(); + + // Initialization of SDP + if (not init_sdp(mac_address, device_name.c_str())) + { + Serial.println("SDP Initialization failed!"); + canvas_info.printf("SDP Initialization failed!\n"); + update_epd(canvas_title, canvas_info, canvas_device_interfaces, canvas_data_frame); + while (true) + { + delay(1000); + } + } + register_sdp_data_callback(callback_data_packet); + Serial.println("SDP Initialized!"); + + // Show device info + canvas_title.printf("Name: %s\n", device_name.c_str()); + canvas_title.printf("ADDR: %2x:%2x:%2x:%2x:%2x:%2x\n", + mac_address[0], mac_address[1], mac_address[2], + mac_address[3], mac_address[4], mac_address[5]); + update_epd(canvas_title, canvas_info, canvas_device_interfaces, canvas_data_frame); +} + +void loop() +{ + Serial.println("loop"); + + // Show Battery voltage + uint32_t battery_voltage = M5.getBatteryVoltage(); + clear_epd(canvas_info); + if (loop_counter % 2 == 0) + { + canvas_info.printf("+ Battery: %u\n", battery_voltage); + } + else + { + canvas_info.printf("x Battery: %u\n", battery_voltage); + } + + // Remove expired data packets + unsigned long current_time = millis(); + for (auto it = data_packets.begin(); it != data_packets.end();) + { + if (current_time - std::get<0>(*it) > duration_timeout) + { + it = data_packets.erase(it); + } + else + { + ++it; + } + } + + // Show device interfaces + clear_epd(canvas_device_interfaces); + canvas_device_interfaces.printf("Device Interfaces:\n"); + auto device_interfaces = get_sdp_interfaces(); + for (auto it = device_interfaces.begin(); it != device_interfaces.end(); ++it) + { + canvas_device_interfaces.printf(" %s : %s\n", std::get<0>(*it).c_str(), std::get<1>(*it).c_str()); + int index = 0; + for (auto it_if = std::get<2>(*it).begin(); it_if != std::get<2>(*it).end(); ++it_if) + { + canvas_device_interfaces.printf(" PD[%d]: %s\n", index, std::get<0>(*it_if).c_str()); + canvas_device_interfaces.printf(" SF[%d]: %s\n", index, std::get<1>(*it_if).c_str()); + index++; + } + } + + // Show data packets + clear_epd(canvas_data_frame); + canvas_data_frame.printf("Data Packets:\n"); + for (auto it = data_packets.rbegin(); it != data_packets.rend(); ++it) + { + const unsigned long timestamp = std::get<0>(*it); + const SDPInterfaceDescription &interface_description = std::get<1>(*it); + const std::string packet_description = std::get<0>(interface_description); + const std::string serialization_format = std::get<1>(interface_description); + const std::vector &body = std::get<2>(*it); + canvas_data_frame.printf("=======================\n"); + canvas_data_frame.printf("Time passed: %f sec\n", 1.0 * (millis() - timestamp) / 1000.0); + canvas_data_frame.printf("Packet Description: %s\n", packet_description.c_str()); + canvas_data_frame.printf("Serialization Format: %s\n", serialization_format.c_str()); + canvas_data_frame.printf("Body:\n"); + for (auto itr = body.rbegin(); itr != body.rend(); itr++) + { + if (std::holds_alternative(*itr)) + { + canvas_data_frame.printf(" %d\n", std::get(*itr)); + } + else if (std::holds_alternative(*itr)) + { + canvas_data_frame.printf(" %f\n", std::get(*itr)); + } + else if (std::holds_alternative(*itr)) + { + canvas_data_frame.printf(" %s\n", std::get(*itr).c_str()); + } + else if (std::holds_alternative(*itr)) + { + canvas_data_frame.printf(" %s\n", std::get(*itr) ? "true" : "false"); + } + else + { + canvas_data_frame.printf(" unknown\n"); + } + } + } + + update_epd(canvas_title, canvas_info, canvas_device_interfaces, canvas_data_frame); + ++loop_counter; +} \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_debug_board/test/README b/smart_device_protocol/sketchbooks/sdp_debug_board/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_debug_board/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/.gitignore b/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/include/README b/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/platformio.ini b/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/platformio.ini new file mode 100644 index 000000000..ece7f8ba3 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/platformio.ini @@ -0,0 +1,22 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-core2] +platform = espressif32 +board = m5stack-core2 +framework = arduino +lib_deps = + m5stack/M5Core2 @ ^0.1.5 + lovyan03/LovyanGFX @ ^1.1.5 + bblanchon/ArduinoJson @ ^6.21.1 + infineon/DigitalPressureSensor @ ^1.0.6 +monitor_speed = 115200 +build_flags = -std=gnu++17 +build_unflags = -std=gnu++11 diff --git a/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/src/main.cpp b/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/src/main.cpp new file mode 100644 index 000000000..d9288b6a5 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/src/main.cpp @@ -0,0 +1,145 @@ +#include + +#include + +#include +#include +#include +#include + +#include "smart_device_protocol/Packet.h" +#include "sdp/sdp.h" +#include "utils/config_loader.h" + +static LGFX lcd; +static LGFX_Sprite sprite_header(&lcd); +static LGFX_Sprite sprite_status(&lcd); + +Dps310 Dps310PressureSensor = Dps310(); + +/* Sensor */ +float sensor_accX = 0.0F; +float sensor_accY = 0.0F; +float sensor_accZ = 0.0F; +float sensor_gyroX = 0.0F; +float sensor_gyroY = 0.0F; +float sensor_gyroZ = 0.0F; +float sensor_pitch = 0.0F; +float sensor_roll = 0.0F; +float sensor_yaw = 0.0F; +float sensor_temp_mpu = 0.0F; +float sensor_temp_dps = 0; +float sensor_pressure = 0; + +/* device */ +uint8_t device_mac_address[6]; +String device_name; + +/* Elevator config */ +typedef struct +{ + uint8_t floor_num; + float floor_height; +} ElevatorConfig; +std::vector elevator_config; + +bool load_config_from_FS(fs::FS &fs, const String &filename) +{ + StaticJsonDocument<1024> doc; + if (!load_json_from_FS<1024>(fs, filename, doc)) + { + return false; + } + + if (not doc.containsKey("device_name") or not doc.containsKey("elevator_config")) + { + return false; + } + + device_name = doc["device_name"].as(); + JsonArray elevator_config_json = doc["elevator_config"].as(); + for (auto itr = elevator_config_json.begin(); itr != elevator_config_json.end(); ++itr) + { + JsonObject e = *itr; + if (e.containsKey("floor_num") and e.containsKey("floor_height")) + { + ElevatorConfig ec; + ec.floor_num = e["floor_num"].as(); + ec.floor_height = e["floor_height"].as(); + elevator_config.push_back(ec); + } + } + return true; +} + +void init_lcd() +{ + // LCD + lcd.init(); + lcd.setRotation(1); + lcd.setBrightness(128); + lcd.setColorDepth(24); + lcd.fillScreen(0xFFFFFF); + + sprite_header.createSprite(lcd.width(), lcd.height() / 4); + sprite_status.createSprite(lcd.width(), lcd.height() * 3 / 4); + + sprite_header.fillScreen(0xFFFFFF); + sprite_header.setTextColor(0x000000); + sprite_header.setTextSize(1.5, 1.5); + sprite_status.fillScreen(0xFFFFFF); + sprite_status.setTextColor(0x000000); +} + +void measure_sensors() +{ + M5.IMU.getGyroData(&sensor_gyroX, &sensor_gyroY, &sensor_gyroZ); + M5.IMU.getAccelData(&sensor_accX, &sensor_accY, &sensor_accZ); + M5.IMU.getAhrsData(&sensor_pitch, &sensor_roll, &sensor_yaw); + M5.IMU.getTempData(&sensor_temp_mpu); + Dps310PressureSensor.measurePressureOnce(sensor_pressure); + Dps310PressureSensor.measureTempOnce(sensor_temp_dps); +} + +void setup() +{ + // Device Initialization + M5.begin(true, false, true, true); + Serial.begin(115200); + M5.IMU.Init(); + Dps310PressureSensor.begin(Wire, 0x77); + + // initialize LCD + init_lcd(); + + // Load config + SD.begin(); + SPIFFS.begin(); + if (not load_config_from_FS(SD, "/config.json")) + { + Serial.println("Failed to load config from SD"); + if (not load_config_from_FS(SPIFFS, "/config.json")) + { + Serial.println("Failed to load config from SPIFFS"); + while (true) + { + delay(1000); + } + } + } + + // Initialize ESP-NOW + init_sdp(device_mac_address, String("elevator_status")); + + // Print + sprite_header.println("ENR DPS310 Interface"); + sprite_header.printf("MAC ADDR: %02X:%02X:%02X:%02X:%02X:%02X\n", + device_mac_address[0], device_mac_address[1], device_mac_address[2], + device_mac_address[3], device_mac_address[4], device_mac_address[5]); + sprite_header.pushSprite(0, 0); +} + +void loop() +{ + measure_sensors(); +} diff --git a/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/test/README b/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_elevator_status_broadcaster/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sdp_example/.gitignore b/smart_device_protocol/sketchbooks/sdp_example/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_example/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sdp_example/include/README b/smart_device_protocol/sketchbooks/sdp_example/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_example/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sdp_example/include/lcd.h b/smart_device_protocol/sketchbooks/sdp_example/include/lcd.h new file mode 100644 index 000000000..d66ee9eb7 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_example/include/lcd.h @@ -0,0 +1,70 @@ +#include + +#include "sdp/sdp_util.h" + +void init_lcd(LGFX &lcd, LGFX_Sprite &sprite_1, LGFX_Sprite &sprite_2, LGFX_Sprite &sprite_3) +{ + lcd.init(); + lcd.setRotation(1); + lcd.setBrightness(128); + lcd.setColorDepth(24); + lcd.fillScreen(0xFFFFFF); + + sprite_1.createSprite(300, 50); + sprite_2.createSprite(300, 50); + sprite_3.createSprite(300, 50); + + sprite_1.fillScreen(0xFFFFFF); + sprite_1.setTextColor(0x000000); + sprite_2.fillScreen(0xFFFFFF); + sprite_2.setTextColor(0x000000); + sprite_3.fillScreen(0xFFFFFF); + sprite_3.setTextColor(0x000000); +} + +void update_lcd(LGFX_Sprite &sprite_1, LGFX_Sprite &sprite_2, LGFX_Sprite &sprite_3) +{ + sprite_1.pushSprite(0, 0); + sprite_2.pushSprite(0, 60); + sprite_3.pushSprite(0, 120); +} + +void clear_sprite(LGFX_Sprite &sprite) +{ + sprite.fillScreen(0xFFFFFF); + sprite.setCursor(0, 0); +} + +void print_sdp_body(LGFX_Sprite &sprite, const std::vector &body) +{ + std::string serialization_format = get_serialization_format(body); + auto itr = body.begin(); + int index_sf = 0; + while (itr != body.end()) + { + switch (serialization_format[index_sf]) + { + case 'i': + sprite.printf("%d: %d\n", index_sf, std::get(*itr)); + break; + case 'f': + sprite.printf("%d: %f\n", index_sf, std::get(*itr)); + break; + case 's': + sprite.printf("%d: %s\n", index_sf, std::get(*itr).c_str()); + break; + case 'S': + sprite.printf("%d: %s\n", index_sf, std::get(*itr).c_str()); + break; + case '?': + case 'b': + sprite.printf("%d: %s\n", index_sf, std::get(*itr) ? "true" : "false"); + break; + default: + sprite.printf("%d: %s\n", index_sf, "unknown"); + break; + } + ++itr; + ++index_sf; + } +} \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_example/platformio.ini b/smart_device_protocol/sketchbooks/sdp_example/platformio.ini new file mode 100644 index 000000000..15ab2950e --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_example/platformio.ini @@ -0,0 +1,24 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-fire] +; platform = https://github.com/platformio/platform-espressif32.git#v6.4.0 +; platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.14 +platform = espressif32 @ 5.3.0 +board = m5stack-fire +framework = arduino +lib_deps = + m5stack/M5Stack@^0.4.6 + lovyan03/LovyanGFX@^1.1.5 +build_flags = + -std=gnu++17 +build_unflags = + -std=gnu++11 +monitor_speed = 115200 \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_example/src/main.cpp b/smart_device_protocol/sketchbooks/sdp_example/src/main.cpp new file mode 100644 index 000000000..67bbdae03 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_example/src/main.cpp @@ -0,0 +1,107 @@ +#include + +#include "M5Stack.h" + +#define LGFX_M5STACK +#define LGFX_USE_V1 +#include +#include + +#include "sdp/sdp_util.h" + +#include "lcd.h" + +// Device name +String device_name = "sdp_sample"; + +// LovyanGFX +static LGFX lcd; +static LGFX_Sprite sprite_device_info(&lcd); +static LGFX_Sprite sprite_send_info(&lcd); +static LGFX_Sprite sprite_recieve_info(&lcd); + +// SDP +uint8_t mac_address[6] = {0}; + +// SDPInterface Example +SDPInterfaceDescription sample_interface_description = std::make_tuple("test interface", "sif?"); + +// SDPData Example +std::vector body_data; + +void callback_sdp_sample(std::vector &body) +{ + Serial.println("Callback: sdp_sample"); + Serial.printf("Received SDP Data for interface %s\n", std::get<0>(sample_interface_description).c_str()); + clear_sprite(sprite_recieve_info); + sprite_recieve_info.println("Received SDP Data for interface"); + print_sdp_body(sprite_recieve_info, body); + body_data[0] = body[0]; + body_data[1] = body[1]; + body_data[2] = body[2]; + body_data[3] = body[3]; +} + +void setup() +{ + M5.begin(false, true, true, false); + Serial.begin(115200); + + // Initialize LCD + init_lcd(lcd, sprite_device_info, sprite_send_info, sprite_recieve_info); + sprite_device_info.println("Smart Device Protocol Broadcast Example"); + sprite_device_info.println("Initializing..."); + update_lcd(sprite_device_info, sprite_send_info, sprite_recieve_info); + + // Initialize SDP + if (not init_sdp(mac_address, String("test"))) + { + Serial.println("Failed to initialize SDP"); + sprite_device_info.println("Failed to initialize SDP"); + update_lcd(sprite_device_info, sprite_send_info, sprite_recieve_info); + while (true) + { + delay(1000); + } + } + else + { + Serial.println("Initialized SDP"); + sprite_device_info.println("Initialized SDP"); + update_lcd(sprite_device_info, sprite_send_info, sprite_recieve_info); + } + + // Update Info Screen + sprite_device_info.printf("Device Name: %s", device_name.c_str()); + sprite_device_info.printf("MAC: %02X:%02X:%02X:%02X:%02X:%02X", + mac_address[0], mac_address[1], mac_address[2], + mac_address[3], mac_address[4], mac_address[5]); + update_lcd(sprite_device_info, sprite_send_info, sprite_recieve_info); + + // Packet + body_data.clear(); + body_data.push_back(SDPData(std::string("Hello, World!"))); + body_data.push_back(SDPData((int32_t)123)); + body_data.push_back(SDPData((float)123.456)); + body_data.push_back(SDPData(true)); +} + +void loop() +{ + delay(1000); + if (not send_sdp_data_packet(sample_interface_description, body_data)) + { + Serial.println("Failed to send SDP Data Body"); + clear_sprite(sprite_send_info); + sprite_send_info.println("Failed to send SDP Data Body."); + update_lcd(sprite_device_info, sprite_send_info, sprite_recieve_info); + } + else + { + Serial.println("Sent SDP Data Body"); + clear_sprite(sprite_send_info); + sprite_send_info.println("Sent SDP Data Body"); + print_sdp_body(sprite_send_info, body_data); + update_lcd(sprite_device_info, sprite_send_info, sprite_recieve_info); + } +} diff --git a/smart_device_protocol/sketchbooks/sdp_example/test/README b/smart_device_protocol/sketchbooks/sdp_example/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_example/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sdp_landmark_information/.gitignore b/smart_device_protocol/sketchbooks/sdp_landmark_information/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_landmark_information/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sdp_landmark_information/README.md b/smart_device_protocol/sketchbooks/sdp_landmark_information/README.md new file mode 100644 index 000000000..4aafa1c33 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_landmark_information/README.md @@ -0,0 +1,11 @@ +# SDP Switchbot Light + +## How to use + +Please connect m5stack_switchbot_client to port A and UWB module to portC. + +``` +git update-index --skip-worktree ./data +``` + +mofidy [config.json](./data/config.json) and burn it to m5stack-fire \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_landmark_information/data/config.json b/smart_device_protocol/sketchbooks/sdp_landmark_information/data/config.json new file mode 100644 index 000000000..26c8e8611 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_landmark_information/data/config.json @@ -0,0 +1,5 @@ +{ + "device_name": "SDP_LANDMARK_INFORMATION", + "information": "This is sample text", + "uwb_id": 1 +} diff --git a/smart_device_protocol/sketchbooks/sdp_landmark_information/include/README b/smart_device_protocol/sketchbooks/sdp_landmark_information/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_landmark_information/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sdp_landmark_information/platformio.ini b/smart_device_protocol/sketchbooks/sdp_landmark_information/platformio.ini new file mode 100644 index 000000000..9e583f222 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_landmark_information/platformio.ini @@ -0,0 +1,46 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-fire] +platform = espressif32 +board = m5stack-fire +framework = arduino +lib_ldf_mode = deep +lib_deps = + m5stack/M5Stack@^0.4.3 + bblanchon/ArduinoJson @ ^6.21.3 +build_flags = + -DM5STACK_FIRE + -std=gnu++17 + -DBOARD_HAS_PSRAM=0 +build_unflags = + -std=gnu++11 + -DBOARD_HAS_PSRAM + ; -mfix-esp32-psram-cache-issue + ; -mfix-esp32-psram-cache-strategy=memw +monitor_speed = 115200 + + +[env:m5core2] +platform = espressif32 +board = m5stack-core2 +framework = arduino +lib_ldf_mode = deep +lib_deps = + m5stack/M5Core2 + bblanchon/ArduinoJson @ ^6.21.3 +build_flags = + -DM5STACK_CORE2 + -std=gnu++17 + -DBOARD_HAS_PSRAM=0 +build_unflags = + -std=gnu++11 + -DBOARD_HAS_PSRAM +monitor_speed = 115200 \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_landmark_information/src/main.cpp b/smart_device_protocol/sketchbooks/sdp_landmark_information/src/main.cpp new file mode 100644 index 000000000..809eaaa0a --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_landmark_information/src/main.cpp @@ -0,0 +1,137 @@ +#include +#include + +#if defined(M5STACK_FIRE) +#include +#elif defined(M5STACK_CORE2) +#include +#endif +#include +#include + +#include + +#include + +#include +#include +#include + +// Device name +String device_name = ""; + +// ESP-NOW +uint8_t mac_address[6] = { 0 }; + +// SDP Interface +std::string packet_description_information = "Landmark information"; +std::string serialization_format_information = "S"; +std::vector data_for_information_data_packet; + +// UWB +int uwb_id = -1; +std::string packet_description_uwb = "UWB Station"; +std::string serialization_format_uwb = "i"; +std::vector data_for_uwb_data_packet; + +// Other +std::vector data; +int loop_counter = 0; + +bool load_config_from_FS(fs::FS& fs, String filename = "/config.json") +{ + StaticJsonDocument<1024> doc; + if (not load_json_from_FS<1024>(fs, filename, doc)) + { + return false; + } + if (not doc.containsKey("device_name") or not doc.containsKey("uwb_id") or not doc.containsKey("information")) + { + return false; + } + + device_name = doc["device_name"].as(); + uwb_id = doc["uwb_id"].as(); + String information_str = doc["information"].as(); + data_for_information_data_packet.push_back(SDPData(std::string(information_str.c_str()))); + + return true; +} + +void setup() +{ + M5.begin(true, true, true, false); + Serial.begin(115200); + Serial2.begin(115200, SERIAL_8N1, 22, 21); + + // LCD Print + M5.Lcd.printf("SDP LANDMARK INFORMATION HOST\n"); + + // Load config from FS + SPIFFS.begin(); + SD.begin(); + if (not load_config_from_FS(SD, "/config.json")) + { + if (not load_config_from_FS(SPIFFS, "/config.json")) + { + Serial.println("Failed to load config file"); + M5.lcd.printf("Failed to load config file\n"); + while (true) + { + delay(1000); + } + } + } + + // Initialization of SDP + if (not init_sdp(mac_address, device_name)) + { + Serial.println("Failed to initialize SDP"); + M5.lcd.printf("Failed to initialize SDP\n"); + while (true) + { + delay(1000); + } + } + Serial.println("SDP Initialized!"); + + // UWB module +#if defined(M5STACK_FIRE) + Serial1.begin(115200, SERIAL_8N1, 16, 17); +#elif defined(M5STACK_CORE2) + Serial1.begin(115200, SERIAL_8N1, 33, 32); +#endif + bool result = initUWB(false, uwb_id, Serial1); + data_for_uwb_data_packet.push_back(SDPData(uwb_id)); + if (result) + { + M5.lcd.printf("Success for initialization of UWB\n"); + } + else + { + M5.lcd.printf("Failed to initialize UWB\n"); + } + + // Display MAC address + M5.Lcd.printf("Name: %s\n", device_name.c_str()); + M5.Lcd.printf("ADDR: %2x:%2x:%2x:%2x:%2x:%2x\n", mac_address[0], mac_address[1], mac_address[2], mac_address[3], + mac_address[4], mac_address[5]); + + // Display loaded config + M5.Lcd.printf("UWB ID: %d\n", uwb_id); +} + +void loop() +{ + delay(5000); + + // Send SDP data packet + if (not send_sdp_data_packet(packet_description_information, data_for_information_data_packet)) + { + Serial.println("Failed to send SDP data packet"); + } + if (not send_sdp_data_packet(packet_description_uwb, data_for_uwb_data_packet)) + { + Serial.println("Failed to send SDP data packet"); + } +} diff --git a/smart_device_protocol/sketchbooks/sdp_landmark_information/test/README b/smart_device_protocol/sketchbooks/sdp_landmark_information/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_landmark_information/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sdp_sesami_host/.gitignore b/smart_device_protocol/sketchbooks/sdp_sesami_host/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_sesami_host/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sdp_sesami_host/README.md b/smart_device_protocol/sketchbooks/sdp_sesami_host/README.md new file mode 100644 index 000000000..64c20d083 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_sesami_host/README.md @@ -0,0 +1,10 @@ +# SDP Sesami Host + + +# How to use + +Connect m5atoms3_sesami_client to port A, UWB module to port C. + +Please update configuration. + +Please see https://partners.candyhouse.co/login/ for api key, secret key, and device uuid. \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_sesami_host/data/config.json b/smart_device_protocol/sketchbooks/sdp_sesami_host/data/config.json new file mode 100644 index 000000000..473caad8d --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_sesami_host/data/config.json @@ -0,0 +1,10 @@ +{ + "device_name": "SDP Sesami", + "wifi_ssid": "", + "wifi_password": "", + "sesami_device_uuid": "", + "sesami_secret_key": "", + "sesami_api_key": "", + "uwb_id": -1, + "comment": "this is configuration for sdp_sesami_host" +} \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_sesami_host/include/README b/smart_device_protocol/sketchbooks/sdp_sesami_host/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_sesami_host/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sdp_sesami_host/platformio.ini b/smart_device_protocol/sketchbooks/sdp_sesami_host/platformio.ini new file mode 100644 index 000000000..6d84ec3b1 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_sesami_host/platformio.ini @@ -0,0 +1,27 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-fire] +platform = espressif32 +board = m5stack-fire +framework = arduino +lib_ldf_mode = deep +lib_deps = + m5stack/M5Stack@^0.4.3 + bblanchon/ArduinoJson @ ^6.21.3 +build_flags = + -std=gnu++17 + -DBOARD_HAS_PSRAM=0 +build_unflags = + -std=gnu++11 + -DBOARD_HAS_PSRAM + ; -mfix-esp32-psram-cache-issue + ; -mfix-esp32-psram-cache-strategy=memw +monitor_speed = 115200 diff --git a/smart_device_protocol/sketchbooks/sdp_sesami_host/src/main.cpp b/smart_device_protocol/sketchbooks/sdp_sesami_host/src/main.cpp new file mode 100644 index 000000000..f124eef05 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_sesami_host/src/main.cpp @@ -0,0 +1,266 @@ +#include +#include + +#include +#include +#include + +#include + +#include +#include "sdp/sdp.h" +#include "devices/uwb_module_util.h" +#include "iot_com_util/iot_host_util.h" +#include "utils/config_loader.h" + +// Device name +String device_name = ""; + +// ESP-NOW +uint8_t mac_address[6] = {0}; + +// Interface +std::string packet_description_operation = "Key control"; +std::string serialization_format_operation = "s"; +SDPInterfaceDescription interface_description_operation = std::make_tuple(packet_description_operation, serialization_format_operation); + +// Key Status +std::string packet_description_key_status = "Key status"; +std::vector data_for_key_status_data_packet; + +// UWB +int uwb_id = -1; +std::string packet_description_uwb = "UWB Station"; +std::string serialization_format_uwb = "i"; +std::vector data_for_uwb_data_packet; + +// Switchbot Client Configuration +String wifi_ssid = ""; +String wifi_password = ""; +String sesami_device_uuid = ""; +String sesami_secret_key = ""; +String sesami_api_key = ""; + +// Other +std::vector data; +StaticJsonDocument<1024> result_json; +int loop_counter = 0; + +void get_key_status_and_update_buf() +{ + Serial.printf("Get key status\n"); + + String result = send_serial_command("{\"command\":\"status\"}\n"); + if (result.length() == 0) + { + Serial.println("Failed to get key status"); + return; + } + DeserializationError error = deserializeJson(result_json, result); + if (error or (result_json.containsKey("success") and not result_json["success"].as())) + { + Serial.printf("deserializeJson() failed or Failed to get key status: %s\n", error.c_str()); + return; + } + else + { + String status = result_json["result"]["CHSesami2Status"].as(); + bool locked = true ? status == "locked" : false; + data_for_key_status_data_packet.clear(); + data_for_key_status_data_packet.push_back(SDPData(locked)); + return; + } +} + +void show_device_config() +{ + String result = send_serial_command("{\"command\":\"get_device_config\"}\n"); + Serial.printf("Device config: %s\n", result.c_str()); +} + +bool load_config_from_FS(fs::FS &fs, String filename = "/config.json") +{ + StaticJsonDocument<1024> doc; + if (not load_json_from_FS<1024>(fs, filename, doc)) + { + return false; + } + if (not doc.containsKey("device_name") and + not doc.containsKey("wifi_ssid") and + not doc.containsKey("wifi_password") and + not doc.containsKey("sesami_device_uuid") and + not doc.containsKey("sesami_secret_key") and + not doc.containsKey("sesami_api_key") and + not doc.containsKey("uwb_id")) + { + return false; + } + + device_name = doc["device_name"].as(); + wifi_ssid = doc["wifi_ssid"].as(); + wifi_password = doc["wifi_password"].as(); + sesami_device_uuid = doc["sesami_device_uuid"].as(); + sesami_secret_key = doc["sesami_secret_key"].as(); + sesami_api_key = doc["sesami_api_key"].as(); + uwb_id = doc["uwb_id"].as(); + + return true; +} + +void callback_sesami_operation(const uint8_t *mac_address, const std::vector &body) +{ + std::string operation_key = std::get(body[0]); + Serial.printf("operation_key: %s\n", operation_key.c_str()); + Serial.printf("operation_key length: %d\n", operation_key.length()); + if (operation_key == "lock") + { + Serial.printf("Lock the key\n"); + String ret = send_serial_command("{\"command\":\"lock\"}\n"); + Serial.printf("Response: %s\n", ret.c_str()); + } + else if (operation_key == "unlock") + { + Serial.printf("Unlock the key\n"); + String ret = send_serial_command("{\"command\":\"unlock\"}\n"); + Serial.printf("Response: %s\n", ret.c_str()); + } + else + { + Serial.printf("Unknown operation key\n"); + } + Serial.printf("Key control command done\n"); +} + +void setup() +{ + esp_read_mac(mac_address, ESP_MAC_WIFI_STA); + + M5.begin(true, true, true, false); + Serial.begin(115200); + Serial1.begin(115200, SERIAL_8N1, 16, 17); + Serial2.begin(115200, SERIAL_8N1, 22, 21); + + M5.Lcd.printf("SDP SESAMI HOST DEVICE\n"); + + // Load config from FS + SPIFFS.begin(); + SD.begin(); + if (not load_config_from_FS(SD, "/config.json")) + { + if (not load_config_from_FS(SPIFFS, "/config.json")) + { + Serial.println("Failed to load config file"); + M5.Lcd.printf("Failed to load config file\n"); + while (true) + { + delay(1000); + } + } + } + + // Initialization of SDP + if (not init_sdp(mac_address, device_name)) + { + Serial.println("Failed to initialize SDP"); + M5.lcd.printf("Failed to initialize SDP\n"); + while (true) + { + delay(1000); + } + } + register_sdp_interface_callback(interface_description_operation, callback_sesami_operation); + Serial.println("SDP Initialized!"); + + // Print info + M5.Lcd.printf("Name: %s\n", device_name.c_str()); + M5.Lcd.printf("ADDR: %2x:%2x:%2x:%2x:%2x:%2x\n", mac_address[0], mac_address[1], mac_address[2], mac_address[3], + mac_address[4], mac_address[5]); + + // UWB module + bool result = initUWB(false, uwb_id, Serial1); + data_for_uwb_data_packet.clear(); + data_for_uwb_data_packet.push_back(SDPData(uwb_id)); + + // WiFi Configuration + String ret = send_serial_command( + String("") + + "{\"command\":\"config_wifi\"," + + "\"ssid\":\"" + wifi_ssid + "\"," + + "\"password\":\"" + wifi_password + "\"}\n", + 20000); + Serial.printf("Response for wifi config: %s\n", ret.c_str()); + + // Sesami Client Configuration + ret = send_serial_command( + String("") + + "{\"command\":\"config_sesami\"," + + "\"device_uuid\":\"" + sesami_device_uuid + "\"," + + "\"secret_key\":\"" + sesami_secret_key + "\"," + + "\"api_key\":\"" + sesami_api_key + "\"}\n", + 5000); + Serial.printf("Response for sesami config: %s\n", ret.c_str()); + + // Show device config + show_device_config(); +} + +void loop() +{ + delay(5000); + + // Run dummy callback if Serial available + if (Serial.available()) + { + uint8_t buf_dummy[240]; + std::vector data_dummy; + data_dummy.clear(); + String str = Serial.readStringUntil('\n'); + Serial.printf("Input: %s\n", str.c_str()); + if (str.indexOf("unlock") != -1) + { + data_dummy.push_back(SDPData(std::string("unlock"))); + } + else if (str.indexOf("lock") != -1) + { + data_dummy.push_back(SDPData(std::string("lock"))); + } + else + { + Serial.println("Unknown command"); + return; + } + Serial.println("Generate data frame"); + std::string serialization_format = get_serialization_format(data_dummy); + Serial.printf("serialization_format: %s\n", serialization_format.c_str()); + bool ret = generate_data_frame( + buf_dummy, + packet_description_operation.c_str(), + data_dummy); + if (not ret) + { + Serial.println("Failed to generate data frame"); + return; + } + Serial.printf("Dummy callback calling\n"); + _OnDataRecv(NULL, buf_dummy, sizeof(buf_dummy)); + Serial.printf("Dummy callback done\n"); + return; + } + + // Send SDP data packet + if (not send_sdp_data_packet(packet_description_key_status, data_for_key_status_data_packet)) + { + Serial.println("Failed to send SDP data packet"); + } + if (not send_sdp_data_packet(packet_description_uwb, data_for_uwb_data_packet)) + { + Serial.println("Failed to send SDP data packet"); + } + + if (loop_counter % 50 == 0) + { + get_key_status_and_update_buf(); + } + + loop_counter++; +} diff --git a/smart_device_protocol/sketchbooks/sdp_sesami_host/test/README b/smart_device_protocol/sketchbooks/sdp_sesami_host/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_sesami_host/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sdp_stickv2_interface/.gitignore b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sdp_stickv2_interface/data/config.json b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/data/config.json new file mode 100644 index 000000000..7eaf73d26 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/data/config.json @@ -0,0 +1,6 @@ +{ + "device_name": "Person CAM", + "uwb_id": -1, + "threshold": 0.5, + "target_class": "person" +} \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_stickv2_interface/include/README b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sdp_stickv2_interface/include/lcd.h b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/include/lcd.h new file mode 100644 index 000000000..eacfc1c48 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/include/lcd.h @@ -0,0 +1,39 @@ +#include + +void clear_sprite(LGFX_Sprite &sprite) +{ + sprite.fillScreen(0xFFFFFF); + sprite.setCursor(0, 0); +} + +void init_lcd(LGFX &lcd, LGFX_Sprite &sprite_title, LGFX_Sprite &sprite_status, LGFX_Sprite &sprite_info) +{ + lcd.init(); + lcd.setRotation(1); + lcd.setBrightness(128); + lcd.setColorDepth(24); + lcd.fillScreen(0xFFFFFF); + + sprite_title.createSprite(320, 60); + sprite_status.createSprite(320, 60); + sprite_info.createSprite(320, 120); + + sprite_title.setTextColor(0x000000); + sprite_status.setTextColor(0x000000); + sprite_info.setTextColor(0x000000); + + sprite_title.setTextSize(1.2, 1.2); + sprite_status.setTextSize(1.0, 1.0); + sprite_info.setTextSize(1.0, 1.0); + + clear_sprite(sprite_title); + clear_sprite(sprite_status); + clear_sprite(sprite_info); +} + +void update_lcd(LGFX &lcd, LGFX_Sprite &sprite_title, LGFX_Sprite &sprite_status, LGFX_Sprite &sprite_info) +{ + sprite_title.pushSprite(0, 0); + sprite_status.pushSprite(0, 60); + sprite_info.pushSprite(0, 120); +} \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_stickv2_interface/platformio.ini b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/platformio.ini new file mode 100644 index 000000000..5342bd782 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/platformio.ini @@ -0,0 +1,23 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-core2] +platform = espressif32 +board = m5stack-core2 +framework = arduino +lib_deps = + m5stack/M5Core2 @ ^0.1.5 + lovyan03/LovyanGFX @ ^1.1.5 + bblanchon/ArduinoJson @ ^6.21.1 +monitor_speed = 115200 +build_flags = + -std=gnu++17 +build_unflags = + -std=gnu++11 \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_stickv2_interface/src/main.cpp b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/src/main.cpp new file mode 100644 index 000000000..381bca672 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/src/main.cpp @@ -0,0 +1,194 @@ +#include + +#include +#include +#include + +#include "sdp/sdp.h" +#include "utils/config_loader.h" +#include "devices/stickv2_util.h" +#include "devices/uwb_module_util.h" + +#include "lcd.h" + +// LovyanGFX +static LGFX lcd; +static LGFX_Sprite sprite_title(&lcd); +static LGFX_Sprite sprite_status(&lcd); +static LGFX_Sprite sprite_info(&lcd); + +/* SDP Interface */ +std::string packet_description = "Number of object"; +std::string serialization_format = "i"; + +/* device information */ +uint8_t mac_address[6]; +String device_name; +bool auto_start = true; + +// Object Detection Threashold +float threashold = 0.5; +String target_class = "person"; + +/* UWB */ +int uwb_id = -1; + +bool load_config_from_FS(fs::FS &fs, const String &filename) +{ + StaticJsonDocument<1024> doc; + if (not load_json_from_FS<1024>(fs, filename, doc)) + { + return false; + } + if (not doc.containsKey("device_name") or + not doc.containsKey("uwb_id") or + not doc.containsKey("threshold") or + not doc.containsKey("target_class")) + { + return false; + } + device_name = doc["device_name"].as(); + uwb_id = doc["uwb_id"].as(); + threashold = doc["threshold"].as(); + target_class = doc["target_class"].as(); + + if (doc.containsKey("auto_start")) + { + auto_start = doc["auto_start"].as(); + } + return true; +} + +void setup() +{ + // Initialize + M5.begin(true, true, true, false); + Serial1.begin(115200, SERIAL_8N1, 33, 32); + Serial.begin(115200, SERIAL_8N1); + + // Display Initialization + init_lcd(lcd, sprite_title, sprite_status, sprite_info); + + // Display Title + sprite_title.println("SDP StickV2 Interface"); + update_lcd(lcd, sprite_title, sprite_status, sprite_info); + + // Load config + SD.begin(); + SPIFFS.begin(); + if (not load_config_from_FS(SD, String("/config.json"))) + { + if (not load_config_from_FS(SPIFFS, String("/config.json"))) + { + Serial.println("Failed to load config."); + sprite_status.println("Failed to load config."); + update_lcd(lcd, sprite_title, sprite_status, sprite_info); + while (true) + { + delay(1000); + } + } + } + + // UWB Initialization + if (not initUWB(false, uwb_id, Serial2)) + { + Serial.println("UWB Initialization Failed."); + sprite_status.println("UWB Initialization Failed."); + update_lcd(lcd, sprite_title, sprite_status, sprite_info); + } + + // SDP Initialization + if (not init_sdp(mac_address, device_name.c_str())) + { + Serial.println("SDP Initialization Failed."); + sprite_status.println("SDP Initialization Failed."); + update_lcd(lcd, sprite_title, sprite_status, sprite_info); + while (true) + { + delay(1000); + } + } + + // Display Device Info + sprite_title.printf("Device Name: %s\n", device_name.c_str()); + sprite_title.printf("MAC Address: %02X:%02X:%02X:%02X:%02X:%02X\n", + mac_address[0], mac_address[1], mac_address[2], + mac_address[3], mac_address[4], mac_address[5]); + sprite_title.printf("UWB ID: %d\n", uwb_id); + sprite_title.printf("Target Class: %s\n", target_class.c_str()); + sprite_title.printf("Threashold: %f\n", threashold); + sprite_status.println("Initialization Completed."); + update_lcd(lcd, sprite_title, sprite_status, sprite_info); +} + +void loop() +{ + auto last_read_stamp = millis(); + StaticJsonDocument<2048> doc; + while (true) + { + delay(100); + if (Serial.available()) + { + String cmd = Serial.readStringUntil('\n'); + if (cmd == "start") + { + auto_start = true; + } + else + { + Serial1.print(cmd); + String response = Serial1.readStringUntil('\n'); + Serial.printf("Response: %s\n", response.c_str()); + } + } + if (not Serial1.available() and (millis() - last_read_stamp > 10000) and auto_start) + { + set_object_recognition_model(Serial1, String("./uploads/models/nanodet_80class")); + Serial.println("Set objection dection mode."); + clear_sprite(sprite_info); + sprite_info.println("Set objection dection mode."); + last_read_stamp = millis(); + } + else if (Serial1.available()) + { + doc.clear(); + bool success = read_data_from_serial(Serial1, doc); + String doc_str; + serializeJson(doc, doc_str); + clear_sprite(sprite_info); + Serial.printf("Read doc data: %s\n", doc_str.c_str()); + sprite_info.printf("Read doc data: %s\n", doc_str.c_str()); + if (success and doc.containsKey("num") and doc.containsKey("obj")) + { + int num_of_target = 0; + long num_of_objects = doc["num"]; + for (int i = 0; i < num_of_objects; i++) + { + Serial.printf(" %d th object: %s, %f\n", + i, + doc["obj"][i]["type"].as().c_str(), + doc["obj"][i]["prob"].as()); + if (doc["obj"][i]["type"] == target_class and doc["obj"][i]["prob"].as() > threashold) + { + ++num_of_target; + } + } + std::vector data; + data.push_back(SDPData(num_of_target)); + send_sdp_data_packet(packet_description, data); + clear_sprite(sprite_status); + sprite_status.printf("Send SDP packet: %d\n", num_of_target); + Serial.printf("Send SDP packet: %d\n", num_of_target); + } + else + { + clear_sprite(sprite_status); + sprite_status.println("Failed to read data."); + } + last_read_stamp = millis(); + } + update_lcd(lcd, sprite_title, sprite_status, sprite_info); + } +} diff --git a/smart_device_protocol/sketchbooks/sdp_stickv2_interface/test/README b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_stickv2_interface/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_light/.gitignore b/smart_device_protocol/sketchbooks/sdp_switchbot_light/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_light/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_light/README.md b/smart_device_protocol/sketchbooks/sdp_switchbot_light/README.md new file mode 100644 index 000000000..4aafa1c33 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_light/README.md @@ -0,0 +1,11 @@ +# SDP Switchbot Light + +## How to use + +Please connect m5stack_switchbot_client to port A and UWB module to portC. + +``` +git update-index --skip-worktree ./data +``` + +mofidy [config.json](./data/config.json) and burn it to m5stack-fire \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_light/data/config.json b/smart_device_protocol/sketchbooks/sdp_switchbot_light/data/config.json new file mode 100644 index 000000000..41e4db2a9 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_light/data/config.json @@ -0,0 +1,10 @@ +{ + "device_name": "SDP Switchbot", + "wifi_ssid": "", + "wifi_password": "", + "switchbot_token": "", + "switchbot_secret": "", + "switchbot_device_id": "", + "uwb_id": -1, + "comment": "this is configuration for sdp_switchbot_light" +} \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_light/include/README b/smart_device_protocol/sketchbooks/sdp_switchbot_light/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_light/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_light/platformio.ini b/smart_device_protocol/sketchbooks/sdp_switchbot_light/platformio.ini new file mode 100644 index 000000000..1422b6c04 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_light/platformio.ini @@ -0,0 +1,27 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-fire] +platform = espressif32 +board = m5stack-fire +framework = arduino +lib_ldf_mode = deep +lib_deps = + m5stack/M5Stack@^0.4.3 + bblanchon/ArduinoJson @ ^6.21.3 +build_flags = + -std=gnu++17 + -DBOARD_HAS_PSRAM=0 +build_unflags = + -std=gnu++11 + -DBOARD_HAS_PSRAM + ; -mfix-esp32-psram-cache-issue + ; -mfix-esp32-psram-cache-strategy=memw +monitor_speed = 115200 diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_light/src/main.cpp b/smart_device_protocol/sketchbooks/sdp_switchbot_light/src/main.cpp new file mode 100644 index 000000000..c332b12ac --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_light/src/main.cpp @@ -0,0 +1,285 @@ +#include +#include + +#include +#include +#include + +#include + +#include +#include "sdp/sdp.h" +#include "iot_com_util/iot_host_util.h" +#include "utils/config_loader.h" +#include "devices/uwb_module_util.h" + +// Device Name +String device_name; + +// ESP-NOW +uint8_t mac_address[6] = {0}; + +// Interface +std::string packet_description_control = "Light control"; +std::string serialization_format_control = "?"; +SDPInterfaceDescription interface_description_control = std::make_tuple(packet_description_control, serialization_format_control); + +// Light Status +std::string packet_description_status = "Light status"; +std::string serialization_format_status = "?"; +std::vector body_status; + +// UWB +int uwb_id = -1; +std::string packet_description_uwb = "UWB Station"; +std::string serialization_format_uwb = "i"; +std::vector body_uwb; + +// Switchbot Client Configuration +String wifi_ssid = ""; +String wifi_password = ""; +String switchbot_device_id = ""; +String switchbot_token = ""; +String switchbot_secret = ""; + +// Other +std::vector data; +StaticJsonDocument<1024> result_json; +int loop_counter = 0; + +void get_bot_status_and_update_buf() +{ + Serial.printf("Get switchbot status\n"); + String result = send_serial_command( + String("") + + "{\"command\":\"get_device_status\"," + + "\"device_id\":\"" + switchbot_device_id + "\"}\n", + 5000); + DeserializationError error = deserializeJson(result_json, result); + if (error or (result_json.containsKey("success") and not result_json["success"].as())) + { + Serial.printf("deserializeJson() failed or get_device_status failed: %s, result: %s\n", error.c_str(), result.c_str()); + return; + } + else + { + String power = result_json["result"]["body"]["power"]; + body_status.clear(); + body_status.push_back(SDPData(power == "on" ? true : false)); + return; + } +} + +bool load_config_from_FS(fs::FS &fs, String filename = "/config.json") +{ + StaticJsonDocument<1024> doc; + if (not load_json_from_FS<1024>(fs, filename, doc)) + { + return false; + } + + if (not doc.containsKey("device_name") or + not doc.containsKey("wifi_ssid") or + not doc.containsKey("wifi_password") or + not doc.containsKey("switchbot_token") or + not doc.containsKey("switchbot_secret") or + not doc.containsKey("switchbot_device_id") or + not doc.containsKey("uwb_id")) + { + return false; + } + + device_name = doc["device_name"].as(); + wifi_ssid = doc["wifi_ssid"].as(); + wifi_password = doc["wifi_password"].as(); + switchbot_token = doc["switchbot_token"].as(); + switchbot_secret = doc["switchbot_secret"].as(); + switchbot_device_id = doc["switchbot_device_id"].as(); + uwb_id = doc["uwb_id"].as(); + return true; +} + +void callback_for_switch_control(const uint8_t *mac_address, const std::vector &body) +{ + Serial.printf("Length of body: %d\n", body.size()); + bool control = std::get(body[0]); + Serial.printf("Light Control Command: %s\n", control ? "ON" : "OFF"); + if (control) + { + Serial.printf("Turn On the light.\n"); + String ret = send_serial_command( + String("") + + "{\"command\":\"send_device_command\"," + + "\"device_id\":\"" + switchbot_device_id + "\"," + + "\"sb_command_type\":\"command\"," + + "\"sb_command\":\"turnOn\"}\n", + 10000); + Serial.printf("Response: %s\n", ret.c_str()); + } + else + { + Serial.printf("Turn Off the light.\n"); + Serial2.printf("{\"command\":\"send_device_command\",\"device_id\":\"%s\",\"sb_command_type\":\"command\",\"sb_command\":\"turnOff\"}\n", switchbot_device_id.c_str()); + String ret = send_serial_command( + String("") + + "{\"command\":\"send_device_command\"," + + "\"device_id\":\"" + switchbot_device_id + "\"," + + "\"sb_command_type\":\"command\"," + + "\"sb_command\":\"turnOff\"}\n", + 10000); + Serial.printf("Response: %s\n", ret.c_str()); + } + Serial.printf("Light Control Command Done\n"); + get_bot_status_and_update_buf(); +} + +void setup() +{ + M5.begin(true, true, true, false); + Serial.begin(115200); + Serial1.begin(115200, SERIAL_8N1, 16, 17); + Serial2.begin(115200, SERIAL_8N1, 22, 21); + + M5.Lcd.printf("SDP SWITCHBOT LIGHT HOST\n"); + + // Load config from FS + SPIFFS.begin(); + SD.begin(); + if (not load_config_from_FS(SD, "/config.json")) + { + if (not load_config_from_FS(SPIFFS, "/config.json")) + { + Serial.println("Failed to load config file"); + M5.lcd.printf("Failed to load config file\n"); + while (true) + { + delay(1000); + } + } + } + + // Initialization of SDP + if (not init_sdp(mac_address, device_name.c_str())) + { + Serial.println("Failed to initialize SDP"); + M5.Lcd.printf("Failed to initialize SDP\n"); + while (true) + { + delay(1000); + } + } + register_sdp_interface_callback(interface_description_control, callback_for_switch_control); + Serial.println("SDP Initialized!"); + + // Show device info + M5.Lcd.printf("Name: %s\n", device_name.c_str()); + M5.Lcd.printf("ADDR: %2x:%2x:%2x:%2x:%2x:%2x\n", mac_address[0], mac_address[1], mac_address[2], mac_address[3], + mac_address[4], mac_address[5]); + + // UWB module + bool result = initUWB(false, uwb_id, Serial1); + body_uwb.clear(); + body_uwb.push_back(SDPData(uwb_id)); + + // Wifi Configuration + Serial.printf("Wifi Configuration\n"); + String ret = send_serial_command( + String("") + + "{\"command\":\"config_wifi\"," + + "\"ssid\":\"" + wifi_ssid + "\"," + + "\"password\":\"" + wifi_password + "\"}\n", + 20000); + Serial.printf("Response for wifi config: %s\n", ret.c_str()); + + delay(3000); + + // Switchbot Client Configuration + Serial.printf("Switchbot Client Configuration\n"); + ret = send_serial_command( + String("") + + "{\"command\":\"config_switchbot\"," + + "\"token\":\"" + switchbot_token + "\"," + + "\"secret\":\"" + switchbot_secret + "\"}\n", + 5000); + Serial.printf("Response for switchbot config: %s\n", ret.c_str()); + + delay(3000); + + // Get device status + ret = send_serial_command( + String("") + + "{\"command\":\"get_device_config\"}\n", + 5000); + Serial.printf("Response for get_device_status: %s\n", ret.c_str()); +} + +void loop() +{ + delay(5000); + + // Run dummy callback if Serial available + if (Serial.available()) + { + uint8_t buf_dummy[240]; + data.clear(); + String str = Serial.readStringUntil('\n'); + Serial.printf("Input: %s\n", str.c_str()); + if (str.indexOf("turnOn") != -1) + { + data.push_back(SDPData(true)); + } + else if (str.indexOf("turnOff") != -1) + { + data.push_back(SDPData(false)); + } + else + { + Serial.printf("Unknown command. Buffer clearing...\n"); + auto timeout = millis() + 5000; + while (millis() < timeout) + { + delay(100); + if (Serial2.available()) + { + Serial.println(String("response: ") + Serial2.readString()); + } + } + return; + } + std::string serialization_format = get_serialization_format(data); + bool result = generate_data_frame( + buf_dummy, + packet_description_control.c_str(), + data); + if (not result) + { + Serial.printf("Failed to generate data frame\n"); + return; + } + else + { + Serial.println("Generate data frame"); + } + Serial.printf("Dummy callback calling\n"); + _OnDataRecv(NULL, buf_dummy, sizeof(buf_dummy)); + Serial.printf("Dummy callback called\n"); + return; + } + + // Send SDP Data + if (not send_sdp_data_packet(packet_description_status, body_status)) + { + Serial.printf("Failed to send SDP data packet\n"); + } + if (not send_sdp_data_packet(packet_description_uwb, body_uwb)) + { + Serial.printf("Failed to send SDP data packet\n"); + } + + // Get switchbot status + if (loop_counter % 50 == 0) + { + get_bot_status_and_update_buf(); + } + loop_counter++; +} diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_light/test/README b/smart_device_protocol/sketchbooks/sdp_switchbot_light/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_light/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_lock/.gitignore b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_lock/README.md b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/README.md new file mode 100644 index 000000000..4aafa1c33 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/README.md @@ -0,0 +1,11 @@ +# SDP Switchbot Light + +## How to use + +Please connect m5stack_switchbot_client to port A and UWB module to portC. + +``` +git update-index --skip-worktree ./data +``` + +mofidy [config.json](./data/config.json) and burn it to m5stack-fire \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_lock/data/config.json b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/data/config.json new file mode 100644 index 000000000..b06e32784 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/data/config.json @@ -0,0 +1,10 @@ +{ + "device_name": "SDP Switchbot", + "wifi_ssid": "", + "wifi_password": "", + "switchbot_token": "", + "switchbot_secret": "", + "switchbot_device_id": "", + "uwb_id": -1, + "comment": "this is configuration for sdp_switchbot_lock" +} \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_lock/include/README b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_lock/platformio.ini b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/platformio.ini new file mode 100644 index 000000000..1422b6c04 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/platformio.ini @@ -0,0 +1,27 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-fire] +platform = espressif32 +board = m5stack-fire +framework = arduino +lib_ldf_mode = deep +lib_deps = + m5stack/M5Stack@^0.4.3 + bblanchon/ArduinoJson @ ^6.21.3 +build_flags = + -std=gnu++17 + -DBOARD_HAS_PSRAM=0 +build_unflags = + -std=gnu++11 + -DBOARD_HAS_PSRAM + ; -mfix-esp32-psram-cache-issue + ; -mfix-esp32-psram-cache-strategy=memw +monitor_speed = 115200 diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_lock/src/main.cpp b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/src/main.cpp new file mode 100644 index 000000000..4cf81fa98 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/src/main.cpp @@ -0,0 +1,279 @@ +#include +#include + +#include +#include +#include + +#include + +#include +#include "sdp/sdp.h" +#include "iot_com_util/iot_host_util.h" +#include "utils/config_loader.h" +#include "devices/uwb_module_util.h" + +// Device Name +String device_name; + +// ESP-NOW +uint8_t mac_address[6] = { 0 }; + +// Interface +std::string packet_description_control = "Key control"; +std::string serialization_format_control = "?"; +SDPInterfaceDescription interface_description_control = + std::make_tuple(packet_description_control, serialization_format_control); + +// Lock Status +std::string packet_description_status = "Key status"; +std::string serialization_format_status = "?"; +std::vector body_status; + +// UWB +int uwb_id = -1; +std::string packet_description_uwb = "UWB Station"; +std::string serialization_format_uwb = "i"; +std::vector body_uwb; + +// Switchbot Client Configuration +String wifi_ssid = ""; +String wifi_password = ""; +String switchbot_device_id = ""; +String switchbot_token = ""; +String switchbot_secret = ""; + +// Status retrieve iteration +int status_retrieve_iteration = 100; + +// Other +std::vector data; +StaticJsonDocument<1024> result_json; +int loop_counter = 0; + +void get_bot_status_and_update_buf() +{ + Serial.printf("Get switchbot status\n"); + String result = send_serial_command( + String("") + "{\"command\":\"get_device_status\"," + "\"device_id\":\"" + switchbot_device_id + "\"}\n", 5000); + Serial.printf("Response for get_device_status: %s\n", result.c_str()); + DeserializationError error = deserializeJson(result_json, result); + if (error or (result_json.containsKey("success") and not result_json["success"].as())) + { + Serial.printf("deserializeJson() failed or get_device_status failed: %s, result: %s\n", error.c_str(), + result.c_str()); + return; + } + else + { + String lock_status = result_json["result"]["body"]["lockState"]; + body_status.clear(); + body_status.push_back(SDPData(std::string(lock_status.c_str()))); + return; + } +} + +bool load_config_from_FS(fs::FS& fs, String filename = "/config.json") +{ + StaticJsonDocument<1024> doc; + if (not load_json_from_FS<1024>(fs, filename, doc)) + { + return false; + } + + if (not doc.containsKey("device_name") or not doc.containsKey("wifi_ssid") or not doc.containsKey("wifi_password") or + not doc.containsKey("switchbot_token") or not doc.containsKey("switchbot_secret") or + not doc.containsKey("switchbot_device_id") or not doc.containsKey("uwb_id")) + { + return false; + } + + device_name = doc["device_name"].as(); + wifi_ssid = doc["wifi_ssid"].as(); + wifi_password = doc["wifi_password"].as(); + switchbot_token = doc["switchbot_token"].as(); + switchbot_secret = doc["switchbot_secret"].as(); + switchbot_device_id = doc["switchbot_device_id"].as(); + uwb_id = doc["uwb_id"].as(); + + if (not doc.containsKey("status_retrieve_iteration")) + { + status_retrieve_iteration = 100; + } + else + { + status_retrieve_iteration = doc["status_retrieve_iteration"].as(); + } + + return true; +} + +void callback_for_switch_control(const uint8_t* mac_address, const std::vector& body) +{ + Serial.printf("Length of body: %d\n", body.size()); + bool control = std::get(body[0]); + Serial.printf("Lock Control Command: %s\n", control ? "Lock" : "Unlock"); + if (control) + { + Serial.printf("Lock the key.\n"); + String command = String("") + "{\"command\":\"send_device_command\"," + "\"device_id\":\"" + switchbot_device_id + + "\"," + "\"sb_command_type\":\"command\"," + "\"sb_command\":\"lock\"}\n"; + String ret = send_serial_command(command, 10000); + Serial.printf("Response: %s\n", ret.c_str()); + } + else + { + Serial.printf("Unlock the key.\n"); + String command = String("") + "{\"command\":\"send_device_command\"," + "\"device_id\":\"" + switchbot_device_id + + "\"," + "\"sb_command_type\":\"command\"," + "\"sb_command\":\"unlock\"}\n"; + String ret = send_serial_command(command, 10000); + Serial.printf("Response: %s\n", ret.c_str()); + } + Serial.printf("Lock Control Command Done\n"); + delay(5000); + get_bot_status_and_update_buf(); +} + +void setup() +{ + M5.begin(true, true, true, false); + Serial.begin(115200); + Serial1.begin(115200, SERIAL_8N1, 16, 17); + Serial2.begin(115200, SERIAL_8N1, 22, 21); + + M5.Lcd.printf("SDP SWITCHBOT LOCK HOST\n"); + + // Load config from FS + SPIFFS.begin(); + SD.begin(); + if (not load_config_from_FS(SD, "/config.json")) + { + if (not load_config_from_FS(SPIFFS, "/config.json")) + { + Serial.println("Failed to load config file"); + M5.lcd.printf("Failed to load config file\n"); + while (true) + { + delay(1000); + } + } + } + + // Initialization of SDP + if (not init_sdp(mac_address, device_name.c_str())) + { + Serial.println("Failed to initialize SDP"); + M5.Lcd.printf("Failed to initialize SDP\n"); + while (true) + { + delay(1000); + } + } + register_sdp_interface_callback(interface_description_control, callback_for_switch_control); + Serial.println("SDP Initialized!"); + + // Show device info + M5.Lcd.printf("Name: %s\n", device_name.c_str()); + M5.Lcd.printf("ADDR: %2x:%2x:%2x:%2x:%2x:%2x\n", mac_address[0], mac_address[1], mac_address[2], mac_address[3], + mac_address[4], mac_address[5]); + + // UWB module + bool result = initUWB(false, uwb_id, Serial1); + body_uwb.clear(); + body_uwb.push_back(SDPData(uwb_id)); + + // Wifi Configuration + Serial.printf("Wifi Configuration\n"); + String ret = send_serial_command(String("") + "{\"command\":\"config_wifi\"," + "\"ssid\":\"" + wifi_ssid + "\"," + + "\"password\":\"" + wifi_password + "\"}\n", + 20000); + Serial.printf("Response for wifi config: %s\n", ret.c_str()); + + // Switchbot Client Configuration + Serial.printf("Switchbot Client Configuration\n"); + ret = send_serial_command(String("") + "{\"command\":\"config_switchbot\"," + "\"token\":\"" + switchbot_token + + "\"," + "\"secret\":\"" + switchbot_secret + "\"}\n", + 5000); + Serial.printf("Response for switchbot config: %s\n", ret.c_str()); + + // Get device status + ret = send_serial_command(String("") + "{\"command\":\"get_device_config\"}\n", 5000); + Serial.printf("Response for get_device_status: %s\n", ret.c_str()); + + // LCD print + M5.lcd.println("=== Device Configuration ==="); + M5.lcd.printf("device_name: %s\n", device_name.c_str()); + M5.lcd.printf("wifi_ssid: %s\n", wifi_ssid.c_str()); + M5.lcd.printf("switchbot_device_id: %s\n", switchbot_device_id.c_str()); + M5.lcd.printf("uwb_id: %d\n", uwb_id); + M5.lcd.println("============================"); +} + +void loop() +{ + // Run dummy callback if Serial available + if (Serial.available()) + { + uint8_t buf_dummy[240]; + data.clear(); + String str = Serial.readStringUntil('\n'); + Serial.printf("Input: %s\n", str.c_str()); + if (str.indexOf("unlock") != -1) + { + data.push_back(SDPData(false)); + } + else if (str.indexOf("lock") != -1) + { + data.push_back(SDPData(true)); + } + else + { + Serial.printf("Unknown command. Buffer clearing...\n"); + auto timeout = millis() + 5000; + while (millis() < timeout) + { + delay(100); + if (Serial2.available()) + { + Serial.println(String("response: ") + Serial2.readString()); + } + } + return; + } + std::string serialization_format = get_serialization_format(data); + bool result = generate_data_frame(buf_dummy, packet_description_control.c_str(), data); + if (not result) + { + Serial.printf("Failed to generate data frame\n"); + return; + } + else + { + Serial.println("Generate data frame"); + } + Serial.printf("Dummy callback calling\n"); + _OnDataRecv(NULL, buf_dummy, sizeof(buf_dummy)); + Serial.printf("Dummy callback called\n"); + return; + } + + // Get switchbot status + if (loop_counter % status_retrieve_iteration == 0) + { + get_bot_status_and_update_buf(); + } + + // Send SDP Data + if (not send_sdp_data_packet(packet_description_status, body_status)) + { + Serial.printf("Failed to send SDP data packet for status\n"); + } + if (not send_sdp_data_packet(packet_description_uwb, body_uwb)) + { + Serial.printf("Failed to send SDP data packet for uwb\n"); + } + + clear_recv_buf(5000); + + loop_counter++; +} diff --git a/smart_device_protocol/sketchbooks/sdp_switchbot_lock/test/README b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/sdp_switchbot_lock/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/sketchbooks/smart_device_protocol_interface/.gitignore b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/smart_device_protocol/sketchbooks/smart_device_protocol_interface/README.md b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/README.md new file mode 100644 index 000000000..4dfd4fa51 --- /dev/null +++ b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/README.md @@ -0,0 +1,6 @@ +# smart_device_protocol + +Support + +- M5Stack Fire +- M5Stack Core2 diff --git a/smart_device_protocol/sketchbooks/smart_device_protocol_interface/include/README b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/smart_device_protocol/sketchbooks/smart_device_protocol_interface/include/lcd.h b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/include/lcd.h new file mode 100644 index 000000000..e8e50810c --- /dev/null +++ b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/include/lcd.h @@ -0,0 +1,138 @@ +#include + +#ifdef USE_DISPLAY +#define LGFX_AUTODETECT +#include +#include + +// Lovyan GFX +static inline LGFX lcd; +static inline LGFX_Sprite sprite_device_info(&lcd); +static inline LGFX_Sprite sprite_device_status(&lcd); +static inline LGFX_Sprite sprite_event_info(&lcd); + +void init_lcd() +{ + lcd.init(); + lcd.setRotation(1); + lcd.setBrightness(128); + lcd.setColorDepth(24); + lcd.fillScreen(0xFFFFFF); + + sprite_device_info.createSprite(lcd.width(), lcd.height() / 3); + sprite_device_status.createSprite(lcd.width(), lcd.height() / 3); + sprite_event_info.createSprite(lcd.width(), lcd.height() / 3); + + sprite_device_info.fillScreen(0xFFFFFF); + sprite_device_info.setTextColor(0x000000); + sprite_device_status.fillScreen(0xFFFFFF); + sprite_device_status.setTextColor(0x000000); + sprite_event_info.fillScreen(0xFFFFFF); + sprite_event_info.setTextColor(0x000000); + +#if defined(M5STACKATOMS3) + sprite_device_info.setTextSize(1.0, 1.0); + sprite_device_status.setTextSize(1.0, 1.0); + sprite_event_info.setTextSize(1.0, 1.0); +#else + sprite_device_info.setTextSize(1.5, 1.5); +#endif +} + +void _clear_lcd(LGFX_Sprite& sprite) +{ + sprite.fillScreen(0xFFFFFF); + sprite.setCursor(0, 0); +} + +void clear_device_info() +{ + _clear_lcd(sprite_device_info); +} + +void clear_device_status() +{ + _clear_lcd(sprite_device_status); +} + +void clear_event_info() +{ + _clear_lcd(sprite_event_info); +} + +template +void print_event_info(T info) +{ + sprite_event_info.println(info); +} + +void _update_lcd(LGFX& lcd, LGFX_Sprite& sprite_device_info, LGFX_Sprite& sprite_device_status, + LGFX_Sprite& sprite_event_info) +{ + sprite_device_info.pushSprite(0, 0); + sprite_device_status.pushSprite(0, lcd.height() / 3); + sprite_event_info.pushSprite(0, lcd.height() * 2 / 3); +} + +void update_lcd() +{ + _update_lcd(lcd, sprite_device_info, sprite_device_status, sprite_device_info); +} + +void print_ros_message_info(const smart_device_protocol::Packet& msg) +{ + sprite_event_info.printf("MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", msg.mac_address[0], msg.mac_address[1], + msg.mac_address[2], msg.mac_address[3], msg.mac_address[4], msg.mac_address[5]); + sprite_event_info.print("data: "); + for (int i = 0; i < msg.data_length; i++) + { + sprite_event_info.printf("%d ", msg.data[i]); + } + sprite_event_info.println(""); +} + +void print_device_info(const uint8_t* device_mac_address, bool uwb_enabled, int tag_id) +{ + sprite_device_info.println("ESP-NOW ROS Driver"); + sprite_device_info.printf("MAC ADDR: %02X:%02X:%02X:%02X:%02X:%02X\n", device_mac_address[0], device_mac_address[1], + device_mac_address[2], device_mac_address[3], device_mac_address[4], device_mac_address[5]); + sprite_device_info.printf("UWB Enabled: %s\n", uwb_enabled ? "true" : "false"); + sprite_device_info.printf("Tag ID: %d\n", tag_id); +} + +#else + +void init_lcd() +{ +} + +void clear_device_info() +{ +} + +void clear_device_status() +{ +} + +void clear_event_info() +{ +} + +template +void print_event_info(T info) +{ +} + +void update_lcd() +{ +} + +void print_ros_message_info(const smart_device_protocol::Packet& msg) +{ +} + +void print_device_info(const uint8_t* device_mac_address, bool uwb_enabled, int tag_id) +{ +} + +#endif \ No newline at end of file diff --git a/smart_device_protocol/sketchbooks/smart_device_protocol_interface/platformio.ini b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/platformio.ini new file mode 100644 index 000000000..817f7fcb6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/platformio.ini @@ -0,0 +1,65 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:m5stack-fire] +platform = espressif32 +board = m5stack-fire +framework = arduino +lib_ldf_mode = deep +lib_deps = + m5stack/M5Stack@^0.4.3 + lovyan03/LovyanGFX@^0.4.18 +build_flags = + -DM5STACKFIRE + -DUSE_DISPLAY + -std=gnu++17 +build_unflags = -std=gnu++11 + +[env:m5stack-core2] +platform = espressif32 +board = m5stack-core2 +framework = arduino +lib_ldf_mode = deep +lib_deps = + m5stack/M5Core2 @ ^0.1.5 + lovyan03/LovyanGFX @ ^1.1.2 +build_flags = + -DM5STACKCORE2 + -DUSE_DISPLAY + -std=gnu++17 +build_unflags = -std=gnu++11 + +[env:m5stack-atoms3] +platform = espressif32 +board = m5stack-atoms3 +framework = arduino +lib_ldf_mode = deep +lib_deps = lovyan03/LovyanGFX @ ^1.1.2 +build_flags = + -DM5STACKATOMS3 + -DUSE_DISPLAY + -DARDUINO_USB_CDC_ON_BOOT=1 + -DARDUINO_USB_MODE=1 + -std=gnu++17 +build_unflags = -std=gnu++11 + +[env:m5stack-atoms3-no-display] +platform = espressif32 +board = m5stack-atoms3 +framework = arduino +lib_ldf_mode = deep +build_flags = + -DM5STACKATOMS3 + -DARDUINO_USB_CDC_ON_BOOT=1 + -DARDUINO_USB_MODE=1 + -std=gnu++17 +build_unflags = + -std=gnu++11 + -DUSE_DISPLAY diff --git a/smart_device_protocol/sketchbooks/smart_device_protocol_interface/src/main.cpp b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/src/main.cpp new file mode 100644 index 000000000..c106e9356 --- /dev/null +++ b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/src/main.cpp @@ -0,0 +1,186 @@ +// Arduino +#if defined(M5STACKFIRE) or defined(M5STACKCORE2) +#include +#define LGFX_USE_V1 +#else +#include +#endif + +// LCD +#include "lcd.h" + +// ROS +#include "ros/node_handle.h" +#include +#include +#if defined(M5STACKATOMS3) +#include "ArduinoAtomS3Hardware.h" +#else +#include "ArduinoHardware.h" +#endif + +#include +#include "sdp/esp_now.h" +#include "devices/uwb_module_util.h" + +void messageCb(const smart_device_protocol::Packet &); + +// ESP-NOW +uint8_t device_mac_address[6] = { 0 }; +uint8_t mac_address_for_msg[6]; +uint8_t buffer_for_msg[256]; + +// UWB +int8_t uwb_serial_rx_pin = 1; +int8_t uwb_serial_tx_pin = 2; +bool uwb_initialized = false; + +// ROSSerial +smart_device_protocol::Packet msg_recv_packet; +smart_device_protocol::UWBDistance msg_uwb; +ros::NodeHandle_ nh; +ros::Publisher publisher("/smart_device_protocol/recv", &msg_recv_packet); +ros::Publisher publisher_uwb("/smart_device_protocol/uwb", &msg_uwb); +ros::Subscriber subscriber("/smart_device_protocol/send", &messageCb); + +void messageCb(const smart_device_protocol::Packet &msg) +{ + if (msg.mac_address_length != 6) + { + nh.logerror("MAC Address length have to be 6."); + return; + } + + // Register a peer + esp_now_peer_info_t peer_temp; + memset(&peer_temp, 0, sizeof(peer_temp)); + for (int i = 0; i < 6; i++) + { + peer_temp.peer_addr[i] = msg.mac_address[i]; + } + esp_err_t add_status = esp_now_add_peer(&peer_temp); + esp_err_t result = esp_now_send(peer_temp.peer_addr, (uint8_t*)msg.data, msg.data_length); + esp_err_t del_status = esp_now_del_peer(peer_temp.peer_addr); + + // Display + clear_event_info(); + print_event_info("Send a packet"); + print_ros_message_info(msg); + update_lcd(); + + // ROS Logging + nh.logdebug("Subscribe a message and send a packet."); +} + +void OnDataRecv(const uint8_t* mac_addr, const uint8_t* data, int data_len) +{ + for (int i = 0; i < 6; i++) + { + mac_address_for_msg[i] = mac_addr[i]; + } + for (int i = 0; i < data_len; i++) + { + buffer_for_msg[i] = data[i]; + } + msg_recv_packet.mac_address = mac_address_for_msg; + msg_recv_packet.mac_address_length = 6; + msg_recv_packet.data = buffer_for_msg; + msg_recv_packet.data_length = data_len; + publisher.publish(&msg_recv_packet); + nh.spinOnce(); + + // Display + clear_event_info(); + print_event_info("Receive a packet"); + print_ros_message_info(msg_recv_packet); + update_lcd(); + + // Log + nh.logdebug("Received a packet and publish a message."); +} + +void setup() +{ + // UWB initialization + Serial2.begin(115200, SERIAL_8N1, uwb_serial_rx_pin, uwb_serial_tx_pin); + + // Rosserial Initialization + nh.initNode(); + while (not nh.connected()) + { + delay(1000); + nh.spinOnce(); + } + + int tag_id = 0; + nh.getParam("~tag_id", &tag_id, 1); + + // UWB initialization + uwb_initialized = initUWB(true, tag_id, Serial2); + + // Subscribe and Publish + nh.advertise(publisher); + if (uwb_initialized) + { + nh.advertise(publisher_uwb); + } + nh.subscribe(subscriber); + while (not nh.connected()) + { + delay(1000); + nh.spinOnce(); + } + + // ESP-NOW initialization + if (not init_esp_now(device_mac_address, OnDataRecv)) + { + while (true) + { + delay(1000); + nh.logerror("ESPNow Init Failed"); + } + } + + // Log + nh.loginfo("ESPNow Init Success"); + if (uwb_initialized) + { + char buf_str[128]; + sprintf(buf_str, "UWB Init Success. Tag ID: %d", tag_id); + nh.loginfo(buf_str); + } + else + { + nh.loginfo("UWB Init Failed. Disabled."); + } + + // LCD Initialization + init_lcd(); + + // Display + clear_device_info(); + print_device_info(device_mac_address, uwb_initialized, tag_id); + update_lcd(); +} + +void loop() +{ + if (uwb_initialized) + { + auto ret = getDistanceUWB(Serial2); + if (ret) + { + char buf_for_log[256]; + int id = std::get<0>(*ret); + float distance = std::get<1>(*ret); + msg_uwb.header.stamp = nh.now(); + msg_uwb.id = id; + msg_uwb.distance = distance; + publisher_uwb.publish(&msg_uwb); + sprintf(buf_for_log, "id: %d, distance: %f", id, distance); + nh.logdebug(buf_for_log); + } + } + nh.spinOnce(); + delay(100); +} diff --git a/smart_device_protocol/sketchbooks/smart_device_protocol_interface/test/README b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/test/README new file mode 100644 index 000000000..9b1e87bc6 --- /dev/null +++ b/smart_device_protocol/sketchbooks/smart_device_protocol_interface/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html diff --git a/smart_device_protocol/tests/sdp_v2_interface_rostest.test b/smart_device_protocol/tests/sdp_v2_interface_rostest.test new file mode 100644 index 000000000..7697d8331 --- /dev/null +++ b/smart_device_protocol/tests/sdp_v2_interface_rostest.test @@ -0,0 +1,5 @@ + + + + + diff --git a/smart_device_protocol/tests/test_sdp_interface.py b/smart_device_protocol/tests/test_sdp_interface.py new file mode 100644 index 000000000..37eb806b6 --- /dev/null +++ b/smart_device_protocol/tests/test_sdp_interface.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import unittest +import rospy +import rostest +from smart_device_protocol.smart_device_protocol_interface import ( + DeviceDictSDPInterfaceWithInterfaceCallback, +) + + +class TestCase(unittest.TestCase): + def callback_test(self, src_address, content): + print("{}: {}".format(src_address, content)) + self.called = True + + def test_sdp_interface(self): + self.called = False + rospy.init_node("test_sdp_interface") + sdp_interface = DeviceDictSDPInterfaceWithInterfaceCallback() + sdp_interface.register_callback(("Light status", "?"), self.callback_test) + rospy.sleep(5) + self.assertTrue(len(sdp_interface.device_interfaces) > 0) + self.assertTrue(self.called) + sdp_interface.unregister_callback(("Light status", "?")) + self.called = False + rospy.sleep(5) + self.assertFalse(self.called) + + +if __name__ == "__main__": + rostest.rosrun("smart_device_protocol", "test_sdp_interface", TestCase) diff --git a/smart_device_protocol/tests/test_topics.bag b/smart_device_protocol/tests/test_topics.bag new file mode 100644 index 0000000000000000000000000000000000000000..ef11183dcf67ca3f9a6b25385cf113aec6392861 GIT binary patch literal 95355 zcmeIb33wF6_CDM*0TMACd^C-i?YfN z2H8ROMRvpm1rZQX5fuIFgm=k4kY_MIMRexJ|xT<=r;(BxECozp#U zpE`A_x=vMCdY_D>#P0e5(QPAjMnMoN(CH{P_|>4l_9Clol&RR^G9(siC@lz8>9jbC zicA(qNs-&2rDQc+$}cGzE?q;xy;M%m4~_swfFr;W;0SO8I0762jsQo1Bft^h2yg`c zn-K`7F1$1jP*LpOI|_@PHkZrpC^8f|ifolB-(??TGo+?!1f1>eGx*mg+U+Q|TMX@N zu3}S>qtxVdxZ0JJ=70@@2L}2pWcvw1EnF}c6xf`0tE{w+G78LYOTN7*&k)&yQiawy zS4pA4Y>R0h7ZaZoozo#E%51ZCw8mMZ<0EsTI>bh`kByD{kVYg5=}FCbHj~wsYcI09 z@z5@})l}%pbG7SXGh1y=eZKfdXD@Qc>+M!uZh^z>j)~S=?Jl>u$YRqO{^CQ|JEMDo z{y&~V7pBjk+gZ&{tG>|YHe1bZvp&~BPiN1|w>cvUY$I(2#AGfkwpsOJu6uN`&DE9| zGxO~(J^jnG71^AG;Ank`iwe0NdW)m5u%yUtF}rPgx1F%~Ge2?Ki}YrFvDxXiTS^Md zPAczkTJ1$Bp6fIh+8~|&xojg!Yy^cqH6?+{6uE4c61SZmXf#Q%IBjMZy&B5Y>q-bk z!j2epVVR|l2uj-W2xHI9_3nJL8xLz6C2A2pr`eT2_h`j_Tw9V&;MnLcR+qk|_`oJg zy2ABz6M6(&vBQ$DZ%I$yceFd-QA7f5`jKX*-JDZkgJ4mItojyUY7zb?$$0DpeUZ7y zQ7)cIynhchVj+de#cztpr*~F>U+*f(BLM0C#ZJdayOn-d&S>%3ECqI3ky~G2&vBZa zqjlh7KUEjj4H#1);u7B|{WZH>4vU>$fK^{=cjxO|ZYQLRZ^J~|>AONTq>2HRF#Nfq z^&gm&BI$8+%9rY~R#y1}!AMVK7~CY(wkP0rCDcR=+zq1iSCe{nBvR1!xUjZsBoUGb z|2jk~)NH5CGSVX*LatFIeDtbq%`xZ1#>K}(=EUSgS)-zIERm6xXtTu<8Pze`+&;#l zT(zNo@%p}r$vuskrp&CqMpIg!G^5_2j}$dio|S3L$fT?&g{-v1-o_MDMrL|yT6Yxj zT_!b6lo9PyNVi^n62&4h3Pm!EX&HUeO~$kVrqt9_x>K~$oupFz(^4}BM4S2=(=+;{ znUeeTPs=o>gGcG+#@@#C?#8s_EGiJABs4QIqo*k)HKT80W^xZvPK=Tqu~@n>qkk{_ zh!~|GAr(nBrVcQspir#BFHJEHNKH1HdK)t`61y8sNqrL2Qz(_0NDQ$`&!@USRuPBW1#YgMdqYWOaFEm?BW~&t~nLbS4yTs+z=h*b^J^84Rx(6t^nDw94t*_ZK z+~!uSX{Zabn%2Gj?MeZ3wGw5lKT#tk=K5`-`Ux2+eN7q0jKtolCQ>eAdbh-6V^7;? z*j=~NQ9xxL{ct@x%m42j>QFm4NC~xcfealQP&DxWrzf|2xbPX{?{g@khR65l+7Pnh zW>;4Yj4*y1(yQ*qLLUXq2*aSR>O`!%JJ=s0$Ws$VG`6JrLxgrn*;-{0GL6Sw&yEYJ zU9Rz?LZ4nZZV5C#Tp-`fTvFgRmHTQr4)TH^`w@?O_qx1X&f>CX2!BqOU;l6TJGaU2 zU9wZ}bWsFehT2dmZo1ItkhNccHYtJh5rU%R6T<_)RMMV5Bh`TRicxj zcAcnnp%=N+ZunpBlK+!Y?4s%!|62+vVugqESO;j>3FF&!QMKXPA)U0mVm%a6X&u1Q zW7|88AfloqV$uO!V~9{`9Ux+Cr&l_Z>-l}_&`;4i^k%&}eG)7MIy$9JyW55vsykpE z{(FxHSO+|`=iU92P-`^(i6#IZdXDs@ZY!Ihkfz54HI^MLk+;n)Ap+(c=|lE)Eg?cX z!l1^on~0^^x~vfIcgHO|&7HX4*OFOwpq9VpM+MZl#>-HHCVDg;sPzrF+Y#y-Kqu1u zK8i{}A>Yn#Y1&4d?f8@`O!dZYGNIwJoAuD2Iz;{tbU%N-G> zYs?Y(|JtSdUvorIFIUeWUIA4b14u|e+h#d@5;pksa3wVp%e1Q*e&tGf-;3Zak<6yb zloY59`}&vyYP=(nTT_@dj>({ zAEOf@PM(epLLu$$MjMnx$lhHJvDo|;D)bMfaioE%G`g46C)3m`wR;cxU+n$--$#=E z4o2tUb^@ri{W>M6+)nUbwGS5nn&?qipf<<)RAZ=X6*`eV@cVSJo2NPa%M&Wq)itlA zX*uxRK&u%90?-u>{-S^yH_*NfG*HXgw7D776*`P`7xRi{L<-vQAsdy|6}cXbw-8I{ zqT+CffK^8N-iFX{6w(Cm7^qT2$)_dlAVQojkEb}=9G}Pq?crZGDT|QVcq_4N^sB4m zl|~TMkDLOvD)U}YK#f-#S*4NbnvGDKAY4)C9P@6T3^mkWkDUN&;Y0NmQOPkw2I&?WP`9XfcX=dY`>F))#{)Cz zc(@-A)Lg5MDWLXOS}Rntzt5o#wOy^u{Og#Y4y!x%uGPJ5Dj!kuZBtP%M<#Y|4htAe zC(<))rGQ(lO$AF-ry*@10w>ay-=Eb6BD7cg`S6>O>uFN+iDglzOQP$IS#wAqty&Fp z*aS`4q5dk&GFaRze~RX>|503TpmuiLh!}6wxFh1b(g3wr|Mf#0v>kKHklu5)d3&g< zc73s$(ZFHEQvH`C{*eZlNyo!&JW$)CE#)6+l-on#=&`B5s&w&}VmGBOWgtB|KNQ1( zf@W-RnzBtru1v&}1!t>6&oRqHgnw3Z_}+pxc*iPb5we~RSOlxRuD5~Vt+LF(c%k;* zl+b$KsByC_Lk*hfQP<(5Ye%hPYe8M>(~0z+8m}WMXm&R;Dyu7UWg@za`Je%K8qf(5 zx8e?f#Qdmb$|7X%4lF|(@9*gS?zqOw-kld}?{1u%;EfvBc;BcMkgjRxD}7Vsz3K;} zcJzD@?^O$m9v5t##~?z(0{YdDfI&pm64KR%Hjh9d`gYz?*&rfUCSuL$@EC{)p%WtJ z9!iKoA?>d%7buI6S%*Sm`MvP9#@sppG_`Y1fm*xWTiOHoMsyKU^D+mxC{JWy&IC@6JIixt3QHzEkk{8Q(SvsC_&2B<~+W z)1*VuT6yVOqrIK|_#{3>tbn7ZYD2?PPp+#0>!7C-=|is{7dv;r`v=_$ARw1I8?s~_+RYN=lCc`7GwdJ9y5i}RZ#Hth#nbAR-z(lo*hJsYOUP(}jrv2{gZFuCfT3 z#yg4SxM@liZ#%*J_Of^9h1#HBs(Cd2{!~KVx0j&?W%g*ii*#*wFA>kDoEIlPV=Weluw7;opS6vr%vTm6dv{nqp_Y5}6aFPp87pAvX^BuT z_ioFohdvsjjggKFS;6AYhm<8LHzQsm1}qpZ1|(okHbm^4^r9G$pt2<@A(q0~H*0d6 z3S=M9N0R{$)FSrZ5Ie`MCSeC)aHh9N{y2GT=&G#A4V zv<97z?%jsMa~k zB4ipgnpj@4wBp_;-i>rT-1`J-CF2)y?^D@E0Y^_&0aluepJ2LbP&D zD`h1`u1rMbD=WlF&QX*B5e0T}O)o(k6EjO$giO!J;I2nY1#e5qNB(@b#X#-3Q}Lc2 zJsCMhAXS9mxvZ;J`g9=W119{e5mG|4p6%}ESHZ( zK+~i{(Vsw`$HoJ-al0;vo#S}QKzh#nAHgWlT2U=kbQQpowdHh6Z&Sk!w9M4V3^Y&+ zxHBx=8#QjAWvD?DW$OC=S3ir<=Gg57Cxx{Di1Ea7v2|`FEHVadkv?Xa z%A(DEYP^?-*0MT6#Ccv>yGU8%PI{}J6A7<_Y_t1 z6oJ*H)z>^@5%)*mxLKBIn5=3~B-A#3yrv4Q!{c-!J?yQCEN)tz2MCss*OrJ=>#=7V z(pxS~WpUFZ3~D?;uq4i?6zSbK@OLMBcQWe$)ZR&0uYekFQe~*gG=37HHn^v@HZ;C7 zok(vfs$Uz0Xr*>FUs%ABGrh4G#({-rk-q$FV=;_FJLSp@6;9-2VmXw4UZKzPSGI@Z z^jZ9{zr~^Gy~{KnsP%t*BL9-8qCEswi_`bk;x_eBMoxj+jm1+Hc7x(J)wfLrYGdDB zD#lHBC0m2^mA*&BZVJUstNDfpmNSm!V#rIPB%-zZ0~R-}&Za(1BD!_8ck`iypG~*_!P>3 zh~X!!;%s=Dx;IT(giO!D(&qQJd_yS!t9shyG(zpN?lZBEVI)4JTL=HZLdBp2*c~|CW#o{;U^XH=RV3Hrb@mO_3}+-wsxwO-qUlUZ^GP z8q7by{sstv4){rkqEYImm->3;TSS%CPjEgLFVZ7&hS z%>Bf9-901`&(2=N0>ootT*@M3dOm~hx_E|0VgC<4Z0FnW18OsCEK@*@cT;4j$<%cw zp>|+Gt`-`fN+;6&{3oyg@!Z_n%IfMRV&T4#Vhq7QBoQYI7Kkwf^f4_*S%ggEao0|V zcxV@JEk6{kl^1HCWS&&$AO4ktow()S=Xf}3vq;x+e%fEzdpLtzSDBrV=^9Y095Rq^ zuOn6kwLxA$?YoI*#BN?s;zas~8u!YBo@*$ZM%=>Vl7OX)d7v1%(n}IyA5~M2LRxhz zFwZ6t!IK>aUmU37DZp|)W0V+8kS2++pI^?xcSjf!ltsui2qJEL z=~mdThSxja^$w_gU-p>-YTT>wjoKVSt>>|eynhWVAsr8I8G+igj-Tx{vb@$UN3iFD)-NtIDZbG2W9^1G7(50;%3`I^~)to%@{ zG+wC98g(nMd}UR(g2#0dkS?&Did}BAyTny4@lpO_!pPs}P{az4@39WhFyW6NF@_+W zGLW9zd6*bOK+B>At5nh(Uwz7VGa~rZZzKw!+hhmu-Hf1)s=uquCDi&Dj*H!t3=wZy z^E>mp9x`b2t%}O(id>JzL&U9WTg4cHOv*rd?w$%*b5PLsxNutxwXZ-4nPrz5m}iM4 z>TFHEQH%)R1A3`msI5M|O#wCTMaXmwn&?qi=$f@^ZYy{Z{pm!y?;q2#K9->Qbe*6= z-IKh3s1mE{n{0doC(^73`d-jLk4>FV_0pVWsRWxkkWQpG?Xy)vAyi-$HWe%* z&sxREizg%z-=7~QMqbb&k?*UpsS8L%&tYTvcNM@c9g5Zgd7gI%)NYg=7CS6il!5g3 zd4I5==inXwD&8GfvS(ivgPsRTA~b70g*FJ<-HqN>`R*3ZPf^(9hmSJLd>L7L2;kEV z=M_-n9-s_0Xrf2s7ZPfdJ3Y|?`Z<_Rq!0ePK5(efI@IRWzsS9Jm00CA zT+6p|5;g1r<4DN&w1-Q`n#B~{7F}->WgtB%Jp%axwTA{3?IBpq^KOYj&)JfQLnYDT z)Oy;6tE#dHnRQr7BGw&BRM=jJ`!X_L#tXG$sY4X{JUrIu!KiI^XnE9(vQ0(B_gDwi z%ih~phymhe%0T+iowr$lxVo)~!1BVIwL;)<=SU*7`uACYc-f&^%GQAj-hYZ^B%;^P z_1i*(g-)awEqfAcU#qoIV5wiDg*ZvvDv3C~Z=yI!oNQEM6;JUTi8%hlrycMVHad}B zq^*RNlLX(}Cdw-8a$*VE&j)@1S^4pBCkUt|O#O$#{vUjJKxXCusi*3$Ak?lc`A7_S z%cTsY4FiILQHYdMuR`O&(sRa};!MaqNyNUrP3l7gt)A^;8)2EoLqxxr9kINl`;d;V z7iv!q9mIEMfTlg@bG8h%m85IMSNd^xNJNeO_i*b9)b7+ht$-R2NRU}qFI}svoyDC< z6;32HY{`Poq6e5yYKiny!p0D2C{5j~tD+?WOMhd3aW=eN5^>kISDX#6{d8SdWf8JB zwu(gL_gG!uyCvdXOqrhJwRpS;pq3DHPV}3HQ3ld$Ui%jduJk#h%}Ye<`8UMi%HfiT z3ukY!;L6|~-BrB1HFVdKSLgFRI0(K6ewdYMJWvaJ=Qjn^xW>yg-U~Iq71?~qRfT1T zhV?jK+Yeph0y>dirt9WMq@Yn3hzge0M_P*Wx(g){XCr!w^SWs|l@H5~8+dHgS`wjK zky{^6QA8)wgOX2*-4vR}sAhx#ESrs!#F>x|NyOPr7xhF6+G8KIQDLJX;@s#4O}yI| z-b?je+ko1MF$M+HxQ+6S+B!ll#<^d?XXgXI4@T|wqzuohxcB!WY>6oH#>SyKHGa6)n+v z60s+H5Z^V0;8X7{12xA54c|2d%KD%&H)MN!uMLFSGdo)f(0C`ENIyGrHBqGT23;Lx zbw#dBM4gF`i}ObjMFtTkmu{$pLfT(jR#6rq^Vz{t&F>`NhJqkdukp_lY9YaI^DqQx znshvTycDSYHfSTC$W#s){Z)tB*zT46%A-ixzD6vHw5M&fo)(UCJ00jlKKk*$7DWmT zyQ!Tkc8T2t2hu0?9d$s4RuJ~#0wC98Q^E4}!ByhC?h?vCx_V0IYAB>t7cIS!SVF_? z9&efNA>m^OS6NF0)Rs<&uj)Mt!27eZJ_a<=qpm=${r9ay;YEz36X|~KN!s&c&IEPfj>x0fRJ^OCrz^yJqsDuRGV35y*KLH_ z54UcL-Mn#>gLJ)GkF`W0+Of{Znx9J{Yx1l|O6fZ6|m)@4={LFWJR6+JWhNkjIK_k3Rvs zw)p(SDEJc-=tR2SQwySqM2J(Gat8~!G7Eju_V5btghok(l%9>j|gG#AELm4QdD=iPy&@5;qu$k1fU zKzdTnX%@(PVN9&D2-&;aNi207ojvc4edoDN!g!y@x3vOlQDKu6Q2Q%eMw(9fH##0Z z@(k3PR{4_m6a_`B@UA^o8(8%k-K-9*!_#ykowRXK9TcJpT&!HRkt-ANRi)-)7{?UK zfQUm?9AX%UHhp(zWf5N1A;ozrjQcW=(o+P`%~$8~O_HFFs(qOk3AN>iH;di8slRJ24d6U%pwcf}q5W{?P^x9GnWJ$hQU&d0E)?2Un? zPgz5SO^J9*R|vJsA3hxnjh{&;(!Vwu%GMqkQkJel ze10>*SAIO)vIDh=L5uiUL^)*i zR~>5ox4%@4_iP`fXA521_G~WS3QN>AwUe=cTIBQH8o|2GrW5J*M}J}KX&n9~UfDF_ z79Il)mW2g<#6Yzcl`btwGm9S%l2GzDgn{HOb~16%l+7oJl1E9;o$r&K`$% z_Y9p#uk5%w4uxm~5;d!Gfu-y~fw+rZ8L_=a>2veM=m0@GSJbqYB%Lvr|`I%qU^2i^)f1FIiQ1Lxxc{gG8Mb-7drdkD2I zi(5Bpblt zu$q2px!6rvKp9AXGk#Fp3(2BN}>Z!t}?j;cyvtkrB z+TkOozO4gLn^w400X1$@WvIzC{tZIy^u%Yx^)wby4$?~&Z$lYD<8v_#xW3g5(d|4{bsWbL8&uKpFu`-jjp=}@%sUZ~~$ z>Tqb_tzG zpGh=|&>?aYGmK_wk#LFlH>8NLZ z3q>JXUrNnDHCP(F+fZR&DDJ+=Ucb!L0JRPAFDjtMD~${_Xriam0JX_=PK)7b&rt@_ zBVN42Rv|IyrYUQ@4EO`Y^2dQ=3cYGRgI)%_7iug2W#PSQWiLXeq|mS|>ocuk*_YFa zbkwgCTBDF=%9SW(B}J}B&%x4h;dn7nXa!{;{o>$-VxSPM**9BRgzSyINh~k>S5nyW zjhkhep38tgNT}uS&-KTREl_2^gJpy*{L%yIL8~lt4jR(uI>mj^<2+X8I5qK|k-L;(e57m5Yg@z@3(kFuV z4^E%fk+MTmRA~HLB;u~-BJUpp zSm}7U7Xj3IJD%bFLqQQM;OH^Sz{)%+AR2nUo=&9m_Ku83A=(l=P^FSOpDW|reiCHr z%`$*ac(n@O_7j?>dg2vOOK#j%46oWid`Q2N86$>Qkry#mg}S~&EaPs?;ay@8c=n&7 zosjj+fLdw0y9%iNmGgga%fHW|h#DT>V_kuoCVYAjtn2f1BJKVv!8`m_s%v2P z*ZC(?6^$9-y?3OZ7>c%0g8P+8e4H>gh9=c!C<*`X0N#7$Yx2zzg~EstvHgKo2#O#yh|c7vq$kgFbO{O zO)5}3JNWT-uu)s+MEX$iiFS}d>wpC*1CLyfnFCAurUWt2Wh-SMtzGbO912mZJXl$T ztlk|ZmWa|Ig-AsHB}`WDyilvZe1igNe`Txuzcwouy0-e)c)mZ4a+B(%VPBnJ6UxU+ zVa(JC}e?B61Q!t+sX>Ei2j*vm?-`7w!h{*NW)c1&G!*gB5@SyFKfpn7llo%dF zG4Vda>SgclecW|(hQi)}eB{r!O$BQ6&+|{F(8lsZv8UsuYpFGp`1j6o$mp*+)Dnzt z-nmo83Rrp!BI@PRuig?ncRMHp=?nF~X6uZo+iw*tKVP~bt~2t2BqG#siLEoTY-y?r zv-|;x$V%EE#^diK5lCN{IJ^;&YIl7F%j?O*#Xy%AB@yOJ<5@iZkg_D@r;yb)h?uxw z9Nz33e+k!trE_C8EC6oU*;I0raPa}9{t0Y=tMf=c#rmwq0xO>Q(0Y+>#4fO zi6v{FTMTr0nKF>xZa;)Fm`|f-HBqoU5%oR)5+;Ji{(E@)0@OY*4&nX7M@FsAnmW9H zsN5>cS|VuJ=1Jo{eji`IUCsLKCkQpe&?XgNQ(vJI>B1e|DnLzD+ElP;HW|c_ja`z6 zA8QU4LpHSQiw(+VS@!NA;@_|Sz&8~n_|$t5KrQINYQCu;l=VSggiO~yB-G9w;Js=Q zH0i&Gx8FeRa_wfkf2iCN0Y{IM39RDBZxGjHd6hDde&V#gAquIqsbC4%Hb)FVdrcCt zC@`MPQ_9^r!+>*`b}xiwyKv2%vMM&1rzn!vtF#B}HxnWGtYp!6bK2 z!0k$lY4mOg(PmdyO(F4vUUhe{|4yQZ5`Dt>cHLR@gFyG#_D-YYME{fMM$?~Y(!DC9 zBX65q&LrAI*ZT(C?bxw~AY>E0dj9YV!L*Z`ndr->zVkm^m(k~L_YA63PY`nG`W)+1 zjd#%^HK21gZEj|zZmWgp&_%`J8zs8r(~@?ViMG-8@S*yOC+OFM&Yj=-u^M55kW2Ka z&-Vq*qW&uA)Ykihj}x6o^vJ}{&A$p~bX2DyZJM+agnYWbsMDo(Hi>@qUq8eJM+m|& zx?Z~Y%g6Q*rl6lJI9vS=(Zh*8Y8_i^D@{QH-DS)N4SpiJfarjJ^&{?eVDy^P;W0@x z@1u~ex7)p?{azYeEh4(wh+xehL_3I1J-M#NXY_tR_dfDQ-G-fM_XDEu__u0klIX~c z4o%h)J%X-lyY7vdmc;0+dZ#+RN3@Hs@2-4FGup`L=Tpx6zd^K{uJ7HJRnM;%qX#S) z-nbjlC3HPv|BWUGdNX=?X6k6Yk1lbc-_|w0o84C+WI#{F;h)O^n{L z>+EA)vjyQPx}N=VhpN|d7(IDzw_4E_K^RBZ$L+e%{DO_q?|=1ko4NUdFrKboY@HkV zkwhn7pWME-T@WVH^^G5|sdA%$(IKxbsS#U9+t1MT!9BILzi}`+XL{p?&5H$LGF>10 z?$U@3C5%4fSRONm=qYsF_{J8^&5?pImFSxd3^k9BVf2@I9qU!6&0eR`^~<`?8qTDB z4nYT})(AUB^mL+&{rkpln!xB`=6(rRh@MH;4@}6_E}P8gh5JSZd`a{yy8hk7Gxh#G zozY#)1NEI|&_arkImr<=PNJ`8j0!(U^c=drFspf|Q_s+XeMHaEJzud_nIM!Az0Me1 z`59WL3$*Y@P}P|Ea2jZtWy5j(*9#eatJ>D)%@zs5vvl2BHMiBr6iW-bd6lflI!gs% zKGEhZOQn`889nl>waRd!7tr+^WrwSNOTi|fvu9te)nc_EEF^kzrzcvRUd!nBhLl9q zTPFyM=z7K**COYwXSDXzo%Wv)y@amE6x^=z-DXCc=iRCizC{q0()HfkSJbXR<7S{= zc(YbWccPaO-RtN2ZD&e!{TeM|j}iSGT|fTAryZ)jAP6gnzP99}ng?j83UtpIZ`RY& zIKWDxmn`TUlDeDG{f+&@W)r=Nt|tVYi>>%Nqg&6vkmxA6!-S4Wc*Fb!<03{6j`#-}oIwZ=&nilzZq$jK+?~RZg?5im`QZ zABn~u#Pf*WO69Tr=DN=rjeRt~BYGQM$0mgf&oLUi4W1!-J6*^2S~tI8H1^4A|1H~R z30pV4aFNm2gXw3YcT#z5+H&j%Mq~GtYM0qo7TDV2z*RflrZWMA*jG(uh%q2xR=M4xS2t=4DC#!F_RDzVQ)2KG-erYYN-*YY+(x5z}Ae$ z{GxZ-Xv8TlnDWx4Eu%4aWfIYt`+(^bzqeyF=0$Xl)QFz|@ky{xoJRbXhi`lHh<=~S zV_17#0;4fL{Tq){21a#@g#6% zuB>=j^Q7d~Z1^%>`%+DIeO%yf?e{d^Z>BQSu4ecRtj*|QUmx?ELvxMb*4X?O2By|y zbla~}g2vO}KCZjwl{Ec#14dUk_)F8aA%b9~>l^**>LMC5y2`v4bQV2xcP0o|G)qGn z{Z+v3*8RhnTeE#tLSXe~jCQR$7TBGfc(^{hTA72MqR?;9ckErOZ*Iw4ANR_iqBlvd z&)IP!V$M^zza(h~MlgDhwp2T(Eu#giy>6FCM!z>Dv|dRRbAyI9-rq4QhSBeC zoSTpr%iJLC{Dpxl;uwAOd{EFw?U_sTd*N%1r;vLD*C*HViY76E(cexzsV(iq=tg@x z`)z-mxkN>Y-#5S5nYlinzuqCRL03jc9R4D(U!ov5NzQT8lq!MAj2`q$wZP;Q<`NyT zeH?Mm$moDJ?zVB=nM<_xz;?~>9*q8E)&%XER7U3>{Y3leKbU(|IQwSJ8NHZ$bm??b zpfQcnfdfAd9NUM{-$c(0da*B~8$Q`B?#q76C3?xyO4~S-(Iw*-Y5VtQF45JarGo!J zMn88dUSoJd5XRE;XK&96yhW}O=%+J!2DKZ^=#1HxAlnc|pE$KI^x2_|PKdHMIr2~D zHtqlXE&s{cjGjH$9I(gC+@`d{TQnsWM&BHktKDj4bk>&BEt}>tI^fQ*@IiUB%Oc(P z@V*m)S$0OBtCtg0HjL4iR$mL+JDj;zi8CrimKHMlorLv~+l!bBbtwJ3#$L?m{*O=8 zt{TDU#p!!%z3*i7jm1-IYuvQ&7u~B{S9_;@lFKEO^$l!a%G|G&S3eFc7{%!1qpt_8 z9nIXYHovzG$sEgEtI{T$G}WGBbi%H|+HT_*y*%Yx?UUmLVFt-xJVVp8?LJCj~uGoz)-K{IkWc2rCpS4by z#aywT$1ZA$XES{+sJ!{mhK>vA+zVX$k(Ie+G zx=nUK%(ey06^lAsvu^$(Mz21-t?tUjw1Ox7mKyiAX$CE2^rAC)+PTXZJ@Va?+IOB~ zboEWPjz2GFE?UoFV*_`rWc0%MDUFA%W^}sYeB;$?m|M2BX+Xsx>jYsj$!~IXi>B@d zMpqo4tWA5K(R1ow)IPnD(YX!RHs864xoGPSB~~fe!suhELju=sW%Oo;Ht5VYisdJn zLHoC9GG1VG!qk7%oUxO+X#HY##2U#(gS+U?3A#c#W?o|K6jAOw)UcbH38 z&F^H(t?x27E+qJE&4r_k{%z1kZJqZSJ+^ygzuq4(mo7Bi9(3;*qnA#IuNrrPxpX%w z4i3EWA)_BVdp)qlDMtTv z)6w5Dw-5Vi#(l?V>=HTr5~H#A;hOImja~IJE;AZ?#m%_F+(GO;X8e)S*imcjPmIPs zQ7>L&GTkKt+{a0@N_^uxY@u?jI{x`xMq@4Q>h~Cp6{5S-PK4!a58sm9N~~qO%a6I0SfTYw z1?Ea(-O&s+kDAQg#40VNk{gP(N4D422<59|;gb*x~Tv*I+uN=YLQ_Poso7`5+P{aJ& ziIS^|S*5Q> zL2_sD9sc6u%!S2w-8GUsi?5ZRc461?4K6T|(fG#HF^Rdh_-647xwde5F%sX}$Xr{D zFPpnD8l$F*yUW~M|JnliAC6+X#n8^?DmE24N=;6Ot6fQH4mqv&$MUlM1o2C?#avKe zbK0%4(mEmFTfbG0SL%zV2`Pyh04MK&iPI9gxgqC#$m-r^`MEGe>E z%x;_BZ6_@L%uk&5BE4B(Y<9ZsmXZRqlgc}sR(lbO=Q_=WHb|#`F58F_8$qE@O-Z0K zMJ}7A#BHYs8ch-`P8wXLS3{Y4T?wH`*b##+EVI-RK}lO4VeGlN-kooD<6&*1ik3t*oqyNe0@uL^1h?p`HmtIXw#20 zJMHG20viO2I%L(i08@+bKS{=8C+LgJMUHauOyd1}s1XY(OfG&?L_WQ<0{nVcNge@6 z_b+xjM%u0PyK+X0&t@sG+lt)!0(*|r>>RBF7yGHYux`MZ3K5t1M(MBF<#Jf;^a8B< zQoB1}=W;tCU3?oR(oWwMsv)Wxsf6Lr6|Mikq!dYyBPqWEoivc{Uk7EqtEJOs8R@B) z8Y***YEUiu`)Kvjnq$t1jf;C6O^GJ*gxtUQrn1 zi;vc^M;km;Uud?N%vLK5h(1i;yTs+z=h*b^J^83jx(6t^nDw7^rLWmC+~&5Dx=Yoh zQUKBA<1#f+4f0EhhMS5VE<>$ql%%63on$|pZWHRY0mC!+>O`X|g00BPE@C(cLqKT9 V*hebTe?bx;yhb#t8aboF{{tb7Xqo^3 literal 0 HcmV?d00001