From a2825ed71a66dd532e32ee91ee23fb2cbb5d59b4 Mon Sep 17 00:00:00 2001 From: astura Date: Sat, 18 Jul 2026 18:22:58 +0800 Subject: [PATCH] =?UTF-8?q?arduino=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- laser_ctl/laser_ctl.ino | 36 ++ laser_ctl/laser_servo_ctl/laser_servo_ctl.ino | 73 +++ laser_servo/laser_servo.ino | 103 ++++ .../examples/ADC/ADC.pde | 52 ++ .../examples/Blink/Blink.pde | 29 + .../examples/BlinkM/BlinkM.pde | 162 ++++++ .../examples/BlinkM/BlinkM_funcs.h | 440 ++++++++++++++ .../examples/Clapper/Clapper.pde | 94 +++ .../examples/Esp8266/HelloWorld.ino | 75 +++ .../examples/HelloWorld/HelloWorld.pde | 28 + .../examples/IrRanger/IrRanger.pde | 64 +++ .../examples/Logging/Logging.pde | 45 ++ .../examples/Odom/Odom.pde | 53 ++ .../examples/ServiceClient/ServiceClient.pde | 38 ++ .../examples/ServiceClient/client.py | 20 + .../examples/ServiceServer/ServiceServer.pde | 40 ++ .../examples/ServoControl/ServoControl.pde | 49 ++ .../examples/Temperature/Temperature.pde | 72 +++ .../examples/TimeTF/TimeTF.pde | 37 ++ .../examples/Ultrasound/Ultrasound.pde | 61 ++ .../button_example/button_example.pde | 61 ++ .../examples/pubsub/pubsub.pde | 40 ++ .../extras/tests/array_test/array_test.pde | 49 ++ .../tests/float64_test/float64_test.pde | 38 ++ .../extras/tests/time_test/time_test.pde | 30 + .../Rosserial_Arduino_Library/keywords.txt | 23 + .../library.properties | 10 + libraries/Rosserial_Arduino_Library/readme.md | 3 + .../src/ArduinoHardware.h | 106 ++++ .../src/Esp8266Hardware.h | 78 +++ .../src/actionlib/TestAction.h | 53 ++ .../src/actionlib/TestActionFeedback.h | 53 ++ .../src/actionlib/TestActionGoal.h | 53 ++ .../src/actionlib/TestActionResult.h | 53 ++ .../src/actionlib/TestFeedback.h | 61 ++ .../src/actionlib/TestGoal.h | 61 ++ .../src/actionlib/TestRequestAction.h | 53 ++ .../src/actionlib/TestRequestActionFeedback.h | 53 ++ .../src/actionlib/TestRequestActionGoal.h | 53 ++ .../src/actionlib/TestRequestActionResult.h | 53 ++ .../src/actionlib/TestRequestFeedback.h | 38 ++ .../src/actionlib/TestRequestGoal.h | 207 +++++++ .../src/actionlib/TestRequestResult.h | 78 +++ .../src/actionlib/TestResult.h | 61 ++ .../src/actionlib/TwoIntsAction.h | 53 ++ .../src/actionlib/TwoIntsActionFeedback.h | 53 ++ .../src/actionlib/TwoIntsActionGoal.h | 53 ++ .../src/actionlib/TwoIntsActionResult.h | 53 ++ .../src/actionlib/TwoIntsFeedback.h | 38 ++ .../src/actionlib/TwoIntsGoal.h | 100 ++++ .../src/actionlib/TwoIntsResult.h | 69 +++ .../src/actionlib_msgs/GoalID.h | 77 +++ .../src/actionlib_msgs/GoalStatus.h | 75 +++ .../src/actionlib_msgs/GoalStatusArray.h | 64 +++ .../src/actionlib_tutorials/AveragingAction.h | 53 ++ .../AveragingActionFeedback.h | 53 ++ .../actionlib_tutorials/AveragingActionGoal.h | 53 ++ .../AveragingActionResult.h | 53 ++ .../actionlib_tutorials/AveragingFeedback.h | 130 +++++ .../src/actionlib_tutorials/AveragingGoal.h | 61 ++ .../src/actionlib_tutorials/AveragingResult.h | 84 +++ .../src/actionlib_tutorials/FibonacciAction.h | 53 ++ .../FibonacciActionFeedback.h | 53 ++ .../actionlib_tutorials/FibonacciActionGoal.h | 53 ++ .../FibonacciActionResult.h | 53 ++ .../actionlib_tutorials/FibonacciFeedback.h | 77 +++ .../src/actionlib_tutorials/FibonacciGoal.h | 61 ++ .../src/actionlib_tutorials/FibonacciResult.h | 77 +++ .../src/bond/Constants.h | 44 ++ .../src/bond/Status.h | 138 +++++ .../FollowJointTrajectoryAction.h | 53 ++ .../FollowJointTrajectoryActionFeedback.h | 53 ++ .../FollowJointTrajectoryActionGoal.h | 53 ++ .../FollowJointTrajectoryActionResult.h | 53 ++ .../FollowJointTrajectoryFeedback.h | 88 +++ .../control_msgs/FollowJointTrajectoryGoal.h | 107 ++++ .../FollowJointTrajectoryResult.h | 83 +++ .../src/control_msgs/GripperCommand.h | 46 ++ .../src/control_msgs/GripperCommandAction.h | 53 ++ .../GripperCommandActionFeedback.h | 53 ++ .../control_msgs/GripperCommandActionGoal.h | 53 ++ .../control_msgs/GripperCommandActionResult.h | 53 ++ .../src/control_msgs/GripperCommandFeedback.h | 80 +++ .../src/control_msgs/GripperCommandGoal.h | 43 ++ .../src/control_msgs/GripperCommandResult.h | 80 +++ .../src/control_msgs/JointControllerState.h | 83 +++ .../src/control_msgs/JointTolerance.h | 66 +++ .../src/control_msgs/JointTrajectoryAction.h | 53 ++ .../JointTrajectoryActionFeedback.h | 53 ++ .../control_msgs/JointTrajectoryActionGoal.h | 53 ++ .../JointTrajectoryActionResult.h | 53 ++ .../JointTrajectoryControllerState.h | 88 +++ .../control_msgs/JointTrajectoryFeedback.h | 38 ++ .../src/control_msgs/JointTrajectoryGoal.h | 43 ++ .../src/control_msgs/JointTrajectoryResult.h | 38 ++ .../src/control_msgs/PointHeadAction.h | 53 ++ .../control_msgs/PointHeadActionFeedback.h | 53 ++ .../src/control_msgs/PointHeadActionGoal.h | 53 ++ .../src/control_msgs/PointHeadActionResult.h | 53 ++ .../src/control_msgs/PointHeadFeedback.h | 42 ++ .../src/control_msgs/PointHeadGoal.h | 91 +++ .../src/control_msgs/PointHeadResult.h | 38 ++ .../src/control_msgs/QueryCalibrationState.h | 87 +++ .../src/control_msgs/QueryTrajectoryState.h | 185 ++++++ .../control_msgs/SingleJointPositionAction.h | 53 ++ .../SingleJointPositionActionFeedback.h | 53 ++ .../SingleJointPositionActionGoal.h | 53 ++ .../SingleJointPositionActionResult.h | 53 ++ .../SingleJointPositionFeedback.h | 55 ++ .../control_msgs/SingleJointPositionGoal.h | 69 +++ .../control_msgs/SingleJointPositionResult.h | 38 ++ .../src/diagnostic_msgs/DiagnosticArray.h | 64 +++ .../src/diagnostic_msgs/DiagnosticStatus.h | 128 +++++ .../src/diagnostic_msgs/KeyValue.h | 70 +++ .../src/diagnostic_msgs/SelfTest.h | 124 ++++ .../src/driver_base/ConfigString.h | 70 +++ .../src/driver_base/ConfigValue.h | 58 ++ .../src/driver_base/SensorLevels.h | 41 ++ .../src/duration.cpp | 81 +++ .../src/dynamic_reconfigure/BoolParameter.h | 71 +++ .../src/dynamic_reconfigure/Config.h | 143 +++++ .../dynamic_reconfigure/ConfigDescription.h | 72 +++ .../src/dynamic_reconfigure/DoubleParameter.h | 58 ++ .../src/dynamic_reconfigure/Group.h | 137 +++++ .../src/dynamic_reconfigure/GroupState.h | 117 ++++ .../src/dynamic_reconfigure/IntParameter.h | 77 +++ .../dynamic_reconfigure/ParamDescription.h | 114 ++++ .../src/dynamic_reconfigure/Reconfigure.h | 79 +++ .../src/dynamic_reconfigure/SensorLevels.h | 41 ++ .../src/dynamic_reconfigure/StrParameter.h | 70 +++ .../src/examples/ADC/ADC.pde | 52 ++ .../src/examples/Blink/Blink.pde | 29 + .../src/examples/BlinkM/BlinkM.pde | 162 ++++++ .../src/examples/BlinkM/BlinkM_funcs.h | 440 ++++++++++++++ .../src/examples/Clapper/Clapper.pde | 94 +++ .../src/examples/HelloWorld/HelloWorld.pde | 28 + .../src/examples/IrRanger/IrRanger.pde | 64 +++ .../src/examples/Logging/Logging.pde | 45 ++ .../src/examples/Odom/Odom.pde | 53 ++ .../examples/ServiceClient/ServiceClient.pde | 38 ++ .../src/examples/ServiceClient/client.py | 20 + .../examples/ServiceServer/ServiceServer.pde | 40 ++ .../examples/ServoControl/ServoControl.pde | 49 ++ .../src/examples/Temperature/Temperature.pde | 72 +++ .../src/examples/TimeTF/TimeTF.pde | 37 ++ .../src/examples/Ultrasound/Ultrasound.pde | 61 ++ .../button_example/button_example.pde | 61 ++ .../src/examples/pubsub/pubsub.pde | 40 ++ .../src/gazebo_msgs/ApplyBodyWrench.h | 191 ++++++ .../src/gazebo_msgs/ApplyJointEffort.h | 169 ++++++ .../src/gazebo_msgs/BodyRequest.h | 86 +++ .../src/gazebo_msgs/ContactState.h | 172 ++++++ .../src/gazebo_msgs/ContactsState.h | 64 +++ .../src/gazebo_msgs/DeleteModel.h | 119 ++++ .../src/gazebo_msgs/GetJointProperties.h | 191 ++++++ .../src/gazebo_msgs/GetLinkProperties.h | 169 ++++++ .../src/gazebo_msgs/GetLinkState.h | 140 +++++ .../src/gazebo_msgs/GetModelProperties.h | 296 ++++++++++ .../src/gazebo_msgs/GetModelState.h | 145 +++++ .../src/gazebo_msgs/GetPhysicsProperties.h | 138 +++++ .../src/gazebo_msgs/GetWorldProperties.h | 156 +++++ .../src/gazebo_msgs/JointRequest.h | 86 +++ .../src/gazebo_msgs/LinkState.h | 80 +++ .../src/gazebo_msgs/LinkStates.h | 112 ++++ .../src/gazebo_msgs/ModelState.h | 80 +++ .../src/gazebo_msgs/ModelStates.h | 112 ++++ .../src/gazebo_msgs/ODEJointProperties.h | 238 ++++++++ .../src/gazebo_msgs/ODEPhysics.h | 115 ++++ .../src/gazebo_msgs/SetJointProperties.h | 124 ++++ .../src/gazebo_msgs/SetJointTrajectory.h | 163 ++++++ .../src/gazebo_msgs/SetLinkProperties.h | 169 ++++++ .../src/gazebo_msgs/SetLinkState.h | 108 ++++ .../src/gazebo_msgs/SetModelConfiguration.h | 187 ++++++ .../src/gazebo_msgs/SetModelState.h | 108 ++++ .../src/gazebo_msgs/SetPhysicsProperties.h | 121 ++++ .../src/gazebo_msgs/SpawnModel.h | 172 ++++++ .../src/gazebo_msgs/WorldState.h | 138 +++++ .../src/geometry_msgs/Accel.h | 47 ++ .../src/geometry_msgs/AccelStamped.h | 48 ++ .../src/geometry_msgs/AccelWithCovariance.h | 51 ++ .../AccelWithCovarianceStamped.h | 48 ++ .../src/geometry_msgs/Inertia.h | 71 +++ .../src/geometry_msgs/InertiaStamped.h | 48 ++ .../src/geometry_msgs/Point.h | 50 ++ .../src/geometry_msgs/Point32.h | 107 ++++ .../src/geometry_msgs/PointStamped.h | 48 ++ .../src/geometry_msgs/Polygon.h | 59 ++ .../src/geometry_msgs/PolygonStamped.h | 48 ++ .../src/geometry_msgs/Pose.h | 48 ++ .../src/geometry_msgs/Pose2D.h | 50 ++ .../src/geometry_msgs/PoseArray.h | 64 +++ .../src/geometry_msgs/PoseStamped.h | 48 ++ .../src/geometry_msgs/PoseWithCovariance.h | 51 ++ .../geometry_msgs/PoseWithCovarianceStamped.h | 48 ++ .../src/geometry_msgs/Quaternion.h | 54 ++ .../src/geometry_msgs/QuaternionStamped.h | 48 ++ .../src/geometry_msgs/Transform.h | 48 ++ .../src/geometry_msgs/TransformStamped.h | 64 +++ .../src/geometry_msgs/Twist.h | 47 ++ .../src/geometry_msgs/TwistStamped.h | 48 ++ .../src/geometry_msgs/TwistWithCovariance.h | 51 ++ .../TwistWithCovarianceStamped.h | 48 ++ .../src/geometry_msgs/Vector3.h | 50 ++ .../src/geometry_msgs/Vector3Stamped.h | 48 ++ .../src/geometry_msgs/Wrench.h | 47 ++ .../src/geometry_msgs/WrenchStamped.h | 48 ++ .../src/laser_assembler/AssembleScans.h | 120 ++++ .../src/laser_assembler/AssembleScans2.h | 120 ++++ .../src/map_msgs/GetMapROI.h | 91 +++ .../src/map_msgs/GetPointMap.h | 75 +++ .../src/map_msgs/GetPointMapROI.h | 103 ++++ .../src/map_msgs/OccupancyGridUpdate.h | 146 +++++ .../src/map_msgs/PointCloud2Update.h | 62 ++ .../src/map_msgs/ProjectedMap.h | 51 ++ .../src/map_msgs/ProjectedMapInfo.h | 78 +++ .../src/map_msgs/ProjectedMapsInfo.h | 91 +++ .../src/map_msgs/SaveMap.h | 75 +++ .../src/map_msgs/SetMapProjections.h | 91 +++ .../src/move_base_msgs/MoveBaseAction.h | 53 ++ .../move_base_msgs/MoveBaseActionFeedback.h | 53 ++ .../src/move_base_msgs/MoveBaseActionGoal.h | 53 ++ .../src/move_base_msgs/MoveBaseActionResult.h | 53 ++ .../src/move_base_msgs/MoveBaseFeedback.h | 43 ++ .../src/move_base_msgs/MoveBaseGoal.h | 43 ++ .../src/move_base_msgs/MoveBaseResult.h | 38 ++ .../src/nav_msgs/GetMap.h | 75 +++ .../src/nav_msgs/GetMapAction.h | 53 ++ .../src/nav_msgs/GetMapActionFeedback.h | 53 ++ .../src/nav_msgs/GetMapActionGoal.h | 53 ++ .../src/nav_msgs/GetMapActionResult.h | 53 ++ .../src/nav_msgs/GetMapFeedback.h | 38 ++ .../src/nav_msgs/GetMapGoal.h | 38 ++ .../src/nav_msgs/GetMapResult.h | 43 ++ .../src/nav_msgs/GetPlan.h | 107 ++++ .../src/nav_msgs/GridCells.h | 110 ++++ .../src/nav_msgs/MapMetaData.h | 113 ++++ .../src/nav_msgs/OccupancyGrid.h | 81 +++ .../src/nav_msgs/Odometry.h | 69 +++ .../src/nav_msgs/Path.h | 64 +++ .../src/nav_msgs/SetMap.h | 97 ++++ .../src/nodelet/NodeletList.h | 102 ++++ .../src/nodelet/NodeletLoad.h | 231 ++++++++ .../src/nodelet/NodeletUnload.h | 103 ++++ .../src/octomap_msgs/BoundingBoxQuery.h | 79 +++ .../src/octomap_msgs/GetOctomap.h | 75 +++ .../src/octomap_msgs/Octomap.h | 113 ++++ .../src/octomap_msgs/OctomapWithPose.h | 53 ++ .../src/opencv_apps/Circle.h | 47 ++ .../src/opencv_apps/CircleArray.h | 59 ++ .../src/opencv_apps/CircleArrayStamped.h | 64 +++ .../src/opencv_apps/Contour.h | 59 ++ .../src/opencv_apps/ContourArray.h | 59 ++ .../src/opencv_apps/ContourArrayStamped.h | 64 +++ .../src/opencv_apps/Face.h | 63 ++ .../src/opencv_apps/FaceArray.h | 59 ++ .../src/opencv_apps/FaceArrayStamped.h | 64 +++ .../src/opencv_apps/Flow.h | 47 ++ .../src/opencv_apps/FlowArray.h | 59 ++ .../src/opencv_apps/FlowArrayStamped.h | 64 +++ .../src/opencv_apps/FlowStamped.h | 48 ++ .../src/opencv_apps/Line.h | 47 ++ .../src/opencv_apps/LineArray.h | 59 ++ .../src/opencv_apps/LineArrayStamped.h | 64 +++ .../src/opencv_apps/Moment.h | 147 +++++ .../src/opencv_apps/MomentArray.h | 59 ++ .../src/opencv_apps/MomentArrayStamped.h | 64 +++ .../src/opencv_apps/Point2D.h | 46 ++ .../src/opencv_apps/Point2DArray.h | 59 ++ .../src/opencv_apps/Point2DArrayStamped.h | 64 +++ .../src/opencv_apps/Point2DStamped.h | 48 ++ .../src/opencv_apps/Rect.h | 54 ++ .../src/opencv_apps/RectArray.h | 59 ++ .../src/opencv_apps/RectArrayStamped.h | 64 +++ .../src/opencv_apps/RotatedRect.h | 52 ++ .../src/opencv_apps/RotatedRectArray.h | 59 ++ .../src/opencv_apps/RotatedRectArrayStamped.h | 64 +++ .../src/opencv_apps/RotatedRectStamped.h | 48 ++ .../src/opencv_apps/Size.h | 46 ++ .../src/pcl_msgs/ModelCoefficients.h | 82 +++ .../src/pcl_msgs/PointIndices.h | 82 +++ .../src/pcl_msgs/PolygonMesh.h | 69 +++ .../src/pcl_msgs/Vertices.h | 66 +++ .../src/polled_camera/GetPolledImage.h | 194 +++++++ libraries/Rosserial_Arduino_Library/src/ros.h | 58 ++ .../src/ros/duration.h | 67 +++ .../Rosserial_Arduino_Library/src/ros/msg.h | 129 +++++ .../src/ros/node_handle.h | 543 ++++++++++++++++++ .../src/ros/publisher.h | 67 +++ .../src/ros/service_client.h | 83 +++ .../src/ros/service_server.h | 76 +++ .../src/ros/subscriber.h | 88 +++ .../Rosserial_Arduino_Library/src/ros/time.h | 73 +++ .../src/roscpp/Empty.h | 70 +++ .../src/roscpp/GetLoggers.h | 91 +++ .../src/roscpp/Logger.h | 70 +++ .../src/roscpp/SetLoggerLevel.h | 102 ++++ .../src/roscpp_tutorials/TwoInts.h | 163 ++++++ .../src/rosgraph_msgs/Clock.h | 61 ++ .../src/rosgraph_msgs/Log.h | 173 ++++++ .../src/rosgraph_msgs/TopicStatistics.h | 333 +++++++++++ .../src/rospy_tutorials/AddTwoInts.h | 163 ++++++ .../src/rospy_tutorials/BadTwoInts.h | 147 +++++ .../src/rospy_tutorials/Floats.h | 77 +++ .../src/rospy_tutorials/HeaderString.h | 59 ++ .../src/rosserial_arduino/Adc.h | 86 +++ .../src/rosserial_arduino/Test.h | 102 ++++ .../src/rosserial_msgs/Log.h | 65 +++ .../src/rosserial_msgs/RequestMessageInfo.h | 118 ++++ .../src/rosserial_msgs/RequestParam.h | 196 +++++++ .../src/rosserial_msgs/RequestServiceInfo.h | 134 +++++ .../src/rosserial_msgs/TopicInfo.h | 125 ++++ .../src/sensor_msgs/CameraInfo.h | 156 +++++ .../src/sensor_msgs/ChannelFloat32.h | 93 +++ .../src/sensor_msgs/CompressedImage.h | 81 +++ .../src/sensor_msgs/FluidPressure.h | 51 ++ .../src/sensor_msgs/Illuminance.h | 51 ++ .../src/sensor_msgs/Image.h | 123 ++++ .../src/sensor_msgs/Imu.h | 81 +++ .../src/sensor_msgs/JointState.h | 135 +++++ .../src/sensor_msgs/Joy.h | 121 ++++ .../src/sensor_msgs/JoyFeedback.h | 76 +++ .../src/sensor_msgs/JoyFeedbackArray.h | 59 ++ .../src/sensor_msgs/LaserEcho.h | 77 +++ .../src/sensor_msgs/LaserScan.h | 282 +++++++++ .../src/sensor_msgs/MagneticField.h | 56 ++ .../src/sensor_msgs/MultiDOFJointState.h | 138 +++++ .../src/sensor_msgs/MultiEchoLaserScan.h | 245 ++++++++ .../src/sensor_msgs/NavSatFix.h | 78 +++ .../src/sensor_msgs/NavSatStatus.h | 71 +++ .../src/sensor_msgs/PointCloud.h | 85 +++ .../src/sensor_msgs/PointCloud2.h | 168 ++++++ .../src/sensor_msgs/PointField.h | 92 +++ .../src/sensor_msgs/Range.h | 143 +++++ .../src/sensor_msgs/RegionOfInterest.h | 103 ++++ .../src/sensor_msgs/RelativeHumidity.h | 51 ++ .../src/sensor_msgs/SetCameraInfo.h | 108 ++++ .../src/sensor_msgs/Temperature.h | 51 ++ .../src/sensor_msgs/TimeReference.h | 82 +++ .../src/shape_msgs/Mesh.h | 80 +++ .../src/shape_msgs/MeshTriangle.h | 54 ++ .../src/shape_msgs/Plane.h | 46 ++ .../src/shape_msgs/SolidPrimitive.h | 76 +++ .../SmachContainerInitialStatusCmd.h | 102 ++++ .../src/smach_msgs/SmachContainerStatus.h | 155 +++++ .../src/smach_msgs/SmachContainerStructure.h | 219 +++++++ .../src/std_msgs/Bool.h | 55 ++ .../src/std_msgs/Byte.h | 55 ++ .../src/std_msgs/ByteMultiArray.h | 76 +++ .../src/std_msgs/Char.h | 44 ++ .../src/std_msgs/ColorRGBA.h | 130 +++++ .../src/std_msgs/Duration.h | 61 ++ .../src/std_msgs/Empty.h | 38 ++ .../src/std_msgs/Float32.h | 61 ++ .../src/std_msgs/Float32MultiArray.h | 82 +++ .../src/std_msgs/Float64.h | 42 ++ .../src/std_msgs/Float64MultiArray.h | 63 ++ .../src/std_msgs/Header.h | 89 +++ .../src/std_msgs/Int16.h | 57 ++ .../src/std_msgs/Int16MultiArray.h | 78 +++ .../src/std_msgs/Int32.h | 61 ++ .../src/std_msgs/Int32MultiArray.h | 82 +++ .../src/std_msgs/Int64.h | 69 +++ .../src/std_msgs/Int64MultiArray.h | 90 +++ .../src/std_msgs/Int8.h | 55 ++ .../src/std_msgs/Int8MultiArray.h | 76 +++ .../src/std_msgs/MultiArrayDimension.h | 78 +++ .../src/std_msgs/MultiArrayLayout.h | 71 +++ .../src/std_msgs/String.h | 54 ++ .../src/std_msgs/Time.h | 61 ++ .../src/std_msgs/UInt16.h | 46 ++ .../src/std_msgs/UInt16MultiArray.h | 67 +++ .../src/std_msgs/UInt32.h | 50 ++ .../src/std_msgs/UInt32MultiArray.h | 71 +++ .../src/std_msgs/UInt64.h | 61 ++ .../src/std_msgs/UInt64MultiArray.h | 82 +++ .../src/std_msgs/UInt8.h | 44 ++ .../src/std_msgs/UInt8MultiArray.h | 65 +++ .../src/std_srvs/Empty.h | 70 +++ .../src/std_srvs/Trigger.h | 103 ++++ .../src/stereo_msgs/DisparityImage.h | 168 ++++++ .../src/tests/array_test/array_test.pde | 49 ++ .../src/tests/float64_test/float64_test.pde | 38 ++ .../src/tests/time_test/time_test.pde | 30 + .../src/tf/FrameGraph.h | 86 +++ .../Rosserial_Arduino_Library/src/tf/tf.h | 56 ++ .../src/tf/tfMessage.h | 59 ++ .../src/tf/transform_broadcaster.h | 68 +++ .../src/tf2_msgs/FrameGraph.h | 86 +++ .../src/tf2_msgs/LookupTransformAction.h | 53 ++ .../tf2_msgs/LookupTransformActionFeedback.h | 53 ++ .../src/tf2_msgs/LookupTransformActionGoal.h | 53 ++ .../tf2_msgs/LookupTransformActionResult.h | 53 ++ .../src/tf2_msgs/LookupTransformFeedback.h | 38 ++ .../src/tf2_msgs/LookupTransformGoal.h | 171 ++++++ .../src/tf2_msgs/LookupTransformResult.h | 48 ++ .../src/tf2_msgs/TF2Error.h | 67 +++ .../src/tf2_msgs/TFMessage.h | 59 ++ .../src/theora_image_transport/Packet.h | 173 ++++++ .../Rosserial_Arduino_Library/src/time.cpp | 68 +++ .../src/topic_tools/DemuxAdd.h | 86 +++ .../src/topic_tools/DemuxDelete.h | 86 +++ .../src/topic_tools/DemuxList.h | 102 ++++ .../src/topic_tools/DemuxSelect.h | 102 ++++ .../src/topic_tools/MuxAdd.h | 86 +++ .../src/topic_tools/MuxDelete.h | 86 +++ .../src/topic_tools/MuxList.h | 102 ++++ .../src/topic_tools/MuxSelect.h | 102 ++++ .../src/trajectory_msgs/JointTrajectory.h | 96 ++++ .../trajectory_msgs/JointTrajectoryPoint.h | 141 +++++ .../trajectory_msgs/MultiDOFJointTrajectory.h | 96 ++++ .../MultiDOFJointTrajectoryPoint.h | 123 ++++ .../src/turtle_actionlib/ShapeAction.h | 53 ++ .../turtle_actionlib/ShapeActionFeedback.h | 53 ++ .../src/turtle_actionlib/ShapeActionGoal.h | 53 ++ .../src/turtle_actionlib/ShapeActionResult.h | 53 ++ .../src/turtle_actionlib/ShapeFeedback.h | 38 ++ .../src/turtle_actionlib/ShapeGoal.h | 84 +++ .../src/turtle_actionlib/ShapeResult.h | 84 +++ .../src/turtle_actionlib/Velocity.h | 84 +++ .../src/turtlesim/Color.h | 56 ++ .../src/turtlesim/Kill.h | 86 +++ .../src/turtlesim/Pose.h | 153 +++++ .../src/turtlesim/SetPen.h | 100 ++++ .../src/turtlesim/Spawn.h | 171 ++++++ .../src/turtlesim/TeleportAbsolute.h | 139 +++++ .../src/turtlesim/TeleportRelative.h | 116 ++++ .../src/visualization_msgs/ImageMarker.h | 241 ++++++++ .../visualization_msgs/InteractiveMarker.h | 145 +++++ .../InteractiveMarkerControl.h | 155 +++++ .../InteractiveMarkerFeedback.h | 142 +++++ .../InteractiveMarkerInit.h | 98 ++++ .../InteractiveMarkerPose.h | 64 +++ .../InteractiveMarkerUpdate.h | 159 +++++ .../src/visualization_msgs/Marker.h | 288 ++++++++++ .../src/visualization_msgs/MarkerArray.h | 59 ++ .../src/visualization_msgs/MenuEntry.h | 103 ++++ libraries/readme.txt | 1 + 舵机/sketch_jun16b.ino | 185 ++++++ 438 files changed, 36538 insertions(+) create mode 100644 laser_ctl/laser_ctl.ino create mode 100644 laser_ctl/laser_servo_ctl/laser_servo_ctl.ino create mode 100644 laser_servo/laser_servo.ino create mode 100644 libraries/Rosserial_Arduino_Library/examples/ADC/ADC.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/Blink/Blink.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/BlinkM/BlinkM.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/BlinkM/BlinkM_funcs.h create mode 100644 libraries/Rosserial_Arduino_Library/examples/Clapper/Clapper.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/Esp8266/HelloWorld.ino create mode 100644 libraries/Rosserial_Arduino_Library/examples/HelloWorld/HelloWorld.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/IrRanger/IrRanger.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/Logging/Logging.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/Odom/Odom.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/ServiceClient/ServiceClient.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/ServiceClient/client.py create mode 100644 libraries/Rosserial_Arduino_Library/examples/ServiceServer/ServiceServer.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/ServoControl/ServoControl.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/Temperature/Temperature.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/TimeTF/TimeTF.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/Ultrasound/Ultrasound.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/button_example/button_example.pde create mode 100644 libraries/Rosserial_Arduino_Library/examples/pubsub/pubsub.pde create mode 100644 libraries/Rosserial_Arduino_Library/extras/tests/array_test/array_test.pde create mode 100644 libraries/Rosserial_Arduino_Library/extras/tests/float64_test/float64_test.pde create mode 100644 libraries/Rosserial_Arduino_Library/extras/tests/time_test/time_test.pde create mode 100644 libraries/Rosserial_Arduino_Library/keywords.txt create mode 100644 libraries/Rosserial_Arduino_Library/library.properties create mode 100644 libraries/Rosserial_Arduino_Library/readme.md create mode 100644 libraries/Rosserial_Arduino_Library/src/ArduinoHardware.h create mode 100644 libraries/Rosserial_Arduino_Library/src/Esp8266Hardware.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TestResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalID.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalStatus.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalStatusArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/bond/Constants.h create mode 100644 libraries/Rosserial_Arduino_Library/src/bond/Status.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommand.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/JointControllerState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/JointTolerance.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryControllerState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/QueryCalibrationState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/QueryTrajectoryState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/DiagnosticArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/DiagnosticStatus.h create mode 100644 libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/KeyValue.h create mode 100644 libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/SelfTest.h create mode 100644 libraries/Rosserial_Arduino_Library/src/driver_base/ConfigString.h create mode 100644 libraries/Rosserial_Arduino_Library/src/driver_base/ConfigValue.h create mode 100644 libraries/Rosserial_Arduino_Library/src/driver_base/SensorLevels.h create mode 100644 libraries/Rosserial_Arduino_Library/src/duration.cpp create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/BoolParameter.h create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Config.h create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/ConfigDescription.h create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/DoubleParameter.h create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Group.h create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/GroupState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/IntParameter.h create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/ParamDescription.h create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Reconfigure.h create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/SensorLevels.h create mode 100644 libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/StrParameter.h create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/ADC/ADC.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/Blink/Blink.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/BlinkM/BlinkM.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/BlinkM/BlinkM_funcs.h create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/Clapper/Clapper.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/HelloWorld/HelloWorld.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/IrRanger/IrRanger.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/Logging/Logging.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/Odom/Odom.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/ServiceClient/ServiceClient.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/ServiceClient/client.py create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/ServiceServer/ServiceServer.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/ServoControl/ServoControl.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/Temperature/Temperature.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/TimeTF/TimeTF.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/Ultrasound/Ultrasound.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/button_example/button_example.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/examples/pubsub/pubsub.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ApplyBodyWrench.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ApplyJointEffort.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/BodyRequest.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ContactState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ContactsState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/DeleteModel.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetJointProperties.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetLinkProperties.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetLinkState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetModelProperties.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetModelState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetPhysicsProperties.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetWorldProperties.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/JointRequest.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/LinkState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/LinkStates.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ModelState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ModelStates.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ODEJointProperties.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ODEPhysics.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetJointProperties.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetJointTrajectory.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetLinkProperties.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetLinkState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetModelConfiguration.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetModelState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetPhysicsProperties.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SpawnModel.h create mode 100644 libraries/Rosserial_Arduino_Library/src/gazebo_msgs/WorldState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Accel.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelWithCovariance.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelWithCovarianceStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Inertia.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/InertiaStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Point.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Point32.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/PointStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Polygon.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/PolygonStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Pose.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Pose2D.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseWithCovariance.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseWithCovarianceStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Quaternion.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/QuaternionStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Transform.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/TransformStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Twist.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistWithCovariance.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistWithCovarianceStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Vector3.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Vector3Stamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/Wrench.h create mode 100644 libraries/Rosserial_Arduino_Library/src/geometry_msgs/WrenchStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/laser_assembler/AssembleScans.h create mode 100644 libraries/Rosserial_Arduino_Library/src/laser_assembler/AssembleScans2.h create mode 100644 libraries/Rosserial_Arduino_Library/src/map_msgs/GetMapROI.h create mode 100644 libraries/Rosserial_Arduino_Library/src/map_msgs/GetPointMap.h create mode 100644 libraries/Rosserial_Arduino_Library/src/map_msgs/GetPointMapROI.h create mode 100644 libraries/Rosserial_Arduino_Library/src/map_msgs/OccupancyGridUpdate.h create mode 100644 libraries/Rosserial_Arduino_Library/src/map_msgs/PointCloud2Update.h create mode 100644 libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMap.h create mode 100644 libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMapInfo.h create mode 100644 libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMapsInfo.h create mode 100644 libraries/Rosserial_Arduino_Library/src/map_msgs/SaveMap.h create mode 100644 libraries/Rosserial_Arduino_Library/src/map_msgs/SetMapProjections.h create mode 100644 libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMap.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/GetPlan.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/GridCells.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/MapMetaData.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/OccupancyGrid.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/Odometry.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/Path.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nav_msgs/SetMap.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nodelet/NodeletList.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nodelet/NodeletLoad.h create mode 100644 libraries/Rosserial_Arduino_Library/src/nodelet/NodeletUnload.h create mode 100644 libraries/Rosserial_Arduino_Library/src/octomap_msgs/BoundingBoxQuery.h create mode 100644 libraries/Rosserial_Arduino_Library/src/octomap_msgs/GetOctomap.h create mode 100644 libraries/Rosserial_Arduino_Library/src/octomap_msgs/Octomap.h create mode 100644 libraries/Rosserial_Arduino_Library/src/octomap_msgs/OctomapWithPose.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Circle.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/CircleArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/CircleArrayStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Contour.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/ContourArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/ContourArrayStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Face.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/FaceArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/FaceArrayStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Flow.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowArrayStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Line.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/LineArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/LineArrayStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Moment.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/MomentArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/MomentArrayStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2D.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DArrayStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Rect.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/RectArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/RectArrayStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRect.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectArrayStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectStamped.h create mode 100644 libraries/Rosserial_Arduino_Library/src/opencv_apps/Size.h create mode 100644 libraries/Rosserial_Arduino_Library/src/pcl_msgs/ModelCoefficients.h create mode 100644 libraries/Rosserial_Arduino_Library/src/pcl_msgs/PointIndices.h create mode 100644 libraries/Rosserial_Arduino_Library/src/pcl_msgs/PolygonMesh.h create mode 100644 libraries/Rosserial_Arduino_Library/src/pcl_msgs/Vertices.h create mode 100644 libraries/Rosserial_Arduino_Library/src/polled_camera/GetPolledImage.h create mode 100644 libraries/Rosserial_Arduino_Library/src/ros.h create mode 100644 libraries/Rosserial_Arduino_Library/src/ros/duration.h create mode 100644 libraries/Rosserial_Arduino_Library/src/ros/msg.h create mode 100644 libraries/Rosserial_Arduino_Library/src/ros/node_handle.h create mode 100644 libraries/Rosserial_Arduino_Library/src/ros/publisher.h create mode 100644 libraries/Rosserial_Arduino_Library/src/ros/service_client.h create mode 100644 libraries/Rosserial_Arduino_Library/src/ros/service_server.h create mode 100644 libraries/Rosserial_Arduino_Library/src/ros/subscriber.h create mode 100644 libraries/Rosserial_Arduino_Library/src/ros/time.h create mode 100644 libraries/Rosserial_Arduino_Library/src/roscpp/Empty.h create mode 100644 libraries/Rosserial_Arduino_Library/src/roscpp/GetLoggers.h create mode 100644 libraries/Rosserial_Arduino_Library/src/roscpp/Logger.h create mode 100644 libraries/Rosserial_Arduino_Library/src/roscpp/SetLoggerLevel.h create mode 100644 libraries/Rosserial_Arduino_Library/src/roscpp_tutorials/TwoInts.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/Clock.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/Log.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/TopicStatistics.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rospy_tutorials/AddTwoInts.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rospy_tutorials/BadTwoInts.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rospy_tutorials/Floats.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rospy_tutorials/HeaderString.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rosserial_arduino/Adc.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rosserial_arduino/Test.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rosserial_msgs/Log.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestMessageInfo.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestParam.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestServiceInfo.h create mode 100644 libraries/Rosserial_Arduino_Library/src/rosserial_msgs/TopicInfo.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/CameraInfo.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/ChannelFloat32.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/CompressedImage.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/FluidPressure.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/Illuminance.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/Image.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/Imu.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/JointState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/Joy.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/JoyFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/JoyFeedbackArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/LaserEcho.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/LaserScan.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/MagneticField.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/MultiDOFJointState.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/MultiEchoLaserScan.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/NavSatFix.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/NavSatStatus.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointCloud.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointCloud2.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointField.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/Range.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/RegionOfInterest.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/RelativeHumidity.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/SetCameraInfo.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/Temperature.h create mode 100644 libraries/Rosserial_Arduino_Library/src/sensor_msgs/TimeReference.h create mode 100644 libraries/Rosserial_Arduino_Library/src/shape_msgs/Mesh.h create mode 100644 libraries/Rosserial_Arduino_Library/src/shape_msgs/MeshTriangle.h create mode 100644 libraries/Rosserial_Arduino_Library/src/shape_msgs/Plane.h create mode 100644 libraries/Rosserial_Arduino_Library/src/shape_msgs/SolidPrimitive.h create mode 100644 libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerInitialStatusCmd.h create mode 100644 libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerStatus.h create mode 100644 libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerStructure.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Bool.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Byte.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/ByteMultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Char.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/ColorRGBA.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Duration.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Empty.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Float32.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Float32MultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Float64.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Float64MultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Header.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Int16.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Int16MultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Int32.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Int32MultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Int64.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Int64MultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Int8.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Int8MultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/MultiArrayDimension.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/MultiArrayLayout.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/String.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/Time.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/UInt16.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/UInt16MultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/UInt32.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/UInt32MultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/UInt64.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/UInt64MultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/UInt8.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_msgs/UInt8MultiArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_srvs/Empty.h create mode 100644 libraries/Rosserial_Arduino_Library/src/std_srvs/Trigger.h create mode 100644 libraries/Rosserial_Arduino_Library/src/stereo_msgs/DisparityImage.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tests/array_test/array_test.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/tests/float64_test/float64_test.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/tests/time_test/time_test.pde create mode 100644 libraries/Rosserial_Arduino_Library/src/tf/FrameGraph.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf/tf.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf/tfMessage.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf/transform_broadcaster.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf2_msgs/FrameGraph.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf2_msgs/TF2Error.h create mode 100644 libraries/Rosserial_Arduino_Library/src/tf2_msgs/TFMessage.h create mode 100644 libraries/Rosserial_Arduino_Library/src/theora_image_transport/Packet.h create mode 100644 libraries/Rosserial_Arduino_Library/src/time.cpp create mode 100644 libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxAdd.h create mode 100644 libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxDelete.h create mode 100644 libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxList.h create mode 100644 libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxSelect.h create mode 100644 libraries/Rosserial_Arduino_Library/src/topic_tools/MuxAdd.h create mode 100644 libraries/Rosserial_Arduino_Library/src/topic_tools/MuxDelete.h create mode 100644 libraries/Rosserial_Arduino_Library/src/topic_tools/MuxList.h create mode 100644 libraries/Rosserial_Arduino_Library/src/topic_tools/MuxSelect.h create mode 100644 libraries/Rosserial_Arduino_Library/src/trajectory_msgs/JointTrajectory.h create mode 100644 libraries/Rosserial_Arduino_Library/src/trajectory_msgs/JointTrajectoryPoint.h create mode 100644 libraries/Rosserial_Arduino_Library/src/trajectory_msgs/MultiDOFJointTrajectory.h create mode 100644 libraries/Rosserial_Arduino_Library/src/trajectory_msgs/MultiDOFJointTrajectoryPoint.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeAction.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeGoal.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeResult.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtle_actionlib/Velocity.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtlesim/Color.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtlesim/Kill.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtlesim/Pose.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtlesim/SetPen.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtlesim/Spawn.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtlesim/TeleportAbsolute.h create mode 100644 libraries/Rosserial_Arduino_Library/src/turtlesim/TeleportRelative.h create mode 100644 libraries/Rosserial_Arduino_Library/src/visualization_msgs/ImageMarker.h create mode 100644 libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarker.h create mode 100644 libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerControl.h create mode 100644 libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerFeedback.h create mode 100644 libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerInit.h create mode 100644 libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerPose.h create mode 100644 libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerUpdate.h create mode 100644 libraries/Rosserial_Arduino_Library/src/visualization_msgs/Marker.h create mode 100644 libraries/Rosserial_Arduino_Library/src/visualization_msgs/MarkerArray.h create mode 100644 libraries/Rosserial_Arduino_Library/src/visualization_msgs/MenuEntry.h create mode 100644 libraries/readme.txt create mode 100644 舵机/sketch_jun16b.ino diff --git a/laser_ctl/laser_ctl.ino b/laser_ctl/laser_ctl.ino new file mode 100644 index 0000000..9d9a64f --- /dev/null +++ b/laser_ctl/laser_ctl.ino @@ -0,0 +1,36 @@ +#include +#include + +ros::NodeHandle nh; + +#define LASER_PIN 3 + +uint8_t currentBrightness = 0; + +void laserCallback(const std_msgs::UInt8& msg) { + currentBrightness = msg.data; + analogWrite(LASER_PIN, currentBrightness); +} + +ros::Subscriber sub("laser_brightness", &laserCallback); + +std_msgs::UInt8 feedbackMsg; +ros::Publisher pub("laser_feedback", &feedbackMsg); + +void setup() { + pinMode(LASER_PIN, OUTPUT); + analogWrite(LASER_PIN, 0); + + nh.initNode(); + nh.subscribe(sub); + nh.advertise(pub); +} + +void loop() { + nh.spinOnce(); + + feedbackMsg.data = currentBrightness; + pub.publish(&feedbackMsg); + + delay(20); +} diff --git a/laser_ctl/laser_servo_ctl/laser_servo_ctl.ino b/laser_ctl/laser_servo_ctl/laser_servo_ctl.ino new file mode 100644 index 0000000..11f43d1 --- /dev/null +++ b/laser_ctl/laser_servo_ctl/laser_servo_ctl.ino @@ -0,0 +1,73 @@ +#include +#include + +ros::NodeHandle nh; + +#define LASER_PIN 3 +#define SERVO_PIN 5 + +// 使用char数组或String存储状态 +String currentstate_laser = "close"; +String currentstate_servo = "close"; + +// 激光回调:接收 "yes" 打开,其他关闭 +void laserCallback(const std_msgs::String& msg) { + currentstate_laser = msg.data; + if (currentstate_laser == "yes") { + analogWrite(LASER_PIN, 255); // 激光全开 + } else { + analogWrite(LASER_PIN, 0); // 激光关闭 + } +} + +// 舵机回调:接收 "servo_1" 转到90度 +void servoCallback(const std_msgs::String& msg) { + currentstate_servo = msg.data; + if (currentstate_servo == "servo_1") { + analogWrite(SERVO_PIN, 23); // 约90度(舵机PWM: 0.5ms~2.5ms对应0~180度) + } else { + analogWrite(SERVO_PIN, 0); // 0度位置 + } +} + +// 修正:订阅者变量名不能重复,且类型名大小写要正确 +ros::Subscriber sub_laser("/caim/target_recognition_result", &laserCallback); +ros::Subscriber sub_servo("payload_drop_cmd", &servoCallback); + +// 修正:发布者变量名不能重复 +std_msgs::String feedbackMsg_laser; +ros::Publisher pub_laser("laser_feedback", &feedbackMsg_laser); + +std_msgs::String feedbackMsg_servo; +ros::Publisher pub_servo("servo_feedback", &feedbackMsg_servo); + +void setup() { + pinMode(LASER_PIN, OUTPUT); + analogWrite(LASER_PIN, 0); + + pinMode(SERVO_PIN, OUTPUT); + analogWrite(SERVO_PIN, 0); + + nh.initNode(); + + // 注册两个订阅者 + nh.subscribe(sub_laser); + nh.subscribe(sub_servo); + + // 注册两个发布者 + nh.advertise(pub_laser); + nh.advertise(pub_servo); +} + +void loop() { + nh.spinOnce(); + + // 发布反馈状态 + feedbackMsg_laser.data = currentstate_laser.c_str(); + pub_laser.publish(&feedbackMsg_laser); + + feedbackMsg_servo.data = currentstate_servo.c_str(); + pub_servo.publish(&feedbackMsg_servo); + + delay(20); +} diff --git a/laser_servo/laser_servo.ino b/laser_servo/laser_servo.ino new file mode 100644 index 0000000..fd25130 --- /dev/null +++ b/laser_servo/laser_servo.ino @@ -0,0 +1,103 @@ +#include +#include +#include "std_msgs/String.h" + +#define LASER_PIN 3 // 激光笔 3号口 +#define SERVO_PIN 5 // 舵机 5号口 +#define SERVO_DEFAULT 0 // 默认角度:0度 +#define SERVO_ACTIVE 70 // 触发角度:70度 + +Servo myServo; +ros::NodeHandle nh; + +// 1. 激光自动复位定时器 +bool isLaserAuto = false; +unsigned long laserStartTime = 0; + +// 2. 舵机自动复位定时器 +bool isServoAuto = false; +unsigned long servoStartTime = 0; + +// ============================================ +// 1. 激光控制回调 (target_recognition_rusult) +// ============================================ +void laserCb(const std_msgs::String& msg) { + String cmd = String(msg.data); + cmd.toLowerCase(); + + if (cmd == "yes") { + // 自动模式:亮激光,启动 2 秒定时 + digitalWrite(LASER_PIN, HIGH); + isLaserAuto = true; + laserStartTime = millis(); + } + else if (cmd == "laser_on") { + // 手动常亮 + digitalWrite(LASER_PIN, HIGH); + isLaserAuto = false; + } + else if (cmd == "off") { + // 手动关闭 + digitalWrite(LASER_PIN, LOW); + isLaserAuto = false; + } +} + +// ============================================ +// 2. 舵机控制回调 (/payload_drop_cmd) +// ============================================ +void servoCb(const std_msgs::String& msg) { + String cmd = String(msg.data); + cmd.toLowerCase(); + + if (cmd == "servo_1") { + // 自动模式:转动 90 度,启动 2 秒定时 + myServo.write(SERVO_ACTIVE); + isServoAuto = true; + servoStartTime = millis(); + } + else if (cmd == "servo_on") { + // 手动保持 90 度 + myServo.write(SERVO_ACTIVE); + isServoAuto = false; + } + else if (cmd == "servo_off") { + // 手动回到 0 度 + myServo.write(SERVO_DEFAULT); + isServoAuto = false; + } +} + +ros::Subscriber subTarget("target_recognition_rusult", &laserCb); +ros::Subscriber subVision("/payload_drop_cmd", &servoCb); + +void setup() { + pinMode(LASER_PIN, OUTPUT); + digitalWrite(LASER_PIN, LOW); // 默认关闭激光 + + myServo.attach(SERVO_PIN); + myServo.write(SERVO_DEFAULT); // 默认舵机归零 + + nh.initNode(); + nh.subscribe(subTarget); + nh.subscribe(subVision); +} + +void loop() { + unsigned long now = millis(); + + // 激光 2 秒自动复位 + if (isLaserAuto && (now - laserStartTime >= 2000)) { + digitalWrite(LASER_PIN, LOW); + isLaserAuto = false; + } + + // 舵机 2 秒自动复位 + if (isServoAuto && (now - servoStartTime >= 2000)) { + myServo.write(SERVO_DEFAULT); + isServoAuto = false; + } + + nh.spinOnce(); + delay(1); +} diff --git a/libraries/Rosserial_Arduino_Library/examples/ADC/ADC.pde b/libraries/Rosserial_Arduino_Library/examples/ADC/ADC.pde new file mode 100644 index 0000000..a6cabe9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/Blink/Blink.pde b/libraries/Rosserial_Arduino_Library/examples/Blink/Blink.pde new file mode 100644 index 0000000..4e9e185 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", &messageCb ); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(sub); +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/libraries/Rosserial_Arduino_Library/examples/BlinkM/BlinkM.pde b/libraries/Rosserial_Arduino_Library/examples/BlinkM/BlinkM.pde new file mode 100644 index 0000000..f54ea28 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/BlinkM/BlinkM_funcs.h b/libraries/Rosserial_Arduino_Library/examples/BlinkM/BlinkM_funcs.h new file mode 100644 index 0000000..94cabeb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/Clapper/Clapper.pde b/libraries/Rosserial_Arduino_Library/examples/Clapper/Clapper.pde new file mode 100644 index 0000000..712b6f9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/Esp8266/HelloWorld.ino b/libraries/Rosserial_Arduino_Library/examples/Esp8266/HelloWorld.ino new file mode 100644 index 0000000..cef0298 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/examples/Esp8266/HelloWorld.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/libraries/Rosserial_Arduino_Library/examples/HelloWorld/HelloWorld.pde b/libraries/Rosserial_Arduino_Library/examples/HelloWorld/HelloWorld.pde new file mode 100644 index 0000000..2474413 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/IrRanger/IrRanger.pde b/libraries/Rosserial_Arduino_Library/examples/IrRanger/IrRanger.pde new file mode 100644 index 0000000..240b5a1 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/Logging/Logging.pde b/libraries/Rosserial_Arduino_Library/examples/Logging/Logging.pde new file mode 100644 index 0000000..400a9cd --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/Odom/Odom.pde b/libraries/Rosserial_Arduino_Library/examples/Odom/Odom.pde new file mode 100644 index 0000000..5841020 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/ServiceClient/ServiceClient.pde b/libraries/Rosserial_Arduino_Library/examples/ServiceClient/ServiceClient.pde new file mode 100644 index 0000000..75093a9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/ServiceClient/client.py b/libraries/Rosserial_Arduino_Library/examples/ServiceClient/client.py new file mode 100644 index 0000000..3b27bd5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/ServiceServer/ServiceServer.pde b/libraries/Rosserial_Arduino_Library/examples/ServiceServer/ServiceServer.pde new file mode 100644 index 0000000..2d3fd70 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/ServoControl/ServoControl.pde b/libraries/Rosserial_Arduino_Library/examples/ServoControl/ServoControl.pde new file mode 100644 index 0000000..24db409 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/Temperature/Temperature.pde b/libraries/Rosserial_Arduino_Library/examples/Temperature/Temperature.pde new file mode 100644 index 0000000..2c2f865 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/TimeTF/TimeTF.pde b/libraries/Rosserial_Arduino_Library/examples/TimeTF/TimeTF.pde new file mode 100644 index 0000000..16fbb70 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/Ultrasound/Ultrasound.pde b/libraries/Rosserial_Arduino_Library/examples/Ultrasound/Ultrasound.pde new file mode 100644 index 0000000..d5870cb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/button_example/button_example.pde b/libraries/Rosserial_Arduino_Library/examples/button_example/button_example.pde new file mode 100644 index 0000000..0404542 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/examples/pubsub/pubsub.pde b/libraries/Rosserial_Arduino_Library/examples/pubsub/pubsub.pde new file mode 100644 index 0000000..753d8ed --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/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/libraries/Rosserial_Arduino_Library/extras/tests/array_test/array_test.pde b/libraries/Rosserial_Arduino_Library/extras/tests/array_test/array_test.pde new file mode 100644 index 0000000..8aa72de --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/extras/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/libraries/Rosserial_Arduino_Library/extras/tests/float64_test/float64_test.pde b/libraries/Rosserial_Arduino_Library/extras/tests/float64_test/float64_test.pde new file mode 100644 index 0000000..41a6f4a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/extras/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/libraries/Rosserial_Arduino_Library/extras/tests/time_test/time_test.pde b/libraries/Rosserial_Arduino_Library/extras/tests/time_test/time_test.pde new file mode 100644 index 0000000..c5fa739 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/extras/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/libraries/Rosserial_Arduino_Library/keywords.txt b/libraries/Rosserial_Arduino_Library/keywords.txt new file mode 100644 index 0000000..82c5ba6 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/keywords.txt @@ -0,0 +1,23 @@ +####################################### +# Syntax Coloring Map For Rosserial +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +Test KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +doSomething KEYWORD2 + +####################################### +# Instances (KEYWORD2) +####################################### + +####################################### +# Constants (LITERAL1) +####################################### diff --git a/libraries/Rosserial_Arduino_Library/library.properties b/libraries/Rosserial_Arduino_Library/library.properties new file mode 100644 index 0000000..5648460 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/library.properties @@ -0,0 +1,10 @@ +name=Rosserial Arduino Library +version=0.7.8 +author=Michael Ferguson +maintainer=Joshua Frank +sentence=Use an Arduino as a ROS publisher/subscriber +paragraph=Works with http://wiki.ros.org/rosserial, requires a rosserial node to connect +category=Communication +url=https://github.com/frankjoshua/rosserial_arduino_lib +architectures=avr +includes=ros.h diff --git a/libraries/Rosserial_Arduino_Library/readme.md b/libraries/Rosserial_Arduino_Library/readme.md new file mode 100644 index 0000000..b6e0437 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/readme.md @@ -0,0 +1,3 @@ +Use an Arduino as a ROS publisher/subscriber + +Works with http://wiki.ros.org/rosserial, requires a rosserial node to connect diff --git a/libraries/Rosserial_Arduino_Library/src/ArduinoHardware.h b/libraries/Rosserial_Arduino_Library/src/ArduinoHardware.h new file mode 100644 index 0000000..0f7ff6b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/ArduinoHardware.h @@ -0,0 +1,106 @@ +/* + * 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__) + #include // Teensy 3.0 and 3.1 + #define SERIAL_CLASS usb_serial_class +#elif defined(_SAM3XA_) + #include // Arduino Due + #define SERIAL_CLASS UARTClass +#elif defined(USE_USBCON) + // Arduino Leonardo USB Serial Port + #define SERIAL_CLASS Serial_ +#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; +#else + iostream = &Serial; +#endif + baud_ = 57600; + } + ArduinoHardware(ArduinoHardware& h){ + this->iostream = iostream; + this->baud_ = h.baud_; + } + + 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){ + for(int i=0; iwrite(data[i]); + } + + unsigned long time(){return millis();} + + protected: + SERIAL_CLASS* iostream; + long baud_; +}; + +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/Esp8266Hardware.h b/libraries/Rosserial_Arduino_Library/src/Esp8266Hardware.h new file mode 100644 index 0000000..f9885b0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/Esp8266Hardware.h @@ -0,0 +1,78 @@ +/* + * Software License Agreement (BSD License) + * + * + * 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 ESP8266HARDWARE_H +#define ESP8266HARDWARE_H + +#include + +class Esp8266Hardware { + public: + Esp8266Hardware() + { + } + + void setConnection(IPAddress &server, int port) { + this->server = server; + this->serverPort = port; + } + + IPAddress getLocalIP() { + return tcp.localIP(); + } + + void init() { + this->tcp.connect(this->server, this->serverPort); + } + + int read() { + if (this->tcp.connected()) { + return tcp.read(); + } else { + this->tcp.connect(this->server, this->serverPort); + } + return -1; + }; + + void write(const uint8_t* data, size_t length) { + tcp.write(data, length); + } + + unsigned long time() {return millis();} + + protected: + WiFiClient tcp; + IPAddress server; + uint16_t serverPort = 11411; +}; + +#endif // ESP8266HARDWARE_H diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestAction.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestAction.h new file mode 100644 index 0000000..7777571 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestAction.h @@ -0,0 +1,53 @@ +#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: + actionlib::TestActionGoal action_goal; + actionlib::TestActionResult action_result; + actionlib::TestActionFeedback action_feedback; + + TestAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib/TestAction"; }; + const char * getMD5(){ return "991e87a72802262dfbe5d1b3cf6efc9a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestActionFeedback.h new file mode 100644 index 0000000..347d3f7 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestFeedback feedback; + + TestActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionFeedback"; }; + const char * getMD5(){ return "6d3d0bf7fb3dda24779c010a9f3eb7cb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestActionGoal.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestActionGoal.h new file mode 100644 index 0000000..2ab1238 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TestGoal goal; + + TestActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionGoal"; }; + const char * getMD5(){ return "348369c5b403676156094e8c159720bf"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestActionResult.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestActionResult.h new file mode 100644 index 0000000..d7e388c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestResult result; + + TestActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionResult"; }; + const char * getMD5(){ return "3d669e3a63aa986c667ea7b0f46ce85e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestFeedback.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestFeedback.h new file mode 100644 index 0000000..380f785 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestFeedback.h @@ -0,0 +1,61 @@ +#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: + int32_t feedback; + + TestFeedback(): + feedback(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib/TestFeedback"; }; + const char * getMD5(){ return "49ceb5b32ea3af22073ede4a0328249e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestGoal.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestGoal.h new file mode 100644 index 0000000..4e2d676 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestGoal.h @@ -0,0 +1,61 @@ +#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: + int32_t goal; + + TestGoal(): + goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib/TestGoal"; }; + const char * getMD5(){ return "18df0149936b7aa95588e3862476ebde"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestAction.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestAction.h new file mode 100644 index 0000000..2117590 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestAction.h @@ -0,0 +1,53 @@ +#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: + actionlib::TestRequestActionGoal action_goal; + actionlib::TestRequestActionResult action_result; + actionlib::TestRequestActionFeedback action_feedback; + + TestRequestAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib/TestRequestAction"; }; + const char * getMD5(){ return "dc44b1f4045dbf0d1db54423b3b86b30"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionFeedback.h new file mode 100644 index 0000000..ce98e9b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestRequestFeedback feedback; + + TestRequestActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionGoal.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionGoal.h new file mode 100644 index 0000000..563b22f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TestRequestGoal goal; + + TestRequestActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionGoal"; }; + const char * getMD5(){ return "1889556d3fef88f821c7cb004e4251f3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionResult.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionResult.h new file mode 100644 index 0000000..67e32a4 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestRequestResult result; + + TestRequestActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionResult"; }; + const char * getMD5(){ return "0476d1fdf437a3a6e7d6d0e9f5561298"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestFeedback.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestFeedback.h new file mode 100644 index 0000000..f1fc247 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "actionlib/TestRequestFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestGoal.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestGoal.h new file mode 100644 index 0000000..8fd822e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestGoal.h @@ -0,0 +1,207 @@ +#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: + int32_t terminate_status; + bool ignore_cancel; + const char* result_text; + int32_t the_result; + bool is_simple_client; + ros::Duration delay_accept; + ros::Duration delay_terminate; + ros::Duration 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 + { + 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); + memcpy(outbuffer + offset, &length_result_text, sizeof(uint32_t)); + 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) + { + 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; + memcpy(&length_result_text, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "actionlib/TestRequestGoal"; }; + const char * getMD5(){ return "db5d00ba98302d6c6dd3737e9a03ceea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestResult.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestResult.h new file mode 100644 index 0000000..27b1425 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestRequestResult.h @@ -0,0 +1,78 @@ +#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: + int32_t the_result; + bool is_simple_server; + + TestRequestResult(): + the_result(0), + is_simple_server(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib/TestRequestResult"; }; + const char * getMD5(){ return "61c2364524499c7c5017e2f3fce7ba06"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TestResult.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TestResult.h new file mode 100644 index 0000000..a0bd838 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TestResult.h @@ -0,0 +1,61 @@ +#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: + int32_t result; + + TestResult(): + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib/TestResult"; }; + const char * getMD5(){ return "034a8e20d6a306665e3a5b340fab3f09"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsAction.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsAction.h new file mode 100644 index 0000000..18ac4d8 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsAction.h @@ -0,0 +1,53 @@ +#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: + actionlib::TwoIntsActionGoal action_goal; + actionlib::TwoIntsActionResult action_result; + actionlib::TwoIntsActionFeedback action_feedback; + + TwoIntsAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib/TwoIntsAction"; }; + const char * getMD5(){ return "6d1aa538c4bd6183a2dfb7fcac41ee50"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionFeedback.h new file mode 100644 index 0000000..1df0fba --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TwoIntsFeedback feedback; + + TwoIntsActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionGoal.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionGoal.h new file mode 100644 index 0000000..dc3e013 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TwoIntsGoal goal; + + TwoIntsActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionGoal"; }; + const char * getMD5(){ return "684a2db55d6ffb8046fb9d6764ce0860"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionResult.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionResult.h new file mode 100644 index 0000000..f6d3397 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TwoIntsResult result; + + TwoIntsActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionResult"; }; + const char * getMD5(){ return "3ba7dea8b8cddcae4528ade4ef74b6e7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsFeedback.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsFeedback.h new file mode 100644 index 0000000..3789c4d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsGoal.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsGoal.h new file mode 100644 index 0000000..1fb5639 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsGoal.h @@ -0,0 +1,100 @@ +#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: + int64_t a; + int64_t b; + + TwoIntsGoal(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib/TwoIntsGoal"; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsResult.h b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsResult.h new file mode 100644 index 0000000..901a523 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib/TwoIntsResult.h @@ -0,0 +1,69 @@ +#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: + int64_t sum; + + TwoIntsResult(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib/TwoIntsResult"; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalID.h b/libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalID.h new file mode 100644 index 0000000..989dc6b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalID.h @@ -0,0 +1,77 @@ +#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: + ros::Time stamp; + const char* id; + + GoalID(): + stamp(), + id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "actionlib_msgs/GoalID"; }; + const char * getMD5(){ return "302881f31927c1df708a2dbab0e80ee8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalStatus.h b/libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalStatus.h new file mode 100644 index 0000000..b728926 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalStatus.h @@ -0,0 +1,75 @@ +#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: + actionlib_msgs::GoalID goal_id; + uint8_t status; + const char* 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 + { + 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); + memcpy(outbuffer + offset, &length_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->goal_id.deserialize(inbuffer + offset); + this->status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->status); + uint32_t length_text; + memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "actionlib_msgs/GoalStatus"; }; + const char * getMD5(){ return "d388f9b87b3c471f784434d671988d4a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalStatusArray.h b/libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalStatusArray.h new file mode 100644 index 0000000..8bff742 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_msgs/GoalStatusArray.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t status_list_length; + actionlib_msgs::GoalStatus st_status_list; + actionlib_msgs::GoalStatus * status_list; + + GoalStatusArray(): + header(), + status_list_length(0), status_list(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = status_list_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_list_length; i++){ + offset += this->status_list[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t status_list_lengthT = *(inbuffer + offset++); + if(status_list_lengthT > status_list_length) + this->status_list = (actionlib_msgs::GoalStatus*)realloc(this->status_list, status_list_lengthT * sizeof(actionlib_msgs::GoalStatus)); + offset += 3; + status_list_length = status_list_lengthT; + for( uint8_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; + } + + const char * getType(){ return "actionlib_msgs/GoalStatusArray"; }; + const char * getMD5(){ return "8b2b82f13216d0a8ea88bd3af735e619"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingAction.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingAction.h new file mode 100644 index 0000000..65a963d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingAction.h @@ -0,0 +1,53 @@ +#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: + actionlib_tutorials::AveragingActionGoal action_goal; + actionlib_tutorials::AveragingActionResult action_result; + actionlib_tutorials::AveragingActionFeedback action_feedback; + + AveragingAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib_tutorials/AveragingAction"; }; + const char * getMD5(){ return "628678f2b4fa6a5951746a4a2d39e716"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionFeedback.h new file mode 100644 index 0000000..97fda36 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::AveragingFeedback feedback; + + AveragingActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionFeedback"; }; + const char * getMD5(){ return "78a4a09241b1791069223ae7ebd5b16b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionGoal.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionGoal.h new file mode 100644 index 0000000..4b225e9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib_tutorials::AveragingGoal goal; + + AveragingActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionGoal"; }; + const char * getMD5(){ return "1561825b734ebd6039851c501e3fb570"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionResult.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionResult.h new file mode 100644 index 0000000..e4d5128 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::AveragingResult result; + + AveragingActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionResult"; }; + const char * getMD5(){ return "8672cb489d347580acdcd05c5d497497"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingFeedback.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingFeedback.h new file mode 100644 index 0000000..a987900 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingFeedback.h @@ -0,0 +1,130 @@ +#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: + int32_t sample; + float data; + float mean; + float std_dev; + + AveragingFeedback(): + sample(0), + data(0), + mean(0), + std_dev(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib_tutorials/AveragingFeedback"; }; + const char * getMD5(){ return "9e8dfc53c2f2a032ca33fa80ec46fd4f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingGoal.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingGoal.h new file mode 100644 index 0000000..5b631c5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingGoal.h @@ -0,0 +1,61 @@ +#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: + int32_t samples; + + AveragingGoal(): + samples(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib_tutorials/AveragingGoal"; }; + const char * getMD5(){ return "32c9b10ef9b253faa93b93f564762c8f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingResult.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingResult.h new file mode 100644 index 0000000..ce08c43 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/AveragingResult.h @@ -0,0 +1,84 @@ +#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: + float mean; + float std_dev; + + AveragingResult(): + mean(0), + std_dev(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib_tutorials/AveragingResult"; }; + const char * getMD5(){ return "d5c7decf6df75ffb4367a05c1bcc7612"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciAction.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciAction.h new file mode 100644 index 0000000..9432e1c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciAction.h @@ -0,0 +1,53 @@ +#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: + actionlib_tutorials::FibonacciActionGoal action_goal; + actionlib_tutorials::FibonacciActionResult action_result; + actionlib_tutorials::FibonacciActionFeedback action_feedback; + + FibonacciAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciAction"; }; + const char * getMD5(){ return "f59df5767bf7634684781c92598b2406"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionFeedback.h new file mode 100644 index 0000000..3a1e341 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::FibonacciFeedback feedback; + + FibonacciActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionFeedback"; }; + const char * getMD5(){ return "73b8497a9f629a31c0020900e4148f07"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionGoal.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionGoal.h new file mode 100644 index 0000000..459561c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib_tutorials::FibonacciGoal goal; + + FibonacciActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionGoal"; }; + const char * getMD5(){ return "006871c7fa1d0e3d5fe2226bf17b2a94"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionResult.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionResult.h new file mode 100644 index 0000000..14ed870 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::FibonacciResult result; + + FibonacciActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionResult"; }; + const char * getMD5(){ return "bee73a9fe29ae25e966e105f5553dd03"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciFeedback.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciFeedback.h new file mode 100644 index 0000000..5a09ac1 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciFeedback.h @@ -0,0 +1,77 @@ +#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: + uint8_t sequence_length; + int32_t st_sequence; + int32_t * sequence; + + FibonacciFeedback(): + sequence_length(0), sequence(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = sequence_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t sequence_lengthT = *(inbuffer + offset++); + if(sequence_lengthT > sequence_length) + this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); + offset += 3; + sequence_length = sequence_lengthT; + for( uint8_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; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciFeedback"; }; + const char * getMD5(){ return "b81e37d2a31925a0e8ae261a8699cb79"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciGoal.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciGoal.h new file mode 100644 index 0000000..3cec227 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciGoal.h @@ -0,0 +1,61 @@ +#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: + int32_t order; + + FibonacciGoal(): + order(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciGoal"; }; + const char * getMD5(){ return "6889063349a00b249bd1661df429d822"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciResult.h b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciResult.h new file mode 100644 index 0000000..db15770 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/actionlib_tutorials/FibonacciResult.h @@ -0,0 +1,77 @@ +#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: + uint8_t sequence_length; + int32_t st_sequence; + int32_t * sequence; + + FibonacciResult(): + sequence_length(0), sequence(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = sequence_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t sequence_lengthT = *(inbuffer + offset++); + if(sequence_lengthT > sequence_length) + this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); + offset += 3; + sequence_length = sequence_lengthT; + for( uint8_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; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciResult"; }; + const char * getMD5(){ return "b81e37d2a31925a0e8ae261a8699cb79"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/bond/Constants.h b/libraries/Rosserial_Arduino_Library/src/bond/Constants.h new file mode 100644 index 0000000..9594342 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "bond/Constants"; }; + const char * getMD5(){ return "6fc594dc1d7bd7919077042712f8c8b0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/bond/Status.h b/libraries/Rosserial_Arduino_Library/src/bond/Status.h new file mode 100644 index 0000000..1fdb04a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/bond/Status.h @@ -0,0 +1,138 @@ +#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: + std_msgs::Header header; + const char* id; + const char* instance_id; + bool active; + float heartbeat_timeout; + float heartbeat_period; + + Status(): + header(), + id(""), + instance_id(""), + active(0), + heartbeat_timeout(0), + heartbeat_period(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + uint32_t length_instance_id = strlen(this->instance_id); + memcpy(outbuffer + offset, &length_instance_id, sizeof(uint32_t)); + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_instance_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "bond/Status"; }; + const char * getMD5(){ return "eacc84bf5d65b6777d4c50f463dfb9c8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryAction.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryAction.h new file mode 100644 index 0000000..aa36c45 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryAction.h @@ -0,0 +1,53 @@ +#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: + control_msgs::FollowJointTrajectoryActionGoal action_goal; + control_msgs::FollowJointTrajectoryActionResult action_result; + control_msgs::FollowJointTrajectoryActionFeedback action_feedback; + + FollowJointTrajectoryAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryAction"; }; + const char * getMD5(){ return "bc4f9b743838566551c0390c65f1a248"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionFeedback.h new file mode 100644 index 0000000..bf9b2c6 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::FollowJointTrajectoryFeedback feedback; + + FollowJointTrajectoryActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionFeedback"; }; + const char * getMD5(){ return "d8920dc4eae9fc107e00999cce4be641"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionGoal.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionGoal.h new file mode 100644 index 0000000..de889cb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::FollowJointTrajectoryGoal goal; + + FollowJointTrajectoryActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionGoal"; }; + const char * getMD5(){ return "cff5c1d533bf2f82dd0138d57f4304bb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionResult.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionResult.h new file mode 100644 index 0000000..252abb3 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::FollowJointTrajectoryResult result; + + FollowJointTrajectoryActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionResult"; }; + const char * getMD5(){ return "c4fb3b000dc9da4fd99699380efcc5d9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryFeedback.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryFeedback.h new file mode 100644 index 0000000..50c5466 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryFeedback.h @@ -0,0 +1,88 @@ +#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: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + trajectory_msgs::JointTrajectoryPoint desired; + trajectory_msgs::JointTrajectoryPoint actual; + trajectory_msgs::JointTrajectoryPoint error; + + FollowJointTrajectoryFeedback(): + header(), + joint_names_length(0), joint_names(NULL), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryFeedback"; }; + const char * getMD5(){ return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryGoal.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryGoal.h new file mode 100644 index 0000000..2a8f9b1 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryGoal.h @@ -0,0 +1,107 @@ +#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: + trajectory_msgs::JointTrajectory trajectory; + uint8_t path_tolerance_length; + control_msgs::JointTolerance st_path_tolerance; + control_msgs::JointTolerance * path_tolerance; + uint8_t goal_tolerance_length; + control_msgs::JointTolerance st_goal_tolerance; + control_msgs::JointTolerance * goal_tolerance; + ros::Duration goal_time_tolerance; + + FollowJointTrajectoryGoal(): + trajectory(), + path_tolerance_length(0), path_tolerance(NULL), + goal_tolerance_length(0), goal_tolerance(NULL), + goal_time_tolerance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + *(outbuffer + offset++) = path_tolerance_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < path_tolerance_length; i++){ + offset += this->path_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = goal_tolerance_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + uint8_t path_tolerance_lengthT = *(inbuffer + offset++); + if(path_tolerance_lengthT > path_tolerance_length) + this->path_tolerance = (control_msgs::JointTolerance*)realloc(this->path_tolerance, path_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + offset += 3; + path_tolerance_length = path_tolerance_lengthT; + for( uint8_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)); + } + uint8_t goal_tolerance_lengthT = *(inbuffer + offset++); + if(goal_tolerance_lengthT > goal_tolerance_length) + this->goal_tolerance = (control_msgs::JointTolerance*)realloc(this->goal_tolerance, goal_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + offset += 3; + goal_tolerance_length = goal_tolerance_lengthT; + for( uint8_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; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryGoal"; }; + const char * getMD5(){ return "69636787b6ecbde4d61d711979bc7ecb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryResult.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryResult.h new file mode 100644 index 0000000..0d55930 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/FollowJointTrajectoryResult.h @@ -0,0 +1,83 @@ +#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: + int32_t error_code; + const char* 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 + { + 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); + memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryResult"; }; + const char * getMD5(){ return "493383b18409bfb604b4e26c676401d2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommand.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommand.h new file mode 100644 index 0000000..a2f65e0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommand.h @@ -0,0 +1,46 @@ +#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: + float position; + float max_effort; + + GripperCommand(): + position(0), + max_effort(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->max_effort); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_effort)); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommand"; }; + const char * getMD5(){ return "680acaff79486f017132a7f198d40f08"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandAction.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandAction.h new file mode 100644 index 0000000..111229e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandAction.h @@ -0,0 +1,53 @@ +#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: + control_msgs::GripperCommandActionGoal action_goal; + control_msgs::GripperCommandActionResult action_result; + control_msgs::GripperCommandActionFeedback action_feedback; + + GripperCommandAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "control_msgs/GripperCommandAction"; }; + const char * getMD5(){ return "950b2a6ebe831f5d4f4ceaba3d8be01e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionFeedback.h new file mode 100644 index 0000000..14f3771 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::GripperCommandFeedback feedback; + + GripperCommandActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionFeedback"; }; + const char * getMD5(){ return "653dff30c045f5e6ff3feb3409f4558d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionGoal.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionGoal.h new file mode 100644 index 0000000..8a09301 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::GripperCommandGoal goal; + + GripperCommandActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionGoal"; }; + const char * getMD5(){ return "aa581f648a35ed681db2ec0bf7a82bea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionResult.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionResult.h new file mode 100644 index 0000000..1a7ea75 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::GripperCommandResult result; + + GripperCommandActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionResult"; }; + const char * getMD5(){ return "143702cb2df0f163c5283cedc5efc6b6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandFeedback.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandFeedback.h new file mode 100644 index 0000000..efc889b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandFeedback.h @@ -0,0 +1,80 @@ +#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: + float position; + float effort; + bool stalled; + bool reached_goal; + + GripperCommandFeedback(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "control_msgs/GripperCommandFeedback"; }; + const char * getMD5(){ return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandGoal.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandGoal.h new file mode 100644 index 0000000..aec6aa2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandGoal.h @@ -0,0 +1,43 @@ +#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: + control_msgs::GripperCommand command; + + GripperCommandGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandGoal"; }; + const char * getMD5(){ return "86fd82f4ddc48a4cb6856cfa69217e43"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandResult.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandResult.h new file mode 100644 index 0000000..7fb51df --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/GripperCommandResult.h @@ -0,0 +1,80 @@ +#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: + float position; + float effort; + bool stalled; + bool reached_goal; + + GripperCommandResult(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "control_msgs/GripperCommandResult"; }; + const char * getMD5(){ return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/JointControllerState.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointControllerState.h new file mode 100644 index 0000000..8de8213 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointControllerState.h @@ -0,0 +1,83 @@ +#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: + std_msgs::Header header; + float set_point; + float process_value; + float process_value_dot; + float error; + float time_step; + float command; + float p; + float i; + float d; + float 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 + { + 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) + { + 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; + } + + const char * getType(){ return "control_msgs/JointControllerState"; }; + const char * getMD5(){ return "c0d034a7bf20aeb1c37f3eccb7992b69"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTolerance.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTolerance.h new file mode 100644 index 0000000..9593f37 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTolerance.h @@ -0,0 +1,66 @@ +#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: + const char* name; + float position; + float velocity; + float acceleration; + + JointTolerance(): + name(""), + position(0), + velocity(0), + acceleration(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "control_msgs/JointTolerance"; }; + const char * getMD5(){ return "f544fe9c16cf04547e135dd6063ff5be"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryAction.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryAction.h new file mode 100644 index 0000000..b619e9f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryAction.h @@ -0,0 +1,53 @@ +#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: + control_msgs::JointTrajectoryActionGoal action_goal; + control_msgs::JointTrajectoryActionResult action_result; + control_msgs::JointTrajectoryActionFeedback action_feedback; + + JointTrajectoryAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "control_msgs/JointTrajectoryAction"; }; + const char * getMD5(){ return "a04ba3ee8f6a2d0985a6aeaf23d9d7ad"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionFeedback.h new file mode 100644 index 0000000..463a4e9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::JointTrajectoryFeedback feedback; + + JointTrajectoryActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionGoal.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionGoal.h new file mode 100644 index 0000000..fb2862d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::JointTrajectoryGoal goal; + + JointTrajectoryActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionGoal"; }; + const char * getMD5(){ return "a99e83ef6185f9fdd7693efe99623a86"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionResult.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionResult.h new file mode 100644 index 0000000..accb4d0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::JointTrajectoryResult result; + + JointTrajectoryActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryControllerState.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryControllerState.h new file mode 100644 index 0000000..f4bc6b8 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryControllerState.h @@ -0,0 +1,88 @@ +#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: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + trajectory_msgs::JointTrajectoryPoint desired; + trajectory_msgs::JointTrajectoryPoint actual; + trajectory_msgs::JointTrajectoryPoint error; + + JointTrajectoryControllerState(): + header(), + joint_names_length(0), joint_names(NULL), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "control_msgs/JointTrajectoryControllerState"; }; + const char * getMD5(){ return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryFeedback.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryFeedback.h new file mode 100644 index 0000000..9dfe808 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryGoal.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryGoal.h new file mode 100644 index 0000000..b0cacb7 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryGoal.h @@ -0,0 +1,43 @@ +#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: + trajectory_msgs::JointTrajectory trajectory; + + JointTrajectoryGoal(): + trajectory() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryGoal"; }; + const char * getMD5(){ return "2a0eff76c870e8595636c2a562ca298e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryResult.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/JointTrajectoryResult.h new file mode 100644 index 0000000..623ed9c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadAction.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadAction.h new file mode 100644 index 0000000..a27be21 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadAction.h @@ -0,0 +1,53 @@ +#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: + control_msgs::PointHeadActionGoal action_goal; + control_msgs::PointHeadActionResult action_result; + control_msgs::PointHeadActionFeedback action_feedback; + + PointHeadAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "control_msgs/PointHeadAction"; }; + const char * getMD5(){ return "7252920f1243de1b741f14f214125371"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionFeedback.h new file mode 100644 index 0000000..8e04bd0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::PointHeadFeedback feedback; + + PointHeadActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionFeedback"; }; + const char * getMD5(){ return "33c9244957176bbba97dd641119e8460"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionGoal.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionGoal.h new file mode 100644 index 0000000..133d532 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::PointHeadGoal goal; + + PointHeadActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionGoal"; }; + const char * getMD5(){ return "b53a8323d0ba7b310ba17a2d3a82a6b8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionResult.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionResult.h new file mode 100644 index 0000000..db855d2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::PointHeadResult result; + + PointHeadActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadFeedback.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadFeedback.h new file mode 100644 index 0000000..4e78f2d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadFeedback.h @@ -0,0 +1,42 @@ +#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: + float pointing_angle_error; + + PointHeadFeedback(): + pointing_angle_error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->pointing_angle_error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pointing_angle_error)); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadFeedback"; }; + const char * getMD5(){ return "cce80d27fd763682da8805a73316cab4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadGoal.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadGoal.h new file mode 100644 index 0000000..65ec646 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadGoal.h @@ -0,0 +1,91 @@ +#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: + geometry_msgs::PointStamped target; + geometry_msgs::Vector3 pointing_axis; + const char* pointing_frame; + ros::Duration min_duration; + float max_velocity; + + PointHeadGoal(): + target(), + pointing_axis(), + pointing_frame(""), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_pointing_frame, sizeof(uint32_t)); + 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) + { + int offset = 0; + offset += this->target.deserialize(inbuffer + offset); + offset += this->pointing_axis.deserialize(inbuffer + offset); + uint32_t length_pointing_frame; + memcpy(&length_pointing_frame, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "control_msgs/PointHeadGoal"; }; + const char * getMD5(){ return "8b92b1cd5e06c8a94c917dc3209a4c1d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadResult.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/PointHeadResult.h new file mode 100644 index 0000000..53f789e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/QueryCalibrationState.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/QueryCalibrationState.h new file mode 100644 index 0000000..b3c1bbf --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/QueryCalibrationState.h @@ -0,0 +1,87 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return QUERYCALIBRATIONSTATE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class QueryCalibrationStateResponse : public ros::Msg + { + public: + bool is_calibrated; + + QueryCalibrationStateResponse(): + is_calibrated(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return QUERYCALIBRATIONSTATE; }; + const char * getMD5(){ return "28af3beedcb84986b8e470dc5470507d"; }; + + }; + + class QueryCalibrationState { + public: + typedef QueryCalibrationStateRequest Request; + typedef QueryCalibrationStateResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/QueryTrajectoryState.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/QueryTrajectoryState.h new file mode 100644 index 0000000..1859d7f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/QueryTrajectoryState.h @@ -0,0 +1,185 @@ +#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: + ros::Time time; + + QueryTrajectoryStateRequest(): + time() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return QUERYTRAJECTORYSTATE; }; + const char * getMD5(){ return "556a4fb76023a469987922359d08a844"; }; + + }; + + class QueryTrajectoryStateResponse : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t position_length; + float st_position; + float * position; + uint8_t velocity_length; + float st_velocity; + float * velocity; + uint8_t acceleration_length; + float st_acceleration; + float * acceleration; + + QueryTrajectoryStateResponse(): + name_length(0), name(NULL), + position_length(0), position(NULL), + velocity_length(0), velocity(NULL), + acceleration_length(0), acceleration(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = velocity_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset++) = acceleration_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < acceleration_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t velocity_lengthT = *(inbuffer + offset++); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + offset += 3; + velocity_length = velocity_lengthT; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint8_t acceleration_lengthT = *(inbuffer + offset++); + if(acceleration_lengthT > acceleration_length) + this->acceleration = (float*)realloc(this->acceleration, acceleration_lengthT * sizeof(float)); + offset += 3; + acceleration_length = acceleration_lengthT; + for( uint8_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; + } + + const char * getType(){ return QUERYTRAJECTORYSTATE; }; + const char * getMD5(){ return "1f1a6554ad060f44d013e71868403c1a"; }; + + }; + + class QueryTrajectoryState { + public: + typedef QueryTrajectoryStateRequest Request; + typedef QueryTrajectoryStateResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionAction.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionAction.h new file mode 100644 index 0000000..25bc0f6 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionAction.h @@ -0,0 +1,53 @@ +#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: + control_msgs::SingleJointPositionActionGoal action_goal; + control_msgs::SingleJointPositionActionResult action_result; + control_msgs::SingleJointPositionActionFeedback action_feedback; + + SingleJointPositionAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "control_msgs/SingleJointPositionAction"; }; + const char * getMD5(){ return "c4a786b7d53e5d0983decf967a5a779e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionFeedback.h new file mode 100644 index 0000000..3cb7efd --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::SingleJointPositionFeedback feedback; + + SingleJointPositionActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionFeedback"; }; + const char * getMD5(){ return "3503b7cf8972f90d245850a5d8796cfa"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionGoal.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionGoal.h new file mode 100644 index 0000000..1337710 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::SingleJointPositionGoal goal; + + SingleJointPositionActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionGoal"; }; + const char * getMD5(){ return "4b0d3d091471663e17749c1d0db90f61"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionResult.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionResult.h new file mode 100644 index 0000000..8f11e6e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::SingleJointPositionResult result; + + SingleJointPositionActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionFeedback.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionFeedback.h new file mode 100644 index 0000000..3c8dd15 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionFeedback.h @@ -0,0 +1,55 @@ +#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: + std_msgs::Header header; + float position; + float velocity; + float error; + + SingleJointPositionFeedback(): + header(), + position(0), + velocity(0), + error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "control_msgs/SingleJointPositionFeedback"; }; + const char * getMD5(){ return "8cee65610a3d08e0a1bded82f146f1fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionGoal.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionGoal.h new file mode 100644 index 0000000..036c31c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionGoal.h @@ -0,0 +1,69 @@ +#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: + float position; + ros::Duration min_duration; + float max_velocity; + + SingleJointPositionGoal(): + position(0), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "control_msgs/SingleJointPositionGoal"; }; + const char * getMD5(){ return "fbaaa562a23a013fd5053e5f72cbb35c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionResult.h b/libraries/Rosserial_Arduino_Library/src/control_msgs/SingleJointPositionResult.h new file mode 100644 index 0000000..7593425 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/DiagnosticArray.h b/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/DiagnosticArray.h new file mode 100644 index 0000000..d530b09 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/DiagnosticArray.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t status_length; + diagnostic_msgs::DiagnosticStatus st_status; + diagnostic_msgs::DiagnosticStatus * status; + + DiagnosticArray(): + header(), + status_length(0), status(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = status_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t status_lengthT = *(inbuffer + offset++); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + offset += 3; + status_length = status_lengthT; + for( uint8_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; + } + + const char * getType(){ return "diagnostic_msgs/DiagnosticArray"; }; + const char * getMD5(){ return "60810da900de1dd6ddd437c3503511da"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/DiagnosticStatus.h b/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/DiagnosticStatus.h new file mode 100644 index 0000000..4cf2e88 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/DiagnosticStatus.h @@ -0,0 +1,128 @@ +#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: + int8_t level; + const char* name; + const char* message; + const char* hardware_id; + uint8_t values_length; + diagnostic_msgs::KeyValue st_values; + diagnostic_msgs::KeyValue * values; + enum { OK = 0 }; + enum { WARN = 1 }; + enum { ERROR = 2 }; + enum { STALE = 3 }; + + DiagnosticStatus(): + level(0), + name(""), + message(""), + hardware_id(""), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + uint32_t length_hardware_id = strlen(this->hardware_id); + memcpy(outbuffer + offset, &length_hardware_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->hardware_id, length_hardware_id); + offset += length_hardware_id; + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + offset += this->values[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_hardware_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (diagnostic_msgs::KeyValue*)realloc(this->values, values_lengthT * sizeof(diagnostic_msgs::KeyValue)); + offset += 3; + values_length = values_lengthT; + for( uint8_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; + } + + const char * getType(){ return "diagnostic_msgs/DiagnosticStatus"; }; + const char * getMD5(){ return "d0ce08bc6e5ba34c7754f563a9cabaf1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/KeyValue.h b/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/KeyValue.h new file mode 100644 index 0000000..7b48800 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/KeyValue.h @@ -0,0 +1,70 @@ +#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: + const char* key; + const char* value; + + KeyValue(): + key(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_key = strlen(this->key); + memcpy(outbuffer + offset, &length_key, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->key, length_key); + offset += length_key; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_key; + memcpy(&length_key, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "diagnostic_msgs/KeyValue"; }; + const char * getMD5(){ return "cf57fdc6617a881a88c16e768132149c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/SelfTest.h b/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/SelfTest.h new file mode 100644 index 0000000..50b599d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/diagnostic_msgs/SelfTest.h @@ -0,0 +1,124 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SELFTEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SelfTestResponse : public ros::Msg + { + public: + const char* id; + int8_t passed; + uint8_t status_length; + diagnostic_msgs::DiagnosticStatus st_status; + diagnostic_msgs::DiagnosticStatus * status; + + SelfTestResponse(): + id(""), + passed(0), + status_length(0), status(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + 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++) = status_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + 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); + uint8_t status_lengthT = *(inbuffer + offset++); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + offset += 3; + status_length = status_lengthT; + for( uint8_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; + } + + const char * getType(){ return SELFTEST; }; + const char * getMD5(){ return "ac21b1bab7ab17546986536c22eb34e9"; }; + + }; + + class SelfTest { + public: + typedef SelfTestRequest Request; + typedef SelfTestResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/driver_base/ConfigString.h b/libraries/Rosserial_Arduino_Library/src/driver_base/ConfigString.h new file mode 100644 index 0000000..539ebcc --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/driver_base/ConfigString.h @@ -0,0 +1,70 @@ +#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: + const char* name; + const char* value; + + ConfigString(): + name(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "driver_base/ConfigString"; }; + const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/driver_base/ConfigValue.h b/libraries/Rosserial_Arduino_Library/src/driver_base/ConfigValue.h new file mode 100644 index 0000000..33b32a0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/driver_base/ConfigValue.h @@ -0,0 +1,58 @@ +#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: + const char* name; + float value; + + ConfigValue(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "driver_base/ConfigValue"; }; + const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/driver_base/SensorLevels.h b/libraries/Rosserial_Arduino_Library/src/driver_base/SensorLevels.h new file mode 100644 index 0000000..4a4ffd2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "driver_base/SensorLevels"; }; + const char * getMD5(){ return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/duration.cpp b/libraries/Rosserial_Arduino_Library/src/duration.cpp new file mode 100644 index 0000000..f471c33 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/duration.cpp @@ -0,0 +1,81 @@ +/* + * 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/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/BoolParameter.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/BoolParameter.h new file mode 100644 index 0000000..23df990 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/BoolParameter.h @@ -0,0 +1,71 @@ +#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: + const char* name; + bool value; + + BoolParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "dynamic_reconfigure/BoolParameter"; }; + const char * getMD5(){ return "23f05028c1a699fb83e22401228c3a9e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Config.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Config.h new file mode 100644 index 0000000..0658228 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Config.h @@ -0,0 +1,143 @@ +#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: + uint8_t bools_length; + dynamic_reconfigure::BoolParameter st_bools; + dynamic_reconfigure::BoolParameter * bools; + uint8_t ints_length; + dynamic_reconfigure::IntParameter st_ints; + dynamic_reconfigure::IntParameter * ints; + uint8_t strs_length; + dynamic_reconfigure::StrParameter st_strs; + dynamic_reconfigure::StrParameter * strs; + uint8_t doubles_length; + dynamic_reconfigure::DoubleParameter st_doubles; + dynamic_reconfigure::DoubleParameter * doubles; + uint8_t groups_length; + dynamic_reconfigure::GroupState st_groups; + dynamic_reconfigure::GroupState * groups; + + Config(): + bools_length(0), bools(NULL), + ints_length(0), ints(NULL), + strs_length(0), strs(NULL), + doubles_length(0), doubles(NULL), + groups_length(0), groups(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = bools_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < bools_length; i++){ + offset += this->bools[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = ints_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ints_length; i++){ + offset += this->ints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = strs_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < strs_length; i++){ + offset += this->strs[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = doubles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < doubles_length; i++){ + offset += this->doubles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = groups_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t bools_lengthT = *(inbuffer + offset++); + if(bools_lengthT > bools_length) + this->bools = (dynamic_reconfigure::BoolParameter*)realloc(this->bools, bools_lengthT * sizeof(dynamic_reconfigure::BoolParameter)); + offset += 3; + bools_length = bools_lengthT; + for( uint8_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)); + } + uint8_t ints_lengthT = *(inbuffer + offset++); + if(ints_lengthT > ints_length) + this->ints = (dynamic_reconfigure::IntParameter*)realloc(this->ints, ints_lengthT * sizeof(dynamic_reconfigure::IntParameter)); + offset += 3; + ints_length = ints_lengthT; + for( uint8_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)); + } + uint8_t strs_lengthT = *(inbuffer + offset++); + if(strs_lengthT > strs_length) + this->strs = (dynamic_reconfigure::StrParameter*)realloc(this->strs, strs_lengthT * sizeof(dynamic_reconfigure::StrParameter)); + offset += 3; + strs_length = strs_lengthT; + for( uint8_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)); + } + uint8_t doubles_lengthT = *(inbuffer + offset++); + if(doubles_lengthT > doubles_length) + this->doubles = (dynamic_reconfigure::DoubleParameter*)realloc(this->doubles, doubles_lengthT * sizeof(dynamic_reconfigure::DoubleParameter)); + offset += 3; + doubles_length = doubles_lengthT; + for( uint8_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)); + } + uint8_t groups_lengthT = *(inbuffer + offset++); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::GroupState*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::GroupState)); + offset += 3; + groups_length = groups_lengthT; + for( uint8_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; + } + + const char * getType(){ return "dynamic_reconfigure/Config"; }; + const char * getMD5(){ return "958f16a05573709014982821e6822580"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/ConfigDescription.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/ConfigDescription.h new file mode 100644 index 0000000..3720189 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/ConfigDescription.h @@ -0,0 +1,72 @@ +#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: + uint8_t groups_length; + dynamic_reconfigure::Group st_groups; + dynamic_reconfigure::Group * groups; + dynamic_reconfigure::Config max; + dynamic_reconfigure::Config min; + dynamic_reconfigure::Config dflt; + + ConfigDescription(): + groups_length(0), groups(NULL), + max(), + min(), + dflt() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = groups_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t groups_lengthT = *(inbuffer + offset++); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::Group*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::Group)); + offset += 3; + groups_length = groups_lengthT; + for( uint8_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; + } + + const char * getType(){ return "dynamic_reconfigure/ConfigDescription"; }; + const char * getMD5(){ return "757ce9d44ba8ddd801bb30bc456f946f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/DoubleParameter.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/DoubleParameter.h new file mode 100644 index 0000000..1407bdb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/DoubleParameter.h @@ -0,0 +1,58 @@ +#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: + const char* name; + float value; + + DoubleParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "dynamic_reconfigure/DoubleParameter"; }; + const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Group.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Group.h new file mode 100644 index 0000000..8e4c957 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Group.h @@ -0,0 +1,137 @@ +#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: + const char* name; + const char* type; + uint8_t parameters_length; + dynamic_reconfigure::ParamDescription st_parameters; + dynamic_reconfigure::ParamDescription * parameters; + int32_t parent; + int32_t id; + + Group(): + name(""), + type(""), + parameters_length(0), parameters(NULL), + parent(0), + id(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset++) = parameters_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t parameters_lengthT = *(inbuffer + offset++); + if(parameters_lengthT > parameters_length) + this->parameters = (dynamic_reconfigure::ParamDescription*)realloc(this->parameters, parameters_lengthT * sizeof(dynamic_reconfigure::ParamDescription)); + offset += 3; + parameters_length = parameters_lengthT; + for( uint8_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; + } + + const char * getType(){ return "dynamic_reconfigure/Group"; }; + const char * getMD5(){ return "9e8cd9e9423c94823db3614dd8b1cf7a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/GroupState.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/GroupState.h new file mode 100644 index 0000000..f2b137a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/GroupState.h @@ -0,0 +1,117 @@ +#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: + const char* name; + bool state; + int32_t id; + int32_t parent; + + GroupState(): + name(""), + state(0), + id(0), + parent(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "dynamic_reconfigure/GroupState"; }; + const char * getMD5(){ return "a2d87f51dc22930325041a2f8b1571f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/IntParameter.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/IntParameter.h new file mode 100644 index 0000000..c9e90be --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/IntParameter.h @@ -0,0 +1,77 @@ +#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: + const char* name; + int32_t value; + + IntParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "dynamic_reconfigure/IntParameter"; }; + const char * getMD5(){ return "65fedc7a0cbfb8db035e46194a350bf1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/ParamDescription.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/ParamDescription.h new file mode 100644 index 0000000..ed6a26e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/ParamDescription.h @@ -0,0 +1,114 @@ +#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: + const char* name; + const char* type; + uint32_t level; + const char* description; + const char* edit_method; + + ParamDescription(): + name(""), + type(""), + level(0), + description(""), + edit_method("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + uint32_t length_edit_method = strlen(this->edit_method); + memcpy(outbuffer + offset, &length_edit_method, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->edit_method, length_edit_method); + offset += length_edit_method; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_edit_method, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "dynamic_reconfigure/ParamDescription"; }; + const char * getMD5(){ return "7434fcb9348c13054e0c3b267c8cb34d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Reconfigure.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Reconfigure.h new file mode 100644 index 0000000..4f5f4fe --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/Reconfigure.h @@ -0,0 +1,79 @@ +#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: + dynamic_reconfigure::Config config; + + ReconfigureRequest(): + config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return RECONFIGURE; }; + const char * getMD5(){ return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class ReconfigureResponse : public ros::Msg + { + public: + dynamic_reconfigure::Config config; + + ReconfigureResponse(): + config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return RECONFIGURE; }; + const char * getMD5(){ return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class Reconfigure { + public: + typedef ReconfigureRequest Request; + typedef ReconfigureResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/SensorLevels.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/SensorLevels.h new file mode 100644 index 0000000..8f85722 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/SensorLevels"; }; + const char * getMD5(){ return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/StrParameter.h b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/StrParameter.h new file mode 100644 index 0000000..2cdabdb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/dynamic_reconfigure/StrParameter.h @@ -0,0 +1,70 @@ +#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: + const char* name; + const char* value; + + StrParameter(): + name(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "dynamic_reconfigure/StrParameter"; }; + const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/examples/ADC/ADC.pde b/libraries/Rosserial_Arduino_Library/src/examples/ADC/ADC.pde new file mode 100644 index 0000000..a6cabe9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/Blink/Blink.pde b/libraries/Rosserial_Arduino_Library/src/examples/Blink/Blink.pde new file mode 100644 index 0000000..4e9e185 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", &messageCb ); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(sub); +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/libraries/Rosserial_Arduino_Library/src/examples/BlinkM/BlinkM.pde b/libraries/Rosserial_Arduino_Library/src/examples/BlinkM/BlinkM.pde new file mode 100644 index 0000000..f54ea28 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/BlinkM/BlinkM_funcs.h b/libraries/Rosserial_Arduino_Library/src/examples/BlinkM/BlinkM_funcs.h new file mode 100644 index 0000000..94cabeb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/Clapper/Clapper.pde b/libraries/Rosserial_Arduino_Library/src/examples/Clapper/Clapper.pde new file mode 100644 index 0000000..712b6f9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/HelloWorld/HelloWorld.pde b/libraries/Rosserial_Arduino_Library/src/examples/HelloWorld/HelloWorld.pde new file mode 100644 index 0000000..2474413 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/IrRanger/IrRanger.pde b/libraries/Rosserial_Arduino_Library/src/examples/IrRanger/IrRanger.pde new file mode 100644 index 0000000..240b5a1 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/Logging/Logging.pde b/libraries/Rosserial_Arduino_Library/src/examples/Logging/Logging.pde new file mode 100644 index 0000000..400a9cd --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/Odom/Odom.pde b/libraries/Rosserial_Arduino_Library/src/examples/Odom/Odom.pde new file mode 100644 index 0000000..5841020 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/ServiceClient/ServiceClient.pde b/libraries/Rosserial_Arduino_Library/src/examples/ServiceClient/ServiceClient.pde new file mode 100644 index 0000000..75093a9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/ServiceClient/client.py b/libraries/Rosserial_Arduino_Library/src/examples/ServiceClient/client.py new file mode 100644 index 0000000..3b27bd5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/ServiceServer/ServiceServer.pde b/libraries/Rosserial_Arduino_Library/src/examples/ServiceServer/ServiceServer.pde new file mode 100644 index 0000000..2d3fd70 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/ServoControl/ServoControl.pde b/libraries/Rosserial_Arduino_Library/src/examples/ServoControl/ServoControl.pde new file mode 100644 index 0000000..24db409 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/Temperature/Temperature.pde b/libraries/Rosserial_Arduino_Library/src/examples/Temperature/Temperature.pde new file mode 100644 index 0000000..2c2f865 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/TimeTF/TimeTF.pde b/libraries/Rosserial_Arduino_Library/src/examples/TimeTF/TimeTF.pde new file mode 100644 index 0000000..16fbb70 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/Ultrasound/Ultrasound.pde b/libraries/Rosserial_Arduino_Library/src/examples/Ultrasound/Ultrasound.pde new file mode 100644 index 0000000..d5870cb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/button_example/button_example.pde b/libraries/Rosserial_Arduino_Library/src/examples/button_example/button_example.pde new file mode 100644 index 0000000..0404542 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/examples/pubsub/pubsub.pde b/libraries/Rosserial_Arduino_Library/src/examples/pubsub/pubsub.pde new file mode 100644 index 0000000..753d8ed --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ApplyBodyWrench.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ApplyBodyWrench.h new file mode 100644 index 0000000..7dd6bc0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ApplyBodyWrench.h @@ -0,0 +1,191 @@ +#ifndef _ROS_SERVICE_ApplyBodyWrench_h +#define _ROS_SERVICE_ApplyBodyWrench_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "geometry_msgs/Wrench.h" +#include "ros/time.h" +#include "geometry_msgs/Point.h" + +namespace gazebo_msgs +{ + +static const char APPLYBODYWRENCH[] = "gazebo_msgs/ApplyBodyWrench"; + + class ApplyBodyWrenchRequest : public ros::Msg + { + public: + const char* body_name; + const char* reference_frame; + geometry_msgs::Point reference_point; + geometry_msgs::Wrench wrench; + ros::Time start_time; + ros::Duration duration; + + ApplyBodyWrenchRequest(): + body_name(""), + reference_frame(""), + reference_point(), + wrench(), + start_time(), + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_body_name = strlen(this->body_name); + memcpy(outbuffer + offset, &length_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_body_name; + memcpy(&length_body_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return APPLYBODYWRENCH; }; + const char * getMD5(){ return "e37e6adf97eba5095baa77dffb71e5bd"; }; + + }; + + class ApplyBodyWrenchResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + ApplyBodyWrenchResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return APPLYBODYWRENCH; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyBodyWrench { + public: + typedef ApplyBodyWrenchRequest Request; + typedef ApplyBodyWrenchResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ApplyJointEffort.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ApplyJointEffort.h new file mode 100644 index 0000000..99e071c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ApplyJointEffort.h @@ -0,0 +1,169 @@ +#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: + const char* joint_name; + float effort; + ros::Time start_time; + ros::Duration duration; + + ApplyJointEffortRequest(): + joint_name(""), + effort(0), + start_time(), + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return APPLYJOINTEFFORT; }; + const char * getMD5(){ return "2c3396ab9af67a509ecd2167a8fe41a2"; }; + + }; + + class ApplyJointEffortResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + ApplyJointEffortResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return APPLYJOINTEFFORT; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyJointEffort { + public: + typedef ApplyJointEffortRequest Request; + typedef ApplyJointEffortResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/BodyRequest.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/BodyRequest.h new file mode 100644 index 0000000..99dae8a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/BodyRequest.h @@ -0,0 +1,86 @@ +#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: + const char* body_name; + + BodyRequestRequest(): + body_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_body_name = strlen(this->body_name); + memcpy(outbuffer + offset, &length_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_body_name; + memcpy(&length_body_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return BODYREQUEST; }; + const char * getMD5(){ return "5eade9afe7f232d78005bd0cafeab755"; }; + + }; + + class BodyRequestResponse : public ros::Msg + { + public: + + BodyRequestResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return BODYREQUEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class BodyRequest { + public: + typedef BodyRequestRequest Request; + typedef BodyRequestResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ContactState.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ContactState.h new file mode 100644 index 0000000..a1966f0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ContactState.h @@ -0,0 +1,172 @@ +#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: + const char* info; + const char* collision1_name; + const char* collision2_name; + uint8_t wrenches_length; + geometry_msgs::Wrench st_wrenches; + geometry_msgs::Wrench * wrenches; + geometry_msgs::Wrench total_wrench; + uint8_t contact_positions_length; + geometry_msgs::Vector3 st_contact_positions; + geometry_msgs::Vector3 * contact_positions; + uint8_t contact_normals_length; + geometry_msgs::Vector3 st_contact_normals; + geometry_msgs::Vector3 * contact_normals; + uint8_t depths_length; + float st_depths; + float * depths; + + ContactState(): + info(""), + collision1_name(""), + collision2_name(""), + wrenches_length(0), wrenches(NULL), + total_wrench(), + contact_positions_length(0), contact_positions(NULL), + contact_normals_length(0), contact_normals(NULL), + depths_length(0), depths(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_info = strlen(this->info); + memcpy(outbuffer + offset, &length_info, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + uint32_t length_collision1_name = strlen(this->collision1_name); + memcpy(outbuffer + offset, &length_collision1_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->collision1_name, length_collision1_name); + offset += length_collision1_name; + uint32_t length_collision2_name = strlen(this->collision2_name); + memcpy(outbuffer + offset, &length_collision2_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->collision2_name, length_collision2_name); + offset += length_collision2_name; + *(outbuffer + offset++) = wrenches_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrenches_length; i++){ + offset += this->wrenches[i].serialize(outbuffer + offset); + } + offset += this->total_wrench.serialize(outbuffer + offset); + *(outbuffer + offset++) = contact_positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contact_positions_length; i++){ + offset += this->contact_positions[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = contact_normals_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contact_normals_length; i++){ + offset += this->contact_normals[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = depths_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < depths_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->depths[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_info; + memcpy(&length_info, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_collision1_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_collision2_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t wrenches_lengthT = *(inbuffer + offset++); + if(wrenches_lengthT > wrenches_length) + this->wrenches = (geometry_msgs::Wrench*)realloc(this->wrenches, wrenches_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrenches_length = wrenches_lengthT; + for( uint8_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); + uint8_t contact_positions_lengthT = *(inbuffer + offset++); + if(contact_positions_lengthT > contact_positions_length) + this->contact_positions = (geometry_msgs::Vector3*)realloc(this->contact_positions, contact_positions_lengthT * sizeof(geometry_msgs::Vector3)); + offset += 3; + contact_positions_length = contact_positions_lengthT; + for( uint8_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)); + } + uint8_t contact_normals_lengthT = *(inbuffer + offset++); + if(contact_normals_lengthT > contact_normals_length) + this->contact_normals = (geometry_msgs::Vector3*)realloc(this->contact_normals, contact_normals_lengthT * sizeof(geometry_msgs::Vector3)); + offset += 3; + contact_normals_length = contact_normals_lengthT; + for( uint8_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)); + } + uint8_t depths_lengthT = *(inbuffer + offset++); + if(depths_lengthT > depths_length) + this->depths = (float*)realloc(this->depths, depths_lengthT * sizeof(float)); + offset += 3; + depths_length = depths_lengthT; + for( uint8_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; + } + + const char * getType(){ return "gazebo_msgs/ContactState"; }; + const char * getMD5(){ return "48c0ffb054b8c444f870cecea1ee50d9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ContactsState.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ContactsState.h new file mode 100644 index 0000000..38da01f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ContactsState.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t states_length; + gazebo_msgs::ContactState st_states; + gazebo_msgs::ContactState * states; + + ContactsState(): + header(), + states_length(0), states(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->states[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t states_lengthT = *(inbuffer + offset++); + if(states_lengthT > states_length) + this->states = (gazebo_msgs::ContactState*)realloc(this->states, states_lengthT * sizeof(gazebo_msgs::ContactState)); + offset += 3; + states_length = states_lengthT; + for( uint8_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; + } + + const char * getType(){ return "gazebo_msgs/ContactsState"; }; + const char * getMD5(){ return "acbcb1601a8e525bf72509f18e6f668d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/DeleteModel.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/DeleteModel.h new file mode 100644 index 0000000..2c744d8 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/DeleteModel.h @@ -0,0 +1,119 @@ +#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: + const char* model_name; + + DeleteModelRequest(): + model_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return DELETEMODEL; }; + const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class DeleteModelResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + DeleteModelResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return DELETEMODEL; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class DeleteModel { + public: + typedef DeleteModelRequest Request; + typedef DeleteModelResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetJointProperties.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetJointProperties.h new file mode 100644 index 0000000..361eae6 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetJointProperties.h @@ -0,0 +1,191 @@ +#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: + const char* joint_name; + + GetJointPropertiesRequest(): + joint_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETJOINTPROPERTIES; }; + const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class GetJointPropertiesResponse : public ros::Msg + { + public: + uint8_t type; + uint8_t damping_length; + float st_damping; + float * damping; + uint8_t position_length; + float st_position; + float * position; + uint8_t rate_length; + float st_rate; + float * rate; + bool success; + const char* 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), damping(NULL), + position_length(0), position(NULL), + rate_length(0), rate(NULL), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = damping_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < damping_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = rate_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t damping_lengthT = *(inbuffer + offset++); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + offset += 3; + damping_length = damping_lengthT; + for( uint8_t i = 0; i < damping_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t rate_lengthT = *(inbuffer + offset++); + if(rate_lengthT > rate_length) + this->rate = (float*)realloc(this->rate, rate_lengthT * sizeof(float)); + offset += 3; + rate_length = rate_lengthT; + for( uint8_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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETJOINTPROPERTIES; }; + const char * getMD5(){ return "cd7b30a39faa372283dc94c5f6457f82"; }; + + }; + + class GetJointProperties { + public: + typedef GetJointPropertiesRequest Request; + typedef GetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetLinkProperties.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetLinkProperties.h new file mode 100644 index 0000000..12ea8dc --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetLinkProperties.h @@ -0,0 +1,169 @@ +#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: + const char* link_name; + + GetLinkPropertiesRequest(): + link_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETLINKPROPERTIES; }; + const char * getMD5(){ return "7d82d60381f1b66a30f2157f60884345"; }; + + }; + + class GetLinkPropertiesResponse : public ros::Msg + { + public: + geometry_msgs::Pose com; + bool gravity_mode; + float mass; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + bool success; + const char* 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 + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETLINKPROPERTIES; }; + const char * getMD5(){ return "a8619f92d17cfcc3958c0fd13299443d"; }; + + }; + + class GetLinkProperties { + public: + typedef GetLinkPropertiesRequest Request; + typedef GetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetLinkState.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetLinkState.h new file mode 100644 index 0000000..5e9ed3a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetLinkState.h @@ -0,0 +1,140 @@ +#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: + const char* link_name; + const char* reference_frame; + + GetLinkStateRequest(): + link_name(""), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETLINKSTATE; }; + const char * getMD5(){ return "7551675c30aaa71f7c288d4864552001"; }; + + }; + + class GetLinkStateResponse : public ros::Msg + { + public: + gazebo_msgs::LinkState link_state; + bool success; + const char* status_message; + + GetLinkStateResponse(): + link_state(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETLINKSTATE; }; + const char * getMD5(){ return "8ba55ad34f9c072e75c0de57b089753b"; }; + + }; + + class GetLinkState { + public: + typedef GetLinkStateRequest Request; + typedef GetLinkStateResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetModelProperties.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetModelProperties.h new file mode 100644 index 0000000..3574fe5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetModelProperties.h @@ -0,0 +1,296 @@ +#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: + const char* model_name; + + GetModelPropertiesRequest(): + model_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETMODELPROPERTIES; }; + const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class GetModelPropertiesResponse : public ros::Msg + { + public: + const char* parent_model_name; + const char* canonical_body_name; + uint8_t body_names_length; + char* st_body_names; + char* * body_names; + uint8_t geom_names_length; + char* st_geom_names; + char* * geom_names; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t child_model_names_length; + char* st_child_model_names; + char* * child_model_names; + bool is_static; + bool success; + const char* status_message; + + GetModelPropertiesResponse(): + parent_model_name(""), + canonical_body_name(""), + body_names_length(0), body_names(NULL), + geom_names_length(0), geom_names(NULL), + joint_names_length(0), joint_names(NULL), + child_model_names_length(0), child_model_names(NULL), + is_static(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_parent_model_name = strlen(this->parent_model_name); + memcpy(outbuffer + offset, &length_parent_model_name, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_canonical_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->canonical_body_name, length_canonical_body_name); + offset += length_canonical_body_name; + *(outbuffer + offset++) = body_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < body_names_length; i++){ + uint32_t length_body_namesi = strlen(this->body_names[i]); + memcpy(outbuffer + offset, &length_body_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_names[i], length_body_namesi); + offset += length_body_namesi; + } + *(outbuffer + offset++) = geom_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < geom_names_length; i++){ + uint32_t length_geom_namesi = strlen(this->geom_names[i]); + memcpy(outbuffer + offset, &length_geom_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->geom_names[i], length_geom_namesi); + offset += length_geom_namesi; + } + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = child_model_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < child_model_names_length; i++){ + uint32_t length_child_model_namesi = strlen(this->child_model_names[i]); + memcpy(outbuffer + offset, &length_child_model_namesi, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_parent_model_name; + memcpy(&length_parent_model_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_canonical_body_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t body_names_lengthT = *(inbuffer + offset++); + if(body_names_lengthT > body_names_length) + this->body_names = (char**)realloc(this->body_names, body_names_lengthT * sizeof(char*)); + offset += 3; + body_names_length = body_names_lengthT; + for( uint8_t i = 0; i < body_names_length; i++){ + uint32_t length_st_body_names; + memcpy(&length_st_body_names, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t geom_names_lengthT = *(inbuffer + offset++); + if(geom_names_lengthT > geom_names_length) + this->geom_names = (char**)realloc(this->geom_names, geom_names_lengthT * sizeof(char*)); + offset += 3; + geom_names_length = geom_names_lengthT; + for( uint8_t i = 0; i < geom_names_length; i++){ + uint32_t length_st_geom_names; + memcpy(&length_st_geom_names, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t child_model_names_lengthT = *(inbuffer + offset++); + 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*)); + offset += 3; + child_model_names_length = child_model_names_lengthT; + for( uint8_t i = 0; i < child_model_names_length; i++){ + uint32_t length_st_child_model_names; + memcpy(&length_st_child_model_names, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETMODELPROPERTIES; }; + const char * getMD5(){ return "b7f370938ef77b464b95f1bab3ec5028"; }; + + }; + + class GetModelProperties { + public: + typedef GetModelPropertiesRequest Request; + typedef GetModelPropertiesResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetModelState.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetModelState.h new file mode 100644 index 0000000..799c432 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetModelState.h @@ -0,0 +1,145 @@ +#ifndef _ROS_SERVICE_GetModelState_h +#define _ROS_SERVICE_GetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + +static const char GETMODELSTATE[] = "gazebo_msgs/GetModelState"; + + class GetModelStateRequest : public ros::Msg + { + public: + const char* model_name; + const char* relative_entity_name; + + GetModelStateRequest(): + model_name(""), + relative_entity_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_relative_entity_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_relative_entity_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETMODELSTATE; }; + const char * getMD5(){ return "19d412713cefe4a67437e17a951e759e"; }; + + }; + + class GetModelStateResponse : public ros::Msg + { + public: + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + bool success; + const char* status_message; + + GetModelStateResponse(): + pose(), + twist(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETMODELSTATE; }; + const char * getMD5(){ return "1f8f991dc94e0cb27fe61383e0f576bb"; }; + + }; + + class GetModelState { + public: + typedef GetModelStateRequest Request; + typedef GetModelStateResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetPhysicsProperties.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetPhysicsProperties.h new file mode 100644 index 0000000..9713896 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetPhysicsProperties.h @@ -0,0 +1,138 @@ +#ifndef _ROS_SERVICE_GetPhysicsProperties_h +#define _ROS_SERVICE_GetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPhysicsPropertiesResponse : public ros::Msg + { + public: + float time_step; + bool pause; + float max_update_rate; + geometry_msgs::Vector3 gravity; + gazebo_msgs::ODEPhysics ode_config; + bool success; + const char* 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 + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "575a5e74786981b7df2e3afc567693a6"; }; + + }; + + class GetPhysicsProperties { + public: + typedef GetPhysicsPropertiesRequest Request; + typedef GetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetWorldProperties.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetWorldProperties.h new file mode 100644 index 0000000..a179500 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/GetWorldProperties.h @@ -0,0 +1,156 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETWORLDPROPERTIES; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetWorldPropertiesResponse : public ros::Msg + { + public: + float sim_time; + uint8_t model_names_length; + char* st_model_names; + char* * model_names; + bool rendering_enabled; + bool success; + const char* status_message; + + GetWorldPropertiesResponse(): + sim_time(0), + model_names_length(0), model_names(NULL), + rendering_enabled(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->sim_time); + *(outbuffer + offset++) = model_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < model_names_length; i++){ + uint32_t length_model_namesi = strlen(this->model_names[i]); + memcpy(outbuffer + offset, &length_model_namesi, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sim_time)); + uint8_t model_names_lengthT = *(inbuffer + offset++); + if(model_names_lengthT > model_names_length) + this->model_names = (char**)realloc(this->model_names, model_names_lengthT * sizeof(char*)); + offset += 3; + model_names_length = model_names_lengthT; + for( uint8_t i = 0; i < model_names_length; i++){ + uint32_t length_st_model_names; + memcpy(&length_st_model_names, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETWORLDPROPERTIES; }; + const char * getMD5(){ return "36bb0f2eccf4d8be971410c22818ba3f"; }; + + }; + + class GetWorldProperties { + public: + typedef GetWorldPropertiesRequest Request; + typedef GetWorldPropertiesResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/JointRequest.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/JointRequest.h new file mode 100644 index 0000000..17029cb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/JointRequest.h @@ -0,0 +1,86 @@ +#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: + const char* joint_name; + + JointRequestRequest(): + joint_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return JOINTREQUEST; }; + const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class JointRequestResponse : public ros::Msg + { + public: + + JointRequestResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return JOINTREQUEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class JointRequest { + public: + typedef JointRequestRequest Request; + typedef JointRequestResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/LinkState.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/LinkState.h new file mode 100644 index 0000000..6c87024 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/LinkState.h @@ -0,0 +1,80 @@ +#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: + const char* link_name; + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + const char* reference_frame; + + LinkState(): + link_name(""), + pose(), + twist(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "gazebo_msgs/LinkState"; }; + const char * getMD5(){ return "0818ebbf28ce3a08d48ab1eaa7309ebe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/LinkStates.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/LinkStates.h new file mode 100644 index 0000000..2dc1c83 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/LinkStates.h @@ -0,0 +1,112 @@ +#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: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + + LinkStates(): + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_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)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_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; + } + + const char * getType(){ return "gazebo_msgs/LinkStates"; }; + const char * getMD5(){ return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ModelState.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ModelState.h new file mode 100644 index 0000000..15ae191 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ModelState.h @@ -0,0 +1,80 @@ +#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: + const char* model_name; + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + const char* reference_frame; + + ModelState(): + model_name(""), + pose(), + twist(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "gazebo_msgs/ModelState"; }; + const char * getMD5(){ return "9330fd35f2fcd82d457e54bd54e10593"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ModelStates.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ModelStates.h new file mode 100644 index 0000000..aeb9f21 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ModelStates.h @@ -0,0 +1,112 @@ +#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: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + + ModelStates(): + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_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)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_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; + } + + const char * getType(){ return "gazebo_msgs/ModelStates"; }; + const char * getMD5(){ return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ODEJointProperties.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ODEJointProperties.h new file mode 100644 index 0000000..1711110 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ODEJointProperties.h @@ -0,0 +1,238 @@ +#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: + uint8_t damping_length; + float st_damping; + float * damping; + uint8_t hiStop_length; + float st_hiStop; + float * hiStop; + uint8_t loStop_length; + float st_loStop; + float * loStop; + uint8_t erp_length; + float st_erp; + float * erp; + uint8_t cfm_length; + float st_cfm; + float * cfm; + uint8_t stop_erp_length; + float st_stop_erp; + float * stop_erp; + uint8_t stop_cfm_length; + float st_stop_cfm; + float * stop_cfm; + uint8_t fudge_factor_length; + float st_fudge_factor; + float * fudge_factor; + uint8_t fmax_length; + float st_fmax; + float * fmax; + uint8_t vel_length; + float st_vel; + float * vel; + + ODEJointProperties(): + damping_length(0), damping(NULL), + hiStop_length(0), hiStop(NULL), + loStop_length(0), loStop(NULL), + erp_length(0), erp(NULL), + cfm_length(0), cfm(NULL), + stop_erp_length(0), stop_erp(NULL), + stop_cfm_length(0), stop_cfm(NULL), + fudge_factor_length(0), fudge_factor(NULL), + fmax_length(0), fmax(NULL), + vel_length(0), vel(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = damping_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < damping_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); + } + *(outbuffer + offset++) = hiStop_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < hiStop_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->hiStop[i]); + } + *(outbuffer + offset++) = loStop_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < loStop_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->loStop[i]); + } + *(outbuffer + offset++) = erp_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < erp_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->erp[i]); + } + *(outbuffer + offset++) = cfm_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cfm_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->cfm[i]); + } + *(outbuffer + offset++) = stop_erp_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < stop_erp_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->stop_erp[i]); + } + *(outbuffer + offset++) = stop_cfm_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < stop_cfm_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->stop_cfm[i]); + } + *(outbuffer + offset++) = fudge_factor_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fudge_factor_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->fudge_factor[i]); + } + *(outbuffer + offset++) = fmax_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fmax_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->fmax[i]); + } + *(outbuffer + offset++) = vel_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vel_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->vel[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t damping_lengthT = *(inbuffer + offset++); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + offset += 3; + damping_length = damping_lengthT; + for( uint8_t i = 0; i < damping_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint8_t hiStop_lengthT = *(inbuffer + offset++); + if(hiStop_lengthT > hiStop_length) + this->hiStop = (float*)realloc(this->hiStop, hiStop_lengthT * sizeof(float)); + offset += 3; + hiStop_length = hiStop_lengthT; + for( uint8_t i = 0; i < hiStop_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_hiStop)); + memcpy( &(this->hiStop[i]), &(this->st_hiStop), sizeof(float)); + } + uint8_t loStop_lengthT = *(inbuffer + offset++); + if(loStop_lengthT > loStop_length) + this->loStop = (float*)realloc(this->loStop, loStop_lengthT * sizeof(float)); + offset += 3; + loStop_length = loStop_lengthT; + for( uint8_t i = 0; i < loStop_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_loStop)); + memcpy( &(this->loStop[i]), &(this->st_loStop), sizeof(float)); + } + uint8_t erp_lengthT = *(inbuffer + offset++); + if(erp_lengthT > erp_length) + this->erp = (float*)realloc(this->erp, erp_lengthT * sizeof(float)); + offset += 3; + erp_length = erp_lengthT; + for( uint8_t i = 0; i < erp_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_erp)); + memcpy( &(this->erp[i]), &(this->st_erp), sizeof(float)); + } + uint8_t cfm_lengthT = *(inbuffer + offset++); + if(cfm_lengthT > cfm_length) + this->cfm = (float*)realloc(this->cfm, cfm_lengthT * sizeof(float)); + offset += 3; + cfm_length = cfm_lengthT; + for( uint8_t i = 0; i < cfm_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_cfm)); + memcpy( &(this->cfm[i]), &(this->st_cfm), sizeof(float)); + } + uint8_t stop_erp_lengthT = *(inbuffer + offset++); + if(stop_erp_lengthT > stop_erp_length) + this->stop_erp = (float*)realloc(this->stop_erp, stop_erp_lengthT * sizeof(float)); + offset += 3; + stop_erp_length = stop_erp_lengthT; + for( uint8_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)); + } + uint8_t stop_cfm_lengthT = *(inbuffer + offset++); + if(stop_cfm_lengthT > stop_cfm_length) + this->stop_cfm = (float*)realloc(this->stop_cfm, stop_cfm_lengthT * sizeof(float)); + offset += 3; + stop_cfm_length = stop_cfm_lengthT; + for( uint8_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)); + } + uint8_t fudge_factor_lengthT = *(inbuffer + offset++); + if(fudge_factor_lengthT > fudge_factor_length) + this->fudge_factor = (float*)realloc(this->fudge_factor, fudge_factor_lengthT * sizeof(float)); + offset += 3; + fudge_factor_length = fudge_factor_lengthT; + for( uint8_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)); + } + uint8_t fmax_lengthT = *(inbuffer + offset++); + if(fmax_lengthT > fmax_length) + this->fmax = (float*)realloc(this->fmax, fmax_lengthT * sizeof(float)); + offset += 3; + fmax_length = fmax_lengthT; + for( uint8_t i = 0; i < fmax_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fmax)); + memcpy( &(this->fmax[i]), &(this->st_fmax), sizeof(float)); + } + uint8_t vel_lengthT = *(inbuffer + offset++); + if(vel_lengthT > vel_length) + this->vel = (float*)realloc(this->vel, vel_lengthT * sizeof(float)); + offset += 3; + vel_length = vel_lengthT; + for( uint8_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; + } + + const char * getType(){ return "gazebo_msgs/ODEJointProperties"; }; + const char * getMD5(){ return "1b744c32a920af979f53afe2f9c3511f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ODEPhysics.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ODEPhysics.h new file mode 100644 index 0000000..079d7bd --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/ODEPhysics.h @@ -0,0 +1,115 @@ +#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: + bool auto_disable_bodies; + uint32_t sor_pgs_precon_iters; + uint32_t sor_pgs_iters; + float sor_pgs_w; + float sor_pgs_rms_error_tol; + float contact_surface_layer; + float contact_max_correcting_vel; + float cfm; + float erp; + uint32_t 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 + { + 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) + { + 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; + } + + const char * getType(){ return "gazebo_msgs/ODEPhysics"; }; + const char * getMD5(){ return "667d56ddbd547918c32d1934503dc335"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetJointProperties.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetJointProperties.h new file mode 100644 index 0000000..1804fd4 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetJointProperties.h @@ -0,0 +1,124 @@ +#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: + const char* joint_name; + gazebo_msgs::ODEJointProperties ode_joint_config; + + SetJointPropertiesRequest(): + joint_name(""), + ode_joint_config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETJOINTPROPERTIES; }; + const char * getMD5(){ return "331fd8f35fd27e3c1421175590258e26"; }; + + }; + + class SetJointPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetJointPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETJOINTPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointProperties { + public: + typedef SetJointPropertiesRequest Request; + typedef SetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetJointTrajectory.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetJointTrajectory.h new file mode 100644 index 0000000..da5b3e9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetJointTrajectory.h @@ -0,0 +1,163 @@ +#ifndef _ROS_SERVICE_SetJointTrajectory_h +#define _ROS_SERVICE_SetJointTrajectory_h +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTTRAJECTORY[] = "gazebo_msgs/SetJointTrajectory"; + + class SetJointTrajectoryRequest : public ros::Msg + { + public: + const char* model_name; + trajectory_msgs::JointTrajectory joint_trajectory; + geometry_msgs::Pose model_pose; + bool set_model_pose; + bool 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 + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETJOINTTRAJECTORY; }; + const char * getMD5(){ return "649dd2eba5ffd358069238825f9f85ab"; }; + + }; + + class SetJointTrajectoryResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetJointTrajectoryResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETJOINTTRAJECTORY; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointTrajectory { + public: + typedef SetJointTrajectoryRequest Request; + typedef SetJointTrajectoryResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetLinkProperties.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetLinkProperties.h new file mode 100644 index 0000000..644164a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetLinkProperties.h @@ -0,0 +1,169 @@ +#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: + const char* link_name; + geometry_msgs::Pose com; + bool gravity_mode; + float mass; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float 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 + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETLINKPROPERTIES; }; + const char * getMD5(){ return "68ac74a4be01b165bc305b5ccdc45e91"; }; + + }; + + class SetLinkPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetLinkPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETLINKPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkProperties { + public: + typedef SetLinkPropertiesRequest Request; + typedef SetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetLinkState.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetLinkState.h new file mode 100644 index 0000000..dad0051 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetLinkState.h @@ -0,0 +1,108 @@ +#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: + gazebo_msgs::LinkState link_state; + + SetLinkStateRequest(): + link_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->link_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETLINKSTATE; }; + const char * getMD5(){ return "22a2c757d56911b6f27868159e9a872d"; }; + + }; + + class SetLinkStateResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetLinkStateResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETLINKSTATE; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkState { + public: + typedef SetLinkStateRequest Request; + typedef SetLinkStateResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetModelConfiguration.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetModelConfiguration.h new file mode 100644 index 0000000..5b963b4 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetModelConfiguration.h @@ -0,0 +1,187 @@ +#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: + const char* model_name; + const char* urdf_param_name; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t joint_positions_length; + float st_joint_positions; + float * joint_positions; + + SetModelConfigurationRequest(): + model_name(""), + urdf_param_name(""), + joint_names_length(0), joint_names(NULL), + joint_positions_length(0), joint_positions(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_urdf_param_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->urdf_param_name, length_urdf_param_name); + offset += length_urdf_param_name; + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = joint_positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_positions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_urdf_param_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t joint_positions_lengthT = *(inbuffer + offset++); + if(joint_positions_lengthT > joint_positions_length) + this->joint_positions = (float*)realloc(this->joint_positions, joint_positions_lengthT * sizeof(float)); + offset += 3; + joint_positions_length = joint_positions_lengthT; + for( uint8_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; + } + + const char * getType(){ return SETMODELCONFIGURATION; }; + const char * getMD5(){ return "160eae60f51fabff255480c70afa289f"; }; + + }; + + class SetModelConfigurationResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetModelConfigurationResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETMODELCONFIGURATION; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelConfiguration { + public: + typedef SetModelConfigurationRequest Request; + typedef SetModelConfigurationResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetModelState.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetModelState.h new file mode 100644 index 0000000..5d8222e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetModelState.h @@ -0,0 +1,108 @@ +#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: + gazebo_msgs::ModelState model_state; + + SetModelStateRequest(): + model_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->model_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->model_state.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETMODELSTATE; }; + const char * getMD5(){ return "cb042b0e91880f4661b29ea5b6234350"; }; + + }; + + class SetModelStateResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetModelStateResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETMODELSTATE; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelState { + public: + typedef SetModelStateRequest Request; + typedef SetModelStateResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetPhysicsProperties.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetPhysicsProperties.h new file mode 100644 index 0000000..9a5534e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SetPhysicsProperties.h @@ -0,0 +1,121 @@ +#ifndef _ROS_SERVICE_SetPhysicsProperties_h +#define _ROS_SERVICE_SetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" + +namespace gazebo_msgs +{ + +static const char SETPHYSICSPROPERTIES[] = "gazebo_msgs/SetPhysicsProperties"; + + class SetPhysicsPropertiesRequest : public ros::Msg + { + public: + float time_step; + float max_update_rate; + geometry_msgs::Vector3 gravity; + gazebo_msgs::ODEPhysics ode_config; + + SetPhysicsPropertiesRequest(): + time_step(0), + max_update_rate(0), + gravity(), + ode_config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return SETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "abd9f82732b52b92e9d6bb36e6a82452"; }; + + }; + + class SetPhysicsPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetPhysicsPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetPhysicsProperties { + public: + typedef SetPhysicsPropertiesRequest Request; + typedef SetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SpawnModel.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SpawnModel.h new file mode 100644 index 0000000..8eeb9c9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/SpawnModel.h @@ -0,0 +1,172 @@ +#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: + const char* model_name; + const char* model_xml; + const char* robot_namespace; + geometry_msgs::Pose initial_pose; + const char* reference_frame; + + SpawnModelRequest(): + model_name(""), + model_xml(""), + robot_namespace(""), + initial_pose(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_model_xml = strlen(this->model_xml); + memcpy(outbuffer + offset, &length_model_xml, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_xml, length_model_xml); + offset += length_model_xml; + uint32_t length_robot_namespace = strlen(this->robot_namespace); + memcpy(outbuffer + offset, &length_robot_namespace, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_model_xml, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_robot_namespace, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SPAWNMODEL; }; + const char * getMD5(){ return "6d0eba5753761cd57e6263a056b79930"; }; + + }; + + class SpawnModelResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SpawnModelResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SPAWNMODEL; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SpawnModel { + public: + typedef SpawnModelRequest Request; + typedef SpawnModelResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/WorldState.h b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/WorldState.h new file mode 100644 index 0000000..9ea0ae6 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/gazebo_msgs/WorldState.h @@ -0,0 +1,138 @@ +#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: + std_msgs::Header header; + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + uint8_t wrench_length; + geometry_msgs::Wrench st_wrench; + geometry_msgs::Wrench * wrench; + + WorldState(): + header(), + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL), + wrench_length(0), wrench(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = wrench_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_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)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_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)); + } + uint8_t wrench_lengthT = *(inbuffer + offset++); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrench_length = wrench_lengthT; + for( uint8_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; + } + + const char * getType(){ return "gazebo_msgs/WorldState"; }; + const char * getMD5(){ return "de1a9de3ab7ba97ac0e9ec01a4eb481e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Accel.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Accel.h new file mode 100644 index 0000000..c3bedcf --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Accel.h @@ -0,0 +1,47 @@ +#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: + geometry_msgs::Vector3 linear; + geometry_msgs::Vector3 angular; + + Accel(): + linear(), + angular() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Accel"; }; + const char * getMD5(){ return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelStamped.h new file mode 100644 index 0000000..121060d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::Accel accel; + + AccelStamped(): + header(), + accel() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelStamped"; }; + const char * getMD5(){ return "d8a98a5d81351b6eb0578c78557e7659"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelWithCovariance.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelWithCovariance.h new file mode 100644 index 0000000..89f39d0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelWithCovariance.h @@ -0,0 +1,51 @@ +#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: + geometry_msgs::Accel accel; + float covariance[36]; + + AccelWithCovariance(): + accel(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->accel.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->accel.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelWithCovariance"; }; + const char * getMD5(){ return "ad5a718d699c6be72a02b8d6a139f334"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelWithCovarianceStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelWithCovarianceStamped.h new file mode 100644 index 0000000..d548139 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/AccelWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::AccelWithCovariance accel; + + AccelWithCovarianceStamped(): + header(), + accel() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelWithCovarianceStamped"; }; + const char * getMD5(){ return "96adb295225031ec8d57fb4251b0a886"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Inertia.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Inertia.h new file mode 100644 index 0000000..c7f719a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Inertia.h @@ -0,0 +1,71 @@ +#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: + float m; + geometry_msgs::Vector3 com; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + + Inertia(): + m(0), + com(), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "geometry_msgs/Inertia"; }; + const char * getMD5(){ return "1d26e4bb6c83ff141c5cf0d883c2b0fe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/InertiaStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/InertiaStamped.h new file mode 100644 index 0000000..33cb756 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/InertiaStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::Inertia inertia; + + InertiaStamped(): + header(), + inertia() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->inertia.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->inertia.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/InertiaStamped"; }; + const char * getMD5(){ return "ddee48caeab5a966c5e8d166654a9ac7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Point.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Point.h new file mode 100644 index 0000000..92e1b42 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Point.h @@ -0,0 +1,50 @@ +#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: + float x; + float y; + float z; + + Point(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Point"; }; + const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Point32.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Point32.h new file mode 100644 index 0000000..15be573 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Point32.h @@ -0,0 +1,107 @@ +#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: + float x; + float y; + float z; + + Point32(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "geometry_msgs/Point32"; }; + const char * getMD5(){ return "cc153912f1453b708d221682bc23d9ac"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PointStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PointStamped.h new file mode 100644 index 0000000..76cb588 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PointStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::Point point; + + PointStamped(): + header(), + point() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->point.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PointStamped"; }; + const char * getMD5(){ return "c63aecb41bfdfd6b7e1fac37c7cbe7bf"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Polygon.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Polygon.h new file mode 100644 index 0000000..1d99362 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Polygon.h @@ -0,0 +1,59 @@ +#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: + uint8_t points_length; + geometry_msgs::Point32 st_points; + geometry_msgs::Point32 * points; + + Polygon(): + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + offset += 3; + points_length = points_lengthT; + for( uint8_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; + } + + const char * getType(){ return "geometry_msgs/Polygon"; }; + const char * getMD5(){ return "cd60a26494a087f577976f0329fa120e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PolygonStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PolygonStamped.h new file mode 100644 index 0000000..1f90c35 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PolygonStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::Polygon polygon; + + PolygonStamped(): + header(), + polygon() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->polygon.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->polygon.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PolygonStamped"; }; + const char * getMD5(){ return "c6be8f7dc3bee7fe9e8d296070f53340"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Pose.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Pose.h new file mode 100644 index 0000000..facec0f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Pose.h @@ -0,0 +1,48 @@ +#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: + geometry_msgs::Point position; + geometry_msgs::Quaternion orientation; + + Pose(): + position(), + orientation() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->position.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->position.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Pose"; }; + const char * getMD5(){ return "e45d45a5a1ce597b249e23fb30fc871f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Pose2D.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Pose2D.h new file mode 100644 index 0000000..a011718 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Pose2D.h @@ -0,0 +1,50 @@ +#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: + float x; + float y; + float theta; + + Pose2D(): + x(0), + y(0), + theta(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->theta)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Pose2D"; }; + const char * getMD5(){ return "938fa65709584ad8e77d238529be13b8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseArray.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseArray.h new file mode 100644 index 0000000..e7a5050 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseArray.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t poses_length; + geometry_msgs::Pose st_poses; + geometry_msgs::Pose * poses; + + PoseArray(): + header(), + poses_length(0), poses(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::Pose*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_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; + } + + const char * getType(){ return "geometry_msgs/PoseArray"; }; + const char * getMD5(){ return "916c28c5764443f268b296bb671b9d97"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseStamped.h new file mode 100644 index 0000000..ae466ab --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::Pose pose; + + PoseStamped(): + header(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseStamped"; }; + const char * getMD5(){ return "d3812c3cbc69362b77dc0b19b345f8f5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseWithCovariance.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseWithCovariance.h new file mode 100644 index 0000000..d2091e6 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseWithCovariance.h @@ -0,0 +1,51 @@ +#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: + geometry_msgs::Pose pose; + float covariance[36]; + + PoseWithCovariance(): + pose(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseWithCovariance"; }; + const char * getMD5(){ return "c23e848cf1b7533a8d7c259073a97e6f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseWithCovarianceStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseWithCovarianceStamped.h new file mode 100644 index 0000000..586a930 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/PoseWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::PoseWithCovariance pose; + + PoseWithCovarianceStamped(): + header(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseWithCovarianceStamped"; }; + const char * getMD5(){ return "953b798c0f514ff060a53a3498ce6246"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Quaternion.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Quaternion.h new file mode 100644 index 0000000..69cddbe --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Quaternion.h @@ -0,0 +1,54 @@ +#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: + float x; + float y; + float z; + float w; + + Quaternion(): + x(0), + y(0), + z(0), + w(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "geometry_msgs/Quaternion"; }; + const char * getMD5(){ return "a779879fadf0160734f906b8c19c7004"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/QuaternionStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/QuaternionStamped.h new file mode 100644 index 0000000..c2e0fcf --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/QuaternionStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::Quaternion quaternion; + + QuaternionStamped(): + header(), + quaternion() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->quaternion.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->quaternion.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/QuaternionStamped"; }; + const char * getMD5(){ return "e57f1e547e0e1fd13504588ffc8334e2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Transform.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Transform.h new file mode 100644 index 0000000..94cf738 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Transform.h @@ -0,0 +1,48 @@ +#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: + geometry_msgs::Vector3 translation; + geometry_msgs::Quaternion rotation; + + Transform(): + translation(), + rotation() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->translation.serialize(outbuffer + offset); + offset += this->rotation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->translation.deserialize(inbuffer + offset); + offset += this->rotation.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Transform"; }; + const char * getMD5(){ return "ac9eff44abf714214112b05d54a3cf9b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TransformStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TransformStamped.h new file mode 100644 index 0000000..d42125e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TransformStamped.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + const char* child_frame_id; + geometry_msgs::Transform transform; + + TransformStamped(): + header(), + child_frame_id(""), + transform() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen(this->child_frame_id); + memcpy(outbuffer + offset, &length_child_frame_id, sizeof(uint32_t)); + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + memcpy(&length_child_frame_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "geometry_msgs/TransformStamped"; }; + const char * getMD5(){ return "b5764a33bfeb3588febc2682852579b0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Twist.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Twist.h new file mode 100644 index 0000000..6133c64 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Twist.h @@ -0,0 +1,47 @@ +#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: + geometry_msgs::Vector3 linear; + geometry_msgs::Vector3 angular; + + Twist(): + linear(), + angular() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Twist"; }; + const char * getMD5(){ return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistStamped.h new file mode 100644 index 0000000..bf39940 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::Twist twist; + + TwistStamped(): + header(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistStamped"; }; + const char * getMD5(){ return "98d34b0043a2093cf9d9345ab6eef12e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistWithCovariance.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistWithCovariance.h new file mode 100644 index 0000000..c30e300 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistWithCovariance.h @@ -0,0 +1,51 @@ +#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: + geometry_msgs::Twist twist; + float covariance[36]; + + TwistWithCovariance(): + twist(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->twist.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->twist.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistWithCovariance"; }; + const char * getMD5(){ return "1fe8a28e6890a4cc3ae4c3ca5c7d82e6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistWithCovarianceStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistWithCovarianceStamped.h new file mode 100644 index 0000000..5ea6c8e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/TwistWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::TwistWithCovariance twist; + + TwistWithCovarianceStamped(): + header(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistWithCovarianceStamped"; }; + const char * getMD5(){ return "8927a1a12fb2607ceea095b2dc440a96"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Vector3.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Vector3.h new file mode 100644 index 0000000..af3f253 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Vector3.h @@ -0,0 +1,50 @@ +#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: + float x; + float y; + float z; + + Vector3(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Vector3"; }; + const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Vector3Stamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Vector3Stamped.h new file mode 100644 index 0000000..589d571 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Vector3Stamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::Vector3 vector; + + Vector3Stamped(): + header(), + vector() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->vector.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->vector.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Vector3Stamped"; }; + const char * getMD5(){ return "7b324c7325e683bf02a9b14b01090ec7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Wrench.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Wrench.h new file mode 100644 index 0000000..d95bf1b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/Wrench.h @@ -0,0 +1,47 @@ +#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: + geometry_msgs::Vector3 force; + geometry_msgs::Vector3 torque; + + Wrench(): + force(), + torque() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->force.serialize(outbuffer + offset); + offset += this->torque.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->force.deserialize(inbuffer + offset); + offset += this->torque.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Wrench"; }; + const char * getMD5(){ return "4f539cf138b23283b520fd271b567936"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/geometry_msgs/WrenchStamped.h b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/WrenchStamped.h new file mode 100644 index 0000000..86becdc --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/geometry_msgs/WrenchStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + geometry_msgs::Wrench wrench; + + WrenchStamped(): + header(), + wrench() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/WrenchStamped"; }; + const char * getMD5(){ return "d78d3cb249ce23087ade7e7d0c40cfa7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/laser_assembler/AssembleScans.h b/libraries/Rosserial_Arduino_Library/src/laser_assembler/AssembleScans.h new file mode 100644 index 0000000..eda9160 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/laser_assembler/AssembleScans.h @@ -0,0 +1,120 @@ +#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: + ros::Time begin; + ros::Time end; + + AssembleScansRequest(): + begin(), + end() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return ASSEMBLESCANS; }; + const char * getMD5(){ return "b341004f74e15bf5e1b2053a9183bdc7"; }; + + }; + + class AssembleScansResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud cloud; + + AssembleScansResponse(): + cloud() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->cloud.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS; }; + const char * getMD5(){ return "4217b28a903e4ad7869a83b3653110ff"; }; + + }; + + class AssembleScans { + public: + typedef AssembleScansRequest Request; + typedef AssembleScansResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/laser_assembler/AssembleScans2.h b/libraries/Rosserial_Arduino_Library/src/laser_assembler/AssembleScans2.h new file mode 100644 index 0000000..244f919 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/laser_assembler/AssembleScans2.h @@ -0,0 +1,120 @@ +#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: + ros::Time begin; + ros::Time end; + + AssembleScans2Request(): + begin(), + end() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return ASSEMBLESCANS2; }; + const char * getMD5(){ return "b341004f74e15bf5e1b2053a9183bdc7"; }; + + }; + + class AssembleScans2Response : public ros::Msg + { + public: + sensor_msgs::PointCloud2 cloud; + + AssembleScans2Response(): + cloud() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->cloud.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS2; }; + const char * getMD5(){ return "96cec5374164b3b3d1d7ef5d7628a7ed"; }; + + }; + + class AssembleScans2 { + public: + typedef AssembleScans2Request Request; + typedef AssembleScans2Response Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/map_msgs/GetMapROI.h b/libraries/Rosserial_Arduino_Library/src/map_msgs/GetMapROI.h new file mode 100644 index 0000000..68e5053 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/map_msgs/GetMapROI.h @@ -0,0 +1,91 @@ +#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: + float x; + float y; + float l_x; + float l_y; + + GetMapROIRequest(): + x(0), + y(0), + l_x(0), + l_y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return GETMAPROI; }; + const char * getMD5(){ return "43c2ff8f45af555c0eaf070c401e9a47"; }; + + }; + + class GetMapROIResponse : public ros::Msg + { + public: + nav_msgs::OccupancyGrid sub_map; + + GetMapROIResponse(): + sub_map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->sub_map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->sub_map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETMAPROI; }; + const char * getMD5(){ return "4d1986519c00d81967d2891a606b234c"; }; + + }; + + class GetMapROI { + public: + typedef GetMapROIRequest Request; + typedef GetMapROIResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/map_msgs/GetPointMap.h b/libraries/Rosserial_Arduino_Library/src/map_msgs/GetPointMap.h new file mode 100644 index 0000000..3f7cfbe --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/map_msgs/GetPointMap.h @@ -0,0 +1,75 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETPOINTMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPointMapResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud2 map; + + GetPointMapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOINTMAP; }; + const char * getMD5(){ return "b84fbb39505086eb6a62d933c75cb7b4"; }; + + }; + + class GetPointMap { + public: + typedef GetPointMapRequest Request; + typedef GetPointMapResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/map_msgs/GetPointMapROI.h b/libraries/Rosserial_Arduino_Library/src/map_msgs/GetPointMapROI.h new file mode 100644 index 0000000..6ecbddf --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/map_msgs/GetPointMapROI.h @@ -0,0 +1,103 @@ +#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: + float x; + float y; + float z; + float r; + float l_x; + float l_y; + float 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 + { + 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) + { + 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; + } + + const char * getType(){ return GETPOINTMAPROI; }; + const char * getMD5(){ return "895f7e437a9a6dd225316872b187a303"; }; + + }; + + class GetPointMapROIResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud2 sub_map; + + GetPointMapROIResponse(): + sub_map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->sub_map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->sub_map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOINTMAPROI; }; + const char * getMD5(){ return "313769f8b0e724525c6463336cbccd63"; }; + + }; + + class GetPointMapROI { + public: + typedef GetPointMapROIRequest Request; + typedef GetPointMapROIResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/map_msgs/OccupancyGridUpdate.h b/libraries/Rosserial_Arduino_Library/src/map_msgs/OccupancyGridUpdate.h new file mode 100644 index 0000000..b86417d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/map_msgs/OccupancyGridUpdate.h @@ -0,0 +1,146 @@ +#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: + std_msgs::Header header; + int32_t x; + int32_t y; + uint32_t width; + uint32_t height; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + OccupancyGridUpdate(): + header(), + x(0), + y(0), + width(0), + height(0), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + 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); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "map_msgs/OccupancyGridUpdate"; }; + const char * getMD5(){ return "b295be292b335c34718bd939deebe1c9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/map_msgs/PointCloud2Update.h b/libraries/Rosserial_Arduino_Library/src/map_msgs/PointCloud2Update.h new file mode 100644 index 0000000..116f2eb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/map_msgs/PointCloud2Update.h @@ -0,0 +1,62 @@ +#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: + std_msgs::Header header; + uint32_t type; + sensor_msgs::PointCloud2 points; + enum { ADD = 0 }; + enum { DELETE = 1 }; + + PointCloud2Update(): + header(), + type(0), + points() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "map_msgs/PointCloud2Update"; }; + const char * getMD5(){ return "6c58e4f249ae9cd2b24fb1ee0f99195e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMap.h b/libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMap.h new file mode 100644 index 0000000..7e9e9e0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMap.h @@ -0,0 +1,51 @@ +#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: + nav_msgs::OccupancyGrid map; + float min_z; + float max_z; + + ProjectedMap(): + map(), + min_z(0), + max_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "map_msgs/ProjectedMap"; }; + const char * getMD5(){ return "7bbe8f96e45089681dc1ea7d023cbfca"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMapInfo.h b/libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMapInfo.h new file mode 100644 index 0000000..993c9fa --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMapInfo.h @@ -0,0 +1,78 @@ +#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: + const char* frame_id; + float x; + float y; + float width; + float height; + float min_z; + float 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 + { + int offset = 0; + uint32_t length_frame_id = strlen(this->frame_id); + memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_frame_id; + memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "map_msgs/ProjectedMapInfo"; }; + const char * getMD5(){ return "2dc10595ae94de23f22f8a6d2a0eef7a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMapsInfo.h b/libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMapsInfo.h new file mode 100644 index 0000000..0f48d32 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/map_msgs/ProjectedMapsInfo.h @@ -0,0 +1,91 @@ +#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: + uint8_t projected_maps_info_length; + map_msgs::ProjectedMapInfo st_projected_maps_info; + map_msgs::ProjectedMapInfo * projected_maps_info; + + ProjectedMapsInfoRequest(): + projected_maps_info_length(0), projected_maps_info(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = projected_maps_info_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t projected_maps_info_lengthT = *(inbuffer + offset++); + 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)); + offset += 3; + projected_maps_info_length = projected_maps_info_lengthT; + for( uint8_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; + } + + const char * getType(){ return PROJECTEDMAPSINFO; }; + const char * getMD5(){ return "d7980a33202421c8cd74565e57a4d229"; }; + + }; + + class ProjectedMapsInfoResponse : public ros::Msg + { + public: + + ProjectedMapsInfoResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return PROJECTEDMAPSINFO; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ProjectedMapsInfo { + public: + typedef ProjectedMapsInfoRequest Request; + typedef ProjectedMapsInfoResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/map_msgs/SaveMap.h b/libraries/Rosserial_Arduino_Library/src/map_msgs/SaveMap.h new file mode 100644 index 0000000..e5db8c2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/map_msgs/SaveMap.h @@ -0,0 +1,75 @@ +#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: + std_msgs::String filename; + + SaveMapRequest(): + filename() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->filename.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->filename.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SAVEMAP; }; + const char * getMD5(){ return "716e25f9d9dc76ceba197f93cbf05dc7"; }; + + }; + + class SaveMapResponse : public ros::Msg + { + public: + + SaveMapResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SAVEMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SaveMap { + public: + typedef SaveMapRequest Request; + typedef SaveMapResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/map_msgs/SetMapProjections.h b/libraries/Rosserial_Arduino_Library/src/map_msgs/SetMapProjections.h new file mode 100644 index 0000000..ff344fb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/map_msgs/SetMapProjections.h @@ -0,0 +1,91 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETMAPPROJECTIONS; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetMapProjectionsResponse : public ros::Msg + { + public: + uint8_t projected_maps_info_length; + map_msgs::ProjectedMapInfo st_projected_maps_info; + map_msgs::ProjectedMapInfo * projected_maps_info; + + SetMapProjectionsResponse(): + projected_maps_info_length(0), projected_maps_info(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = projected_maps_info_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t projected_maps_info_lengthT = *(inbuffer + offset++); + 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)); + offset += 3; + projected_maps_info_length = projected_maps_info_lengthT; + for( uint8_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; + } + + const char * getType(){ return SETMAPPROJECTIONS; }; + const char * getMD5(){ return "d7980a33202421c8cd74565e57a4d229"; }; + + }; + + class SetMapProjections { + public: + typedef SetMapProjectionsRequest Request; + typedef SetMapProjectionsResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseAction.h b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseAction.h new file mode 100644 index 0000000..ad7b480 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseAction.h @@ -0,0 +1,53 @@ +#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: + move_base_msgs::MoveBaseActionGoal action_goal; + move_base_msgs::MoveBaseActionResult action_result; + move_base_msgs::MoveBaseActionFeedback action_feedback; + + MoveBaseAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "move_base_msgs/MoveBaseAction"; }; + const char * getMD5(){ return "70b6aca7c7f7746d8d1609ad94c80bb8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionFeedback.h new file mode 100644 index 0000000..b2622c7 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + move_base_msgs::MoveBaseFeedback feedback; + + MoveBaseActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseActionFeedback"; }; + const char * getMD5(){ return "7d1870ff6e0decea702b943b5af0b42e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionGoal.h b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionGoal.h new file mode 100644 index 0000000..fc9971a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + move_base_msgs::MoveBaseGoal goal; + + MoveBaseActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseActionGoal"; }; + const char * getMD5(){ return "660d6895a1b9a16dce51fbdd9a64a56b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionResult.h b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionResult.h new file mode 100644 index 0000000..55ebba0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + move_base_msgs::MoveBaseResult result; + + MoveBaseActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseFeedback.h b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseFeedback.h new file mode 100644 index 0000000..9a96df9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseFeedback.h @@ -0,0 +1,43 @@ +#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: + geometry_msgs::PoseStamped base_position; + + MoveBaseFeedback(): + base_position() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->base_position.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->base_position.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseFeedback"; }; + const char * getMD5(){ return "3fb824c456a757373a226f6d08071bf0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseGoal.h b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseGoal.h new file mode 100644 index 0000000..d16bc62 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseGoal.h @@ -0,0 +1,43 @@ +#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: + geometry_msgs::PoseStamped target_pose; + + MoveBaseGoal(): + target_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->target_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->target_pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseGoal"; }; + const char * getMD5(){ return "257d089627d7eb7136c24d3593d05a16"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseResult.h b/libraries/Rosserial_Arduino_Library/src/move_base_msgs/MoveBaseResult.h new file mode 100644 index 0000000..c43c536 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMap.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMap.h new file mode 100644 index 0000000..5fa87e8 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMap.h @@ -0,0 +1,75 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetMapResponse : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + + GetMapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETMAP; }; + const char * getMD5(){ return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + + class GetMap { + public: + typedef GetMapRequest Request; + typedef GetMapResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapAction.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapAction.h new file mode 100644 index 0000000..774101b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapAction.h @@ -0,0 +1,53 @@ +#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: + nav_msgs::GetMapActionGoal action_goal; + nav_msgs::GetMapActionResult action_result; + nav_msgs::GetMapActionFeedback action_feedback; + + GetMapAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "nav_msgs/GetMapAction"; }; + const char * getMD5(){ return "e611ad23fbf237c031b7536416dc7cd7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionFeedback.h new file mode 100644 index 0000000..e5445b3 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + nav_msgs::GetMapFeedback feedback; + + GetMapActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionGoal.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionGoal.h new file mode 100644 index 0000000..644be5c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + nav_msgs::GetMapGoal goal; + + GetMapActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionGoal"; }; + const char * getMD5(){ return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionResult.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionResult.h new file mode 100644 index 0000000..b635cfd --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + nav_msgs::GetMapResult result; + + GetMapActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionResult"; }; + const char * getMD5(){ return "ac66e5b9a79bb4bbd33dab245236c892"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapFeedback.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapFeedback.h new file mode 100644 index 0000000..e3b4560 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapGoal.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapGoal.h new file mode 100644 index 0000000..88a17c5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapGoal"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapResult.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapResult.h new file mode 100644 index 0000000..005b639 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetMapResult.h @@ -0,0 +1,43 @@ +#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: + nav_msgs::OccupancyGrid map; + + GetMapResult(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapResult"; }; + const char * getMD5(){ return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetPlan.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetPlan.h new file mode 100644 index 0000000..1ea3f32 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GetPlan.h @@ -0,0 +1,107 @@ +#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: + geometry_msgs::PoseStamped start; + geometry_msgs::PoseStamped goal; + float tolerance; + + GetPlanRequest(): + start(), + goal(), + tolerance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return GETPLAN; }; + const char * getMD5(){ return "e25a43e0752bcca599a8c2eef8282df8"; }; + + }; + + class GetPlanResponse : public ros::Msg + { + public: + nav_msgs::Path plan; + + GetPlanResponse(): + plan() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->plan.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->plan.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPLAN; }; + const char * getMD5(){ return "0002bc113c0259d71f6cf8cbc9430e18"; }; + + }; + + class GetPlan { + public: + typedef GetPlanRequest Request; + typedef GetPlanResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/GridCells.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GridCells.h new file mode 100644 index 0000000..c65160c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/GridCells.h @@ -0,0 +1,110 @@ +#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: + std_msgs::Header header; + float cell_width; + float cell_height; + uint8_t cells_length; + geometry_msgs::Point st_cells; + geometry_msgs::Point * cells; + + GridCells(): + header(), + cell_width(0), + cell_height(0), + cells_length(0), cells(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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++) = cells_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cells_length; i++){ + offset += this->cells[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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); + uint8_t cells_lengthT = *(inbuffer + offset++); + if(cells_lengthT > cells_length) + this->cells = (geometry_msgs::Point*)realloc(this->cells, cells_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + cells_length = cells_lengthT; + for( uint8_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; + } + + const char * getType(){ return "nav_msgs/GridCells"; }; + const char * getMD5(){ return "b9e4f5df6d28e272ebde00a3994830f5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/MapMetaData.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/MapMetaData.h new file mode 100644 index 0000000..e9e73d8 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/MapMetaData.h @@ -0,0 +1,113 @@ +#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: + ros::Time map_load_time; + float resolution; + uint32_t width; + uint32_t height; + geometry_msgs::Pose origin; + + MapMetaData(): + map_load_time(), + resolution(0), + width(0), + height(0), + origin() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "nav_msgs/MapMetaData"; }; + const char * getMD5(){ return "10cfc8a2818024d3248802c00c95f11b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/OccupancyGrid.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/OccupancyGrid.h new file mode 100644 index 0000000..6cc22b7 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/OccupancyGrid.h @@ -0,0 +1,81 @@ +#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: + std_msgs::Header header; + nav_msgs::MapMetaData info; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + OccupancyGrid(): + header(), + info(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->info.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->info.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "nav_msgs/OccupancyGrid"; }; + const char * getMD5(){ return "3381f2d731d4076ec5c71b0759edbe4e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/Odometry.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/Odometry.h new file mode 100644 index 0000000..7966ea5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/Odometry.h @@ -0,0 +1,69 @@ +#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: + std_msgs::Header header; + const char* child_frame_id; + geometry_msgs::PoseWithCovariance pose; + geometry_msgs::TwistWithCovariance twist; + + Odometry(): + header(), + child_frame_id(""), + pose(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen(this->child_frame_id); + memcpy(outbuffer + offset, &length_child_frame_id, sizeof(uint32_t)); + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + memcpy(&length_child_frame_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "nav_msgs/Odometry"; }; + const char * getMD5(){ return "cd5e73d190d741a2f92e81eda573aca7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/Path.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/Path.h new file mode 100644 index 0000000..88d2301 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/Path.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t poses_length; + geometry_msgs::PoseStamped st_poses; + geometry_msgs::PoseStamped * poses; + + Path(): + header(), + poses_length(0), poses(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::PoseStamped*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::PoseStamped)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_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; + } + + const char * getType(){ return "nav_msgs/Path"; }; + const char * getMD5(){ return "6227e2b7e9cce15051f669a5e197bbf7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/nav_msgs/SetMap.h b/libraries/Rosserial_Arduino_Library/src/nav_msgs/SetMap.h new file mode 100644 index 0000000..436f95d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nav_msgs/SetMap.h @@ -0,0 +1,97 @@ +#ifndef _ROS_SERVICE_SetMap_h +#define _ROS_SERVICE_SetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" +#include "geometry_msgs/PoseWithCovarianceStamped.h" + +namespace nav_msgs +{ + +static const char SETMAP[] = "nav_msgs/SetMap"; + + class SetMapRequest : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + geometry_msgs::PoseWithCovarianceStamped initial_pose; + + SetMapRequest(): + map(), + initial_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + offset += this->initial_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + offset += this->initial_pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETMAP; }; + const char * getMD5(){ return "91149a20d7be299b87c340df8cc94fd4"; }; + + }; + + class SetMapResponse : public ros::Msg + { + public: + bool success; + + SetMapResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return SETMAP; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SetMap { + public: + typedef SetMapRequest Request; + typedef SetMapResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/nodelet/NodeletList.h b/libraries/Rosserial_Arduino_Library/src/nodelet/NodeletList.h new file mode 100644 index 0000000..6cb0cd1 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nodelet/NodeletList.h @@ -0,0 +1,102 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return NODELETLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class NodeletListResponse : public ros::Msg + { + public: + uint8_t nodelets_length; + char* st_nodelets; + char* * nodelets; + + NodeletListResponse(): + nodelets_length(0), nodelets(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = nodelets_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < nodelets_length; i++){ + uint32_t length_nodeletsi = strlen(this->nodelets[i]); + memcpy(outbuffer + offset, &length_nodeletsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->nodelets[i], length_nodeletsi); + offset += length_nodeletsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t nodelets_lengthT = *(inbuffer + offset++); + if(nodelets_lengthT > nodelets_length) + this->nodelets = (char**)realloc(this->nodelets, nodelets_lengthT * sizeof(char*)); + offset += 3; + nodelets_length = nodelets_lengthT; + for( uint8_t i = 0; i < nodelets_length; i++){ + uint32_t length_st_nodelets; + memcpy(&length_st_nodelets, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return NODELETLIST; }; + const char * getMD5(){ return "99c7b10e794f5600b8030e697e946ca7"; }; + + }; + + class NodeletList { + public: + typedef NodeletListRequest Request; + typedef NodeletListResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/nodelet/NodeletLoad.h b/libraries/Rosserial_Arduino_Library/src/nodelet/NodeletLoad.h new file mode 100644 index 0000000..17d85de --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nodelet/NodeletLoad.h @@ -0,0 +1,231 @@ +#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: + const char* name; + const char* type; + uint8_t remap_source_args_length; + char* st_remap_source_args; + char* * remap_source_args; + uint8_t remap_target_args_length; + char* st_remap_target_args; + char* * remap_target_args; + uint8_t my_argv_length; + char* st_my_argv; + char* * my_argv; + const char* bond_id; + + NodeletLoadRequest(): + name(""), + type(""), + remap_source_args_length(0), remap_source_args(NULL), + remap_target_args_length(0), remap_target_args(NULL), + my_argv_length(0), my_argv(NULL), + bond_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset++) = remap_source_args_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_remap_source_argsi = strlen(this->remap_source_args[i]); + memcpy(outbuffer + offset, &length_remap_source_argsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->remap_source_args[i], length_remap_source_argsi); + offset += length_remap_source_argsi; + } + *(outbuffer + offset++) = remap_target_args_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_remap_target_argsi = strlen(this->remap_target_args[i]); + memcpy(outbuffer + offset, &length_remap_target_argsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->remap_target_args[i], length_remap_target_argsi); + offset += length_remap_target_argsi; + } + *(outbuffer + offset++) = my_argv_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < my_argv_length; i++){ + uint32_t length_my_argvi = strlen(this->my_argv[i]); + memcpy(outbuffer + offset, &length_my_argvi, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_bond_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->bond_id, length_bond_id); + offset += length_bond_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t remap_source_args_lengthT = *(inbuffer + offset++); + 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*)); + offset += 3; + remap_source_args_length = remap_source_args_lengthT; + for( uint8_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_st_remap_source_args; + memcpy(&length_st_remap_source_args, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t remap_target_args_lengthT = *(inbuffer + offset++); + 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*)); + offset += 3; + remap_target_args_length = remap_target_args_lengthT; + for( uint8_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_st_remap_target_args; + memcpy(&length_st_remap_target_args, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t my_argv_lengthT = *(inbuffer + offset++); + if(my_argv_lengthT > my_argv_length) + this->my_argv = (char**)realloc(this->my_argv, my_argv_lengthT * sizeof(char*)); + offset += 3; + my_argv_length = my_argv_lengthT; + for( uint8_t i = 0; i < my_argv_length; i++){ + uint32_t length_st_my_argv; + memcpy(&length_st_my_argv, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_bond_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return NODELETLOAD; }; + const char * getMD5(){ return "c6e28cc4d2e259249d96cfb50658fbec"; }; + + }; + + class NodeletLoadResponse : public ros::Msg + { + public: + bool success; + + NodeletLoadResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return NODELETLOAD; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletLoad { + public: + typedef NodeletLoadRequest Request; + typedef NodeletLoadResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/nodelet/NodeletUnload.h b/libraries/Rosserial_Arduino_Library/src/nodelet/NodeletUnload.h new file mode 100644 index 0000000..0f1c1df --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/nodelet/NodeletUnload.h @@ -0,0 +1,103 @@ +#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: + const char* name; + + NodeletUnloadRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return NODELETUNLOAD; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class NodeletUnloadResponse : public ros::Msg + { + public: + bool success; + + NodeletUnloadResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return NODELETUNLOAD; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletUnload { + public: + typedef NodeletUnloadRequest Request; + typedef NodeletUnloadResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/octomap_msgs/BoundingBoxQuery.h b/libraries/Rosserial_Arduino_Library/src/octomap_msgs/BoundingBoxQuery.h new file mode 100644 index 0000000..f634791 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/octomap_msgs/BoundingBoxQuery.h @@ -0,0 +1,79 @@ +#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: + geometry_msgs::Point min; + geometry_msgs::Point max; + + BoundingBoxQueryRequest(): + min(), + max() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->min.serialize(outbuffer + offset); + offset += this->max.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->min.deserialize(inbuffer + offset); + offset += this->max.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return BOUNDINGBOXQUERY; }; + const char * getMD5(){ return "93aa3d73b866f04880927745f4aab303"; }; + + }; + + class BoundingBoxQueryResponse : public ros::Msg + { + public: + + BoundingBoxQueryResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return BOUNDINGBOXQUERY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class BoundingBoxQuery { + public: + typedef BoundingBoxQueryRequest Request; + typedef BoundingBoxQueryResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/octomap_msgs/GetOctomap.h b/libraries/Rosserial_Arduino_Library/src/octomap_msgs/GetOctomap.h new file mode 100644 index 0000000..794e1f8 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/octomap_msgs/GetOctomap.h @@ -0,0 +1,75 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETOCTOMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetOctomapResponse : public ros::Msg + { + public: + octomap_msgs::Octomap map; + + GetOctomapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETOCTOMAP; }; + const char * getMD5(){ return "be9d2869d24fe40d6bc21ac21f6bb2c5"; }; + + }; + + class GetOctomap { + public: + typedef GetOctomapRequest Request; + typedef GetOctomapResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/octomap_msgs/Octomap.h b/libraries/Rosserial_Arduino_Library/src/octomap_msgs/Octomap.h new file mode 100644 index 0000000..469249d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/octomap_msgs/Octomap.h @@ -0,0 +1,113 @@ +#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: + std_msgs::Header header; + bool binary; + const char* id; + float resolution; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + Octomap(): + header(), + binary(0), + id(""), + resolution(0), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + offset += serializeAvrFloat64(outbuffer + offset, this->resolution); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + 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; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + 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)); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "octomap_msgs/Octomap"; }; + const char * getMD5(){ return "9a45536b45c5e409cd49f04bb2d9999f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/octomap_msgs/OctomapWithPose.h b/libraries/Rosserial_Arduino_Library/src/octomap_msgs/OctomapWithPose.h new file mode 100644 index 0000000..6247fe9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/octomap_msgs/OctomapWithPose.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + geometry_msgs::Pose origin; + octomap_msgs::Octomap octomap; + + OctomapWithPose(): + header(), + origin(), + octomap() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->origin.deserialize(inbuffer + offset); + offset += this->octomap.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "octomap_msgs/OctomapWithPose"; }; + const char * getMD5(){ return "20b380aca6a508a657e95526cddaf618"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Circle.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Circle.h new file mode 100644 index 0000000..9ab3468 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Circle.h @@ -0,0 +1,47 @@ +#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: + opencv_apps::Point2D center; + float radius; + + Circle(): + center(), + radius(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->center.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->radius); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->center.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->radius)); + return offset; + } + + const char * getType(){ return "opencv_apps/Circle"; }; + const char * getMD5(){ return "4f6847051b4fe493b5af8caad66201d5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/CircleArray.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/CircleArray.h new file mode 100644 index 0000000..de9a69a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/CircleArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t circles_length; + opencv_apps::Circle st_circles; + opencv_apps::Circle * circles; + + CircleArray(): + circles_length(0), circles(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = circles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < circles_length; i++){ + offset += this->circles[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t circles_lengthT = *(inbuffer + offset++); + if(circles_lengthT > circles_length) + this->circles = (opencv_apps::Circle*)realloc(this->circles, circles_lengthT * sizeof(opencv_apps::Circle)); + offset += 3; + circles_length = circles_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/CircleArray"; }; + const char * getMD5(){ return "1970b146e338dd024c765e522039a727"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/CircleArrayStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/CircleArrayStamped.h new file mode 100644 index 0000000..0713946 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/CircleArrayStamped.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t circles_length; + opencv_apps::Circle st_circles; + opencv_apps::Circle * circles; + + CircleArrayStamped(): + header(), + circles_length(0), circles(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = circles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < circles_length; i++){ + offset += this->circles[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t circles_lengthT = *(inbuffer + offset++); + if(circles_lengthT > circles_length) + this->circles = (opencv_apps::Circle*)realloc(this->circles, circles_lengthT * sizeof(opencv_apps::Circle)); + offset += 3; + circles_length = circles_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/CircleArrayStamped"; }; + const char * getMD5(){ return "430ffa6c2b0a36b7e81feff1ce79c3c4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Contour.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Contour.h new file mode 100644 index 0000000..fcb9bb2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Contour.h @@ -0,0 +1,59 @@ +#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: + uint8_t points_length; + opencv_apps::Point2D st_points; + opencv_apps::Point2D * points; + + Contour(): + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (opencv_apps::Point2D*)realloc(this->points, points_lengthT * sizeof(opencv_apps::Point2D)); + offset += 3; + points_length = points_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/Contour"; }; + const char * getMD5(){ return "8f02263beef99aa03117a577a3eb879d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/ContourArray.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/ContourArray.h new file mode 100644 index 0000000..5f5a650 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/ContourArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t contours_length; + opencv_apps::Contour st_contours; + opencv_apps::Contour * contours; + + ContourArray(): + contours_length(0), contours(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = contours_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contours_length; i++){ + offset += this->contours[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t contours_lengthT = *(inbuffer + offset++); + if(contours_lengthT > contours_length) + this->contours = (opencv_apps::Contour*)realloc(this->contours, contours_lengthT * sizeof(opencv_apps::Contour)); + offset += 3; + contours_length = contours_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/ContourArray"; }; + const char * getMD5(){ return "fc54374f45559dfed248b316ccf9181d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/ContourArrayStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/ContourArrayStamped.h new file mode 100644 index 0000000..9c50f1d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/ContourArrayStamped.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t contours_length; + opencv_apps::Contour st_contours; + opencv_apps::Contour * contours; + + ContourArrayStamped(): + header(), + contours_length(0), contours(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = contours_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contours_length; i++){ + offset += this->contours[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t contours_lengthT = *(inbuffer + offset++); + if(contours_lengthT > contours_length) + this->contours = (opencv_apps::Contour*)realloc(this->contours, contours_lengthT * sizeof(opencv_apps::Contour)); + offset += 3; + contours_length = contours_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/ContourArrayStamped"; }; + const char * getMD5(){ return "6bcf2733566be102cf11fc89685fd962"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Face.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Face.h new file mode 100644 index 0000000..d4e6b76 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Face.h @@ -0,0 +1,63 @@ +#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: + opencv_apps::Rect face; + uint8_t eyes_length; + opencv_apps::Rect st_eyes; + opencv_apps::Rect * eyes; + + Face(): + face(), + eyes_length(0), eyes(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->face.serialize(outbuffer + offset); + *(outbuffer + offset++) = eyes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < eyes_length; i++){ + offset += this->eyes[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->face.deserialize(inbuffer + offset); + uint8_t eyes_lengthT = *(inbuffer + offset++); + if(eyes_lengthT > eyes_length) + this->eyes = (opencv_apps::Rect*)realloc(this->eyes, eyes_lengthT * sizeof(opencv_apps::Rect)); + offset += 3; + eyes_length = eyes_lengthT; + for( uint8_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)); + } + return offset; + } + + const char * getType(){ return "opencv_apps/Face"; }; + const char * getMD5(){ return "0c2547d2eaf71219898bf5c25e36907e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/FaceArray.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/FaceArray.h new file mode 100644 index 0000000..1806642 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/FaceArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t faces_length; + opencv_apps::Face st_faces; + opencv_apps::Face * faces; + + FaceArray(): + faces_length(0), faces(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = faces_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < faces_length; i++){ + offset += this->faces[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t faces_lengthT = *(inbuffer + offset++); + if(faces_lengthT > faces_length) + this->faces = (opencv_apps::Face*)realloc(this->faces, faces_lengthT * sizeof(opencv_apps::Face)); + offset += 3; + faces_length = faces_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/FaceArray"; }; + const char * getMD5(){ return "40b464276ad8e3c5012f7a3a93eed2a4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/FaceArrayStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/FaceArrayStamped.h new file mode 100644 index 0000000..bfd77f5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/FaceArrayStamped.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t faces_length; + opencv_apps::Face st_faces; + opencv_apps::Face * faces; + + FaceArrayStamped(): + header(), + faces_length(0), faces(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = faces_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < faces_length; i++){ + offset += this->faces[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t faces_lengthT = *(inbuffer + offset++); + if(faces_lengthT > faces_length) + this->faces = (opencv_apps::Face*)realloc(this->faces, faces_lengthT * sizeof(opencv_apps::Face)); + offset += 3; + faces_length = faces_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/FaceArrayStamped"; }; + const char * getMD5(){ return "bf258edc868c139ea6c94254d9ab51e5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Flow.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Flow.h new file mode 100644 index 0000000..06c55f2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Flow.h @@ -0,0 +1,47 @@ +#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: + opencv_apps::Point2D point; + opencv_apps::Point2D velocity; + + Flow(): + point(), + velocity() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->point.serialize(outbuffer + offset); + offset += this->velocity.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->point.deserialize(inbuffer + offset); + offset += this->velocity.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "opencv_apps/Flow"; }; + const char * getMD5(){ return "dd9a9efd88ba39035e78af697593d751"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowArray.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowArray.h new file mode 100644 index 0000000..da14dc4 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t flow_length; + opencv_apps::Flow st_flow; + opencv_apps::Flow * flow; + + FlowArray(): + flow_length(0), flow(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = flow_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < flow_length; i++){ + offset += this->flow[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t flow_lengthT = *(inbuffer + offset++); + if(flow_lengthT > flow_length) + this->flow = (opencv_apps::Flow*)realloc(this->flow, flow_lengthT * sizeof(opencv_apps::Flow)); + offset += 3; + flow_length = flow_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/FlowArray"; }; + const char * getMD5(){ return "fe292dca56eb3673cd698ea9ef841962"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowArrayStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowArrayStamped.h new file mode 100644 index 0000000..b3fcdfd --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowArrayStamped.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t flow_length; + opencv_apps::Flow st_flow; + opencv_apps::Flow * flow; + + FlowArrayStamped(): + header(), + flow_length(0), flow(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = flow_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < flow_length; i++){ + offset += this->flow[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t flow_lengthT = *(inbuffer + offset++); + if(flow_lengthT > flow_length) + this->flow = (opencv_apps::Flow*)realloc(this->flow, flow_lengthT * sizeof(opencv_apps::Flow)); + offset += 3; + flow_length = flow_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/FlowArrayStamped"; }; + const char * getMD5(){ return "b55faf909449963372b92417925b68cc"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowStamped.h new file mode 100644 index 0000000..416ae96 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/FlowStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + opencv_apps::Flow flow; + + FlowStamped(): + header(), + flow() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->flow.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->flow.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "opencv_apps/FlowStamped"; }; + const char * getMD5(){ return "b55faf909449963372b92417925b68cc"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Line.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Line.h new file mode 100644 index 0000000..ca59706 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Line.h @@ -0,0 +1,47 @@ +#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: + opencv_apps::Point2D pt1; + opencv_apps::Point2D pt2; + + Line(): + pt1(), + pt2() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->pt1.serialize(outbuffer + offset); + offset += this->pt2.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->pt1.deserialize(inbuffer + offset); + offset += this->pt2.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "opencv_apps/Line"; }; + const char * getMD5(){ return "a1419010b3fc4549e3f450018363d000"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/LineArray.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/LineArray.h new file mode 100644 index 0000000..35a94ae --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/LineArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t lines_length; + opencv_apps::Line st_lines; + opencv_apps::Line * lines; + + LineArray(): + lines_length(0), lines(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = lines_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < lines_length; i++){ + offset += this->lines[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t lines_lengthT = *(inbuffer + offset++); + if(lines_lengthT > lines_length) + this->lines = (opencv_apps::Line*)realloc(this->lines, lines_lengthT * sizeof(opencv_apps::Line)); + offset += 3; + lines_length = lines_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/LineArray"; }; + const char * getMD5(){ return "2b5441933900cc71528395dda29124da"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/LineArrayStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/LineArrayStamped.h new file mode 100644 index 0000000..47373eb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/LineArrayStamped.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t lines_length; + opencv_apps::Line st_lines; + opencv_apps::Line * lines; + + LineArrayStamped(): + header(), + lines_length(0), lines(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = lines_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < lines_length; i++){ + offset += this->lines[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t lines_lengthT = *(inbuffer + offset++); + if(lines_lengthT > lines_length) + this->lines = (opencv_apps::Line*)realloc(this->lines, lines_lengthT * sizeof(opencv_apps::Line)); + offset += 3; + lines_length = lines_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/LineArrayStamped"; }; + const char * getMD5(){ return "8ad5d104256b4f6774479453d1118f74"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Moment.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Moment.h new file mode 100644 index 0000000..810ecfb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Moment.h @@ -0,0 +1,147 @@ +#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: + float m00; + float m10; + float m01; + float m20; + float m11; + float m02; + float m30; + float m21; + float m12; + float m03; + float mu20; + float mu11; + float mu02; + float mu30; + float mu21; + float mu12; + float mu03; + float nu20; + float nu11; + float nu02; + float nu30; + float nu21; + float nu12; + float nu03; + opencv_apps::Point2D center; + float length; + float 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 + { + 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) + { + 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; + } + + const char * getType(){ return "opencv_apps/Moment"; }; + const char * getMD5(){ return "560ee3fabfffb4ed4155742d6db8a03c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/MomentArray.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/MomentArray.h new file mode 100644 index 0000000..7ddf5e4 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/MomentArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t moments_length; + opencv_apps::Moment st_moments; + opencv_apps::Moment * moments; + + MomentArray(): + moments_length(0), moments(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = moments_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < moments_length; i++){ + offset += this->moments[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t moments_lengthT = *(inbuffer + offset++); + if(moments_lengthT > moments_length) + this->moments = (opencv_apps::Moment*)realloc(this->moments, moments_lengthT * sizeof(opencv_apps::Moment)); + offset += 3; + moments_length = moments_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/MomentArray"; }; + const char * getMD5(){ return "fb51ddd1dea5da45f56842efe759d448"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/MomentArrayStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/MomentArrayStamped.h new file mode 100644 index 0000000..04029c0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/MomentArrayStamped.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t moments_length; + opencv_apps::Moment st_moments; + opencv_apps::Moment * moments; + + MomentArrayStamped(): + header(), + moments_length(0), moments(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = moments_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < moments_length; i++){ + offset += this->moments[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t moments_lengthT = *(inbuffer + offset++); + if(moments_lengthT > moments_length) + this->moments = (opencv_apps::Moment*)realloc(this->moments, moments_lengthT * sizeof(opencv_apps::Moment)); + offset += 3; + moments_length = moments_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/MomentArrayStamped"; }; + const char * getMD5(){ return "28ac0beb70b037acf76c3bed71b679a9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2D.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2D.h new file mode 100644 index 0000000..c87539d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2D.h @@ -0,0 +1,46 @@ +#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: + float x; + float y; + + Point2D(): + x(0), + y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + return offset; + } + + const char * getType(){ return "opencv_apps/Point2D"; }; + const char * getMD5(){ return "209f516d3eb691f0663e25cb750d67c1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DArray.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DArray.h new file mode 100644 index 0000000..aebbadc --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t points_length; + opencv_apps::Point2D st_points; + opencv_apps::Point2D * points; + + Point2DArray(): + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (opencv_apps::Point2D*)realloc(this->points, points_lengthT * sizeof(opencv_apps::Point2D)); + offset += 3; + points_length = points_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/Point2DArray"; }; + const char * getMD5(){ return "8f02263beef99aa03117a577a3eb879d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DArrayStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DArrayStamped.h new file mode 100644 index 0000000..7c19f0b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DArrayStamped.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t points_length; + opencv_apps::Point2D st_points; + opencv_apps::Point2D * points; + + Point2DArrayStamped(): + header(), + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (opencv_apps::Point2D*)realloc(this->points, points_lengthT * sizeof(opencv_apps::Point2D)); + offset += 3; + points_length = points_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/Point2DArrayStamped"; }; + const char * getMD5(){ return "06c8694bd7b07dbc04014c86ef9991a2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DStamped.h new file mode 100644 index 0000000..0d576bc --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Point2DStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + opencv_apps::Point2D point; + + Point2DStamped(): + header(), + point() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->point.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "opencv_apps/Point2DStamped"; }; + const char * getMD5(){ return "9f7db918fde9989a73131d0d083d049d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Rect.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Rect.h new file mode 100644 index 0000000..e6acb15 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Rect.h @@ -0,0 +1,54 @@ +#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: + float x; + float y; + float width; + float height; + + Rect(): + x(0), + y(0), + width(0), + height(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "opencv_apps/Rect"; }; + const char * getMD5(){ return "7048f28f1f0ef51e102638c86d9a7728"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/RectArray.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RectArray.h new file mode 100644 index 0000000..d72e370 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RectArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t rects_length; + opencv_apps::Rect st_rects; + opencv_apps::Rect * rects; + + RectArray(): + rects_length(0), rects(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = rects_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < rects_length; i++){ + offset += this->rects[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t rects_lengthT = *(inbuffer + offset++); + if(rects_lengthT > rects_length) + this->rects = (opencv_apps::Rect*)realloc(this->rects, rects_lengthT * sizeof(opencv_apps::Rect)); + offset += 3; + rects_length = rects_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/RectArray"; }; + const char * getMD5(){ return "d4a6f20c7699fa2791af675958a5f148"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/RectArrayStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RectArrayStamped.h new file mode 100644 index 0000000..daf2b77 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RectArrayStamped.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t rects_length; + opencv_apps::Rect st_rects; + opencv_apps::Rect * rects; + + RectArrayStamped(): + header(), + rects_length(0), rects(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = rects_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < rects_length; i++){ + offset += this->rects[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t rects_lengthT = *(inbuffer + offset++); + if(rects_lengthT > rects_length) + this->rects = (opencv_apps::Rect*)realloc(this->rects, rects_lengthT * sizeof(opencv_apps::Rect)); + offset += 3; + rects_length = rects_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/RectArrayStamped"; }; + const char * getMD5(){ return "f29b08b33e061c73d7d9fc35142631d0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRect.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRect.h new file mode 100644 index 0000000..570e643 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRect.h @@ -0,0 +1,52 @@ +#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: + float angle; + opencv_apps::Point2D center; + opencv_apps::Size size; + + RotatedRect(): + angle(0), + center(), + size() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->angle)); + offset += this->center.deserialize(inbuffer + offset); + offset += this->size.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "opencv_apps/RotatedRect"; }; + const char * getMD5(){ return "0ae60505c52f020176686d0689b8d390"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectArray.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectArray.h new file mode 100644 index 0000000..727ad23 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t rects_length; + opencv_apps::RotatedRect st_rects; + opencv_apps::RotatedRect * rects; + + RotatedRectArray(): + rects_length(0), rects(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = rects_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < rects_length; i++){ + offset += this->rects[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t rects_lengthT = *(inbuffer + offset++); + if(rects_lengthT > rects_length) + this->rects = (opencv_apps::RotatedRect*)realloc(this->rects, rects_lengthT * sizeof(opencv_apps::RotatedRect)); + offset += 3; + rects_length = rects_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/RotatedRectArray"; }; + const char * getMD5(){ return "a27e397ed2b5b1a633561d324f64d2a6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectArrayStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectArrayStamped.h new file mode 100644 index 0000000..205fbf3 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectArrayStamped.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + uint8_t rects_length; + opencv_apps::RotatedRect st_rects; + opencv_apps::RotatedRect * rects; + + RotatedRectArrayStamped(): + header(), + rects_length(0), rects(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = rects_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < rects_length; i++){ + offset += this->rects[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t rects_lengthT = *(inbuffer + offset++); + if(rects_lengthT > rects_length) + this->rects = (opencv_apps::RotatedRect*)realloc(this->rects, rects_lengthT * sizeof(opencv_apps::RotatedRect)); + offset += 3; + rects_length = rects_lengthT; + for( uint8_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; + } + + const char * getType(){ return "opencv_apps/RotatedRectArrayStamped"; }; + const char * getMD5(){ return "89a2d4a7db2d2945ca46c25a3bd8c7c5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectStamped.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectStamped.h new file mode 100644 index 0000000..e3da899 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/RotatedRectStamped.h @@ -0,0 +1,48 @@ +#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: + std_msgs::Header header; + opencv_apps::RotatedRect rect; + + RotatedRectStamped(): + header(), + rect() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->rect.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->rect.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "opencv_apps/RotatedRectStamped"; }; + const char * getMD5(){ return "ba2d76a1968e4f77570c01223781fe15"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/opencv_apps/Size.h b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Size.h new file mode 100644 index 0000000..4b483f5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/opencv_apps/Size.h @@ -0,0 +1,46 @@ +#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: + float width; + float height; + + Size(): + width(0), + height(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->width); + offset += serializeAvrFloat64(outbuffer + offset, this->height); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->width)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->height)); + return offset; + } + + const char * getType(){ return "opencv_apps/Size"; }; + const char * getMD5(){ return "f86522e647336fb10b55359fe003f673"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/pcl_msgs/ModelCoefficients.h b/libraries/Rosserial_Arduino_Library/src/pcl_msgs/ModelCoefficients.h new file mode 100644 index 0000000..87ede8b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/pcl_msgs/ModelCoefficients.h @@ -0,0 +1,82 @@ +#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: + std_msgs::Header header; + uint8_t values_length; + float st_values; + float * values; + + ModelCoefficients(): + header(), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + offset += 3; + values_length = values_lengthT; + for( uint8_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; + } + + const char * getType(){ return "pcl_msgs/ModelCoefficients"; }; + const char * getMD5(){ return "ca27dea75e72cb894cd36f9e5005e93e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/pcl_msgs/PointIndices.h b/libraries/Rosserial_Arduino_Library/src/pcl_msgs/PointIndices.h new file mode 100644 index 0000000..5e55370 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/pcl_msgs/PointIndices.h @@ -0,0 +1,82 @@ +#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: + std_msgs::Header header; + uint8_t indices_length; + int32_t st_indices; + int32_t * indices; + + PointIndices(): + header(), + indices_length(0), indices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = indices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t indices_lengthT = *(inbuffer + offset++); + if(indices_lengthT > indices_length) + this->indices = (int32_t*)realloc(this->indices, indices_lengthT * sizeof(int32_t)); + offset += 3; + indices_length = indices_lengthT; + for( uint8_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; + } + + const char * getType(){ return "pcl_msgs/PointIndices"; }; + const char * getMD5(){ return "458c7998b7eaf99908256472e273b3d4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/pcl_msgs/PolygonMesh.h b/libraries/Rosserial_Arduino_Library/src/pcl_msgs/PolygonMesh.h new file mode 100644 index 0000000..eac8917 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/pcl_msgs/PolygonMesh.h @@ -0,0 +1,69 @@ +#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: + std_msgs::Header header; + sensor_msgs::PointCloud2 cloud; + uint8_t polygons_length; + pcl_msgs::Vertices st_polygons; + pcl_msgs::Vertices * polygons; + + PolygonMesh(): + header(), + cloud(), + polygons_length(0), polygons(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->cloud.serialize(outbuffer + offset); + *(outbuffer + offset++) = polygons_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < polygons_length; i++){ + offset += this->polygons[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->cloud.deserialize(inbuffer + offset); + uint8_t polygons_lengthT = *(inbuffer + offset++); + if(polygons_lengthT > polygons_length) + this->polygons = (pcl_msgs::Vertices*)realloc(this->polygons, polygons_lengthT * sizeof(pcl_msgs::Vertices)); + offset += 3; + polygons_length = polygons_lengthT; + for( uint8_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; + } + + const char * getType(){ return "pcl_msgs/PolygonMesh"; }; + const char * getMD5(){ return "45a5fc6ad2cde8489600a790acc9a38a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/pcl_msgs/Vertices.h b/libraries/Rosserial_Arduino_Library/src/pcl_msgs/Vertices.h new file mode 100644 index 0000000..47479b4 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/pcl_msgs/Vertices.h @@ -0,0 +1,66 @@ +#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: + uint8_t vertices_length; + uint32_t st_vertices; + uint32_t * vertices; + + Vertices(): + vertices_length(0), vertices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = vertices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t vertices_lengthT = *(inbuffer + offset++); + if(vertices_lengthT > vertices_length) + this->vertices = (uint32_t*)realloc(this->vertices, vertices_lengthT * sizeof(uint32_t)); + offset += 3; + vertices_length = vertices_lengthT; + for( uint8_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; + } + + const char * getType(){ return "pcl_msgs/Vertices"; }; + const char * getMD5(){ return "39bd7b1c23763ddd1b882b97cb7cfe11"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/polled_camera/GetPolledImage.h b/libraries/Rosserial_Arduino_Library/src/polled_camera/GetPolledImage.h new file mode 100644 index 0000000..31da9e7 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/polled_camera/GetPolledImage.h @@ -0,0 +1,194 @@ +#ifndef _ROS_SERVICE_GetPolledImage_h +#define _ROS_SERVICE_GetPolledImage_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/RegionOfInterest.h" +#include "ros/duration.h" +#include "ros/time.h" + +namespace polled_camera +{ + +static const char GETPOLLEDIMAGE[] = "polled_camera/GetPolledImage"; + + class GetPolledImageRequest : public ros::Msg + { + public: + const char* response_namespace; + ros::Duration timeout; + uint32_t binning_x; + uint32_t binning_y; + sensor_msgs::RegionOfInterest roi; + + GetPolledImageRequest(): + response_namespace(""), + timeout(), + binning_x(0), + binning_y(0), + roi() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_response_namespace = strlen(this->response_namespace); + memcpy(outbuffer + offset, &length_response_namespace, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_response_namespace; + memcpy(&length_response_namespace, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETPOLLEDIMAGE; }; + const char * getMD5(){ return "c77ed43e530fd48e9e7a2a93845e154c"; }; + + }; + + class GetPolledImageResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + ros::Time stamp; + + GetPolledImageResponse(): + success(0), + status_message(""), + stamp() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + 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) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return GETPOLLEDIMAGE; }; + const char * getMD5(){ return "dbf1f851bc511800e6129ccd5a3542ab"; }; + + }; + + class GetPolledImage { + public: + typedef GetPolledImageRequest Request; + typedef GetPolledImageResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/ros.h b/libraries/Rosserial_Arduino_Library/src/ros.h new file mode 100644 index 0000000..447cf32 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/ros.h @@ -0,0 +1,58 @@ +/* + * 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" +#include "ArduinoHardware.h" + +namespace ros +{ +#if defined(__AVR_ATmega8__) || defined(__AVR_ATmega168__) + /* downsize our buffers */ + typedef NodeHandle_ NodeHandle; + +#elif defined(__AVR_ATmega328P__) + + typedef NodeHandle_ NodeHandle; + +#else + + typedef NodeHandle_ NodeHandle; + +#endif +} + +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/ros/duration.h b/libraries/Rosserial_Arduino_Library/src/ros/duration.h new file mode 100644 index 0000000..ab889cd --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/ros/duration.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_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/libraries/Rosserial_Arduino_Library/src/ros/msg.h b/libraries/Rosserial_Arduino_Library/src/ros/msg.h new file mode 100644 index 0000000..87f2e5c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/ros/msg.h @@ -0,0 +1,129 @@ +/* + * 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 + +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 AVV 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) + { + const int32_t* val = (int32_t*) &f; + int32_t exp = ((*val >> 23) & 255); + if (exp != 0) + { + exp += 1023 - 127; + } + + int32_t sig = *val; + *(outbuffer++) = 0; + *(outbuffer++) = 0; + *(outbuffer++) = 0; + *(outbuffer++) = (sig << 5) & 0xff; + *(outbuffer++) = (sig >> 3) & 0xff; + *(outbuffer++) = (sig >> 11) & 0xff; + *(outbuffer++) = ((exp << 4) & 0xF0) | ((sig >> 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) + { + uint32_t* val = (uint32_t*)f; + inbuffer += 3; + + // Copy truncated mantissa. + *val = ((uint32_t)(*(inbuffer++)) >> 5 & 0x07); + *val |= ((uint32_t)(*(inbuffer++)) & 0xff) << 3; + *val |= ((uint32_t)(*(inbuffer++)) & 0xff) << 11; + *val |= ((uint32_t)(*inbuffer) & 0x0f) << 19; + + // Copy truncated exponent. + uint32_t exp = ((uint32_t)(*(inbuffer++)) & 0xf0)>>4; + exp |= ((uint32_t)(*inbuffer) & 0x7f) << 4; + if (exp != 0) + { + *val |= ((exp) - 1023 + 127) << 23; + } + + // Copy negative sign. + *val |= ((uint32_t)(*(inbuffer++)) & 0x80) << 24; + + return 8; + } + +}; + +} // namespace ros + +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/ros/node_handle.h b/libraries/Rosserial_Arduino_Library/src/ros/node_handle.h new file mode 100644 index 0000000..9babaff --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/ros/node_handle.h @@ -0,0 +1,543 @@ +/* + * 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" + +#define SYNC_SECONDS 5 + +#define 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 + */ +#define MODE_PROTOCOL_VER 1 +#define PROTOCOL_VER1 0xff // through groovy +#define PROTOCOL_VER2 0xfe // in hydro +#define PROTOCOL_VER PROTOCOL_VER2 +#define MODE_SIZE_L 2 +#define MODE_SIZE_H 3 +#define MODE_SIZE_CHECKSUM 4 // checksum for msg size received from size L and H +#define MODE_TOPIC_L 5 // waiting for topic id +#define MODE_TOPIC_H 6 +#define MODE_MESSAGE 7 +#define MODE_MSG_CHECKSUM 8 // checksum for msg and topic id + + +#define MSG_TIMEOUT 20 //20 milliseconds to recieve all of message data + +#include "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 "publisher.h" +#include "subscriber.h" +#include "service_server.h" +#include "service_client.h" + +namespace ros { + + using rosserial_msgs::TopicInfo; + + /* Node Handle */ + template + class NodeHandle_ : public NodeHandleBase_ + { + protected: + Hardware hardware_; + + /* time used for syncing */ + uint32_t rt_time; + + /* used for computing current time */ + uint32_t sec_offset, nsec_offset; + + uint8_t message_in[INPUT_SIZE]; + uint8_t message_out[OUTPUT_SIZE]; + + Publisher * publishers[MAX_PUBLISHERS]; + Subscriber_ * subscribers[MAX_SUBSCRIBERS]; + + /* + * Setup Functions + */ + public: + NodeHandle_() : configured_(false) { + + for(unsigned int i=0; i< MAX_PUBLISHERS; i++) + publishers[i] = 0; + + for(unsigned int i=0; i< MAX_SUBSCRIBERS; i++) + subscribers[i] = 0; + + for(unsigned int i=0; i< INPUT_SIZE; i++) + message_in[i] = 0; + + for(unsigned int i=0; i< OUTPUT_SIZE; i++) + message_out[i] = 0; + + req_param_resp.ints_length = 0; + req_param_resp.ints = NULL; + req_param_resp.floats_length = 0; + req_param_resp.floats = NULL; + req_param_resp.ints_length = 0; + req_param_resp.ints = NULL; + } + + 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; + }; + + protected: + //State machine variables for spinOnce + int mode_; + int bytes_; + int topic_; + int index_; + int checksum_; + + bool configured_; + + /* used for syncing the time */ + uint32_t last_sync_time; + uint32_t last_sync_receive_time; + uint32_t last_msg_timeout_time; + + public: + /* This function goes in your loop() function, it handles + * serial input and callbacks for subscribers. + */ + + + virtual int spinOnce(){ + + /* 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 ) + { + 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 + MSG_TIMEOUT; + } + else if( hardware_.time() - c_time > (SYNC_SECONDS)){ + /* We have been stuck in spinOnce too long, return error */ + configured_=false; + return -2; + } + }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 -1; + }else if(topic_ == TopicInfo::ID_TIME){ + syncTime(message_in); + }else if (topic_ == TopicInfo::ID_PARAMETER_REQUEST){ + req_param_resp.deserialize(message_in); + param_recieved= 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 0; + } + + + /* Are we connected to the PC? */ + virtual bool connected() { + 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( 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 */ + template + bool subscribe(Subscriber< MsgT> & s){ + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &s; + s.id_ = i+100; + return true; + } + } + return false; + } + + /* Register a new Service Server */ + template + bool advertiseService(ServiceServer& srv){ + bool v = advertise(srv.pub); + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &srv; + srv.id_ = i+100; + return v; + } + } + return false; + } + + /* Register a new Service Client */ + template + bool serviceClient(ServiceClient& srv){ + bool v = advertise(srv.pub); + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &srv; + srv.id_ = i+100; + return v; + } + } + return false; + } + + 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) + { + if(id >= 100 && !configured_) + return 0; + + /* serialize message */ + uint16_t 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 end_time) return false; + } + return true; + } + + public: + bool getParam(const char* name, int* param, int length =1){ + if (requestParam(name) ){ + if (length == req_param_resp.ints_length){ + //copy it over + for(int i=0; ipublish(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/libraries/Rosserial_Arduino_Library/src/ros/service_client.h b/libraries/Rosserial_Arduino_Library/src/ros/service_client.h new file mode 100644 index 0000000..06522f2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/ros/service_client.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_SERVICE_CLIENT_H_ +#define _ROS_SERVICE_CLIENT_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "publisher.h" +#include "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) + { + 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){ + ret->deserialize(data); + waiting = false; + } + virtual const char * getMsgType(){ return this->resp.getType(); } + virtual const char * getMsgMD5(){ return this->resp.getMD5(); } + virtual int getEndpointType(){ 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/libraries/Rosserial_Arduino_Library/src/ros/service_server.h b/libraries/Rosserial_Arduino_Library/src/ros/service_server.h new file mode 100644 index 0000000..67a3e0a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/ros/service_server.h @@ -0,0 +1,76 @@ +/* + * 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 "publisher.h" +#include "subscriber.h" + +namespace ros { + + 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){ + req.deserialize(data); + cb_(req,resp); + pub.publish(&resp); + } + virtual const char * getMsgType(){ return this->req.getType(); } + virtual const char * getMsgMD5(){ return this->req.getMD5(); } + virtual int getEndpointType(){ 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/libraries/Rosserial_Arduino_Library/src/ros/subscriber.h b/libraries/Rosserial_Arduino_Library/src/ros/subscriber.h new file mode 100644 index 0000000..5464646 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/ros/subscriber.h @@ -0,0 +1,88 @@ +/* + * 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_; + }; + + + /* Actual subscriber, templated on message type. */ + 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){ + msg.deserialize(data); + this->cb_(msg); + } + + virtual const char * getMsgType(){ return this->msg.getType(); } + virtual const char * getMsgMD5(){ return this->msg.getMD5(); } + virtual int getEndpointType(){ return endpoint_; } + + private: + CallbackT cb_; + int endpoint_; + }; + +} + +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/ros/time.h b/libraries/Rosserial_Arduino_Library/src/ros/time.h new file mode 100644 index 0000000..6141261 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/ros/time.h @@ -0,0 +1,73 @@ +/* + * 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 +#include + +#include "ros/duration.h" + +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); + + static Time now(); + static void setNow( Time & new_now); + }; + +} + +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/roscpp/Empty.h b/libraries/Rosserial_Arduino_Library/src/roscpp/Empty.h new file mode 100644 index 0000000..df021b7 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + EmptyResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/roscpp/GetLoggers.h b/libraries/Rosserial_Arduino_Library/src/roscpp/GetLoggers.h new file mode 100644 index 0000000..0574cd7 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/roscpp/GetLoggers.h @@ -0,0 +1,91 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETLOGGERS; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetLoggersResponse : public ros::Msg + { + public: + uint8_t loggers_length; + roscpp::Logger st_loggers; + roscpp::Logger * loggers; + + GetLoggersResponse(): + loggers_length(0), loggers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = loggers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < loggers_length; i++){ + offset += this->loggers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t loggers_lengthT = *(inbuffer + offset++); + if(loggers_lengthT > loggers_length) + this->loggers = (roscpp::Logger*)realloc(this->loggers, loggers_lengthT * sizeof(roscpp::Logger)); + offset += 3; + loggers_length = loggers_lengthT; + for( uint8_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; + } + + const char * getType(){ return GETLOGGERS; }; + const char * getMD5(){ return "32e97e85527d4678a8f9279894bb64b0"; }; + + }; + + class GetLoggers { + public: + typedef GetLoggersRequest Request; + typedef GetLoggersResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/roscpp/Logger.h b/libraries/Rosserial_Arduino_Library/src/roscpp/Logger.h new file mode 100644 index 0000000..a67fb51 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/roscpp/Logger.h @@ -0,0 +1,70 @@ +#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: + const char* name; + const char* level; + + Logger(): + name(""), + level("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_level = strlen(this->level); + memcpy(outbuffer + offset, &length_level, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_level, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "roscpp/Logger"; }; + const char * getMD5(){ return "a6069a2ff40db7bd32143dd66e1f408e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/roscpp/SetLoggerLevel.h b/libraries/Rosserial_Arduino_Library/src/roscpp/SetLoggerLevel.h new file mode 100644 index 0000000..dddee2e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/roscpp/SetLoggerLevel.h @@ -0,0 +1,102 @@ +#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: + const char* logger; + const char* level; + + SetLoggerLevelRequest(): + logger(""), + level("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_logger = strlen(this->logger); + memcpy(outbuffer + offset, &length_logger, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->logger, length_logger); + offset += length_logger; + uint32_t length_level = strlen(this->level); + memcpy(outbuffer + offset, &length_level, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_logger; + memcpy(&length_logger, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_level, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETLOGGERLEVEL; }; + const char * getMD5(){ return "51da076440d78ca1684d36c868df61ea"; }; + + }; + + class SetLoggerLevelResponse : public ros::Msg + { + public: + + SetLoggerLevelResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETLOGGERLEVEL; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetLoggerLevel { + public: + typedef SetLoggerLevelRequest Request; + typedef SetLoggerLevelResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/roscpp_tutorials/TwoInts.h b/libraries/Rosserial_Arduino_Library/src/roscpp_tutorials/TwoInts.h new file mode 100644 index 0000000..f35797c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/roscpp_tutorials/TwoInts.h @@ -0,0 +1,163 @@ +#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: + int64_t a; + int64_t b; + + TwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return TWOINTS; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + + class TwoIntsResponse : public ros::Msg + { + public: + int64_t sum; + + TwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return TWOINTS; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + + class TwoInts { + public: + typedef TwoIntsRequest Request; + typedef TwoIntsResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/Clock.h b/libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/Clock.h new file mode 100644 index 0000000..10a3c0c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/Clock.h @@ -0,0 +1,61 @@ +#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: + ros::Time clock; + + Clock(): + clock() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "rosgraph_msgs/Clock"; }; + const char * getMD5(){ return "a9c97c1d230cfc112e270351a944ee47"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/Log.h b/libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/Log.h new file mode 100644 index 0000000..439dd36 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/Log.h @@ -0,0 +1,173 @@ +#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: + std_msgs::Header header; + int8_t level; + const char* name; + const char* msg; + const char* file; + const char* function; + uint32_t line; + uint8_t topics_length; + char* st_topics; + char* * 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), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_msg = strlen(this->msg); + memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + uint32_t length_file = strlen(this->file); + memcpy(outbuffer + offset, &length_file, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->file, length_file); + offset += length_file; + uint32_t length_function = strlen(this->function); + memcpy(outbuffer + offset, &length_function, sizeof(uint32_t)); + 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++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_file, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_function, (inbuffer + offset), sizeof(uint32_t)); + 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); + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "rosgraph_msgs/Log"; }; + const char * getMD5(){ return "acffd30cd6b6de30f120938c17c593fb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/TopicStatistics.h b/libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/TopicStatistics.h new file mode 100644 index 0000000..2c6fd65 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rosgraph_msgs/TopicStatistics.h @@ -0,0 +1,333 @@ +#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: + const char* topic; + const char* node_pub; + const char* node_sub; + ros::Time window_start; + ros::Time window_stop; + int32_t delivered_msgs; + int32_t dropped_msgs; + int32_t traffic; + ros::Duration period_mean; + ros::Duration period_stddev; + ros::Duration period_max; + ros::Duration stamp_age_mean; + ros::Duration stamp_age_stddev; + ros::Duration 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 + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + uint32_t length_node_pub = strlen(this->node_pub); + memcpy(outbuffer + offset, &length_node_pub, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->node_pub, length_node_pub); + offset += length_node_pub; + uint32_t length_node_sub = strlen(this->node_sub); + memcpy(outbuffer + offset, &length_node_sub, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_node_pub, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_node_sub, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "rosgraph_msgs/TopicStatistics"; }; + const char * getMD5(){ return "10152ed868c5097a5e2e4a89d7daa710"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/AddTwoInts.h b/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/AddTwoInts.h new file mode 100644 index 0000000..37332a0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/AddTwoInts.h @@ -0,0 +1,163 @@ +#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: + int64_t a; + int64_t b; + + AddTwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return ADDTWOINTS; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + + class AddTwoIntsResponse : public ros::Msg + { + public: + int64_t sum; + + AddTwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return ADDTWOINTS; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + + class AddTwoInts { + public: + typedef AddTwoIntsRequest Request; + typedef AddTwoIntsResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/BadTwoInts.h b/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/BadTwoInts.h new file mode 100644 index 0000000..f76f277 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/BadTwoInts.h @@ -0,0 +1,147 @@ +#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: + int64_t a; + int32_t b; + + BadTwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return BADTWOINTS; }; + const char * getMD5(){ return "29bb5c7dea8bf822f53e94b0ee5a3a56"; }; + + }; + + class BadTwoIntsResponse : public ros::Msg + { + public: + int32_t sum; + + BadTwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return BADTWOINTS; }; + const char * getMD5(){ return "0ba699c25c9418c0366f3595c0c8e8ec"; }; + + }; + + class BadTwoInts { + public: + typedef BadTwoIntsRequest Request; + typedef BadTwoIntsResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/Floats.h b/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/Floats.h new file mode 100644 index 0000000..113468d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/Floats.h @@ -0,0 +1,77 @@ +#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: + uint8_t data_length; + float st_data; + float * data; + + Floats(): + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "rospy_tutorials/Floats"; }; + const char * getMD5(){ return "420cd38b6b071cd49f2970c3e2cee511"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/HeaderString.h b/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/HeaderString.h new file mode 100644 index 0000000..f53759c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rospy_tutorials/HeaderString.h @@ -0,0 +1,59 @@ +#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: + std_msgs::Header header; + const char* data; + + HeaderString(): + header(), + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_data = strlen(this->data); + memcpy(outbuffer + offset, &length_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->data, length_data); + offset += length_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_data; + memcpy(&length_data, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "rospy_tutorials/HeaderString"; }; + const char * getMD5(){ return "c99a9440709e4d4a9716d55b8270d5e7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/rosserial_arduino/Adc.h b/libraries/Rosserial_Arduino_Library/src/rosserial_arduino/Adc.h new file mode 100644 index 0000000..21114c7 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rosserial_arduino/Adc.h @@ -0,0 +1,86 @@ +#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: + uint16_t adc0; + uint16_t adc1; + uint16_t adc2; + uint16_t adc3; + uint16_t adc4; + uint16_t adc5; + + Adc(): + adc0(0), + adc1(0), + adc2(0), + adc3(0), + adc4(0), + adc5(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "rosserial_arduino/Adc"; }; + const char * getMD5(){ return "6d7853a614e2e821319068311f2af25b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/rosserial_arduino/Test.h b/libraries/Rosserial_Arduino_Library/src/rosserial_arduino/Test.h new file mode 100644 index 0000000..e132728 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rosserial_arduino/Test.h @@ -0,0 +1,102 @@ +#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: + const char* input; + + TestRequest(): + input("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_input = strlen(this->input); + memcpy(outbuffer + offset, &length_input, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->input, length_input); + offset += length_input; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_input; + memcpy(&length_input, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return TEST; }; + const char * getMD5(){ return "39e92f1778057359c64c7b8a7d7b19de"; }; + + }; + + class TestResponse : public ros::Msg + { + public: + const char* output; + + TestResponse(): + output("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_output = strlen(this->output); + memcpy(outbuffer + offset, &length_output, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->output, length_output); + offset += length_output; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_output; + memcpy(&length_output, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return TEST; }; + const char * getMD5(){ return "0825d95fdfa2c8f4bbb4e9c74bccd3fd"; }; + + }; + + class Test { + public: + typedef TestRequest Request; + typedef TestResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/Log.h b/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/Log.h new file mode 100644 index 0000000..bcd6fd6 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/Log.h @@ -0,0 +1,65 @@ +#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: + uint8_t level; + const char* 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 + { + int offset = 0; + *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_msg = strlen(this->msg); + memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->level = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->level); + uint32_t length_msg; + memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "rosserial_msgs/Log"; }; + const char * getMD5(){ return "11abd731c25933261cd6183bd12d6295"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestMessageInfo.h b/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestMessageInfo.h new file mode 100644 index 0000000..98af72e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestMessageInfo.h @@ -0,0 +1,118 @@ +#ifndef _ROS_SERVICE_RequestMessageInfo_h +#define _ROS_SERVICE_RequestMessageInfo_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTMESSAGEINFO[] = "rosserial_msgs/RequestMessageInfo"; + + class RequestMessageInfoRequest : public ros::Msg + { + public: + const char* type; + + RequestMessageInfoRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return REQUESTMESSAGEINFO; }; + const char * getMD5(){ return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class RequestMessageInfoResponse : public ros::Msg + { + public: + const char* md5; + const char* definition; + + RequestMessageInfoResponse(): + md5(""), + definition("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_md5 = strlen(this->md5); + memcpy(outbuffer + offset, &length_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->md5, length_md5); + offset += length_md5; + uint32_t length_definition = strlen(this->definition); + memcpy(outbuffer + offset, &length_definition, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->definition, length_definition); + offset += length_definition; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_md5; + memcpy(&length_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_md5-1]=0; + this->md5 = (char *)(inbuffer + offset-1); + offset += length_md5; + uint32_t length_definition; + memcpy(&length_definition, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_definition; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_definition-1]=0; + this->definition = (char *)(inbuffer + offset-1); + offset += length_definition; + return offset; + } + + const char * getType(){ return REQUESTMESSAGEINFO; }; + const char * getMD5(){ return "fe452186a069bed40f09b8628fe5eac8"; }; + + }; + + class RequestMessageInfo { + public: + typedef RequestMessageInfoRequest Request; + typedef RequestMessageInfoResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestParam.h b/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestParam.h new file mode 100644 index 0000000..f4c76bd --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestParam.h @@ -0,0 +1,196 @@ +#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: + const char* name; + + RequestParamRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return REQUESTPARAM; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class RequestParamResponse : public ros::Msg + { + public: + uint8_t ints_length; + int32_t st_ints; + int32_t * ints; + uint8_t floats_length; + float st_floats; + float * floats; + uint8_t strings_length; + char* st_strings; + char* * strings; + + RequestParamResponse(): + ints_length(0), ints(NULL), + floats_length(0), floats(NULL), + strings_length(0), strings(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = ints_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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++) = floats_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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++) = strings_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < strings_length; i++){ + uint32_t length_stringsi = strlen(this->strings[i]); + memcpy(outbuffer + offset, &length_stringsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->strings[i], length_stringsi); + offset += length_stringsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t ints_lengthT = *(inbuffer + offset++); + if(ints_lengthT > ints_length) + this->ints = (int32_t*)realloc(this->ints, ints_lengthT * sizeof(int32_t)); + offset += 3; + ints_length = ints_lengthT; + for( uint8_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)); + } + uint8_t floats_lengthT = *(inbuffer + offset++); + if(floats_lengthT > floats_length) + this->floats = (float*)realloc(this->floats, floats_lengthT * sizeof(float)); + offset += 3; + floats_length = floats_lengthT; + for( uint8_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)); + } + uint8_t strings_lengthT = *(inbuffer + offset++); + if(strings_lengthT > strings_length) + this->strings = (char**)realloc(this->strings, strings_lengthT * sizeof(char*)); + offset += 3; + strings_length = strings_lengthT; + for( uint8_t i = 0; i < strings_length; i++){ + uint32_t length_st_strings; + memcpy(&length_st_strings, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return REQUESTPARAM; }; + const char * getMD5(){ return "9f0e98bda65981986ddf53afa7a40e49"; }; + + }; + + class RequestParam { + public: + typedef RequestParamRequest Request; + typedef RequestParamResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestServiceInfo.h b/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestServiceInfo.h new file mode 100644 index 0000000..90b47c5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/RequestServiceInfo.h @@ -0,0 +1,134 @@ +#ifndef _ROS_SERVICE_RequestServiceInfo_h +#define _ROS_SERVICE_RequestServiceInfo_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTSERVICEINFO[] = "rosserial_msgs/RequestServiceInfo"; + + class RequestServiceInfoRequest : public ros::Msg + { + public: + const char* service; + + RequestServiceInfoRequest(): + service("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_service = strlen(this->service); + memcpy(outbuffer + offset, &length_service, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->service, length_service); + offset += length_service; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_service; + memcpy(&length_service, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return REQUESTSERVICEINFO; }; + const char * getMD5(){ return "1cbcfa13b08f6d36710b9af8741e6112"; }; + + }; + + class RequestServiceInfoResponse : public ros::Msg + { + public: + const char* service_md5; + const char* request_md5; + const char* response_md5; + + RequestServiceInfoResponse(): + service_md5(""), + request_md5(""), + response_md5("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_service_md5 = strlen(this->service_md5); + memcpy(outbuffer + offset, &length_service_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->service_md5, length_service_md5); + offset += length_service_md5; + uint32_t length_request_md5 = strlen(this->request_md5); + memcpy(outbuffer + offset, &length_request_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->request_md5, length_request_md5); + offset += length_request_md5; + uint32_t length_response_md5 = strlen(this->response_md5); + memcpy(outbuffer + offset, &length_response_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->response_md5, length_response_md5); + offset += length_response_md5; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_service_md5; + memcpy(&length_service_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service_md5-1]=0; + this->service_md5 = (char *)(inbuffer + offset-1); + offset += length_service_md5; + uint32_t length_request_md5; + memcpy(&length_request_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_request_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_request_md5-1]=0; + this->request_md5 = (char *)(inbuffer + offset-1); + offset += length_request_md5; + uint32_t length_response_md5; + memcpy(&length_response_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_response_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_response_md5-1]=0; + this->response_md5 = (char *)(inbuffer + offset-1); + offset += length_response_md5; + return offset; + } + + const char * getType(){ return REQUESTSERVICEINFO; }; + const char * getMD5(){ return "c3d6dd25b909596479fbbc6559fa6874"; }; + + }; + + class RequestServiceInfo { + public: + typedef RequestServiceInfoRequest Request; + typedef RequestServiceInfoResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/TopicInfo.h b/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/TopicInfo.h new file mode 100644 index 0000000..c4daf2d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/rosserial_msgs/TopicInfo.h @@ -0,0 +1,125 @@ +#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: + uint16_t topic_id; + const char* topic_name; + const char* message_type; + const char* md5sum; + int32_t 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 + { + 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); + memcpy(outbuffer + offset, &length_topic_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic_name, length_topic_name); + offset += length_topic_name; + uint32_t length_message_type = strlen(this->message_type); + memcpy(outbuffer + offset, &length_message_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message_type, length_message_type); + offset += length_message_type; + uint32_t length_md5sum = strlen(this->md5sum); + memcpy(outbuffer + offset, &length_md5sum, sizeof(uint32_t)); + 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) + { + 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; + memcpy(&length_topic_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_message_type, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_md5sum, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "rosserial_msgs/TopicInfo"; }; + const char * getMD5(){ return "0ad51f88fc44892f8c10684077646005"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/CameraInfo.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/CameraInfo.h new file mode 100644 index 0000000..55280ed --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/CameraInfo.h @@ -0,0 +1,156 @@ +#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: + std_msgs::Header header; + uint32_t height; + uint32_t width; + const char* distortion_model; + uint8_t D_length; + float st_D; + float * D; + float K[9]; + float R[9]; + float P[12]; + uint32_t binning_x; + uint32_t binning_y; + sensor_msgs::RegionOfInterest roi; + + CameraInfo(): + header(), + height(0), + width(0), + distortion_model(""), + D_length(0), D(NULL), + K(), + R(), + P(), + binning_x(0), + binning_y(0), + roi() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_distortion_model, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->distortion_model, length_distortion_model); + offset += length_distortion_model; + *(outbuffer + offset++) = D_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < D_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->D[i]); + } + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->K[i]); + } + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->R[i]); + } + for( uint8_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) + { + 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; + memcpy(&length_distortion_model, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t D_lengthT = *(inbuffer + offset++); + if(D_lengthT > D_length) + this->D = (float*)realloc(this->D, D_lengthT * sizeof(float)); + offset += 3; + D_length = D_lengthT; + for( uint8_t i = 0; i < D_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_D)); + memcpy( &(this->D[i]), &(this->st_D), sizeof(float)); + } + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->K[i])); + } + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->R[i])); + } + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/CameraInfo"; }; + const char * getMD5(){ return "c9a58c1b0b154e0e6da7578cb991d214"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/ChannelFloat32.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/ChannelFloat32.h new file mode 100644 index 0000000..ed58158 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/ChannelFloat32.h @@ -0,0 +1,93 @@ +#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: + const char* name; + uint8_t values_length; + float st_values; + float * values; + + ChannelFloat32(): + name(""), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + offset += 3; + values_length = values_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/ChannelFloat32"; }; + const char * getMD5(){ return "3d40139cdd33dfedcb71ffeeeb42ae7f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/CompressedImage.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/CompressedImage.h new file mode 100644 index 0000000..fdda842 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/CompressedImage.h @@ -0,0 +1,81 @@ +#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: + std_msgs::Header header; + const char* format; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + CompressedImage(): + header(), + format(""), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_format = strlen(this->format); + memcpy(outbuffer + offset, &length_format, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->format, length_format); + offset += length_format; + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_format; + memcpy(&length_format, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/CompressedImage"; }; + const char * getMD5(){ return "8f7a12909da2c9d3332d540a0977563f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/FluidPressure.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/FluidPressure.h new file mode 100644 index 0000000..b24e211 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/FluidPressure.h @@ -0,0 +1,51 @@ +#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: + std_msgs::Header header; + float fluid_pressure; + float variance; + + FluidPressure(): + header(), + fluid_pressure(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->fluid_pressure)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/FluidPressure"; }; + const char * getMD5(){ return "804dc5cea1c5306d6a2eb80b9833befe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Illuminance.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Illuminance.h new file mode 100644 index 0000000..7e21795 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Illuminance.h @@ -0,0 +1,51 @@ +#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: + std_msgs::Header header; + float illuminance; + float variance; + + Illuminance(): + header(), + illuminance(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->illuminance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/Illuminance"; }; + const char * getMD5(){ return "8cf5febb0952fca9d650c3d11a81a188"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Image.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Image.h new file mode 100644 index 0000000..2b7ba85 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Image.h @@ -0,0 +1,123 @@ +#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: + std_msgs::Header header; + uint32_t height; + uint32_t width; + const char* encoding; + uint8_t is_bigendian; + uint32_t step; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + Image(): + header(), + height(0), + width(0), + encoding(""), + is_bigendian(0), + step(0), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_encoding, sizeof(uint32_t)); + 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++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + 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; + memcpy(&length_encoding, (inbuffer + offset), sizeof(uint32_t)); + 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); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/Image"; }; + const char * getMD5(){ return "060021388200f6f0f447d0fcd9c64743"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Imu.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Imu.h new file mode 100644 index 0000000..7f7116e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Imu.h @@ -0,0 +1,81 @@ +#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: + std_msgs::Header header; + geometry_msgs::Quaternion orientation; + float orientation_covariance[9]; + geometry_msgs::Vector3 angular_velocity; + float angular_velocity_covariance[9]; + geometry_msgs::Vector3 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 + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->orientation_covariance[i]); + } + offset += this->angular_velocity.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->angular_velocity_covariance[i]); + } + offset += this->linear_acceleration.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->linear_acceleration_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->orientation_covariance[i])); + } + offset += this->angular_velocity.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->angular_velocity_covariance[i])); + } + offset += this->linear_acceleration.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->linear_acceleration_covariance[i])); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Imu"; }; + const char * getMD5(){ return "6a62c6daae103f4ff57a132d6f95cec2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/JointState.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/JointState.h new file mode 100644 index 0000000..387b7f4 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/JointState.h @@ -0,0 +1,135 @@ +#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: + std_msgs::Header header; + uint8_t name_length; + char* st_name; + char* * name; + uint8_t position_length; + float st_position; + float * position; + uint8_t velocity_length; + float st_velocity; + float * velocity; + uint8_t effort_length; + float st_effort; + float * effort; + + JointState(): + header(), + name_length(0), name(NULL), + position_length(0), position(NULL), + velocity_length(0), velocity(NULL), + effort_length(0), effort(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = velocity_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset++) = effort_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < effort_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->effort[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t velocity_lengthT = *(inbuffer + offset++); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + offset += 3; + velocity_length = velocity_lengthT; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint8_t effort_lengthT = *(inbuffer + offset++); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + offset += 3; + effort_length = effort_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/JointState"; }; + const char * getMD5(){ return "3066dcd76a6cfaef579bd0f34173e9fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Joy.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Joy.h new file mode 100644 index 0000000..f8b5721 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Joy.h @@ -0,0 +1,121 @@ +#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: + std_msgs::Header header; + uint8_t axes_length; + float st_axes; + float * axes; + uint8_t buttons_length; + int32_t st_buttons; + int32_t * buttons; + + Joy(): + header(), + axes_length(0), axes(NULL), + buttons_length(0), buttons(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = axes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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++) = buttons_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t axes_lengthT = *(inbuffer + offset++); + if(axes_lengthT > axes_length) + this->axes = (float*)realloc(this->axes, axes_lengthT * sizeof(float)); + offset += 3; + axes_length = axes_lengthT; + for( uint8_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)); + } + uint8_t buttons_lengthT = *(inbuffer + offset++); + if(buttons_lengthT > buttons_length) + this->buttons = (int32_t*)realloc(this->buttons, buttons_lengthT * sizeof(int32_t)); + offset += 3; + buttons_length = buttons_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/Joy"; }; + const char * getMD5(){ return "5a9ea5f83505693b71e785041e67a8bb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/JoyFeedback.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/JoyFeedback.h new file mode 100644 index 0000000..dfea009 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/JoyFeedback.h @@ -0,0 +1,76 @@ +#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: + uint8_t type; + uint8_t id; + float 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 + { + 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) + { + 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; + } + + const char * getType(){ return "sensor_msgs/JoyFeedback"; }; + const char * getMD5(){ return "f4dcd73460360d98f36e55ee7f2e46f1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/JoyFeedbackArray.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/JoyFeedbackArray.h new file mode 100644 index 0000000..9f0de2b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/JoyFeedbackArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t array_length; + sensor_msgs::JoyFeedback st_array; + sensor_msgs::JoyFeedback * array; + + JoyFeedbackArray(): + array_length(0), array(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = array_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < array_length; i++){ + offset += this->array[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t array_lengthT = *(inbuffer + offset++); + if(array_lengthT > array_length) + this->array = (sensor_msgs::JoyFeedback*)realloc(this->array, array_lengthT * sizeof(sensor_msgs::JoyFeedback)); + offset += 3; + array_length = array_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/JoyFeedbackArray"; }; + const char * getMD5(){ return "cde5730a895b1fc4dee6f91b754b213d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/LaserEcho.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/LaserEcho.h new file mode 100644 index 0000000..8d48ba5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/LaserEcho.h @@ -0,0 +1,77 @@ +#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: + uint8_t echoes_length; + float st_echoes; + float * echoes; + + LaserEcho(): + echoes_length(0), echoes(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = echoes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t echoes_lengthT = *(inbuffer + offset++); + if(echoes_lengthT > echoes_length) + this->echoes = (float*)realloc(this->echoes, echoes_lengthT * sizeof(float)); + offset += 3; + echoes_length = echoes_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/LaserEcho"; }; + const char * getMD5(){ return "8bc5ae449b200fba4d552b4225586696"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/LaserScan.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/LaserScan.h new file mode 100644 index 0000000..8276622 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/LaserScan.h @@ -0,0 +1,282 @@ +#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: + std_msgs::Header header; + float angle_min; + float angle_max; + float angle_increment; + float time_increment; + float scan_time; + float range_min; + float range_max; + uint8_t ranges_length; + float st_ranges; + float * ranges; + uint8_t intensities_length; + float st_intensities; + float * 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), ranges(NULL), + intensities_length(0), intensities(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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++) = ranges_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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++) = intensities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + 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); + uint8_t ranges_lengthT = *(inbuffer + offset++); + if(ranges_lengthT > ranges_length) + this->ranges = (float*)realloc(this->ranges, ranges_lengthT * sizeof(float)); + offset += 3; + ranges_length = ranges_lengthT; + for( uint8_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)); + } + uint8_t intensities_lengthT = *(inbuffer + offset++); + if(intensities_lengthT > intensities_length) + this->intensities = (float*)realloc(this->intensities, intensities_lengthT * sizeof(float)); + offset += 3; + intensities_length = intensities_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/LaserScan"; }; + const char * getMD5(){ return "90c7ef2dc6895d81024acba2ac42f369"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/MagneticField.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/MagneticField.h new file mode 100644 index 0000000..b4a37c2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/MagneticField.h @@ -0,0 +1,56 @@ +#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: + std_msgs::Header header; + geometry_msgs::Vector3 magnetic_field; + float magnetic_field_covariance[9]; + + MagneticField(): + header(), + magnetic_field(), + magnetic_field_covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->magnetic_field.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->magnetic_field_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->magnetic_field.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->magnetic_field_covariance[i])); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MagneticField"; }; + const char * getMD5(){ return "2f3b0b43eed0c9501de0fa3ff89a45aa"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/MultiDOFJointState.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/MultiDOFJointState.h new file mode 100644 index 0000000..af5ab91 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/MultiDOFJointState.h @@ -0,0 +1,138 @@ +#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: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t transforms_length; + geometry_msgs::Transform st_transforms; + geometry_msgs::Transform * transforms; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + uint8_t wrench_length; + geometry_msgs::Wrench st_wrench; + geometry_msgs::Wrench * wrench; + + MultiDOFJointState(): + header(), + joint_names_length(0), joint_names(NULL), + transforms_length(0), transforms(NULL), + twist_length(0), twist(NULL), + wrench_length(0), wrench(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = wrench_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_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)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_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)); + } + uint8_t wrench_lengthT = *(inbuffer + offset++); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrench_length = wrench_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/MultiDOFJointState"; }; + const char * getMD5(){ return "690f272f0640d2631c305eeb8301e59d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/MultiEchoLaserScan.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/MultiEchoLaserScan.h new file mode 100644 index 0000000..142be5f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/MultiEchoLaserScan.h @@ -0,0 +1,245 @@ +#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: + std_msgs::Header header; + float angle_min; + float angle_max; + float angle_increment; + float time_increment; + float scan_time; + float range_min; + float range_max; + uint8_t ranges_length; + sensor_msgs::LaserEcho st_ranges; + sensor_msgs::LaserEcho * ranges; + uint8_t intensities_length; + sensor_msgs::LaserEcho st_intensities; + sensor_msgs::LaserEcho * 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), ranges(NULL), + intensities_length(0), intensities(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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++) = ranges_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ranges_length; i++){ + offset += this->ranges[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = intensities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < intensities_length; i++){ + offset += this->intensities[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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); + uint8_t ranges_lengthT = *(inbuffer + offset++); + if(ranges_lengthT > ranges_length) + this->ranges = (sensor_msgs::LaserEcho*)realloc(this->ranges, ranges_lengthT * sizeof(sensor_msgs::LaserEcho)); + offset += 3; + ranges_length = ranges_lengthT; + for( uint8_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)); + } + uint8_t intensities_lengthT = *(inbuffer + offset++); + if(intensities_lengthT > intensities_length) + this->intensities = (sensor_msgs::LaserEcho*)realloc(this->intensities, intensities_lengthT * sizeof(sensor_msgs::LaserEcho)); + offset += 3; + intensities_length = intensities_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/MultiEchoLaserScan"; }; + const char * getMD5(){ return "6fefb0c6da89d7c8abe4b339f5c2f8fb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/NavSatFix.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/NavSatFix.h new file mode 100644 index 0000000..ba06e0c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/NavSatFix.h @@ -0,0 +1,78 @@ +#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: + std_msgs::Header header; + sensor_msgs::NavSatStatus status; + float latitude; + float longitude; + float altitude; + float position_covariance[9]; + uint8_t 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 + { + 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( uint8_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) + { + 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( uint8_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; + } + + const char * getType(){ return "sensor_msgs/NavSatFix"; }; + const char * getMD5(){ return "2d3a8cd499b9b4a0249fb98fd05cfa48"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/NavSatStatus.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/NavSatStatus.h new file mode 100644 index 0000000..f696571 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/NavSatStatus.h @@ -0,0 +1,71 @@ +#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: + int8_t status; + uint16_t 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 + { + 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) + { + 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; + } + + const char * getType(){ return "sensor_msgs/NavSatStatus"; }; + const char * getMD5(){ return "331cdbddfa4bc96ffc3b9ad98900a54c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointCloud.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointCloud.h new file mode 100644 index 0000000..ce7f775 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointCloud.h @@ -0,0 +1,85 @@ +#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: + std_msgs::Header header; + uint8_t points_length; + geometry_msgs::Point32 st_points; + geometry_msgs::Point32 * points; + uint8_t channels_length; + sensor_msgs::ChannelFloat32 st_channels; + sensor_msgs::ChannelFloat32 * channels; + + PointCloud(): + header(), + points_length(0), points(NULL), + channels_length(0), channels(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = channels_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < channels_length; i++){ + offset += this->channels[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + offset += 3; + points_length = points_lengthT; + for( uint8_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)); + } + uint8_t channels_lengthT = *(inbuffer + offset++); + if(channels_lengthT > channels_length) + this->channels = (sensor_msgs::ChannelFloat32*)realloc(this->channels, channels_lengthT * sizeof(sensor_msgs::ChannelFloat32)); + offset += 3; + channels_length = channels_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/PointCloud"; }; + const char * getMD5(){ return "d8e9c3f5afbdd8a130fd1d2763945fca"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointCloud2.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointCloud2.h new file mode 100644 index 0000000..8b50802 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointCloud2.h @@ -0,0 +1,168 @@ +#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: + std_msgs::Header header; + uint32_t height; + uint32_t width; + uint8_t fields_length; + sensor_msgs::PointField st_fields; + sensor_msgs::PointField * fields; + bool is_bigendian; + uint32_t point_step; + uint32_t row_step; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + bool is_dense; + + PointCloud2(): + header(), + height(0), + width(0), + fields_length(0), fields(NULL), + is_bigendian(0), + point_step(0), + row_step(0), + data_length(0), data(NULL), + is_dense(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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++) = fields_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + 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); + uint8_t fields_lengthT = *(inbuffer + offset++); + if(fields_lengthT > fields_length) + this->fields = (sensor_msgs::PointField*)realloc(this->fields, fields_lengthT * sizeof(sensor_msgs::PointField)); + offset += 3; + fields_length = fields_lengthT; + for( uint8_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); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "sensor_msgs/PointCloud2"; }; + const char * getMD5(){ return "1158d486dd51d683ce2f1be655c3c181"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointField.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointField.h new file mode 100644 index 0000000..5ef0d0e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/PointField.h @@ -0,0 +1,92 @@ +#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: + const char* name; + uint32_t offset; + uint8_t datatype; + uint32_t 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 + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "sensor_msgs/PointField"; }; + const char * getMD5(){ return "268eacb2962780ceac86cbd17e328150"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Range.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Range.h new file mode 100644 index 0000000..a8ddcaa --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Range.h @@ -0,0 +1,143 @@ +#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: + std_msgs::Header header; + uint8_t radiation_type; + float field_of_view; + float min_range; + float max_range; + float 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 + { + 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) + { + 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; + } + + const char * getType(){ return "sensor_msgs/Range"; }; + const char * getMD5(){ return "c005c34273dc426c67a020a87bc24148"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/RegionOfInterest.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/RegionOfInterest.h new file mode 100644 index 0000000..ebdb9b3 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/RegionOfInterest.h @@ -0,0 +1,103 @@ +#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: + uint32_t x_offset; + uint32_t y_offset; + uint32_t height; + uint32_t width; + bool do_rectify; + + RegionOfInterest(): + x_offset(0), + y_offset(0), + height(0), + width(0), + do_rectify(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "sensor_msgs/RegionOfInterest"; }; + const char * getMD5(){ return "bdb633039d588fcccb441a4d43ccfe09"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/RelativeHumidity.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/RelativeHumidity.h new file mode 100644 index 0000000..2ec392a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/RelativeHumidity.h @@ -0,0 +1,51 @@ +#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: + std_msgs::Header header; + float relative_humidity; + float variance; + + RelativeHumidity(): + header(), + relative_humidity(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->relative_humidity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/RelativeHumidity"; }; + const char * getMD5(){ return "8730015b05955b7e992ce29a2678d90f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/SetCameraInfo.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/SetCameraInfo.h new file mode 100644 index 0000000..9f49b67 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/SetCameraInfo.h @@ -0,0 +1,108 @@ +#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: + sensor_msgs::CameraInfo camera_info; + + SetCameraInfoRequest(): + camera_info() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->camera_info.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->camera_info.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETCAMERAINFO; }; + const char * getMD5(){ return "ee34be01fdeee563d0d99cd594d5581d"; }; + + }; + + class SetCameraInfoResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetCameraInfoResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SETCAMERAINFO; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetCameraInfo { + public: + typedef SetCameraInfoRequest Request; + typedef SetCameraInfoResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Temperature.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Temperature.h new file mode 100644 index 0000000..f630a39 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/Temperature.h @@ -0,0 +1,51 @@ +#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: + std_msgs::Header header; + float temperature; + float variance; + + Temperature(): + header(), + temperature(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->temperature)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/Temperature"; }; + const char * getMD5(){ return "ff71b307acdbe7c871a5a6d7ed359100"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/sensor_msgs/TimeReference.h b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/TimeReference.h new file mode 100644 index 0000000..eab85e6 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/sensor_msgs/TimeReference.h @@ -0,0 +1,82 @@ +#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: + std_msgs::Header header; + ros::Time time_ref; + const char* source; + + TimeReference(): + header(), + time_ref(), + source("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_source, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->source, length_source); + offset += length_source; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_source, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "sensor_msgs/TimeReference"; }; + const char * getMD5(){ return "fded64a0265108ba86c3d38fb11c0c16"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/shape_msgs/Mesh.h b/libraries/Rosserial_Arduino_Library/src/shape_msgs/Mesh.h new file mode 100644 index 0000000..8a12baa --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/shape_msgs/Mesh.h @@ -0,0 +1,80 @@ +#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: + uint8_t triangles_length; + shape_msgs::MeshTriangle st_triangles; + shape_msgs::MeshTriangle * triangles; + uint8_t vertices_length; + geometry_msgs::Point st_vertices; + geometry_msgs::Point * vertices; + + Mesh(): + triangles_length(0), triangles(NULL), + vertices_length(0), vertices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = triangles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < triangles_length; i++){ + offset += this->triangles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = vertices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vertices_length; i++){ + offset += this->vertices[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t triangles_lengthT = *(inbuffer + offset++); + if(triangles_lengthT > triangles_length) + this->triangles = (shape_msgs::MeshTriangle*)realloc(this->triangles, triangles_lengthT * sizeof(shape_msgs::MeshTriangle)); + offset += 3; + triangles_length = triangles_lengthT; + for( uint8_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)); + } + uint8_t vertices_lengthT = *(inbuffer + offset++); + if(vertices_lengthT > vertices_length) + this->vertices = (geometry_msgs::Point*)realloc(this->vertices, vertices_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + vertices_length = vertices_lengthT; + for( uint8_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; + } + + const char * getType(){ return "shape_msgs/Mesh"; }; + const char * getMD5(){ return "1ffdae9486cd3316a121c578b47a85cc"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/shape_msgs/MeshTriangle.h b/libraries/Rosserial_Arduino_Library/src/shape_msgs/MeshTriangle.h new file mode 100644 index 0000000..1cb7e99 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + for( uint8_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) + { + int offset = 0; + for( uint8_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; + } + + const char * getType(){ return "shape_msgs/MeshTriangle"; }; + const char * getMD5(){ return "23688b2e6d2de3d32fe8af104a903253"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/shape_msgs/Plane.h b/libraries/Rosserial_Arduino_Library/src/shape_msgs/Plane.h new file mode 100644 index 0000000..b6c4d77 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + for( uint8_t i = 0; i < 4; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->coef[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + for( uint8_t i = 0; i < 4; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->coef[i])); + } + return offset; + } + + const char * getType(){ return "shape_msgs/Plane"; }; + const char * getMD5(){ return "2c1b92ed8f31492f8e73f6a4a44ca796"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/shape_msgs/SolidPrimitive.h b/libraries/Rosserial_Arduino_Library/src/shape_msgs/SolidPrimitive.h new file mode 100644 index 0000000..ba1974d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/shape_msgs/SolidPrimitive.h @@ -0,0 +1,76 @@ +#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: + uint8_t type; + uint8_t dimensions_length; + float st_dimensions; + float * 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), dimensions(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = dimensions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < dimensions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->dimensions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t dimensions_lengthT = *(inbuffer + offset++); + if(dimensions_lengthT > dimensions_length) + this->dimensions = (float*)realloc(this->dimensions, dimensions_lengthT * sizeof(float)); + offset += 3; + dimensions_length = dimensions_lengthT; + for( uint8_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; + } + + const char * getType(){ return "shape_msgs/SolidPrimitive"; }; + const char * getMD5(){ return "d8f8cbc74c5ff283fca29569ccefb45d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerInitialStatusCmd.h b/libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerInitialStatusCmd.h new file mode 100644 index 0000000..aa0b000 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerInitialStatusCmd.h @@ -0,0 +1,102 @@ +#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: + const char* path; + uint8_t initial_states_length; + char* st_initial_states; + char* * initial_states; + const char* local_data; + + SmachContainerInitialStatusCmd(): + path(""), + initial_states_length(0), initial_states(NULL), + local_data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = initial_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen(this->initial_states[i]); + memcpy(outbuffer + offset, &length_initial_statesi, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_local_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t initial_states_lengthT = *(inbuffer + offset++); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + offset += 3; + initial_states_length = initial_states_lengthT; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + memcpy(&length_st_initial_states, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_local_data, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "smach_msgs/SmachContainerInitialStatusCmd"; }; + const char * getMD5(){ return "45f8cf31fc29b829db77f23001f788d6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerStatus.h b/libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerStatus.h new file mode 100644 index 0000000..73300de --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerStatus.h @@ -0,0 +1,155 @@ +#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: + std_msgs::Header header; + const char* path; + uint8_t initial_states_length; + char* st_initial_states; + char* * initial_states; + uint8_t active_states_length; + char* st_active_states; + char* * active_states; + const char* local_data; + const char* info; + + SmachContainerStatus(): + header(), + path(""), + initial_states_length(0), initial_states(NULL), + active_states_length(0), active_states(NULL), + local_data(""), + info("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = initial_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen(this->initial_states[i]); + memcpy(outbuffer + offset, &length_initial_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + *(outbuffer + offset++) = active_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < active_states_length; i++){ + uint32_t length_active_statesi = strlen(this->active_states[i]); + memcpy(outbuffer + offset, &length_active_statesi, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_local_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + uint32_t length_info = strlen(this->info); + memcpy(outbuffer + offset, &length_info, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t initial_states_lengthT = *(inbuffer + offset++); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + offset += 3; + initial_states_length = initial_states_lengthT; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + memcpy(&length_st_initial_states, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t active_states_lengthT = *(inbuffer + offset++); + if(active_states_lengthT > active_states_length) + this->active_states = (char**)realloc(this->active_states, active_states_lengthT * sizeof(char*)); + offset += 3; + active_states_length = active_states_lengthT; + for( uint8_t i = 0; i < active_states_length; i++){ + uint32_t length_st_active_states; + memcpy(&length_st_active_states, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_local_data, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_info, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "smach_msgs/SmachContainerStatus"; }; + const char * getMD5(){ return "5ba2bb79ac19e3842d562a191f2a675b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerStructure.h b/libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerStructure.h new file mode 100644 index 0000000..c03ed2e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/smach_msgs/SmachContainerStructure.h @@ -0,0 +1,219 @@ +#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: + std_msgs::Header header; + const char* path; + uint8_t children_length; + char* st_children; + char* * children; + uint8_t internal_outcomes_length; + char* st_internal_outcomes; + char* * internal_outcomes; + uint8_t outcomes_from_length; + char* st_outcomes_from; + char* * outcomes_from; + uint8_t outcomes_to_length; + char* st_outcomes_to; + char* * outcomes_to; + uint8_t container_outcomes_length; + char* st_container_outcomes; + char* * container_outcomes; + + SmachContainerStructure(): + header(), + path(""), + children_length(0), children(NULL), + internal_outcomes_length(0), internal_outcomes(NULL), + outcomes_from_length(0), outcomes_from(NULL), + outcomes_to_length(0), outcomes_to(NULL), + container_outcomes_length(0), container_outcomes(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = children_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < children_length; i++){ + uint32_t length_childreni = strlen(this->children[i]); + memcpy(outbuffer + offset, &length_childreni, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->children[i], length_childreni); + offset += length_childreni; + } + *(outbuffer + offset++) = internal_outcomes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_internal_outcomesi = strlen(this->internal_outcomes[i]); + memcpy(outbuffer + offset, &length_internal_outcomesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->internal_outcomes[i], length_internal_outcomesi); + offset += length_internal_outcomesi; + } + *(outbuffer + offset++) = outcomes_from_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_outcomes_fromi = strlen(this->outcomes_from[i]); + memcpy(outbuffer + offset, &length_outcomes_fromi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_from[i], length_outcomes_fromi); + offset += length_outcomes_fromi; + } + *(outbuffer + offset++) = outcomes_to_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_outcomes_toi = strlen(this->outcomes_to[i]); + memcpy(outbuffer + offset, &length_outcomes_toi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_to[i], length_outcomes_toi); + offset += length_outcomes_toi; + } + *(outbuffer + offset++) = container_outcomes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_container_outcomesi = strlen(this->container_outcomes[i]); + memcpy(outbuffer + offset, &length_container_outcomesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->container_outcomes[i], length_container_outcomesi); + offset += length_container_outcomesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + 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; + uint8_t children_lengthT = *(inbuffer + offset++); + if(children_lengthT > children_length) + this->children = (char**)realloc(this->children, children_lengthT * sizeof(char*)); + offset += 3; + children_length = children_lengthT; + for( uint8_t i = 0; i < children_length; i++){ + uint32_t length_st_children; + memcpy(&length_st_children, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t internal_outcomes_lengthT = *(inbuffer + offset++); + if(internal_outcomes_lengthT > internal_outcomes_length) + this->internal_outcomes = (char**)realloc(this->internal_outcomes, internal_outcomes_lengthT * sizeof(char*)); + offset += 3; + internal_outcomes_length = internal_outcomes_lengthT; + for( uint8_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_st_internal_outcomes; + memcpy(&length_st_internal_outcomes, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t outcomes_from_lengthT = *(inbuffer + offset++); + if(outcomes_from_lengthT > outcomes_from_length) + this->outcomes_from = (char**)realloc(this->outcomes_from, outcomes_from_lengthT * sizeof(char*)); + offset += 3; + outcomes_from_length = outcomes_from_lengthT; + for( uint8_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_st_outcomes_from; + memcpy(&length_st_outcomes_from, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t outcomes_to_lengthT = *(inbuffer + offset++); + if(outcomes_to_lengthT > outcomes_to_length) + this->outcomes_to = (char**)realloc(this->outcomes_to, outcomes_to_lengthT * sizeof(char*)); + offset += 3; + outcomes_to_length = outcomes_to_lengthT; + for( uint8_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_st_outcomes_to; + memcpy(&length_st_outcomes_to, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t container_outcomes_lengthT = *(inbuffer + offset++); + if(container_outcomes_lengthT > container_outcomes_length) + this->container_outcomes = (char**)realloc(this->container_outcomes, container_outcomes_lengthT * sizeof(char*)); + offset += 3; + container_outcomes_length = container_outcomes_lengthT; + for( uint8_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_st_container_outcomes; + memcpy(&length_st_container_outcomes, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "smach_msgs/SmachContainerStructure"; }; + const char * getMD5(){ return "3d3d1e0d0f99779ee9e58101a5dcf7ea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Bool.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Bool.h new file mode 100644 index 0000000..1ec6d07 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Bool.h @@ -0,0 +1,55 @@ +#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: + bool data; + + Bool(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/Bool"; }; + const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Byte.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Byte.h new file mode 100644 index 0000000..cbb1bc2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Byte.h @@ -0,0 +1,55 @@ +#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: + int8_t data; + + Byte(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/Byte"; }; + const char * getMD5(){ return "ad736a2e8818154c487bb80fe42ce43b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/ByteMultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/ByteMultiArray.h new file mode 100644 index 0000000..a41a450 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/ByteMultiArray.h @@ -0,0 +1,76 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + ByteMultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/ByteMultiArray"; }; + const char * getMD5(){ return "70ea476cbcfd65ac2f68f3cda1e891fe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Char.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Char.h new file mode 100644 index 0000000..977cc8b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Char.h @@ -0,0 +1,44 @@ +#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: + uint8_t data; + + Char(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Char"; }; + const char * getMD5(){ return "1bf77f25acecdedba0e224b162199717"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/ColorRGBA.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/ColorRGBA.h new file mode 100644 index 0000000..d458c91 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/ColorRGBA.h @@ -0,0 +1,130 @@ +#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: + float r; + float g; + float b; + float a; + + ColorRGBA(): + r(0), + g(0), + b(0), + a(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/ColorRGBA"; }; + const char * getMD5(){ return "a29a96539573343b1310c73607334b00"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Duration.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Duration.h new file mode 100644 index 0000000..883a752 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Duration.h @@ -0,0 +1,61 @@ +#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: + ros::Duration data; + + Duration(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/Duration"; }; + const char * getMD5(){ return "3e286caf4241d664e55f3ad380e2ae46"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Empty.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Empty.h new file mode 100644 index 0000000..440e5ed --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "std_msgs/Empty"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Float32.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Float32.h new file mode 100644 index 0000000..b324c1b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Float32.h @@ -0,0 +1,61 @@ +#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: + float data; + + Float32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/Float32"; }; + const char * getMD5(){ return "73fcbf46b49191e672908e50842a83d4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Float32MultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Float32MultiArray.h new file mode 100644 index 0000000..51f9406 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Float32MultiArray.h @@ -0,0 +1,82 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + float st_data; + float * data; + + Float32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/Float32MultiArray"; }; + const char * getMD5(){ return "6a40e0ffa6a17a503ac3f8616991b1f6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Float64.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Float64.h new file mode 100644 index 0000000..3cc9fd0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Float64.h @@ -0,0 +1,42 @@ +#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: + float data; + + Float64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->data)); + return offset; + } + + const char * getType(){ return "std_msgs/Float64"; }; + const char * getMD5(){ return "fdb28210bfa9d7c91146260178d9a584"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Float64MultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Float64MultiArray.h new file mode 100644 index 0000000..ab740b6 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Float64MultiArray.h @@ -0,0 +1,63 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + float st_data; + float * data; + + Float64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/Float64MultiArray"; }; + const char * getMD5(){ return "4b7d974086d4060e7db4613a7e6c3ba4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Header.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Header.h new file mode 100644 index 0000000..2aa0f7f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Header.h @@ -0,0 +1,89 @@ +#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: + uint32_t seq; + ros::Time stamp; + const char* frame_id; + + Header(): + seq(0), + stamp(), + frame_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "std_msgs/Header"; }; + const char * getMD5(){ return "2176decaecbce78abc3b96ef049fabed"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Int16.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int16.h new file mode 100644 index 0000000..a83f7b2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int16.h @@ -0,0 +1,57 @@ +#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: + int16_t data; + + Int16(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/Int16"; }; + const char * getMD5(){ return "8524586e34fbd7cb1c08c5f5f1ca0e57"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Int16MultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int16MultiArray.h new file mode 100644 index 0000000..e70f4e2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int16MultiArray.h @@ -0,0 +1,78 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int16_t st_data; + int16_t * data; + + Int16MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int16_t*)realloc(this->data, data_lengthT * sizeof(int16_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/Int16MultiArray"; }; + const char * getMD5(){ return "d9338d7f523fcb692fae9d0a0e9f067c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Int32.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int32.h new file mode 100644 index 0000000..a2a364f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int32.h @@ -0,0 +1,61 @@ +#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: + int32_t data; + + Int32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/Int32"; }; + const char * getMD5(){ return "da5909fbe378aeaf85e547e830cc1bb7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Int32MultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int32MultiArray.h new file mode 100644 index 0000000..4df5ff5 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int32MultiArray.h @@ -0,0 +1,82 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int32_t st_data; + int32_t * data; + + Int32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int32_t*)realloc(this->data, data_lengthT * sizeof(int32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/Int32MultiArray"; }; + const char * getMD5(){ return "1d99f79f8b325b44fee908053e9c945b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Int64.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int64.h new file mode 100644 index 0000000..4016081 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int64.h @@ -0,0 +1,69 @@ +#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: + int64_t data; + + Int64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/Int64"; }; + const char * getMD5(){ return "34add168574510e6e17f5d23ecc077ef"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Int64MultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int64MultiArray.h new file mode 100644 index 0000000..5733608 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int64MultiArray.h @@ -0,0 +1,90 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int64_t st_data; + int64_t * data; + + Int64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int64_t*)realloc(this->data, data_lengthT * sizeof(int64_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/Int64MultiArray"; }; + const char * getMD5(){ return "54865aa6c65be0448113a2afc6a49270"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Int8.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int8.h new file mode 100644 index 0000000..b02ef77 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int8.h @@ -0,0 +1,55 @@ +#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: + int8_t data; + + Int8(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/Int8"; }; + const char * getMD5(){ return "27ffa0c9c4b8fb8492252bcad9e5c57b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Int8MultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int8MultiArray.h new file mode 100644 index 0000000..7bf8c9b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Int8MultiArray.h @@ -0,0 +1,76 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + Int8MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/Int8MultiArray"; }; + const char * getMD5(){ return "d7c1af35a1b4781bbe79e03dd94b7c13"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/MultiArrayDimension.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/MultiArrayDimension.h new file mode 100644 index 0000000..7cae4ba --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/MultiArrayDimension.h @@ -0,0 +1,78 @@ +#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: + const char* label; + uint32_t size; + uint32_t stride; + + MultiArrayDimension(): + label(""), + size(0), + stride(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_label = strlen(this->label); + memcpy(outbuffer + offset, &length_label, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_label; + memcpy(&length_label, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "std_msgs/MultiArrayDimension"; }; + const char * getMD5(){ return "4cd0c83a8683deae40ecdac60e53bfa8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/MultiArrayLayout.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/MultiArrayLayout.h new file mode 100644 index 0000000..a30ff41 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/MultiArrayLayout.h @@ -0,0 +1,71 @@ +#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: + uint8_t dim_length; + std_msgs::MultiArrayDimension st_dim; + std_msgs::MultiArrayDimension * dim; + uint32_t data_offset; + + MultiArrayLayout(): + dim_length(0), dim(NULL), + data_offset(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = dim_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t dim_lengthT = *(inbuffer + offset++); + if(dim_lengthT > dim_length) + this->dim = (std_msgs::MultiArrayDimension*)realloc(this->dim, dim_lengthT * sizeof(std_msgs::MultiArrayDimension)); + offset += 3; + dim_length = dim_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/MultiArrayLayout"; }; + const char * getMD5(){ return "0fed2a11c13e11c5571b4e2a995a91a3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/String.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/String.h new file mode 100644 index 0000000..f590500 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/String.h @@ -0,0 +1,54 @@ +#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: + const char* data; + + String(): + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_data = strlen(this->data); + memcpy(outbuffer + offset, &length_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->data, length_data); + offset += length_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_data; + memcpy(&length_data, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "std_msgs/String"; }; + const char * getMD5(){ return "992ce8a1687cec8c8bd883ec73ca41d1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/Time.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/Time.h new file mode 100644 index 0000000..d87047b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/Time.h @@ -0,0 +1,61 @@ +#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: + ros::Time data; + + Time(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/Time"; }; + const char * getMD5(){ return "cd7166c74c552c311fbcc2fe5a7bc289"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt16.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt16.h new file mode 100644 index 0000000..dd3c0cb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt16.h @@ -0,0 +1,46 @@ +#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: + uint16_t data; + + UInt16(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + this->data = ((uint16_t) (*(inbuffer + offset))); + this->data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt16"; }; + const char * getMD5(){ return "1df79edf208b629fe6b81923a544552d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt16MultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt16MultiArray.h new file mode 100644 index 0000000..28bc27d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt16MultiArray.h @@ -0,0 +1,67 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint16_t st_data; + uint16_t * data; + + UInt16MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint16_t*)realloc(this->data, data_lengthT * sizeof(uint16_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/UInt16MultiArray"; }; + const char * getMD5(){ return "52f264f1c973c4b73790d384c6cb4484"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt32.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt32.h new file mode 100644 index 0000000..170208f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt32.h @@ -0,0 +1,50 @@ +#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: + uint32_t data; + + UInt32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "std_msgs/UInt32"; }; + const char * getMD5(){ return "304a39449588c7f8ce2df6e8001c5fce"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt32MultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt32MultiArray.h new file mode 100644 index 0000000..8dd7e1b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt32MultiArray.h @@ -0,0 +1,71 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint32_t st_data; + uint32_t * data; + + UInt32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint32_t*)realloc(this->data, data_lengthT * sizeof(uint32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/UInt32MultiArray"; }; + const char * getMD5(){ return "4d6a180abc9be191b96a7eda6c8a233d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt64.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt64.h new file mode 100644 index 0000000..d69b9fe --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt64.h @@ -0,0 +1,61 @@ +#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: + uint64_t data; + + UInt64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + uint64_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) + { + int offset = 0; + union { + uint64_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; + } + + const char * getType(){ return "std_msgs/UInt64"; }; + const char * getMD5(){ return "1b2a79973e8bf53d7b53acb71299cb57"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt64MultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt64MultiArray.h new file mode 100644 index 0000000..5510abe --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt64MultiArray.h @@ -0,0 +1,82 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint64_t st_data; + uint64_t * data; + + UInt64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + uint64_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) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint64_t*)realloc(this->data, data_lengthT * sizeof(uint64_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + uint64_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(uint64_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt64MultiArray"; }; + const char * getMD5(){ return "6088f127afb1d6c72927aa1247e945af"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt8.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt8.h new file mode 100644 index 0000000..15dbb6f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt8.h @@ -0,0 +1,44 @@ +#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: + uint8_t data; + + UInt8(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt8"; }; + const char * getMD5(){ return "7c8164229e7d2c17eb95e9231617fdee"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt8MultiArray.h b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt8MultiArray.h new file mode 100644 index 0000000..8a2a616 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_msgs/UInt8MultiArray.h @@ -0,0 +1,65 @@ +#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: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + UInt8MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "std_msgs/UInt8MultiArray"; }; + const char * getMD5(){ return "82373f1612381bb6ee473b5cd6f5d89c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/std_srvs/Empty.h b/libraries/Rosserial_Arduino_Library/src/std_srvs/Empty.h new file mode 100644 index 0000000..b040dd2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + EmptyResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/std_srvs/Trigger.h b/libraries/Rosserial_Arduino_Library/src/std_srvs/Trigger.h new file mode 100644 index 0000000..958d2b8 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/std_srvs/Trigger.h @@ -0,0 +1,103 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TRIGGER; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TriggerResponse : public ros::Msg + { + public: + bool success; + const char* message; + + TriggerResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return TRIGGER; }; + const char * getMD5(){ return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class Trigger { + public: + typedef TriggerRequest Request; + typedef TriggerResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/stereo_msgs/DisparityImage.h b/libraries/Rosserial_Arduino_Library/src/stereo_msgs/DisparityImage.h new file mode 100644 index 0000000..53d557b --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/stereo_msgs/DisparityImage.h @@ -0,0 +1,168 @@ +#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: + std_msgs::Header header; + sensor_msgs::Image image; + float f; + float T; + sensor_msgs::RegionOfInterest valid_window; + float min_disparity; + float max_disparity; + float 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 + { + 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) + { + 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; + } + + const char * getType(){ return "stereo_msgs/DisparityImage"; }; + const char * getMD5(){ return "04a177815f75271039fa21f16acad8c9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/tests/array_test/array_test.pde b/libraries/Rosserial_Arduino_Library/src/tests/array_test/array_test.pde new file mode 100644 index 0000000..8aa72de --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/tests/float64_test/float64_test.pde b/libraries/Rosserial_Arduino_Library/src/tests/float64_test/float64_test.pde new file mode 100644 index 0000000..41a6f4a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/tests/time_test/time_test.pde b/libraries/Rosserial_Arduino_Library/src/tests/time_test/time_test.pde new file mode 100644 index 0000000..c5fa739 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/tf/FrameGraph.h b/libraries/Rosserial_Arduino_Library/src/tf/FrameGraph.h new file mode 100644 index 0000000..b7d2f31 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf/FrameGraph.h @@ -0,0 +1,86 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + const char* dot_graph; + + FrameGraphResponse(): + dot_graph("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_dot_graph = strlen(this->dot_graph); + memcpy(outbuffer + offset, &length_dot_graph, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->dot_graph, length_dot_graph); + offset += length_dot_graph; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_dot_graph; + memcpy(&length_dot_graph, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "c4af9ac907e58e906eb0b6e3c58478c0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/tf/tf.h b/libraries/Rosserial_Arduino_Library/src/tf/tf.h new file mode 100644 index 0000000..a2888e3 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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/libraries/Rosserial_Arduino_Library/src/tf/tfMessage.h b/libraries/Rosserial_Arduino_Library/src/tf/tfMessage.h new file mode 100644 index 0000000..e8b3eb7 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf/tfMessage.h @@ -0,0 +1,59 @@ +#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: + uint8_t transforms_length; + geometry_msgs::TransformStamped st_transforms; + geometry_msgs::TransformStamped * transforms; + + tfMessage(): + transforms_length(0), transforms(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_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; + } + + const char * getType(){ return "tf/tfMessage"; }; + const char * getMD5(){ return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/tf/transform_broadcaster.h b/libraries/Rosserial_Arduino_Library/src/tf/transform_broadcaster.h new file mode 100644 index 0000000..817eaba --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf/transform_broadcaster.h @@ -0,0 +1,68 @@ +/* + * 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 "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/libraries/Rosserial_Arduino_Library/src/tf2_msgs/FrameGraph.h b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/FrameGraph.h new file mode 100644 index 0000000..a703dd2 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/FrameGraph.h @@ -0,0 +1,86 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + const char* frame_yaml; + + FrameGraphResponse(): + frame_yaml("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_frame_yaml = strlen(this->frame_yaml); + memcpy(outbuffer + offset, &length_frame_yaml, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_yaml, length_frame_yaml); + offset += length_frame_yaml; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_frame_yaml; + memcpy(&length_frame_yaml, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "437ea58e9463815a0d511c7326b686b0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformAction.h b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformAction.h new file mode 100644 index 0000000..2a0178f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformAction.h @@ -0,0 +1,53 @@ +#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: + tf2_msgs::LookupTransformActionGoal action_goal; + tf2_msgs::LookupTransformActionResult action_result; + tf2_msgs::LookupTransformActionFeedback action_feedback; + + LookupTransformAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "tf2_msgs/LookupTransformAction"; }; + const char * getMD5(){ return "7ee01ba91a56c2245c610992dbaa3c37"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionFeedback.h new file mode 100644 index 0000000..f0de7af --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + tf2_msgs::LookupTransformFeedback feedback; + + LookupTransformActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionGoal.h b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionGoal.h new file mode 100644 index 0000000..d668cd9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + tf2_msgs::LookupTransformGoal goal; + + LookupTransformActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionGoal"; }; + const char * getMD5(){ return "f2e7bcdb75c847978d0351a13e699da5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionResult.h b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionResult.h new file mode 100644 index 0000000..99298ff --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + tf2_msgs::LookupTransformResult result; + + LookupTransformActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionResult"; }; + const char * getMD5(){ return "ac26ce75a41384fa8bb4dc10f491ab90"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformFeedback.h b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformFeedback.h new file mode 100644 index 0000000..6be0748 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformGoal.h b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformGoal.h new file mode 100644 index 0000000..f498e45 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformGoal.h @@ -0,0 +1,171 @@ +#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: + const char* target_frame; + const char* source_frame; + ros::Time source_time; + ros::Duration timeout; + ros::Time target_time; + const char* fixed_frame; + bool advanced; + + LookupTransformGoal(): + target_frame(""), + source_frame(""), + source_time(), + timeout(), + target_time(), + fixed_frame(""), + advanced(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_target_frame = strlen(this->target_frame); + memcpy(outbuffer + offset, &length_target_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->target_frame, length_target_frame); + offset += length_target_frame; + uint32_t length_source_frame = strlen(this->source_frame); + memcpy(outbuffer + offset, &length_source_frame, sizeof(uint32_t)); + 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); + memcpy(outbuffer + offset, &length_fixed_frame, sizeof(uint32_t)); + 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) + { + int offset = 0; + uint32_t length_target_frame; + memcpy(&length_target_frame, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_source_frame, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_fixed_frame, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "tf2_msgs/LookupTransformGoal"; }; + const char * getMD5(){ return "35e3720468131d675a18bb6f3e5f22f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformResult.h b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformResult.h new file mode 100644 index 0000000..6dbf6f4 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/LookupTransformResult.h @@ -0,0 +1,48 @@ +#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: + geometry_msgs::TransformStamped transform; + tf2_msgs::TF2Error error; + + LookupTransformResult(): + transform(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->transform.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->transform.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformResult"; }; + const char * getMD5(){ return "3fe5db6a19ca9cfb675418c5ad875c36"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/tf2_msgs/TF2Error.h b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/TF2Error.h new file mode 100644 index 0000000..0fc1a7f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/TF2Error.h @@ -0,0 +1,67 @@ +#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: + uint8_t error; + const char* 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 + { + int offset = 0; + *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF; + offset += sizeof(this->error); + uint32_t length_error_string = strlen(this->error_string); + memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->error = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->error); + uint32_t length_error_string; + memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "tf2_msgs/TF2Error"; }; + const char * getMD5(){ return "bc6848fd6fd750c92e38575618a4917d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/tf2_msgs/TFMessage.h b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/TFMessage.h new file mode 100644 index 0000000..d358efa --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/tf2_msgs/TFMessage.h @@ -0,0 +1,59 @@ +#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: + uint8_t transforms_length; + geometry_msgs::TransformStamped st_transforms; + geometry_msgs::TransformStamped * transforms; + + TFMessage(): + transforms_length(0), transforms(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_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; + } + + const char * getType(){ return "tf2_msgs/TFMessage"; }; + const char * getMD5(){ return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/theora_image_transport/Packet.h b/libraries/Rosserial_Arduino_Library/src/theora_image_transport/Packet.h new file mode 100644 index 0000000..85127b9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/theora_image_transport/Packet.h @@ -0,0 +1,173 @@ +#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: + std_msgs::Header header; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + int32_t b_o_s; + int32_t e_o_s; + int64_t granulepos; + int64_t packetno; + + Packet(): + header(), + data_length(0), data(NULL), + b_o_s(0), + e_o_s(0), + granulepos(0), + packetno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_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; + } + + const char * getType(){ return "theora_image_transport/Packet"; }; + const char * getMD5(){ return "33ac4e14a7cff32e7e0d65f18bb410f3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/time.cpp b/libraries/Rosserial_Arduino_Library/src/time.cpp new file mode 100644 index 0000000..9341196 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/time.cpp @@ -0,0 +1,68 @@ +/* + * 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 += rhs.sec; + nsec += rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; + } + + Time& Time::operator -=(const Duration &rhs){ + sec += -rhs.sec; + nsec += -rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; + } +} diff --git a/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxAdd.h b/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxAdd.h new file mode 100644 index 0000000..269912e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxAdd.h @@ -0,0 +1,86 @@ +#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: + const char* topic; + + DemuxAddRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return DEMUXADD; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxAddResponse : public ros::Msg + { + public: + + DemuxAddResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXADD; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxAdd { + public: + typedef DemuxAddRequest Request; + typedef DemuxAddResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxDelete.h b/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxDelete.h new file mode 100644 index 0000000..af15d3a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxDelete.h @@ -0,0 +1,86 @@ +#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: + const char* topic; + + DemuxDeleteRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return DEMUXDELETE; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxDeleteResponse : public ros::Msg + { + public: + + DemuxDeleteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXDELETE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxDelete { + public: + typedef DemuxDeleteRequest Request; + typedef DemuxDeleteResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxList.h b/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxList.h new file mode 100644 index 0000000..5d0beb9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxList.h @@ -0,0 +1,102 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxListResponse : public ros::Msg + { + public: + uint8_t topics_length; + char* st_topics; + char* * topics; + + DemuxListResponse(): + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return DEMUXLIST; }; + const char * getMD5(){ return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class DemuxList { + public: + typedef DemuxListRequest Request; + typedef DemuxListResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxSelect.h b/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxSelect.h new file mode 100644 index 0000000..449a387 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/topic_tools/DemuxSelect.h @@ -0,0 +1,102 @@ +#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: + const char* topic; + + DemuxSelectRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return DEMUXSELECT; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxSelectResponse : public ros::Msg + { + public: + const char* prev_topic; + + DemuxSelectResponse(): + prev_topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_prev_topic = strlen(this->prev_topic); + memcpy(outbuffer + offset, &length_prev_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_prev_topic; + memcpy(&length_prev_topic, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return DEMUXSELECT; }; + const char * getMD5(){ return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class DemuxSelect { + public: + typedef DemuxSelectRequest Request; + typedef DemuxSelectResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxAdd.h b/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxAdd.h new file mode 100644 index 0000000..92ffe35 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxAdd.h @@ -0,0 +1,86 @@ +#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: + const char* topic; + + MuxAddRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return MUXADD; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxAddResponse : public ros::Msg + { + public: + + MuxAddResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXADD; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxAdd { + public: + typedef MuxAddRequest Request; + typedef MuxAddResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxDelete.h b/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxDelete.h new file mode 100644 index 0000000..b624e7a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxDelete.h @@ -0,0 +1,86 @@ +#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: + const char* topic; + + MuxDeleteRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return MUXDELETE; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxDeleteResponse : public ros::Msg + { + public: + + MuxDeleteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXDELETE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxDelete { + public: + typedef MuxDeleteRequest Request; + typedef MuxDeleteResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxList.h b/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxList.h new file mode 100644 index 0000000..011c179 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxList.h @@ -0,0 +1,102 @@ +#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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxListResponse : public ros::Msg + { + public: + uint8_t topics_length; + char* st_topics; + char* * topics; + + MuxListResponse(): + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return MUXLIST; }; + const char * getMD5(){ return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class MuxList { + public: + typedef MuxListRequest Request; + typedef MuxListResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxSelect.h b/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxSelect.h new file mode 100644 index 0000000..b883b8e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/topic_tools/MuxSelect.h @@ -0,0 +1,102 @@ +#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: + const char* topic; + + MuxSelectRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return MUXSELECT; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxSelectResponse : public ros::Msg + { + public: + const char* prev_topic; + + MuxSelectResponse(): + prev_topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_prev_topic = strlen(this->prev_topic); + memcpy(outbuffer + offset, &length_prev_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_prev_topic; + memcpy(&length_prev_topic, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return MUXSELECT; }; + const char * getMD5(){ return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class MuxSelect { + public: + typedef MuxSelectRequest Request; + typedef MuxSelectResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/JointTrajectory.h b/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/JointTrajectory.h new file mode 100644 index 0000000..13a4f3c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/JointTrajectory.h @@ -0,0 +1,96 @@ +#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: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t points_length; + trajectory_msgs::JointTrajectoryPoint st_points; + trajectory_msgs::JointTrajectoryPoint * points; + + JointTrajectory(): + header(), + joint_names_length(0), joint_names(NULL), + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (trajectory_msgs::JointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::JointTrajectoryPoint)); + offset += 3; + points_length = points_lengthT; + for( uint8_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; + } + + const char * getType(){ return "trajectory_msgs/JointTrajectory"; }; + const char * getMD5(){ return "65b4f94a94d1ed67169da35a02f33d3f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/JointTrajectoryPoint.h b/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/JointTrajectoryPoint.h new file mode 100644 index 0000000..20b40e4 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/JointTrajectoryPoint.h @@ -0,0 +1,141 @@ +#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: + uint8_t positions_length; + float st_positions; + float * positions; + uint8_t velocities_length; + float st_velocities; + float * velocities; + uint8_t accelerations_length; + float st_accelerations; + float * accelerations; + uint8_t effort_length; + float st_effort; + float * effort; + ros::Duration time_from_start; + + JointTrajectoryPoint(): + positions_length(0), positions(NULL), + velocities_length(0), velocities(NULL), + accelerations_length(0), accelerations(NULL), + effort_length(0), effort(NULL), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->positions[i]); + } + *(outbuffer + offset++) = velocities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocities[i]); + } + *(outbuffer + offset++) = accelerations_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->accelerations[i]); + } + *(outbuffer + offset++) = effort_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t positions_lengthT = *(inbuffer + offset++); + if(positions_lengthT > positions_length) + this->positions = (float*)realloc(this->positions, positions_lengthT * sizeof(float)); + offset += 3; + positions_length = positions_lengthT; + for( uint8_t i = 0; i < positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_positions)); + memcpy( &(this->positions[i]), &(this->st_positions), sizeof(float)); + } + uint8_t velocities_lengthT = *(inbuffer + offset++); + if(velocities_lengthT > velocities_length) + this->velocities = (float*)realloc(this->velocities, velocities_lengthT * sizeof(float)); + offset += 3; + velocities_length = velocities_lengthT; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocities)); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(float)); + } + uint8_t accelerations_lengthT = *(inbuffer + offset++); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (float*)realloc(this->accelerations, accelerations_lengthT * sizeof(float)); + offset += 3; + accelerations_length = accelerations_lengthT; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_accelerations)); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(float)); + } + uint8_t effort_lengthT = *(inbuffer + offset++); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + offset += 3; + effort_length = effort_lengthT; + for( uint8_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; + } + + const char * getType(){ return "trajectory_msgs/JointTrajectoryPoint"; }; + const char * getMD5(){ return "f3cd1e1c4d320c79d6985c904ae5dcd3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/MultiDOFJointTrajectory.h b/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/MultiDOFJointTrajectory.h new file mode 100644 index 0000000..dcecf64 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/MultiDOFJointTrajectory.h @@ -0,0 +1,96 @@ +#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: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t points_length; + trajectory_msgs::MultiDOFJointTrajectoryPoint st_points; + trajectory_msgs::MultiDOFJointTrajectoryPoint * points; + + MultiDOFJointTrajectory(): + header(), + joint_names_length(0), joint_names(NULL), + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + 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*)); + } + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (trajectory_msgs::MultiDOFJointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + offset += 3; + points_length = points_lengthT; + for( uint8_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; + } + + const char * getType(){ return "trajectory_msgs/MultiDOFJointTrajectory"; }; + const char * getMD5(){ return "ef145a45a5f47b77b7f5cdde4b16c942"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/MultiDOFJointTrajectoryPoint.h b/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/MultiDOFJointTrajectoryPoint.h new file mode 100644 index 0000000..d665acd --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/trajectory_msgs/MultiDOFJointTrajectoryPoint.h @@ -0,0 +1,123 @@ +#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: + uint8_t transforms_length; + geometry_msgs::Transform st_transforms; + geometry_msgs::Transform * transforms; + uint8_t velocities_length; + geometry_msgs::Twist st_velocities; + geometry_msgs::Twist * velocities; + uint8_t accelerations_length; + geometry_msgs::Twist st_accelerations; + geometry_msgs::Twist * accelerations; + ros::Duration time_from_start; + + MultiDOFJointTrajectoryPoint(): + transforms_length(0), transforms(NULL), + velocities_length(0), velocities(NULL), + accelerations_length(0), accelerations(NULL), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = velocities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += this->velocities[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = accelerations_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_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)); + } + uint8_t velocities_lengthT = *(inbuffer + offset++); + if(velocities_lengthT > velocities_length) + this->velocities = (geometry_msgs::Twist*)realloc(this->velocities, velocities_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + velocities_length = velocities_lengthT; + for( uint8_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)); + } + uint8_t accelerations_lengthT = *(inbuffer + offset++); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (geometry_msgs::Twist*)realloc(this->accelerations, accelerations_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + accelerations_length = accelerations_lengthT; + for( uint8_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; + } + + const char * getType(){ return "trajectory_msgs/MultiDOFJointTrajectoryPoint"; }; + const char * getMD5(){ return "3ebe08d1abd5b65862d50e09430db776"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeAction.h b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeAction.h new file mode 100644 index 0000000..76a28dd --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeAction.h @@ -0,0 +1,53 @@ +#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: + turtle_actionlib::ShapeActionGoal action_goal; + turtle_actionlib::ShapeActionResult action_result; + turtle_actionlib::ShapeActionFeedback action_feedback; + + ShapeAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "turtle_actionlib/ShapeAction"; }; + const char * getMD5(){ return "d73b17d6237a925511f5d7727a1dc903"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionFeedback.h b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionFeedback.h new file mode 100644 index 0000000..f6186e3 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionFeedback.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + turtle_actionlib::ShapeFeedback feedback; + + ShapeActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionGoal.h b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionGoal.h new file mode 100644 index 0000000..1d205cc --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionGoal.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + turtle_actionlib::ShapeGoal goal; + + ShapeActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionGoal"; }; + const char * getMD5(){ return "dbfccd187f2ec9c593916447ffd6cc77"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionResult.h b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionResult.h new file mode 100644 index 0000000..e60375a --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeActionResult.h @@ -0,0 +1,53 @@ +#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: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + turtle_actionlib::ShapeResult result; + + ShapeActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionResult"; }; + const char * getMD5(){ return "c8d13d5d140f1047a2e4d3bf5c045822"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeFeedback.h b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeFeedback.h new file mode 100644 index 0000000..6c00c07 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/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 + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeGoal.h b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeGoal.h new file mode 100644 index 0000000..0e1f10d --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeGoal.h @@ -0,0 +1,84 @@ +#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: + int32_t edges; + float radius; + + ShapeGoal(): + edges(0), + radius(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "turtle_actionlib/ShapeGoal"; }; + const char * getMD5(){ return "3b9202ab7292cebe5a95ab2bf6b9c091"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeResult.h b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeResult.h new file mode 100644 index 0000000..164f65c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/ShapeResult.h @@ -0,0 +1,84 @@ +#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: + float interior_angle; + float apothem; + + ShapeResult(): + interior_angle(0), + apothem(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "turtle_actionlib/ShapeResult"; }; + const char * getMD5(){ return "b06c6e2225f820dbc644270387cd1a7c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/Velocity.h b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/Velocity.h new file mode 100644 index 0000000..5105eb3 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtle_actionlib/Velocity.h @@ -0,0 +1,84 @@ +#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: + float linear; + float angular; + + Velocity(): + linear(0), + angular(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "turtle_actionlib/Velocity"; }; + const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtlesim/Color.h b/libraries/Rosserial_Arduino_Library/src/turtlesim/Color.h new file mode 100644 index 0000000..90ed1fb --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtlesim/Color.h @@ -0,0 +1,56 @@ +#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: + uint8_t r; + uint8_t g; + uint8_t b; + + Color(): + r(0), + g(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "turtlesim/Color"; }; + const char * getMD5(){ return "353891e354491c51aabe32df673fb446"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtlesim/Kill.h b/libraries/Rosserial_Arduino_Library/src/turtlesim/Kill.h new file mode 100644 index 0000000..c7011bf --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtlesim/Kill.h @@ -0,0 +1,86 @@ +#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: + const char* name; + + KillRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return KILL; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class KillResponse : public ros::Msg + { + public: + + KillResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return KILL; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Kill { + public: + typedef KillRequest Request; + typedef KillResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/turtlesim/Pose.h b/libraries/Rosserial_Arduino_Library/src/turtlesim/Pose.h new file mode 100644 index 0000000..a0ab8d8 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtlesim/Pose.h @@ -0,0 +1,153 @@ +#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: + float x; + float y; + float theta; + float linear_velocity; + float angular_velocity; + + Pose(): + x(0), + y(0), + theta(0), + linear_velocity(0), + angular_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return "turtlesim/Pose"; }; + const char * getMD5(){ return "863b248d5016ca62ea2e895ae5265cf9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/turtlesim/SetPen.h b/libraries/Rosserial_Arduino_Library/src/turtlesim/SetPen.h new file mode 100644 index 0000000..0759f05 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtlesim/SetPen.h @@ -0,0 +1,100 @@ +#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: + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t width; + uint8_t off; + + SetPenRequest(): + r(0), + g(0), + b(0), + width(0), + off(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return SETPEN; }; + const char * getMD5(){ return "9f452acce566bf0c0954594f69a8e41b"; }; + + }; + + class SetPenResponse : public ros::Msg + { + public: + + SetPenResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETPEN; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetPen { + public: + typedef SetPenRequest Request; + typedef SetPenResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/turtlesim/Spawn.h b/libraries/Rosserial_Arduino_Library/src/turtlesim/Spawn.h new file mode 100644 index 0000000..416fa95 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtlesim/Spawn.h @@ -0,0 +1,171 @@ +#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: + float x; + float y; + float theta; + const char* name; + + SpawnRequest(): + x(0), + y(0), + theta(0), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + 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; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SPAWN; }; + const char * getMD5(){ return "57f001c49ab7b11d699f8606c1f4f7ff"; }; + + }; + + class SpawnResponse : public ros::Msg + { + public: + const char* name; + + SpawnResponse(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return SPAWN; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class Spawn { + public: + typedef SpawnRequest Request; + typedef SpawnResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/turtlesim/TeleportAbsolute.h b/libraries/Rosserial_Arduino_Library/src/turtlesim/TeleportAbsolute.h new file mode 100644 index 0000000..a75f19e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtlesim/TeleportAbsolute.h @@ -0,0 +1,139 @@ +#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: + float x; + float y; + float theta; + + TeleportAbsoluteRequest(): + x(0), + y(0), + theta(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return TELEPORTABSOLUTE; }; + const char * getMD5(){ return "a130bc60ee6513855dc62ea83fcc5b20"; }; + + }; + + class TeleportAbsoluteResponse : public ros::Msg + { + public: + + TeleportAbsoluteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TELEPORTABSOLUTE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportAbsolute { + public: + typedef TeleportAbsoluteRequest Request; + typedef TeleportAbsoluteResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/turtlesim/TeleportRelative.h b/libraries/Rosserial_Arduino_Library/src/turtlesim/TeleportRelative.h new file mode 100644 index 0000000..7df40d9 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/turtlesim/TeleportRelative.h @@ -0,0 +1,116 @@ +#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: + float linear; + float angular; + + TeleportRelativeRequest(): + linear(0), + angular(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + 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) + { + 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; + } + + const char * getType(){ return TELEPORTRELATIVE; }; + const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; + + }; + + class TeleportRelativeResponse : public ros::Msg + { + public: + + TeleportRelativeResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TELEPORTRELATIVE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportRelative { + public: + typedef TeleportRelativeRequest Request; + typedef TeleportRelativeResponse Response; + }; + +} +#endif diff --git a/libraries/Rosserial_Arduino_Library/src/visualization_msgs/ImageMarker.h b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/ImageMarker.h new file mode 100644 index 0000000..008ee8e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/ImageMarker.h @@ -0,0 +1,241 @@ +#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: + std_msgs::Header header; + const char* ns; + int32_t id; + int32_t type; + int32_t action; + geometry_msgs::Point position; + float scale; + std_msgs::ColorRGBA outline_color; + uint8_t filled; + std_msgs::ColorRGBA fill_color; + ros::Duration lifetime; + uint8_t points_length; + geometry_msgs::Point st_points; + geometry_msgs::Point * points; + uint8_t outline_colors_length; + std_msgs::ColorRGBA st_outline_colors; + std_msgs::ColorRGBA * 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), points(NULL), + outline_colors_length(0), outline_colors(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + memcpy(outbuffer + offset, &length_ns, sizeof(uint32_t)); + 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++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = outline_colors_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outline_colors_length; i++){ + offset += this->outline_colors[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + memcpy(&length_ns, (inbuffer + offset), sizeof(uint32_t)); + 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); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + points_length = points_lengthT; + for( uint8_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)); + } + uint8_t outline_colors_lengthT = *(inbuffer + offset++); + if(outline_colors_lengthT > outline_colors_length) + this->outline_colors = (std_msgs::ColorRGBA*)realloc(this->outline_colors, outline_colors_lengthT * sizeof(std_msgs::ColorRGBA)); + offset += 3; + outline_colors_length = outline_colors_lengthT; + for( uint8_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; + } + + const char * getType(){ return "visualization_msgs/ImageMarker"; }; + const char * getMD5(){ return "1de93c67ec8858b831025a08fbf1b35c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarker.h b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarker.h new file mode 100644 index 0000000..97f9510 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarker.h @@ -0,0 +1,145 @@ +#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: + std_msgs::Header header; + geometry_msgs::Pose pose; + const char* name; + const char* description; + float scale; + uint8_t menu_entries_length; + visualization_msgs::MenuEntry st_menu_entries; + visualization_msgs::MenuEntry * menu_entries; + uint8_t controls_length; + visualization_msgs::InteractiveMarkerControl st_controls; + visualization_msgs::InteractiveMarkerControl * controls; + + InteractiveMarker(): + header(), + pose(), + name(""), + description(""), + scale(0), + menu_entries_length(0), menu_entries(NULL), + controls_length(0), controls(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_description = strlen(this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + 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++) = menu_entries_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < menu_entries_length; i++){ + offset += this->menu_entries[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = controls_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < controls_length; i++){ + offset += this->controls[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + 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); + uint8_t menu_entries_lengthT = *(inbuffer + offset++); + if(menu_entries_lengthT > menu_entries_length) + this->menu_entries = (visualization_msgs::MenuEntry*)realloc(this->menu_entries, menu_entries_lengthT * sizeof(visualization_msgs::MenuEntry)); + offset += 3; + menu_entries_length = menu_entries_lengthT; + for( uint8_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)); + } + uint8_t controls_lengthT = *(inbuffer + offset++); + if(controls_lengthT > controls_length) + this->controls = (visualization_msgs::InteractiveMarkerControl*)realloc(this->controls, controls_lengthT * sizeof(visualization_msgs::InteractiveMarkerControl)); + offset += 3; + controls_length = controls_lengthT; + for( uint8_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; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarker"; }; + const char * getMD5(){ return "311bd5f6cd6a20820ac0ba84315f4e22"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerControl.h b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerControl.h new file mode 100644 index 0000000..1c2cef0 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerControl.h @@ -0,0 +1,155 @@ +#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: + const char* name; + geometry_msgs::Quaternion orientation; + uint8_t orientation_mode; + uint8_t interaction_mode; + bool always_visible; + uint8_t markers_length; + visualization_msgs::Marker st_markers; + visualization_msgs::Marker * markers; + bool independent_marker_orientation; + const char* 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), markers(NULL), + independent_marker_orientation(0), + description("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + 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++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_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); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_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; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerControl"; }; + const char * getMD5(){ return "e3a939c98cdd4f709d8e1dec2a9c3f37"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerFeedback.h b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerFeedback.h new file mode 100644 index 0000000..7cdd2c3 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerFeedback.h @@ -0,0 +1,142 @@ +#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: + std_msgs::Header header; + const char* client_id; + const char* marker_name; + const char* control_name; + uint8_t event_type; + geometry_msgs::Pose pose; + uint32_t menu_entry_id; + geometry_msgs::Point mouse_point; + bool 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 + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_client_id = strlen(this->client_id); + memcpy(outbuffer + offset, &length_client_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->client_id, length_client_id); + offset += length_client_id; + uint32_t length_marker_name = strlen(this->marker_name); + memcpy(outbuffer + offset, &length_marker_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->marker_name, length_marker_name); + offset += length_marker_name; + uint32_t length_control_name = strlen(this->control_name); + memcpy(outbuffer + offset, &length_control_name, sizeof(uint32_t)); + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_client_id; + memcpy(&length_client_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_marker_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_control_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerFeedback"; }; + const char * getMD5(){ return "ab0f1eee058667e28c19ff3ffc3f4b78"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerInit.h b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerInit.h new file mode 100644 index 0000000..656df9e --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerInit.h @@ -0,0 +1,98 @@ +#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: + const char* server_id; + uint64_t seq_num; + uint8_t markers_length; + visualization_msgs::InteractiveMarker st_markers; + visualization_msgs::InteractiveMarker * markers; + + InteractiveMarkerInit(): + server_id(""), + seq_num(0), + markers_length(0), markers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_server_id = strlen(this->server_id); + memcpy(outbuffer + offset, &length_server_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.real = this->seq_num; + *(outbuffer + offset + 0) = (u_seq_num.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_seq_num.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_seq_num.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_seq_num.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_server_id; + memcpy(&length_server_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.base = 0; + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num = u_seq_num.real; + offset += sizeof(this->seq_num); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_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; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerInit"; }; + const char * getMD5(){ return "aa2f1dcea79533d1710675195653028d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerPose.h b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerPose.h new file mode 100644 index 0000000..b94dc8f --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerPose.h @@ -0,0 +1,64 @@ +#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: + std_msgs::Header header; + geometry_msgs::Pose pose; + const char* name; + + InteractiveMarkerPose(): + header(), + pose(), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerPose"; }; + const char * getMD5(){ return "a6e6833209a196a38d798dadb02c81f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerUpdate.h b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerUpdate.h new file mode 100644 index 0000000..d24ea0c --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/InteractiveMarkerUpdate.h @@ -0,0 +1,159 @@ +#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: + const char* server_id; + uint64_t seq_num; + uint8_t type; + uint8_t markers_length; + visualization_msgs::InteractiveMarker st_markers; + visualization_msgs::InteractiveMarker * markers; + uint8_t poses_length; + visualization_msgs::InteractiveMarkerPose st_poses; + visualization_msgs::InteractiveMarkerPose * poses; + uint8_t erases_length; + char* st_erases; + char* * erases; + enum { KEEP_ALIVE = 0 }; + enum { UPDATE = 1 }; + + InteractiveMarkerUpdate(): + server_id(""), + seq_num(0), + type(0), + markers_length(0), markers(NULL), + poses_length(0), poses(NULL), + erases_length(0), erases(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_server_id = strlen(this->server_id); + memcpy(outbuffer + offset, &length_server_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.real = this->seq_num; + *(outbuffer + offset + 0) = (u_seq_num.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_seq_num.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_seq_num.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_seq_num.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = erases_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < erases_length; i++){ + uint32_t length_erasesi = strlen(this->erases[i]); + memcpy(outbuffer + offset, &length_erasesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->erases[i], length_erasesi); + offset += length_erasesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_server_id; + memcpy(&length_server_id, (inbuffer + offset), sizeof(uint32_t)); + 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; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.base = 0; + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num = u_seq_num.real; + offset += sizeof(this->seq_num); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_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)); + } + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (visualization_msgs::InteractiveMarkerPose*)realloc(this->poses, poses_lengthT * sizeof(visualization_msgs::InteractiveMarkerPose)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_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)); + } + uint8_t erases_lengthT = *(inbuffer + offset++); + if(erases_lengthT > erases_length) + this->erases = (char**)realloc(this->erases, erases_lengthT * sizeof(char*)); + offset += 3; + erases_length = erases_lengthT; + for( uint8_t i = 0; i < erases_length; i++){ + uint32_t length_st_erases; + memcpy(&length_st_erases, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerUpdate"; }; + const char * getMD5(){ return "83e22f99d3b31fde725e0a338200e036"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/visualization_msgs/Marker.h b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/Marker.h new file mode 100644 index 0000000..2219629 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/Marker.h @@ -0,0 +1,288 @@ +#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: + std_msgs::Header header; + const char* ns; + int32_t id; + int32_t type; + int32_t action; + geometry_msgs::Pose pose; + geometry_msgs::Vector3 scale; + std_msgs::ColorRGBA color; + ros::Duration lifetime; + bool frame_locked; + uint8_t points_length; + geometry_msgs::Point st_points; + geometry_msgs::Point * points; + uint8_t colors_length; + std_msgs::ColorRGBA st_colors; + std_msgs::ColorRGBA * colors; + const char* text; + const char* mesh_resource; + bool 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 }; + + Marker(): + header(), + ns(""), + id(0), + type(0), + action(0), + pose(), + scale(), + color(), + lifetime(), + frame_locked(0), + points_length(0), points(NULL), + colors_length(0), colors(NULL), + text(""), + mesh_resource(""), + mesh_use_embedded_materials(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + memcpy(outbuffer + offset, &length_ns, sizeof(uint32_t)); + 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++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = colors_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < colors_length; i++){ + offset += this->colors[i].serialize(outbuffer + offset); + } + uint32_t length_text = strlen(this->text); + memcpy(outbuffer + offset, &length_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + uint32_t length_mesh_resource = strlen(this->mesh_resource); + memcpy(outbuffer + offset, &length_mesh_resource, sizeof(uint32_t)); + 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) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + memcpy(&length_ns, (inbuffer + offset), sizeof(uint32_t)); + 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); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + points_length = points_lengthT; + for( uint8_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)); + } + uint8_t colors_lengthT = *(inbuffer + offset++); + if(colors_lengthT > colors_length) + this->colors = (std_msgs::ColorRGBA*)realloc(this->colors, colors_lengthT * sizeof(std_msgs::ColorRGBA)); + offset += 3; + colors_length = colors_lengthT; + for( uint8_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; + memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_mesh_resource, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "visualization_msgs/Marker"; }; + const char * getMD5(){ return "18326976df9d29249efc939e00342cde"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/visualization_msgs/MarkerArray.h b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/MarkerArray.h new file mode 100644 index 0000000..97e32df --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/MarkerArray.h @@ -0,0 +1,59 @@ +#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: + uint8_t markers_length; + visualization_msgs::Marker st_markers; + visualization_msgs::Marker * markers; + + MarkerArray(): + markers_length(0), markers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_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; + } + + const char * getType(){ return "visualization_msgs/MarkerArray"; }; + const char * getMD5(){ return "90da67007c26525f655c1c269094e39f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/Rosserial_Arduino_Library/src/visualization_msgs/MenuEntry.h b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/MenuEntry.h new file mode 100644 index 0000000..8ba43e8 --- /dev/null +++ b/libraries/Rosserial_Arduino_Library/src/visualization_msgs/MenuEntry.h @@ -0,0 +1,103 @@ +#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: + uint32_t id; + uint32_t parent_id; + const char* title; + const char* command; + uint8_t 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 + { + 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); + memcpy(outbuffer + offset, &length_title, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->title, length_title); + offset += length_title; + uint32_t length_command = strlen(this->command); + memcpy(outbuffer + offset, &length_command, sizeof(uint32_t)); + 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) + { + 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; + memcpy(&length_title, (inbuffer + offset), sizeof(uint32_t)); + 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; + memcpy(&length_command, (inbuffer + offset), sizeof(uint32_t)); + 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; + } + + const char * getType(){ return "visualization_msgs/MenuEntry"; }; + const char * getMD5(){ return "b90ec63024573de83b57aa93eb39be2d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/libraries/readme.txt b/libraries/readme.txt new file mode 100644 index 0000000..ff3e453 --- /dev/null +++ b/libraries/readme.txt @@ -0,0 +1 @@ +安装库的详细信息,请参阅:http://www.arduino.cc/en/Guide/Libraries diff --git a/舵机/sketch_jun16b.ino b/舵机/sketch_jun16b.ino new file mode 100644 index 0000000..9072e87 --- /dev/null +++ b/舵机/sketch_jun16b.ino @@ -0,0 +1,185 @@ +#include +#include +#include "std_msgs/String.h" +#include "std_msgs/UInt8.h" +#include "std_msgs/Bool.h" + +#define SERVO_PIN_1 3 +#define SERVO_PIN_2 6 +#define SERVO_PIN_3 9 +#define SERVO_PIN_4 10 +#define SERVO_DEFAULT 90 + +// 普通舵机:OPEN=0, CLOSE=90 +#define SERVO_OPEN 0 +#define SERVO_CLOSE 90 + +// 舵机2反向:OPEN=90, CLOSE=0 +#define SERVO_OPEN_2 180 +#define SERVO_CLOSE_2 90 + +// ============================================ +// 舵机任务类(非阻塞状态机,自带完美运行态防抖) +// ============================================ +class ServoTask { +public: + enum State { IDLE, OPENING, WAIT_OPEN, CLOSING, WAIT_CLOSE }; + + ServoTask() : state_(IDLE), startTime_(0), active_(false), completed_(false), reversed_(false) {} + + void attach(int pin) { servo_.attach(pin); } + + // 🌟 设置是否反向 + void setReversed(bool rev) { reversed_ = rev; } + + void trigger() { + if (active_) return; + active_ = true; + completed_ = false; + state_ = OPENING; + } + + void setImmediate(int angle) { + active_ = false; + completed_ = false; + state_ = IDLE; + servo_.write(angle); + } + + bool checkAndClearCompleted() { + if (completed_) { + completed_ = false; + return true; + } + return false; + } + + void update() { + if (!active_) return; + + unsigned long now = millis(); + switch (state_) { + case OPENING: + // 🌟 根据是否反向选择 OPEN 角度 + servo_.write(reversed_ ? SERVO_OPEN_2 : SERVO_OPEN); + state_ = WAIT_OPEN; + startTime_ = now; + break; + + case WAIT_OPEN: + if (now - startTime_ >= 1000) state_ = CLOSING; + break; + + case CLOSING: + // 🌟 根据是否反向选择 CLOSE 角度 + servo_.write(reversed_ ? SERVO_CLOSE_2 : SERVO_CLOSE); + state_ = WAIT_CLOSE; + startTime_ = now; + break; + + case WAIT_CLOSE: + if (now - startTime_ >= 1000) { + state_ = IDLE; + active_ = false; + completed_ = true; + } + break; + + default: break; + } + } + +private: + Servo servo_; + State state_; + unsigned long startTime_; + bool active_; + bool completed_; + bool reversed_; // 🌟 是否反向 +}; + +// ============================================ +// 全局对象与ROS通信 +// ============================================ +ros::NodeHandle nh; + +ServoTask task1, task2, task3, task4; +ServoTask* tasks[4] = {&task1, &task2, &task3, &task4}; + +std_msgs::Bool dropStatusMsg; +std_msgs::UInt8 dropDoneMsg; + +ros::Publisher pubDropStatus("/payload_drop_status", &dropStatusMsg); +ros::Publisher pubDropDone("/payload_drop_done", &dropDoneMsg); + +// ============================================ +// 执行投放掩码 +// ============================================ +void executeDrop(uint8_t servoMask) { + for (int i = 0; i < 4; i++) { + if (servoMask & (1 << i)) tasks[i]->trigger(); + } +} + +// ============================================ +// 回调核心:去掉了外部延时锁,指令立刻响应 +// ============================================ +void stringCallback(const std_msgs::String& msg) { + String cmd = msg.data; + + if (cmd == "servo_1") executeDrop(0x01); + else if (cmd == "servo_2") executeDrop(0x02); + else if (cmd == "servo_3") executeDrop(0x04); + else if (cmd == "servo_4") executeDrop(0x08); + else if (cmd == "servo_12") executeDrop(0x03); + else if (cmd == "servo_34") executeDrop(0x0C); + else if (cmd == "servo_1234") executeDrop(0x0F); + + // 强行中断并复位 + else if (cmd == "servo_1234_0") for (int i=0; i<4; i++) tasks[i]->setImmediate(SERVO_OPEN); + else if (cmd == "servo_1234_1") for (int i=0; i<4; i++) tasks[i]->setImmediate(SERVO_CLOSE); + else if (cmd == "servo_reset") for (int i=0; i<4; i++) tasks[i]->setImmediate(SERVO_DEFAULT); +} + +ros::Subscriber subTest("/arduino_ros", &stringCallback); +ros::Subscriber subVision("/payload_drop_cmd", &stringCallback); + +// ============================================ +// Arduino 主循环 +// ============================================ +void setup() { + task1.attach(SERVO_PIN_1); + task2.attach(SERVO_PIN_2); + task3.attach(SERVO_PIN_3); + task4.attach(SERVO_PIN_4); + + // 🌟 设置舵机2反向 + task2.setReversed(true); + task4.setReversed(true); + + for (int i = 0; i < 4; i++) tasks[i]->setImmediate(SERVO_DEFAULT); + + nh.initNode(); + nh.advertise(pubDropStatus); + nh.advertise(pubDropDone); + nh.subscribe(subTest); + nh.subscribe(subVision); +} + +void loop() { + // 1. 更新每个舵机的动作状态 + for (int i = 0; i < 4; i++) { + tasks[i]->update(); + + // 2. 如果动作刚刚完成,发送 ROS 提醒 + if (tasks[i]->checkAndClearCompleted()) { + dropStatusMsg.data = true; + pubDropStatus.publish(&dropStatusMsg); + dropDoneMsg.data = i + 1; + pubDropDone.publish(&dropDoneMsg); + } + } + + nh.spinOnce(); + delay(10); +}