├── msg ├── DesiredPitch.msg ├── DesiredRoll.msg ├── DesiredHeading.msg ├── DesiredHeadingRate.msg ├── PolygonVertex.msg ├── RemoteState.msg ├── PlanManeuver.msg ├── PlanDBState.msg ├── DesiredZ.msg ├── DesiredSpeed.msg ├── PlanDBInformation.msg ├── PlanControl.msg ├── PlanSpecification.msg ├── PlanControlState.msg ├── SonarData.msg ├── VehicleState.msg ├── EstimatedState.msg ├── PlanDB.msg └── Maneuver.msg ├── vehicles-defs ├── lolo.png ├── sam.png └── defaults │ ├── 04-adamastor-vehicle-lsts.nvcl │ ├── 30-folaga.nvcl │ └── 04-squirtle-vehicle-lsts.nvcl ├── docs └── figures │ ├── image_1.png │ ├── image_2.png │ ├── image_3.png │ ├── image_4.png │ ├── image_5.png │ ├── image_6.png │ ├── image_7.png │ ├── image_8.png │ ├── image_9.png │ ├── image_10.png │ └── image_11.png ├── .github └── workflows │ ├── main.yml │ ├── test-release.yml │ └── release.yml ├── launch ├── bridge_sam.launch └── bridge.launch ├── src ├── imc_to_ros │ ├── Abort.cpp │ ├── Heartbeat.cpp │ ├── Goto.cpp │ └── PlanControl.cpp └── ros_to_imc │ ├── Heartbeat.cpp │ ├── DesiredRoll.cpp │ ├── DesiredPitch.cpp │ ├── DesiredHeading.cpp │ ├── DesiredHeadingRate.cpp │ ├── DesiredZ.cpp │ ├── DesiredSpeed.cpp │ ├── Goto.cpp │ ├── GpsNavData.cpp │ ├── GpsFix.cpp │ ├── RemoteState.cpp │ ├── PlanControlState.cpp │ ├── SonarData.cpp │ ├── VehicleState.cpp │ └── EstimatedState.cpp ├── LICENSE ├── include ├── imc_ros_bridge │ ├── imc_to_ros │ │ ├── Abort.h │ │ ├── Goto.h │ │ ├── Heartbeat.h │ │ ├── PlanControl.h │ │ └── PlanDB.h │ ├── ros_to_imc │ │ ├── Goto.h │ │ ├── GpsFix.h │ │ ├── DesiredZ.h │ │ ├── Heartbeat.h │ │ ├── GpsNavData.h │ │ ├── SonarData.h │ │ ├── DesiredRoll.h │ │ ├── RemoteState.h │ │ ├── DesiredPitch.h │ │ ├── DesiredSpeed.h │ │ ├── VehicleState.h │ │ ├── PlanDB.h │ │ ├── DesiredHeading.h │ │ ├── PlanControlState.h │ │ ├── DesiredHeadingRate.h │ │ └── EstimatedState.h │ └── imc_ros_bridge_server.h ├── imc_tcp_link │ └── imc_handle.h └── imc_udp_link │ └── udp_link.h ├── external ├── imc-cxx │ └── IMC │ │ ├── Spec │ │ ├── Maneuver.hpp │ │ ├── RemoteData.hpp │ │ ├── ControlCommand.hpp │ │ ├── Header.hpp │ │ ├── Constants.hpp │ │ ├── Bitfields.hpp │ │ ├── Abort.hpp │ │ ├── Pulse.hpp │ │ ├── Aborted.hpp │ │ ├── Heartbeat.hpp │ │ ├── Enumerations.hpp │ │ ├── StopManeuver.hpp │ │ ├── RestartSystem.hpp │ │ ├── QueryEntityState.hpp │ │ ├── GetParametersXml.hpp │ │ ├── ImageTracking.hpp │ │ ├── TeleoperationDone.hpp │ │ ├── AcousticSystemsQuery.hpp │ │ ├── GetOperationalLimits.hpp │ │ ├── QueryPowerChannelState.hpp │ │ └── QueryEntityActivationState.hpp │ │ └── Base │ │ ├── Config.hpp │ │ ├── Factory.hpp │ │ ├── Exceptions.hpp │ │ ├── Platform.hpp │ │ ├── Clock.hpp │ │ ├── String.hpp │ │ └── ByteBuffer.hpp └── md5 │ └── md5.h └── package.xml /msg/DesiredPitch.msg: -------------------------------------------------------------------------------- 1 | float64 value -------------------------------------------------------------------------------- /msg/DesiredRoll.msg: -------------------------------------------------------------------------------- 1 | float64 value -------------------------------------------------------------------------------- /msg/DesiredHeading.msg: -------------------------------------------------------------------------------- 1 | float64 value -------------------------------------------------------------------------------- /msg/DesiredHeadingRate.msg: -------------------------------------------------------------------------------- 1 | float64 value -------------------------------------------------------------------------------- /msg/PolygonVertex.msg: -------------------------------------------------------------------------------- 1 | float64 lat 2 | float64 lon 3 | -------------------------------------------------------------------------------- /msg/RemoteState.msg: -------------------------------------------------------------------------------- 1 | float32 lat 2 | float32 lon 3 | uint8 depth 4 | float32 speed 5 | float32 psi -------------------------------------------------------------------------------- /vehicles-defs/lolo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/vehicles-defs/lolo.png -------------------------------------------------------------------------------- /vehicles-defs/sam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/vehicles-defs/sam.png -------------------------------------------------------------------------------- /docs/figures/image_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_1.png -------------------------------------------------------------------------------- /docs/figures/image_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_2.png -------------------------------------------------------------------------------- /docs/figures/image_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_3.png -------------------------------------------------------------------------------- /docs/figures/image_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_4.png -------------------------------------------------------------------------------- /docs/figures/image_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_5.png -------------------------------------------------------------------------------- /docs/figures/image_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_6.png -------------------------------------------------------------------------------- /docs/figures/image_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_7.png -------------------------------------------------------------------------------- /docs/figures/image_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_8.png -------------------------------------------------------------------------------- /docs/figures/image_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_9.png -------------------------------------------------------------------------------- /docs/figures/image_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_10.png -------------------------------------------------------------------------------- /docs/figures/image_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smarc-project/imc_ros_bridge/HEAD/docs/figures/image_11.png -------------------------------------------------------------------------------- /msg/PlanManeuver.msg: -------------------------------------------------------------------------------- 1 | string maneuver_id 2 | # Originally InlineMessage 3 | Maneuver maneuver 4 | 5 | # not implemented 6 | # start_actions 7 | # end_actions 8 | -------------------------------------------------------------------------------- /msg/PlanDBState.msg: -------------------------------------------------------------------------------- 1 | uint16 plan_count 2 | uint32 plan_size 3 | float64 change_time 4 | uint16 change_sid 5 | string change_sname 6 | uint8[] md5 7 | PlanDBInformation[] plans_info 8 | -------------------------------------------------------------------------------- /msg/DesiredZ.msg: -------------------------------------------------------------------------------- 1 | # Z Units. 2 | # None. 3 | uint8 Z_NONE = 0 4 | # Depth. 5 | uint8 Z_DEPTH = 1 6 | # Altitude. 7 | uint8 Z_ALTITUDE = 2 8 | # Height. 9 | uint8 Z_HEIGHT = 3 10 | 11 | float64 value 12 | uint8 z_units -------------------------------------------------------------------------------- /msg/DesiredSpeed.msg: -------------------------------------------------------------------------------- 1 | # Speed Units. 2 | # Meters per second. 3 | uint8 SUNITS_METERS_PS = 0 4 | # RPM. 5 | uint8 SUNITS_RPM = 1 6 | # Percentage. 7 | uint8 SUNITS_PERCENTAGE = 2 8 | 9 | float64 value 10 | uint8 speed_units -------------------------------------------------------------------------------- /msg/PlanDBInformation.msg: -------------------------------------------------------------------------------- 1 | # def. needed 2 | string plan_id 3 | 4 | # not really needed 5 | uint16 plan_size 6 | float64 change_time 7 | uint16 change_sid 8 | string change_sname 9 | 10 | # this is the only thing we actually use really. 11 | uint8[] md5 12 | -------------------------------------------------------------------------------- /msg/PlanControl.msg: -------------------------------------------------------------------------------- 1 | # IMC PlanControl message in ROS form. 2 | 3 | 4 | 5 | # enums 6 | uint8 type #0,1,2,3 -> request, success, failure, in progress 7 | uint8 op # 0,1,2,3 -> start, stop, load, get 8 | 9 | # fields 10 | uint16 request_id 11 | string plan_id 12 | uint16 flags 13 | string info 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /msg/PlanSpecification.msg: -------------------------------------------------------------------------------- 1 | string plan_id 2 | string description 3 | string vnamespace 4 | string start_man_id 5 | 6 | # This is a MessageList in IMC Spec. 7 | PlanManeuver[] maneuvers 8 | 9 | # Not Implemented yet. 10 | # PlanVariable[] variables 11 | # PlanTransition[] transitions 12 | # start_actions 13 | # end_actions 14 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | industrial_ci: 7 | strategy: 8 | matrix: 9 | env: 10 | - {ROS_DISTRO: noetic, ROS_REPO: testing} 11 | - {ROS_DISTRO: noetic, ROS_REPO: main} 12 | - {ROS_DISTRO: melodic, ROS_REPO: main} 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v1 16 | - uses: 'ros-industrial/industrial_ci@master' 17 | env: ${{matrix.env}} 18 | -------------------------------------------------------------------------------- /msg/PlanControlState.msg: -------------------------------------------------------------------------------- 1 | # IMC PlanControlState message in ROS form. 2 | 3 | uint8 state 4 | # state enums 5 | uint8 BLOCKED = 0 6 | uint8 READY = 1 7 | uint8 INITIALIZING = 2 8 | uint8 EXECUTING = 3 9 | 10 | 11 | string plan_id 12 | int32 plan_eta 13 | # percent 14 | float32 plan_progress 15 | 16 | string man_id 17 | uint16 man_type 18 | int32 man_eta 19 | 20 | 21 | uint8 last_outcome 22 | # last outcome enums 23 | uint8 NONE = 0 24 | uint8 SUCCESS = 1 25 | uint8 FAILURE = 2 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /.github/workflows/test-release.yml: -------------------------------------------------------------------------------- 1 | name: release-CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test-release-job: 7 | strategy: 8 | matrix: 9 | include: 10 | #- distro: melodic 11 | # ubuntu: bionic 12 | - distro: noetic 13 | ubuntu: focal 14 | runs-on: ubuntu-latest 15 | name: Test building a ROS debian release 16 | steps: 17 | - uses: actions/checkout@v2 18 | - name: Run the release build 19 | uses: smarc-project/test-ros-release-action@v2.0.1 20 | with: 21 | ubuntu: ${{ matrix.ubuntu }} 22 | distro: ${{ matrix.distro }} 23 | -------------------------------------------------------------------------------- /msg/SonarData.msg: -------------------------------------------------------------------------------- 1 | # IMC SonarData message in ROS form. 2 | 3 | 4 | uint8 ST_SIDESCAN = 0 # Sidescan. 5 | uint8 ST_ECHOSOUNDER = 1 # Echo Sounder. 6 | uint8 ST_MULTIBEAM = 2 # Multibeam. 7 | 8 | uint8 type # Type. 9 | uint32 frequency # Frequency. 10 | uint16 min_range # Minimum Range. 11 | uint16 max_range # Maximum Range. 12 | uint8 bits_per_point # Bits Per Data Point. 13 | float32 scale_factor # Scaling Factor. 14 | # TODO add beamconfig 15 | uint8[] data # Data. first half of vector is left side, other half is right side of side scan 16 | 17 | #MessageList beam_config # Beam Configuration. 18 | -------------------------------------------------------------------------------- /msg/VehicleState.msg: -------------------------------------------------------------------------------- 1 | # IMC VehicleState message in ROS form. 2 | 3 | 4 | #enums 5 | # op mode 6 | uint8 SERVICE = 0 7 | uint8 CALIBRATION = 1 8 | uint8 ERROR = 2 9 | uint8 MANEUVER = 3 10 | uint8 EXTERNAL = 4 11 | uint8 BOOT = 5 12 | 13 | 14 | # fields 15 | uint8 op_mode # Operation Mode. 16 | uint8 error_count # Errors -- Count. 17 | string error_ents # Errors -- Entities. 18 | uint16 maneuver_type # Maneuver -- Type. 19 | float64 maneuver_stime # Maneuver -- Start Time. 20 | uint16 maneuver_eta # Maneuver -- ETA. 21 | uint32 control_loops # Control Loops. 22 | uint8 flags # Flags. 23 | string last_error # Last Error -- Description. 24 | float64 last_error_time # Last Error -- Time. 25 | -------------------------------------------------------------------------------- /msg/EstimatedState.msg: -------------------------------------------------------------------------------- 1 | # Latitude (WGS-84). 2 | float64 lat 3 | # Longitude (WGS-84). 4 | float64 lon 5 | # Height (WGS-84). 6 | float32 height 7 | # Offset north. 8 | float32 x 9 | # Offset east. 10 | float32 y 11 | # Offset down. 12 | float32 z 13 | # Rotation over x axis. 14 | float32 phi 15 | # Rotation over y axis. 16 | float32 theta 17 | # Rotation over z axis. 18 | float32 psi 19 | # Body-Fixed xx Velocity. 20 | float32 u 21 | # Body-Fixed yy Velocity. 22 | float32 v 23 | # Body-Fixed zz Velocity. 24 | float32 w 25 | # Ground Velocity X (North). 26 | float32 vx 27 | # Ground Velocity Y (East). 28 | float32 vy 29 | # Ground Velocity Z (Down). 30 | float32 vz 31 | # Angular Velocity in x. 32 | float32 p 33 | # Angular Velocity in y. 34 | float32 q 35 | # Angular Velocity in z. 36 | float32 r 37 | # Depth. 38 | float32 depth 39 | # Altitude. 40 | float32 alt -------------------------------------------------------------------------------- /msg/PlanDB.msg: -------------------------------------------------------------------------------- 1 | # Type enums 2 | uint8 REQUEST = 0 3 | uint8 SUCCESS = 1 4 | uint8 FAILURE = 2 5 | uint8 IN_PROGESS = 3 6 | 7 | # Operation enums 8 | uint8 SET = 0 9 | uint8 DEL = 1 10 | uint8 GET = 2 11 | uint8 GET_INFO = 3 12 | uint8 CLEAR = 4 13 | uint8 GET_STATE = 5 14 | uint8 GET_DSTATE = 6 15 | uint8 BOOT = 7 16 | 17 | uint8 type 18 | uint8 op 19 | uint16 request_id 20 | string plan_id 21 | 22 | # this part is special made for just waypoint type plan_dbs. ill handle other types later. 23 | # this is the Message arg in the original 24 | PlanSpecification plan_spec 25 | uint8[] plan_spec_md5 26 | # might be other types of fields that come into 'arg'. In IMC, this arg is a "message" type, so who knows what it can become... 27 | # Apparently, arg can also be a PlanDBInformation message. 28 | PlanDBInformation plandb_information 29 | PlanDBState plandb_state 30 | 31 | 32 | -------------------------------------------------------------------------------- /launch/bridge_sam.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /msg/Maneuver.msg: -------------------------------------------------------------------------------- 1 | # Z Units. 2 | # None. 3 | uint8 Z_NONE = 0 4 | # Depth. 5 | uint8 Z_DEPTH = 1 6 | # Altitude. 7 | uint8 Z_ALTITUDE = 2 8 | # Height. 9 | uint8 Z_HEIGHT = 3 10 | 11 | # Speed Units. 12 | # Meters per second. 13 | uint8 SUNITS_METERS_PS = 0 14 | # RPM. 15 | uint8 SUNITS_RPM = 1 16 | # Percentage. 17 | uint8 SUNITS_PERCENTAGE = 2 18 | 19 | # many IMC maneuvers should fit in this message 20 | # and we should just decide what to do with the data 21 | # depending on the maneuver name or id 22 | # i will take the IMC/Spec/Goto maneuver as my basis 23 | string maneuver_name 24 | uint16 maneuver_imc_id 25 | 26 | # 450 GOTO 27 | float64 lat 28 | float64 lon 29 | float32 z 30 | uint8 z_units 31 | float32 speed 32 | uint8 speed_units 33 | 34 | float32 roll 35 | float32 pitch 36 | float32 yaw 37 | 38 | uint16 timeout 39 | string custom_string 40 | 41 | # 489 SAMPLE that are not in GOTO 42 | uint8 syringe0 43 | uint8 syringe1 44 | uint8 syringe2 45 | 46 | # 473 COVER_AREA that are not in GOTO 47 | PolygonVertex[] polygon 48 | 49 | 50 | -------------------------------------------------------------------------------- /launch/bridge.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/imc_to_ros/Abort.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace imc_to_ros { 17 | 18 | template <> 19 | bool convert(const IMC::Abort& imc_msg, std_msgs::Empty& ros_msg) 20 | { 21 | return true; 22 | } 23 | 24 | } // namespace imc_to_ros 25 | -------------------------------------------------------------------------------- /src/imc_to_ros/Heartbeat.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace imc_to_ros { 17 | 18 | template <> 19 | bool convert(const IMC::Heartbeat& imc_msg, std_msgs::Empty& ros_msg) 20 | { 21 | return true; 22 | } 23 | 24 | } // namespace imc_to_ros 25 | -------------------------------------------------------------------------------- /src/ros_to_imc/Heartbeat.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const std_msgs::Empty& ros_msg, IMC::Heartbeat& imc_msg) 20 | { 21 | return true; 22 | } 23 | 24 | } // namespace ros_to_imc 25 | -------------------------------------------------------------------------------- /src/ros_to_imc/DesiredRoll.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const imc_ros_bridge::DesiredRoll& ros_msg, IMC::DesiredRoll& imc_msg) 20 | { 21 | imc_msg.value = ros_msg.value; 22 | return true; 23 | } 24 | 25 | } // namespace imc_to_ros 26 | -------------------------------------------------------------------------------- /src/ros_to_imc/DesiredPitch.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const imc_ros_bridge::DesiredPitch& ros_msg, IMC::DesiredPitch& imc_msg) 20 | { 21 | imc_msg.value = ros_msg.value; 22 | return true; 23 | } 24 | 25 | } // namespace imc_to_ros 26 | -------------------------------------------------------------------------------- /src/ros_to_imc/DesiredHeading.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const imc_ros_bridge::DesiredHeading& ros_msg, IMC::DesiredHeading& imc_msg) 20 | { 21 | imc_msg.value = ros_msg.value; 22 | return true; 23 | } 24 | 25 | } // namespace imc_to_ros 26 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release-deb 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | 8 | jobs: 9 | release_build: 10 | strategy: 11 | matrix: 12 | include: 13 | - distro: melodic 14 | ubuntu: bionic 15 | bloom: python-bloom 16 | - distro: noetic 17 | ubuntu: focal 18 | bloom: python3-bloom 19 | runs-on: ubuntu-latest 20 | container: 21 | image: rostooling/setup-ros-docker:ubuntu-${{ matrix.ubuntu }}-ros-${{ matrix.distro }}-ros-base-latest 22 | steps: 23 | - uses: actions/checkout@v2 24 | with: 25 | path: '.' 26 | - name: Setup environment 27 | run: | 28 | sudo apt update 29 | rosdep update 30 | - name: Install deps 31 | run: | 32 | ls 33 | rosdep install --from-path . --ignore-src --rosdistro ${{ matrix.distro }} -y 34 | sudo apt install -y ${{ matrix.bloom }} fakeroot dpkg-dev debhelper zip 35 | - name: Build package 36 | run: | 37 | ls 38 | bloom-release --version 39 | bloom-generate rosdebian --os-name ubuntu --os-version ${{ matrix.ubuntu }} --ros-distro ${{ matrix.distro }} 40 | fakeroot debian/rules binary 41 | mv ../ros-${{ matrix.distro }}-*.deb . 42 | zip bloom-${{ matrix.distro }}-release-deb.zip ros-${{ matrix.distro }}-*.deb 43 | ls 44 | - name: Upload binaries to release 45 | uses: svenstaro/upload-release-action@v2 46 | with: 47 | repo_token: ${{ secrets.GITHUB_TOKEN }} 48 | file: ./bloom-${{ matrix.distro }}-release-deb.zip 49 | asset_name: bloom-${{ matrix.distro }}-release-deb.zip 50 | tag: ${{ github.ref }} 51 | overwrite: true 52 | body: "Debian release generated using bloom" 53 | -------------------------------------------------------------------------------- /src/ros_to_imc/DesiredHeadingRate.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const imc_ros_bridge::DesiredHeadingRate& ros_msg, IMC::DesiredHeadingRate& imc_msg) 20 | { 21 | imc_msg.value = ros_msg.value; 22 | return true; 23 | } 24 | 25 | } // namespace imc_to_ros 26 | -------------------------------------------------------------------------------- /src/ros_to_imc/DesiredZ.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const imc_ros_bridge::DesiredZ& ros_msg, IMC::DesiredZ& imc_msg) 20 | { 21 | imc_msg.value = ros_msg.value; 22 | imc_msg.z_units = ros_msg.z_units; 23 | return true; 24 | } 25 | 26 | } // namespace imc_to_ros 27 | -------------------------------------------------------------------------------- /src/ros_to_imc/DesiredSpeed.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const imc_ros_bridge::DesiredSpeed& ros_msg, IMC::DesiredSpeed& imc_msg) 20 | { 21 | imc_msg.value = ros_msg.value; 22 | imc_msg.speed_units = ros_msg.speed_units; 23 | return true; 24 | } 25 | 26 | } // namespace imc_to_ros 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2019, The SMaRC project (https://smarc.se/) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | Included Dependencies 32 | ===================== 33 | 34 | The external/imc-cxx folder contains https://github.com/oceanscan/imc-cxx as 35 | a subtree. The package is licensed as Apache License, Version 2.0. 36 | Credit: Copyright 2017 OceanScan - Marine Systems & Technology, Lda . 37 | -------------------------------------------------------------------------------- /src/imc_to_ros/Goto.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace imc_to_ros { 17 | 18 | template <> 19 | bool convert(const IMC::Goto& imc_msg, geometry_msgs::Pose& ros_msg) 20 | { 21 | ros_msg.position.x = imc_msg.lon; 22 | ros_msg.position.y = imc_msg.lat; 23 | ros_msg.position.z = imc_msg.z; 24 | return true; 25 | } 26 | 27 | } // namespace imc_to_ros 28 | -------------------------------------------------------------------------------- /src/ros_to_imc/Goto.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const geometry_msgs::Pose& ros_msg, IMC::Goto& imc_msg) 20 | { 21 | imc_msg.lon = ros_msg.position.x; 22 | imc_msg.lat = ros_msg.position.y; 23 | imc_msg.z = ros_msg.position.z; 24 | return true; 25 | } 26 | 27 | } // namespace ros_to_imc 28 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/imc_to_ros/Abort.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef IMC_TO_ROS_ABORT_H 15 | #define IMC_TO_ROS_ABORT_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace imc_to_ros { 22 | 23 | template <> 24 | bool convert(const IMC::Abort& imc_msg, std_msgs::Empty& ros_msg); 25 | 26 | } // namespace imc_to_ros 27 | 28 | #endif // IMC_TO_ROS_GOTO_H 29 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/imc_to_ros/Goto.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef IMC_TO_ROS_GOTO_H 15 | #define IMC_TO_ROS_GOTO_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace imc_to_ros { 22 | 23 | template <> 24 | bool convert(const IMC::Goto& imc_msg, geometry_msgs::Pose& ros_msg); 25 | 26 | } // namespace imc_to_ros 27 | 28 | #endif // IMC_TO_ROS_GOTO_H 29 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/Goto.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_GOTO_H 15 | #define ROS_TO_IMC_GOTO_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const geometry_msgs::Pose& ros_msg, IMC::Goto& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | 28 | #endif // ROS_TO_IMC_GOTO_H 29 | -------------------------------------------------------------------------------- /src/ros_to_imc/GpsNavData.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const sensor_msgs::NavSatFix& ros_msg, IMC::GpsNavData& imc_msg) 20 | { 21 | imc_msg.lat = ros_msg.latitude; 22 | imc_msg.lon = ros_msg.longitude; 23 | imc_msg.height_sea = ros_msg.altitude; 24 | 25 | return true; 26 | } 27 | 28 | } // namespace ros_to_imc 29 | 30 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/imc_to_ros/Heartbeat.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef IMC_TO_ROS_HEARTBEAT_H 15 | #define IMC_TO_ROS_HEARTBEAT_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace imc_to_ros { 22 | 23 | template <> 24 | bool convert(const IMC::Heartbeat& imc_msg, std_msgs::Empty& ros_msg); 25 | 26 | } // namespace imc_to_ros 27 | 28 | #endif // IMC_TO_ROS_GOTO_H 29 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/GpsFix.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_GPSFIX_H 15 | #define ROS_TO_IMC_GPSFIX_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const sensor_msgs::NavSatFix& ros_msg, IMC::GpsFix& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | 28 | #endif // ROS_TO_IMC_GPSFIX_H 29 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/DesiredZ.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_DESIREDZ_H 15 | #define ROS_TO_IMC_DESIREDZ_H 16 | 17 | #include 18 | #include "imc_ros_bridge/DesiredZ.h" 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const imc_ros_bridge::DesiredZ& ros_msg, IMC::DesiredZ& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | #endif // ROS_TO_IMC_DESIREDZ_H 28 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/Heartbeat.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_HEARTBEAT_H 15 | #define ROS_TO_IMC_HEARTBEAT_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const std_msgs::Empty& ros_msg, IMC::Heartbeat& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | 28 | #endif // ROS_TO_IMC_HEARTBEAT_H 29 | -------------------------------------------------------------------------------- /src/ros_to_imc/GpsFix.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const sensor_msgs::NavSatFix& ros_msg, IMC::GpsFix& imc_msg) 20 | { 21 | imc_msg.lat = ros_msg.latitude; 22 | imc_msg.lon = ros_msg.longitude; 23 | imc_msg.height = ros_msg.altitude; 24 | imc_msg.validity = 0x0004; // Position is valid 25 | return true; 26 | } 27 | 28 | } // namespace ros_to_imc 29 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/GpsNavData.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_GPSNAVDATA_H 15 | #define ROS_TO_IMC_GPSNAVDATA_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const sensor_msgs::NavSatFix& ros_msg, IMC::GpsNavData& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | 28 | #endif // ROS_TO_IMC_GPSFIX_H 29 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/SonarData.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_SONARDATA_H 15 | #define ROS_TO_IMC_SONARDATA_H 16 | 17 | #include 18 | #include "imc_ros_bridge/SonarData.h" 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const imc_ros_bridge::SonarData& ros_msg, IMC::SonarData& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | 28 | #endif // ROS_TO_IMC_SONARDATA_H 29 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/Maneuver.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_MANEUVER_HPP_INCLUDED_ 24 | #define IMC_MANEUVER_HPP_INCLUDED_ 25 | 26 | // IMC headers. 27 | #include 28 | 29 | namespace IMC 30 | { 31 | //! Super type Maneuver. 32 | class Maneuver: public Message 33 | 34 | { }; 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/DesiredRoll.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_DESIREDROLL_H 15 | #define ROS_TO_IMC_DESIREDROLL_H 16 | 17 | #include 18 | #include "imc_ros_bridge/DesiredRoll.h" 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const imc_ros_bridge::DesiredRoll& ros_msg, IMC::DesiredRoll& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | #endif // ROS_TO_IMC_DESIREDROLL_H 28 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/RemoteState.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_REMOTESTATE_H 15 | #define ROS_TO_IMC_REMOTESTATE_H 16 | 17 | #include 18 | #include "imc_ros_bridge/RemoteState.h" 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const imc_ros_bridge::RemoteState& ros_msg, IMC::RemoteState& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | #endif // ROS_TO_IMC_REMOTESTATE_H 28 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/imc_to_ros/PlanControl.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef IMC_TO_ROS_PLANCONTROL_H 15 | #define IMC_TO_ROS_PLANCONTROL_H 16 | 17 | #include 18 | #include "imc_ros_bridge/PlanControl.h" 19 | #include 20 | 21 | namespace imc_to_ros { 22 | 23 | template <> 24 | bool convert(const IMC::PlanControl& imc_msg, imc_ros_bridge::PlanControl& ros_msg); 25 | 26 | } // namespace imc_to_ros 27 | 28 | #endif // IMC_TO_ROS_GOTO_H 29 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/DesiredPitch.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_DESIREDPITCH_H 15 | #define ROS_TO_IMC_DESIREDPITCH_H 16 | 17 | #include 18 | #include "imc_ros_bridge/DesiredPitch.h" 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const imc_ros_bridge::DesiredPitch& ros_msg, IMC::DesiredPitch& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | #endif // ROS_TO_IMC_DESIREDPITCH_H 28 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/DesiredSpeed.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_DESIREDSPEED_H 15 | #define ROS_TO_IMC_DESIREDSPEED_H 16 | 17 | #include 18 | #include "imc_ros_bridge/DesiredSpeed.h" 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const imc_ros_bridge::DesiredSpeed& ros_msg, IMC::DesiredSpeed& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | #endif // ROS_TO_IMC_DESIREDSPEED_H 28 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/VehicleState.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_VEHICLESTATE_H 15 | #define ROS_TO_IMC_VEHICLESTATE_H 16 | 17 | #include 18 | #include "imc_ros_bridge/VehicleState.h" 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const imc_ros_bridge::VehicleState& ros_msg, IMC::VehicleState& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | #endif // ROS_TO_IMC_VEHICLESTATE_H 28 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/RemoteData.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_REMOTEDATA_HPP_INCLUDED_ 24 | #define IMC_REMOTEDATA_HPP_INCLUDED_ 25 | 26 | // IMC headers. 27 | #include 28 | 29 | namespace IMC 30 | { 31 | //! Super type RemoteData. 32 | class RemoteData: public Message 33 | 34 | { }; 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/ros_to_imc/RemoteState.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const imc_ros_bridge::RemoteState& ros_msg, IMC::RemoteState& imc_msg) 20 | { 21 | imc_msg.lat = ros_msg.lat; 22 | imc_msg.lon = ros_msg.lon; 23 | imc_msg.depth = ros_msg.depth; 24 | imc_msg.speed = ros_msg.speed; 25 | imc_msg.psi = ros_msg.psi; 26 | 27 | return true; 28 | } 29 | 30 | } // namespace imc_to_ros 31 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/PlanDB.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_PLANDB_H 15 | #define ROS_TO_IMC_PLANDB_H 16 | 17 | #include 18 | // #include 19 | #include 20 | #include 21 | 22 | 23 | namespace ros_to_imc { 24 | 25 | template <> 26 | bool convert(const imc_ros_bridge::PlanDB& ros_msg, IMC::PlanDB& imc_msg); 27 | 28 | 29 | } // namespace ros_to_imc 30 | #endif // ROS_TO_IMC_PLANDB_H 31 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/DesiredHeading.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_DESIREDHEADING_H 15 | #define ROS_TO_IMC_DESIREDHEADING_H 16 | 17 | #include 18 | #include "imc_ros_bridge/DesiredHeading.h" 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const imc_ros_bridge::DesiredHeading& ros_msg, IMC::DesiredHeading& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | #endif // ROS_TO_IMC_DESIREDHEADING_H 28 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/ControlCommand.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_CONTROLCOMMAND_HPP_INCLUDED_ 24 | #define IMC_CONTROLCOMMAND_HPP_INCLUDED_ 25 | 26 | // IMC headers. 27 | #include 28 | 29 | namespace IMC 30 | { 31 | //! Super type Control Command. 32 | class ControlCommand: public Message 33 | 34 | { }; 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/PlanControlState.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef IMC_TO_ROS_PLANCONTROLSTATE_H 15 | #define IMC_TO_ROS_PLANCONTROLSTATE_H 16 | 17 | #include 18 | #include "imc_ros_bridge/PlanControlState.h" 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const imc_ros_bridge::PlanControlState& ros_msg, IMC::PlanControlState& imc_msg); 25 | 26 | } // namespace imc_to_ros 27 | 28 | #endif // IMC_TO_ROS_GOTO_H 29 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/DesiredHeadingRate.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_DESIREDHEADINGRATE_H 15 | #define ROS_TO_IMC_DESIREDHEADINGRATE_H 16 | 17 | #include 18 | #include "imc_ros_bridge/DesiredHeadingRate.h" 19 | #include 20 | 21 | namespace ros_to_imc { 22 | 23 | template <> 24 | bool convert(const imc_ros_bridge::DesiredHeadingRate& ros_msg, IMC::DesiredHeadingRate& imc_msg); 25 | 26 | } // namespace ros_to_imc 27 | #endif // ROS_TO_IMC_DESIREDHEADINGRATE_H 28 | -------------------------------------------------------------------------------- /src/imc_to_ros/PlanControl.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace imc_to_ros { 17 | 18 | template <> 19 | bool convert(const IMC::PlanControl& imc_msg, imc_ros_bridge::PlanControl& ros_msg) 20 | { 21 | ros_msg.type = imc_msg.type; 22 | ros_msg.op = imc_msg.op; 23 | ros_msg.request_id = imc_msg.request_id; 24 | ros_msg.plan_id = imc_msg.plan_id; 25 | ros_msg.flags = imc_msg.flags; 26 | ros_msg.info = imc_msg.info; 27 | 28 | return true; 29 | } 30 | 31 | } // namespace imc_to_ros 32 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/imc_to_ros/PlanDB.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef IMC_TO_ROS_PLANDB_H 15 | #define IMC_TO_ROS_PLANDB_H 16 | 17 | #include 18 | // #include 19 | #include 20 | #include 21 | 22 | 23 | namespace imc_to_ros { 24 | 25 | // template <> 26 | // bool convert(const IMC::PlanDB& imc_msg, std_msgs::String& ros_msg); 27 | // 28 | 29 | template <> 30 | bool convert(const IMC::PlanDB& imc_msg, imc_ros_bridge::PlanDB& ros_msg); 31 | 32 | 33 | } // namespace imc_to_ros 34 | #endif // IMC_TO_ROS_GOTO_H 35 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/ros_to_imc/EstimatedState.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef ROS_TO_IMC_ESTIMATEDSTATE_H 15 | #define ROS_TO_IMC_ESTIMATEDSTATE_H 16 | 17 | #include 18 | #include "imc_ros_bridge/EstimatedState.h" 19 | #include 20 | #include 21 | 22 | namespace ros_to_imc { 23 | 24 | template <> 25 | bool convert(const imc_ros_bridge::EstimatedState& ros_msg, IMC::EstimatedState& imc_msg); 26 | 27 | template <> 28 | bool convert(const geometry_msgs::Pose& ros_msg, IMC::EstimatedState& imc_msg); 29 | 30 | 31 | } // namespace ros_to_imc 32 | 33 | #endif // ROS_TO_IMC_ESTIMATEDSTATE_H 34 | -------------------------------------------------------------------------------- /src/ros_to_imc/PlanControlState.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const imc_ros_bridge::PlanControlState& ros_msg, IMC::PlanControlState& imc_msg) 20 | { 21 | imc_msg.state = ros_msg.state; 22 | imc_msg.plan_id = ros_msg.plan_id; 23 | imc_msg.plan_eta = ros_msg.plan_eta; 24 | imc_msg.plan_progress = ros_msg.plan_progress; 25 | imc_msg.man_id = ros_msg.man_id; 26 | imc_msg.man_type = ros_msg.man_type; 27 | imc_msg.man_eta = ros_msg.man_eta; 28 | imc_msg.last_outcome = ros_msg.last_outcome; 29 | 30 | return true; 31 | } 32 | 33 | } // namespace imc_to_ros 34 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Base/Config.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | 19 | #ifndef IMC_CONFIG_HPP 20 | #define IMC_CONFIG_HPP 21 | 22 | // IMC Base headers. 23 | #include "Platform.hpp" 24 | 25 | #if defined(IMC_OS_POSIX) 26 | # include 27 | #elif defined(IMC_OS_WINDOWS) 28 | # include 29 | typedef INT8 int8_t; 30 | typedef UINT8 uint8_t; 31 | typedef INT16 int16_t; 32 | typedef UINT16 uint16_t; 33 | typedef INT32 int32_t; 34 | typedef UINT32 uint32_t; 35 | typedef INT64 int64_t; 36 | typedef UINT64 uint64_t; 37 | 38 | #else 39 | # error failed to find standard integer definition 40 | #endif 41 | 42 | // Declaration for exporting symbols. 43 | #if defined(IMC_OS_WINDOWS) 44 | # if defined(IMC_DLL_EXPORT) 45 | # define IMC_SYM_EXPORT __declspec(dllexport) 46 | # else 47 | # define IMC_SYM_EXPORT __declspec(dllimport) 48 | # endif 49 | 50 | #else 51 | # define IMC_SYM_EXPORT 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/ros_to_imc/SonarData.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const imc_ros_bridge::SonarData& ros_msg, IMC::SonarData& imc_msg) 20 | { 21 | 22 | imc_msg.type = ros_msg.type; 23 | imc_msg.frequency = ros_msg.frequency; 24 | imc_msg.min_range = ros_msg.min_range; 25 | imc_msg.max_range = ros_msg.max_range; 26 | imc_msg.bits_per_point = ros_msg.bits_per_point; 27 | imc_msg.scale_factor = ros_msg.scale_factor; 28 | for(unsigned int i=0;i 15 | 16 | namespace ros_to_imc { 17 | 18 | template <> 19 | bool convert(const imc_ros_bridge::VehicleState& ros_msg, IMC::VehicleState& imc_msg) 20 | { 21 | imc_msg.op_mode = ros_msg.op_mode; 22 | imc_msg.error_count = ros_msg.error_count; 23 | imc_msg.error_ents = ros_msg.error_ents; 24 | imc_msg.maneuver_type = ros_msg.maneuver_type; 25 | imc_msg.maneuver_stime = ros_msg.maneuver_stime; 26 | imc_msg.maneuver_eta = ros_msg.maneuver_eta; 27 | imc_msg.control_loops = ros_msg.control_loops; 28 | imc_msg.flags = ros_msg.flags; 29 | imc_msg.last_error = ros_msg.last_error; 30 | imc_msg.last_error_time = ros_msg.last_error_time; 31 | 32 | return true; 33 | } 34 | 35 | } // namespace imc_to_ros 36 | -------------------------------------------------------------------------------- /vehicles-defs/defaults/04-adamastor-vehicle-lsts.nvcl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | adamastor 5 | Adamastor 6 | ROV 7 | 8 | 1.2 9 | 0.75 10 | 0.7 11 | ../vehicles-files/adamastor/adamastor_top.png 12 | ../vehicles-files/adamastor/adamastor_side.png 13 | ../vehicles-files/adamastor/adamastor_presentation.png 14 | ../vehicles-files/adamastor/adamastor.j3d 15 | 16 | SNAME 17 | 18 | 19 | 20 | 21 | 22 | No documentation available 23 | pt.lsts.neptus.mp.maneuvers.Unconstrained 24 | 25 | 26 | 27 | 28 | 29 | 30 | ethernet 31 | ethernet 32 | 10.0.10.70 33 | imc 34 | 35 | 36 | 37 | 6002 38 | 6002 39 | true 40 | false 41 | 04:02 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ../conf/consoles/adamastor-light.ncon 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/Header.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_HEADER_HPP_INCLUDED_ 24 | #define IMC_HEADER_HPP_INCLUDED_ 25 | 26 | // IMC headers. 27 | #include 28 | 29 | namespace IMC 30 | { 31 | //! Header format. 32 | struct Header 33 | { 34 | //! Synchronization Number. 35 | uint16_t sync; 36 | //! Message Identification Number. 37 | uint16_t mgid; 38 | //! Message size. 39 | uint16_t size; 40 | //! Time stamp. 41 | double timestamp; 42 | //! Source Address. 43 | uint16_t src; 44 | //! Source Entity. 45 | uint8_t src_ent; 46 | //! Destination Address. 47 | uint16_t dst; 48 | //! Destination Entity. 49 | uint8_t dst_ent; 50 | }; 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/Constants.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_CONSTANTS_HPP_INCLUDED_ 24 | #define IMC_CONSTANTS_HPP_INCLUDED_ 25 | 26 | //! IMC version string. 27 | #define IMC_CONST_VERSION "5.4.20" 28 | //! Git repository information. 29 | #define IMC_CONST_GIT_INFO "2018-06-08 47bc4c9 (HEAD, tag: imc-5.4.20, origin/master, origin/HEAD, master)" 30 | //! MD5 sum of XML specification file. 31 | #define IMC_CONST_MD5 "522ff971d12877ebe15aff467ba253d4" 32 | //! Synchronization number. 33 | #define IMC_CONST_SYNC 0xFE54 34 | //! Reversed synchronization number. 35 | #define IMC_CONST_SYNC_REV 0x54FE 36 | //! Size of the header in bytes. 37 | #define IMC_CONST_HEADER_SIZE 20 38 | //! Size of the footer in bytes. 39 | #define IMC_CONST_FOOTER_SIZE 2 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/imc_tcp_link/imc_handle.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef IMC_HANDLE_H 15 | #define IMC_HANDLE_H 16 | 17 | //#include 18 | #include 19 | 20 | class IMCHandle { 21 | 22 | private: 23 | 24 | std::string sys_name; 25 | int imc_id; 26 | int imc_src; 27 | std::string bridge_tcp_addr; 28 | std::string bridge_tcp_port; 29 | std::string neptus_addr; 30 | 31 | //ros_imc_broker::TcpLink* tcp_client_; 32 | //boost::thread* tcp_client_thread_; 33 | UDPLink udp_link; 34 | 35 | // we might need multiple for every message in the future, let's start here 36 | std::map > callbacks; 37 | 38 | double lat; 39 | 40 | public: 41 | 42 | IMCHandle(const std::string& bridge_tcp_addr, const std::string& bridge_tcp_port, 43 | const std::string& neptus_addr, 44 | const std::string& sys_name, int imc_id, int imc_src); 45 | 46 | ~IMCHandle(); 47 | 48 | void announce(); 49 | 50 | void publish_heartbeat(); 51 | 52 | void tcp_subscribe(uint16_t uid, std::function callback); 53 | 54 | void tcp_callback(const IMC::Message* msg); 55 | 56 | template 57 | void write(IMC_MSG& imc_msg) 58 | { 59 | //tcp_client_.write(imc_msg); 60 | //tcp_client_->write(&imc_msg); 61 | udp_link.publish(imc_msg, neptus_addr); 62 | } 63 | 64 | }; 65 | 66 | #endif // IMC_HANDLE_H 67 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Base/Factory.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | 19 | #ifndef IMC_FACTORY_HPP_INCLUDED_ 20 | #define IMC_FACTORY_HPP_INCLUDED_ 21 | 22 | // ISO C++ 98 headers. 23 | #include 24 | #include 25 | 26 | // IMC Base headers. 27 | #include "Config.hpp" 28 | #include "Message.hpp" 29 | 30 | namespace IMC 31 | { 32 | class IMC_SYM_EXPORT Factory; 33 | 34 | class Factory 35 | { 36 | public: 37 | //! Produce a message object by identification number. 38 | //! @param key message identification number. 39 | //! @return message object allocated on the heap. 40 | static Message* 41 | produce(uint32_t key); 42 | 43 | //! Produce a message object by name. 44 | //! @param name message name. 45 | //! @return message object allocated on the heap. 46 | static Message* 47 | produce(const std::string& name); 48 | 49 | //! Retrieve all message abbreviations. 50 | //! @param v output vector 51 | static void 52 | getAbbrevs(std::vector& v); 53 | 54 | //! Retrieve all message identification numbers. 55 | //! @param v output vector 56 | static void 57 | getIds(std::vector& v); 58 | 59 | //! Retrieve the corresponding message abbreviation from the 60 | //! identification number. 61 | //! @param id identification number. 62 | //! @return abbreviation. 63 | static std::string 64 | getAbbrevFromId(uint32_t id); 65 | 66 | //! Retrieve the corresponding message identification number from the 67 | //! abbreviation. 68 | //! @param name abbreviation. 69 | //! @return identification number. 70 | static uint32_t 71 | getIdFromAbbrev(const std::string& name); 72 | }; 73 | } 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | imc_ros_bridge 4 | 0.0.18 5 | The imc_ros_bridge package 6 | 7 | 8 | 9 | 10 | Nils Bore 11 | 12 | 13 | 14 | 15 | 16 | BSD 17 | 18 | 19 | 20 | 21 | 22 | https://smarc.se/ 23 | 24 | 25 | 26 | 27 | 28 | Nils Bore 29 | Ozer Ozkahraman 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | message_generation 42 | message_runtime 43 | std_msgs 44 | sensor_msgs 45 | geometry_msgs 46 | nav_msgs 47 | tf2 48 | tf2_geometry_msgs 49 | message_runtime 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | catkin 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/ros_to_imc/EstimatedState.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | namespace ros_to_imc { 20 | 21 | template <> 22 | bool convert(const imc_ros_bridge::EstimatedState& ros_msg, IMC::EstimatedState& imc_msg) 23 | { 24 | imc_msg.lat = ros_msg.lat; 25 | imc_msg.lon = ros_msg.lon; 26 | imc_msg.height = ros_msg.height; 27 | imc_msg.x = ros_msg.x; 28 | imc_msg.y = ros_msg.y; 29 | imc_msg.z = ros_msg.z; 30 | imc_msg.phi = ros_msg.phi; 31 | imc_msg.theta = ros_msg.theta; 32 | imc_msg.psi = ros_msg.psi; 33 | imc_msg.u = ros_msg.u; 34 | imc_msg.v = ros_msg.v; 35 | imc_msg.w = ros_msg.w; 36 | imc_msg.vx = ros_msg.vx; 37 | imc_msg.vy = ros_msg.vy; 38 | imc_msg.vz = ros_msg.vz; 39 | imc_msg.p = ros_msg.p; 40 | imc_msg.q = ros_msg.q; 41 | imc_msg.r = ros_msg.r; 42 | imc_msg.depth = ros_msg.depth; 43 | imc_msg.alt = ros_msg.alt; 44 | 45 | return true; 46 | } 47 | 48 | template <> 49 | bool convert(const geometry_msgs::Pose& ros_msg, IMC::EstimatedState& imc_msg) 50 | { 51 | imc_msg.lat = ros_msg.position.y; 52 | imc_msg.lon = ros_msg.position.x; 53 | 54 | // convert quaternion to euler (phi,theta,psi) rot over (x,y,z) 55 | tf2::Quaternion quat_tf; 56 | geometry_msgs::Quaternion quat_msg = ros_msg.orientation; 57 | tf2::convert(quat_msg , quat_tf); 58 | double roll, pitch, yaw; 59 | tf2::Matrix3x3(quat_tf).getRPY(roll, pitch, yaw); 60 | 61 | imc_msg.psi = M_PI/2. - yaw; 62 | 63 | 64 | return true; 65 | } 66 | 67 | } // namespace ros_to_imc 68 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Base/Exceptions.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | 19 | #ifndef IMC_EXCEPTIONS_HPP_INCLUDED_ 20 | #define IMC_EXCEPTIONS_HPP_INCLUDED_ 21 | 22 | // ISO C++ 98 headers. 23 | #include 24 | 25 | // IMC Base headers. 26 | #include "String.hpp" 27 | 28 | namespace IMC 29 | { 30 | //! Invalid synchronization number exception. 31 | class InvalidSync: public std::runtime_error 32 | { 33 | public: 34 | explicit 35 | InvalidSync(uint16_t sync): 36 | std::runtime_error("invalid synchronization number: " + String::toHex(sync)) 37 | { } 38 | }; 39 | 40 | //! Invalid message identification number exception. 41 | class InvalidMessageId: public std::runtime_error 42 | { 43 | public: 44 | explicit 45 | InvalidMessageId(uint32_t id): 46 | std::runtime_error("invalid message identification number: " + String::str(id)) 47 | { } 48 | }; 49 | 50 | //! Invalid message abbreviation exception. 51 | class InvalidMessageAbbrev: public std::runtime_error 52 | { 53 | public: 54 | explicit 55 | InvalidMessageAbbrev(const std::string& abbrev): 56 | std::runtime_error("invalid message abbreviation: " + abbrev) 57 | { } 58 | }; 59 | 60 | //! Invalid CRC exception. 61 | class InvalidCrc: public std::runtime_error 62 | { 63 | public: 64 | InvalidCrc(): 65 | std::runtime_error("invalid CRC") 66 | { } 67 | }; 68 | 69 | //! Buffer too short to be unpacked exception. 70 | class BufferTooShort: public std::runtime_error 71 | { 72 | public: 73 | BufferTooShort(void): 74 | std::runtime_error("buffer is too short to be unpacked") 75 | { } 76 | }; 77 | 78 | class InvalidMessageSize: public std::runtime_error 79 | { 80 | public: 81 | explicit 82 | InvalidMessageSize(size_t size): 83 | std::runtime_error(String::str("invalid message size %u", size)) 84 | { } 85 | }; 86 | } 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /include/imc_udp_link/udp_link.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef UDP_LINK_H 15 | #define UDP_LINK_H 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | // IMC headers. 25 | #include 26 | 27 | //#define IPADDRESS "127.0.0.1" // "192.168.1.64" 28 | //#define UDP_PORT 30101 //6001 29 | 30 | using boost::asio::ip::udp; 31 | using boost::asio::ip::address; 32 | 33 | class UDPLink { 34 | 35 | private: 36 | 37 | std::string bridge_addr; 38 | std::string bridge_port; 39 | 40 | boost::asio::io_service io_service; 41 | udp::socket socket{io_service}; 42 | udp::socket multicast_socket{io_service}; 43 | // 32KiB in bits. Max UDP packet size. 44 | boost::array recv_buffer; 45 | udp::endpoint remote_endpoint; 46 | std::function recv_handler_; 47 | IMC::Parser parser_; 48 | boost::thread run_thread; 49 | 50 | std::vector announce_ports{30100, 30101, 30102, 30103, 30104}; 51 | 52 | bool should_shutdown; 53 | 54 | int imc_src = 4; 55 | int imc_src_ent = 32; 56 | int imc_id; 57 | 58 | public: 59 | 60 | UDPLink(std::function recv_handler, 61 | const std::string& bridge_addr, const std::string& bridge_port, 62 | int imc_id, int imc_src); 63 | 64 | ~UDPLink(); 65 | 66 | void wait(); 67 | 68 | void publish(IMC::Message& msg, const std::string& address); 69 | 70 | void publish_multicast(IMC::Message& msg, const std::string& multicast_addr); 71 | 72 | void handle_receive(const boost::system::error_code& error, size_t bytes_transferred); 73 | 74 | }; 75 | 76 | #endif // UDP_LINK_H 77 | -------------------------------------------------------------------------------- /external/md5/md5.h: -------------------------------------------------------------------------------- 1 | /* MD5 2 | converted to C++ class by Frank Thilo (thilo@unix-ag.org) 3 | for bzflag (http://www.bzflag.org) 4 | 5 | based on: 6 | 7 | md5.h and md5.c 8 | reference implementation of RFC 1321 9 | 10 | Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 11 | rights reserved. 12 | 13 | License to copy and use this software is granted provided that it 14 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest 15 | Algorithm" in all material mentioning or referencing this software 16 | or this function. 17 | 18 | License is also granted to make and use derivative works provided 19 | that such works are identified as "derived from the RSA Data 20 | Security, Inc. MD5 Message-Digest Algorithm" in all material 21 | mentioning or referencing the derived work. 22 | 23 | RSA Data Security, Inc. makes no representations concerning either 24 | the merchantability of this software or the suitability of this 25 | software for any particular purpose. It is provided "as is" 26 | without express or implied warranty of any kind. 27 | 28 | These notices must be retained in any copies of any part of this 29 | documentation and/or software. 30 | 31 | */ 32 | 33 | #ifndef BZF_MD5_H 34 | #define BZF_MD5_H 35 | 36 | #include 37 | #include 38 | 39 | 40 | // a small class for calculating MD5 hashes of strings or byte arrays 41 | // it is not meant to be fast or secure 42 | // 43 | // usage: 1) feed it blocks of uchars with update() 44 | // 2) finalize() 45 | // 3) get hexdigest() string 46 | // or 47 | // MD5(std::string).hexdigest() 48 | // 49 | // assumes that char is 8 bit and int is 32 bit 50 | class MD5 51 | { 52 | public: 53 | typedef unsigned int size_type; // must be 32bit 54 | 55 | MD5(); 56 | MD5(const std::string& text); 57 | void update(const unsigned char *buf, size_type length); 58 | void update(const char *buf, size_type length); 59 | MD5& finalize(); 60 | std::string hexdigest() const; 61 | unsigned char* get_digest(); 62 | friend std::ostream& operator<<(std::ostream&, MD5 md5); 63 | 64 | private: 65 | void init(); 66 | typedef unsigned char uint1; // 8bit 67 | typedef unsigned int uint4; // 32bit 68 | enum {blocksize = 64}; // VC6 won't eat a const static int here 69 | 70 | void transform(const uint1 block[blocksize]); 71 | static void decode(uint4 output[], const uint1 input[], size_type len); 72 | static void encode(uint1 output[], const uint4 input[], size_type len); 73 | 74 | bool finalized; 75 | uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk 76 | uint4 count[2]; // 64bit counter for number of bits (lo, hi) 77 | uint4 state[4]; // digest so far 78 | uint1 digest[16]; // the result 79 | 80 | // low level logic operations 81 | static inline uint4 F(uint4 x, uint4 y, uint4 z); 82 | static inline uint4 G(uint4 x, uint4 y, uint4 z); 83 | static inline uint4 H(uint4 x, uint4 y, uint4 z); 84 | static inline uint4 I(uint4 x, uint4 y, uint4 z); 85 | static inline uint4 rotate_left(uint4 x, int n); 86 | static inline void FF(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); 87 | static inline void GG(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); 88 | static inline void HH(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); 89 | static inline void II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); 90 | }; 91 | 92 | std::string md5(const std::string str); 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/Bitfields.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_BITFIELDS_HPP_INCLUDED_ 24 | #define IMC_BITFIELDS_HPP_INCLUDED_ 25 | 26 | namespace IMC 27 | { 28 | //! Control Loops Mask. 29 | enum CLoopsMask 30 | { 31 | //! None. 32 | CL_NONE = 0x00000000, 33 | //! Path Control. 34 | CL_PATH = 0x00000001, 35 | //! Teleoperation Control. 36 | CL_TELEOPERATION = 0x00000002, 37 | //! Altitude Control. 38 | CL_ALTITUDE = 0x00000004, 39 | //! Depth Control. 40 | CL_DEPTH = 0x00000008, 41 | //! Roll Control. 42 | CL_ROLL = 0x00000010, 43 | //! Pitch Control. 44 | CL_PITCH = 0x00000020, 45 | //! Yaw Control. 46 | CL_YAW = 0x00000040, 47 | //! Speed Control. 48 | CL_SPEED = 0x00000080, 49 | //! Yaw Rate Control. 50 | CL_YAW_RATE = 0x00000100, 51 | //! Vertical Rate Control. 52 | CL_VERTICAL_RATE = 0x00000200, 53 | //! Torque Control. 54 | CL_TORQUE = 0x00000400, 55 | //! Force Control. 56 | CL_FORCE = 0x00000800, 57 | //! Velocity Control. 58 | CL_VELOCITY = 0x00001000, 59 | //! Throttle Control. 60 | CL_THROTTLE = 0x00002000, 61 | //! Unspecified External Control. 62 | CL_EXTERNAL = 0x40000000, 63 | //! Non-overridable control. 64 | CL_NO_OVERRIDE = 0x80000000, 65 | //! All. 66 | CL_ALL = 0xFFFFFFFF 67 | }; 68 | 69 | //! Operational Limits Mask. 70 | enum OpLimitsMask 71 | { 72 | //! Maximum Depth. 73 | OPL_MAX_DEPTH = 0x01, 74 | //! Minimum Altitude. 75 | OPL_MIN_ALT = 0x02, 76 | //! Maximum Altitude. 77 | OPL_MAX_ALT = 0x04, 78 | //! Minimum Speed. 79 | OPL_MIN_SPEED = 0x08, 80 | //! Maximum Speed. 81 | OPL_MAX_SPEED = 0x10, 82 | //! Maximum Vertical Rate. 83 | OPL_MAX_VRATE = 0x20, 84 | //! Operation Area. 85 | OPL_AREA = 0x40 86 | }; 87 | } 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Base/Platform.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | 19 | #ifndef IMC_PLATFORM_HPP_INCLUDED_ 20 | #define IMC_PLATFORM_HPP_INCLUDED_ 21 | 22 | // Probe operating system. 23 | #if defined(__linux__) 24 | # define IMC_OS_LINUX 1 25 | # define IMC_OS_POSIX 1 26 | # define IMC_OS_NAME "Linux" 27 | 28 | #elif defined(_WIN32) 29 | # define IMC_OS_WINDOWS 1 30 | # define IMC_OS_NAME "Windows" 31 | 32 | #elif defined(__APPLE__) 33 | # define IMC_OS_MACOS 1 34 | # define IMC_OS_POSIX 1 35 | # define IMC_OS_NAME "macOS" 36 | 37 | #elif defined(__APPLE__) 38 | # define IMC_OS_FREEBSD 1 39 | # define IMC_OS_POSIX 1 40 | # define IMC_OS_NAME "FreeBSD" 41 | 42 | #else 43 | # error unknown operating system 44 | #endif 45 | 46 | // Architecture. 47 | #if defined(__amd64__) || defined(__amd64) || defined(_AMD64_) || defined(__x86_64__) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) 48 | # define IMC_CPU_AMD64 1 49 | # define IMC_CPU_LE 1 50 | # define IMC_CPU_64B 1 51 | # define IMC_CPU_NAME "amd64" 52 | 53 | #elif defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(__x86_32__) 54 | # define IMC_CPU_X86 1 55 | # define IMC_CPU_LE 1 56 | # define IMC_CPU_32B 1 57 | # define IMC_CPU_NAME "x86" 58 | 59 | #elif defined(__arm__) 60 | # define IMC_CPU_ARM 1 61 | # define IMC_CPU_LE 1 62 | # define IMC_CPU_32B 1 63 | # define IMC_CPU_NAME "arm" 64 | 65 | #elif defined(__aarch64__) 66 | # define IMC_CPU_AARCH64 1 67 | # define IMC_CPU_LE 1 68 | # define IMC_CPU_32B 1 69 | # define IMC_CPU_NAME "aarch64" 70 | 71 | #else 72 | # error unknown architecture 73 | 74 | #endif 75 | 76 | // Compiler. 77 | #if defined(__clang__) 78 | # define IMC_CXX_CLANG 1 79 | # define IMC_CXX_NAME "clang" 80 | 81 | #elif defined(__GNUC__) 82 | # define IMC_CXX_GNU 1 83 | # define IMC_CXX_NAME "gcc" 84 | 85 | #elif defined(_MSC_VER) 86 | # define IMC_CXX_MSC 1 87 | # define IMC_CXX_NAME "msc" 88 | 89 | 90 | #else 91 | # error unknown compiler 92 | 93 | #endif 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /vehicles-defs/defaults/30-folaga.nvcl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | efolaga 6 | eFolaga AUV 7 | AUV 8 | Folaga 9 | 10 | 1.4 11 | 0.25 12 | 0.25 13 | ../vehicles-files/efolaga/top.png 14 | ../vehicles-files/lauv/lauv-seacon0-side.png 15 | ../vehicles-files/lauv/lauv-seacon0-back.png 16 | ../vehicles-files/efolaga/presentation.png 17 | ../vehicles-files/lauv/lauv-xtreme-2.x3d 18 | 19 | 128 20 | 64 21 | 64 22 | 23 | 24 | SNAME 25 | 26 | 27 | 28 | 29 | 30 | 31 | GotoDestination 32 | GotoDestination 33 | 34 | 0N 35 | 0E 36 | 2 37 | 38 | 39 | 5 40 | 41 | 1.0 42 | 43 | 1 44 | 45 | 46 | No documentation available 47 | pt.lsts.neptus.mp.maneuvers.Goto 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | ethernet 60 | ethernet 61 | 172.10.10.10 62 | imc 63 | 64 | 65 | 66 | 8888 67 | 8889 68 | true 69 | false 70 | 00:5D 71 | 72 | 73 | 74 | 75 | 76 | 77 | ../conf/consoles/lauv.ncon 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /vehicles-defs/defaults/04-squirtle-vehicle-lsts.nvcl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | squirtle 5 | Adamastor 6 | ROV 7 | 8 | 0.7 9 | 0.5 10 | 0.3 11 | ../vehicles-files/adamastor/adamastor_top.png 12 | ../vehicles-files/adamastor/adamastor_side.png 13 | ../vehicles-files/adamastor/adamastor_presentation.png 14 | ../vehicles-files/adamastor/adamastor.j3d 15 | 16 | 17 | depth 18 | 19 | SNAME 20 | 21 | 22 | 23 | 24 | 25 | No documentation available 26 | pt.lsts.neptus.mp.maneuvers.Unconstrained 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | GotoDestination 35 | GotoDestination 36 | 37 | 0N 38 | 0E 39 | 5 40 | 41 | 42 | 5 43 | 44 | 5 45 | 46 | 5 47 | 48 | 49 | Move to a given point 50 | pt.lsts.neptus.mp.maneuvers.Goto 51 | 52 | 53 | 54 | 55 | 56 | 57 | ethernet 58 | ethernet 59 | 192.168.2.2 60 | imc 61 | 62 | 63 | 64 | 6002 65 | 6002 66 | true 67 | false 68 | 04:03 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | ../conf/consoles/adamastor-light.ncon 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Base/Clock.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | 19 | #ifndef IMC_CLOCK_HPP_INCLUDED_ 20 | #define IMC_CLOCK_HPP_INCLUDED_ 21 | 22 | // ISO C++ 98 headers. 23 | #include 24 | #include 25 | #include 26 | 27 | // IMC Base headers. 28 | #include "Config.hpp" 29 | 30 | // Platform specific headers. 31 | #if defined(IMC_OS_WINDOWS) 32 | # include 33 | #elif defined(IMC_OS_POSIX) 34 | # include 35 | # include 36 | #endif 37 | 38 | namespace IMC 39 | { 40 | //! Number of nanoseconds in a second. 41 | static const unsigned c_nsec_per_sec = 1000000000u; 42 | //! Number of nanoseconds in a second (floating point). 43 | static const double c_nsec_per_sec_fp = 1000000000.0; 44 | 45 | //! %System clock routines. 46 | class Clock 47 | { 48 | public: 49 | //! Get the amount of time (in nanoseconds) elapsed since the 50 | //! UNIX Epoch (Midnight UTC of January 1, 1970). 51 | //! @return time in nanoseconds. 52 | static uint64_t 53 | getSinceEpochNsec() 54 | { 55 | // POSIX RT. 56 | #if defined(CLOCK_REALTIME) 57 | timespec ts = {0, 0}; 58 | clock_gettime(CLOCK_REALTIME, &ts); 59 | return (uint64_t)ts.tv_sec * c_nsec_per_sec + (uint64_t)ts.tv_nsec; 60 | 61 | // POSIX. 62 | #elif defined(IMC_OS_POSIX) 63 | timeval tv; 64 | gettimeofday(&tv, 0); 65 | return (uint64_t)tv.tv_sec * c_nsec_per_sec + (uint64_t)tv.tv_usec * 1000; 66 | 67 | // Microsoft Windows. 68 | #elif defined(IMC_OS_WINDOWS) 69 | FILETIME ft; 70 | uint64_t tm; 71 | GetSystemTimeAsFileTime(&ft); 72 | std::memcpy(&tm, &ft, sizeof(uint64_t)); 73 | 74 | // Subtract number of 100-nanosecond intervals between the beginning of the Windows 75 | // epoch (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970). 76 | tm -= 116444736000000000ULL; 77 | 78 | return tm * 100; 79 | 80 | // Unsupported system. 81 | #else 82 | # error Clock::getSinceEpochNsec() is not yet implemented in this system. 83 | 84 | #endif 85 | } 86 | 87 | //! Get the amount of time (in seconds) elapsed since the 88 | //! UNIX Epoch (Midnight UTC of January 1, 1970). 89 | //! @return time in seconds. 90 | static double 91 | getSinceEpoch() 92 | { 93 | return getSinceEpochNsec() / c_nsec_per_sec_fp; 94 | } 95 | }; 96 | } 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/Abort.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_ABORT_HPP_INCLUDED_ 24 | #define IMC_ABORT_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Abort. 44 | class Abort: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 550; 52 | } 53 | 54 | static Abort* 55 | cast(Message* msg__) 56 | { 57 | return (Abort*)msg__; 58 | } 59 | 60 | Abort(void) 61 | { 62 | m_header.mgid = Abort::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | Abort* 67 | clone(void) const 68 | { 69 | return new Abort(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return Abort::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "Abort"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/Pulse.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_PULSE_HPP_INCLUDED_ 24 | #define IMC_PULSE_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Pulse. 44 | class Pulse: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 277; 52 | } 53 | 54 | static Pulse* 55 | cast(Message* msg__) 56 | { 57 | return (Pulse*)msg__; 58 | } 59 | 60 | Pulse(void) 61 | { 62 | m_header.mgid = Pulse::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | Pulse* 67 | clone(void) const 68 | { 69 | return new Pulse(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return Pulse::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "Pulse"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/Aborted.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_ABORTED_HPP_INCLUDED_ 24 | #define IMC_ABORTED_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Aborted. 44 | class Aborted: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 889; 52 | } 53 | 54 | static Aborted* 55 | cast(Message* msg__) 56 | { 57 | return (Aborted*)msg__; 58 | } 59 | 60 | Aborted(void) 61 | { 62 | m_header.mgid = Aborted::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | Aborted* 67 | clone(void) const 68 | { 69 | return new Aborted(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return Aborted::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "Aborted"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Base/String.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | 19 | #ifndef IMC_STRING_HPP_INCLUDED_ 20 | #define IMC_STRING_HPP_INCLUDED_ 21 | 22 | // ISO C++ 98 headers. 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | 34 | namespace IMC 35 | { 36 | class String 37 | { 38 | public: 39 | static std::string 40 | toHex(const std::vector& str) 41 | { 42 | char bfr[3]; 43 | std::string result; 44 | 45 | for (unsigned int i = 0; i < str.size(); ++i) 46 | { 47 | format(bfr, 3, "%02X", (uint8_t)str[i]); 48 | result.push_back(bfr[0]); 49 | result.push_back(bfr[1]); 50 | } 51 | 52 | return result; 53 | } 54 | 55 | static std::string 56 | toHex(unsigned nr) 57 | { 58 | std::stringstream ss; 59 | ss << std::hex << nr; 60 | return ss.str(); 61 | } 62 | 63 | template 64 | static std::string 65 | str(Type t) 66 | { 67 | std::stringstream ss; 68 | ss << t; 69 | return ss.str(); 70 | } 71 | 72 | static std::string 73 | str(const char* fmt, ...) 74 | { 75 | std::va_list ap; 76 | va_start(ap, fmt); 77 | std::string result = strVl(fmt, ap); 78 | va_end(ap); 79 | return result; 80 | } 81 | 82 | static std::string 83 | strVl(const char* fmt, std::va_list ap) 84 | { 85 | char bfr[1024] = {0}; 86 | formatVl(bfr, sizeof(bfr), fmt, ap); 87 | return std::string(bfr); 88 | } 89 | 90 | static int 91 | format(char* str, size_t size, const char* fmt, ...) 92 | { 93 | std::va_list ap; 94 | va_start(ap, fmt); 95 | int rv = formatVl(str, size, fmt, ap); 96 | va_end(ap); 97 | return rv; 98 | } 99 | 100 | static int 101 | formatVl(char* str, size_t size, const char* fmt, std::va_list ap) 102 | { 103 | #if defined(IMC_OS_POSIX) 104 | int rv = vsnprintf(str, size, fmt, ap); 105 | #elif defined(IMC_OS_WINDOWS) 106 | int rv = vsnprintf_s(str, size, size - 1, fmt, ap); 107 | #else 108 | int rv = std::vsprintf(str, fmt, ap); 109 | #endif 110 | return rv; 111 | } 112 | }; 113 | } 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/Heartbeat.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_HEARTBEAT_HPP_INCLUDED_ 24 | #define IMC_HEARTBEAT_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Heartbeat. 44 | class Heartbeat: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 150; 52 | } 53 | 54 | static Heartbeat* 55 | cast(Message* msg__) 56 | { 57 | return (Heartbeat*)msg__; 58 | } 59 | 60 | Heartbeat(void) 61 | { 62 | m_header.mgid = Heartbeat::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | Heartbeat* 67 | clone(void) const 68 | { 69 | return new Heartbeat(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return Heartbeat::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "Heartbeat"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/Enumerations.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_ENUMERATIONS_HPP_INCLUDED_ 24 | #define IMC_ENUMERATIONS_HPP_INCLUDED_ 25 | 26 | namespace IMC 27 | { 28 | //! Boolean Value. 29 | enum Boolean 30 | { 31 | //! False. 32 | BOOL_FALSE = 0, 33 | //! True. 34 | BOOL_TRUE = 1 35 | }; 36 | 37 | //! Controlled Mode. 38 | enum ControlledMode 39 | { 40 | //! Relinquish / Handoff Control. 41 | CTLMD_RELINQUISH_HANDOFF_CTL = 0, 42 | //! Request Control. 43 | CTLMD_REQUEST_CTL = 1, 44 | //! Override Control. 45 | CTLMD_OVERRIDE_CTL = 2 46 | }; 47 | 48 | //! Speed Units. 49 | enum SpeedUnits 50 | { 51 | //! Meters per second. 52 | SUNITS_METERS_PS = 0, 53 | //! RPM. 54 | SUNITS_RPM = 1, 55 | //! Percentage. 56 | SUNITS_PERCENTAGE = 2 57 | }; 58 | 59 | //! System Type. 60 | enum SystemType 61 | { 62 | //! CCU. 63 | SYSTEMTYPE_CCU = 0, 64 | //! Human-portable Sensor. 65 | SYSTEMTYPE_HUMANSENSOR = 1, 66 | //! UUV. 67 | SYSTEMTYPE_UUV = 2, 68 | //! USV. 69 | SYSTEMTYPE_USV = 3, 70 | //! UAV. 71 | SYSTEMTYPE_UAV = 4, 72 | //! UGV. 73 | SYSTEMTYPE_UGV = 5, 74 | //! Static sensor. 75 | SYSTEMTYPE_STATICSENSOR = 6, 76 | //! Mobile sensor. 77 | SYSTEMTYPE_MOBILESENSOR = 7, 78 | //! Wireless Sensor Network. 79 | SYSTEMTYPE_WSN = 8 80 | }; 81 | 82 | //! Z Units. 83 | enum ZUnits 84 | { 85 | //! None. 86 | Z_NONE = 0, 87 | //! Depth. 88 | Z_DEPTH = 1, 89 | //! Altitude. 90 | Z_ALTITUDE = 2, 91 | //! Height. 92 | Z_HEIGHT = 3 93 | }; 94 | 95 | //! RSSI Units. 96 | enum RSSIUnits 97 | { 98 | //! Decibel. 99 | RSSIUNITS_dB = 0, 100 | //! Percentage. 101 | RSSIUNITS_PERCENTAGE = 1 102 | }; 103 | 104 | //! UAV Type. 105 | enum UAVType 106 | { 107 | //! Fixed-Wing. 108 | UAVTYPE_FIXEDWING = 0, 109 | //! Copter. 110 | UAVTYPE_COPTER = 1, 111 | //! Vtol. 112 | UAVTYPE_VTOL = 2 113 | }; 114 | } 115 | 116 | #endif 117 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/StopManeuver.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_STOPMANEUVER_HPP_INCLUDED_ 24 | #define IMC_STOPMANEUVER_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Stop Maneuver. 44 | class StopManeuver: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 468; 52 | } 53 | 54 | static StopManeuver* 55 | cast(Message* msg__) 56 | { 57 | return (StopManeuver*)msg__; 58 | } 59 | 60 | StopManeuver(void) 61 | { 62 | m_header.mgid = StopManeuver::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | StopManeuver* 67 | clone(void) const 68 | { 69 | return new StopManeuver(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return StopManeuver::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "StopManeuver"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/RestartSystem.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_RESTARTSYSTEM_HPP_INCLUDED_ 24 | #define IMC_RESTARTSYSTEM_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Restart System. 44 | class RestartSystem: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 9; 52 | } 53 | 54 | static RestartSystem* 55 | cast(Message* msg__) 56 | { 57 | return (RestartSystem*)msg__; 58 | } 59 | 60 | RestartSystem(void) 61 | { 62 | m_header.mgid = RestartSystem::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | RestartSystem* 67 | clone(void) const 68 | { 69 | return new RestartSystem(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return RestartSystem::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "RestartSystem"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/QueryEntityState.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_QUERYENTITYSTATE_HPP_INCLUDED_ 24 | #define IMC_QUERYENTITYSTATE_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Query Entity State. 44 | class QueryEntityState: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 2; 52 | } 53 | 54 | static QueryEntityState* 55 | cast(Message* msg__) 56 | { 57 | return (QueryEntityState*)msg__; 58 | } 59 | 60 | QueryEntityState(void) 61 | { 62 | m_header.mgid = QueryEntityState::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | QueryEntityState* 67 | clone(void) const 68 | { 69 | return new QueryEntityState(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return QueryEntityState::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "QueryEntityState"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/GetParametersXml.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_GETPARAMETERSXML_HPP_INCLUDED_ 24 | #define IMC_GETPARAMETERSXML_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Get Parameters XML. 44 | class GetParametersXml: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 894; 52 | } 53 | 54 | static GetParametersXml* 55 | cast(Message* msg__) 56 | { 57 | return (GetParametersXml*)msg__; 58 | } 59 | 60 | GetParametersXml(void) 61 | { 62 | m_header.mgid = GetParametersXml::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | GetParametersXml* 67 | clone(void) const 68 | { 69 | return new GetParametersXml(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return GetParametersXml::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "GetParametersXml"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/ImageTracking.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_IMAGETRACKING_HPP_INCLUDED_ 24 | #define IMC_IMAGETRACKING_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | namespace IMC 43 | { 44 | //! Image Tracking. 45 | class ImageTracking: public Maneuver 46 | { 47 | public: 48 | 49 | static uint16_t 50 | getIdStatic(void) 51 | { 52 | return 490; 53 | } 54 | 55 | static ImageTracking* 56 | cast(Message* msg__) 57 | { 58 | return (ImageTracking*)msg__; 59 | } 60 | 61 | ImageTracking(void) 62 | { 63 | m_header.mgid = ImageTracking::getIdStatic(); 64 | clear(); 65 | } 66 | 67 | ImageTracking* 68 | clone(void) const 69 | { 70 | return new ImageTracking(*this); 71 | } 72 | 73 | void 74 | clear(void) 75 | { 76 | } 77 | 78 | uint8_t* 79 | serializeFields(uint8_t* bfr__) const 80 | { 81 | return bfr__; 82 | } 83 | 84 | size_t 85 | deserializeFields(const uint8_t* bfr__, size_t size__) 86 | { 87 | (void)bfr__; 88 | (void)size__; 89 | return 0; 90 | } 91 | 92 | size_t 93 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 94 | { 95 | (void)bfr__; 96 | (void)size__; 97 | return 0; 98 | } 99 | 100 | uint16_t 101 | getId(void) const 102 | { 103 | return ImageTracking::getIdStatic(); 104 | } 105 | 106 | const char* 107 | getName(void) const 108 | { 109 | return "ImageTracking"; 110 | } 111 | 112 | size_t 113 | getFixedSerializationSize(void) const 114 | { 115 | return 0; 116 | } 117 | }; 118 | } 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/TeleoperationDone.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_TELEOPERATIONDONE_HPP_INCLUDED_ 24 | #define IMC_TELEOPERATIONDONE_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Teleoperation Done. 44 | class TeleoperationDone: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 460; 52 | } 53 | 54 | static TeleoperationDone* 55 | cast(Message* msg__) 56 | { 57 | return (TeleoperationDone*)msg__; 58 | } 59 | 60 | TeleoperationDone(void) 61 | { 62 | m_header.mgid = TeleoperationDone::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | TeleoperationDone* 67 | clone(void) const 68 | { 69 | return new TeleoperationDone(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return TeleoperationDone::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "TeleoperationDone"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/AcousticSystemsQuery.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_ACOUSTICSYSTEMSQUERY_HPP_INCLUDED_ 24 | #define IMC_ACOUSTICSYSTEMSQUERY_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Acoustic Systems Query. 44 | class AcousticSystemsQuery: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 212; 52 | } 53 | 54 | static AcousticSystemsQuery* 55 | cast(Message* msg__) 56 | { 57 | return (AcousticSystemsQuery*)msg__; 58 | } 59 | 60 | AcousticSystemsQuery(void) 61 | { 62 | m_header.mgid = AcousticSystemsQuery::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | AcousticSystemsQuery* 67 | clone(void) const 68 | { 69 | return new AcousticSystemsQuery(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return AcousticSystemsQuery::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "AcousticSystemsQuery"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/GetOperationalLimits.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_GETOPERATIONALLIMITS_HPP_INCLUDED_ 24 | #define IMC_GETOPERATIONALLIMITS_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Get Operational Limits. 44 | class GetOperationalLimits: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 505; 52 | } 53 | 54 | static GetOperationalLimits* 55 | cast(Message* msg__) 56 | { 57 | return (GetOperationalLimits*)msg__; 58 | } 59 | 60 | GetOperationalLimits(void) 61 | { 62 | m_header.mgid = GetOperationalLimits::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | GetOperationalLimits* 67 | clone(void) const 68 | { 69 | return new GetOperationalLimits(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return GetOperationalLimits::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "GetOperationalLimits"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/QueryPowerChannelState.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_QUERYPOWERCHANNELSTATE_HPP_INCLUDED_ 24 | #define IMC_QUERYPOWERCHANNELSTATE_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Query Power Channel State. 44 | class QueryPowerChannelState: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 310; 52 | } 53 | 54 | static QueryPowerChannelState* 55 | cast(Message* msg__) 56 | { 57 | return (QueryPowerChannelState*)msg__; 58 | } 59 | 60 | QueryPowerChannelState(void) 61 | { 62 | m_header.mgid = QueryPowerChannelState::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | QueryPowerChannelState* 67 | clone(void) const 68 | { 69 | return new QueryPowerChannelState(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return QueryPowerChannelState::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "QueryPowerChannelState"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Spec/QueryEntityActivationState.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | // Automatically generated. * 19 | //*************************************************************************** 20 | // IMC XML MD5: 522ff971d12877ebe15aff467ba253d4 * 21 | //*************************************************************************** 22 | 23 | #ifndef IMC_QUERYENTITYACTIVATIONSTATE_HPP_INCLUDED_ 24 | #define IMC_QUERYENTITYACTIVATIONSTATE_HPP_INCLUDED_ 25 | 26 | // ISO C++ 98 headers. 27 | #include 28 | #include 29 | #include 30 | 31 | // IMC headers. 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace IMC 42 | { 43 | //! Query Entity Activation State. 44 | class QueryEntityActivationState: public Message 45 | { 46 | public: 47 | 48 | static uint16_t 49 | getIdStatic(void) 50 | { 51 | return 15; 52 | } 53 | 54 | static QueryEntityActivationState* 55 | cast(Message* msg__) 56 | { 57 | return (QueryEntityActivationState*)msg__; 58 | } 59 | 60 | QueryEntityActivationState(void) 61 | { 62 | m_header.mgid = QueryEntityActivationState::getIdStatic(); 63 | clear(); 64 | } 65 | 66 | QueryEntityActivationState* 67 | clone(void) const 68 | { 69 | return new QueryEntityActivationState(*this); 70 | } 71 | 72 | void 73 | clear(void) 74 | { 75 | } 76 | 77 | uint8_t* 78 | serializeFields(uint8_t* bfr__) const 79 | { 80 | return bfr__; 81 | } 82 | 83 | size_t 84 | deserializeFields(const uint8_t* bfr__, size_t size__) 85 | { 86 | (void)bfr__; 87 | (void)size__; 88 | return 0; 89 | } 90 | 91 | size_t 92 | reverseDeserializeFields(const uint8_t* bfr__, size_t size__) 93 | { 94 | (void)bfr__; 95 | (void)size__; 96 | return 0; 97 | } 98 | 99 | uint16_t 100 | getId(void) const 101 | { 102 | return QueryEntityActivationState::getIdStatic(); 103 | } 104 | 105 | const char* 106 | getName(void) const 107 | { 108 | return "QueryEntityActivationState"; 109 | } 110 | 111 | size_t 112 | getFixedSerializationSize(void) const 113 | { 114 | return 0; 115 | } 116 | }; 117 | } 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /external/imc-cxx/IMC/Base/ByteBuffer.hpp: -------------------------------------------------------------------------------- 1 | //*************************************************************************** 2 | // Copyright 2017 OceanScan - Marine Systems & Technology, Lda. * 3 | //*************************************************************************** 4 | // Licensed under the Apache License, Version 2.0 (the "License"); * 5 | // you may not use this file except in compliance with the License. * 6 | // You may obtain a copy of the License at * 7 | // * 8 | // http://www.apache.org/licenses/LICENSE-2.0 * 9 | // * 10 | // Unless required by applicable law or agreed to in writing, software * 11 | // distributed under the License is distributed on an "AS IS" BASIS, * 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 13 | // See the License for the specific language governing permissions and * 14 | // limitations under the License. * 15 | //*************************************************************************** 16 | // Author: Ricardo Martins * 17 | //*************************************************************************** 18 | 19 | #ifndef IMC_BYTE_BUFFER_HPP_INCLUDED_ 20 | #define IMC_BYTE_BUFFER_HPP_INCLUDED_ 21 | 22 | // ISO C++ 98 headers. 23 | #include 24 | #include 25 | #include 26 | 27 | // IMC Base headers. 28 | #include "Config.hpp" 29 | 30 | namespace IMC 31 | { 32 | class ByteBuffer 33 | { 34 | friend std::ostream& 35 | operator<<(std::ostream& os, ByteBuffer& buffer); 36 | 37 | public: 38 | explicit 39 | ByteBuffer(size_t capacity = 128): 40 | m_buffer(NULL), 41 | m_capacity(ByteBuffer::computeNextPowerOfTwo(capacity)), 42 | m_size(0) 43 | { 44 | m_buffer = (uint8_t*)std::malloc(m_capacity); 45 | } 46 | 47 | inline 48 | ~ByteBuffer() 49 | { 50 | std::free(m_buffer); 51 | } 52 | 53 | inline size_t 54 | getCapacity() const 55 | { 56 | return m_capacity; 57 | } 58 | 59 | inline void 60 | grow(size_t size) 61 | { 62 | if (size > m_capacity) 63 | { 64 | m_capacity = computeNextPowerOfTwo(size); 65 | m_buffer = (uint8_t*)std::realloc(m_buffer, m_capacity); 66 | } 67 | } 68 | 69 | inline void 70 | setSize(size_t size) 71 | { 72 | grow(size); 73 | m_size = size; 74 | } 75 | 76 | inline size_t 77 | getSize() 78 | { 79 | return m_size; 80 | } 81 | 82 | inline uint8_t* 83 | getBuffer() 84 | { 85 | return m_buffer; 86 | } 87 | 88 | inline char* 89 | getBufferSigned() 90 | { 91 | return (char*)m_buffer; 92 | } 93 | 94 | void 95 | append(const uint8_t* data, size_t size) 96 | { 97 | grow(m_size + size); 98 | std::memcpy(m_buffer + m_size, data, size); 99 | m_size += size; 100 | } 101 | 102 | void 103 | appendSigned(const char* data, size_t size) 104 | { 105 | append((uint8_t*)data, size); 106 | } 107 | 108 | private: 109 | //! Internal buffer. 110 | uint8_t* m_buffer; 111 | //! Internal buffer's capacity. 112 | size_t m_capacity; 113 | //! Internal buffer's used space. 114 | size_t m_size; 115 | 116 | //! Compute the next power of two of a value. 117 | //! @param val value. 118 | //! @return next power of two. 119 | static inline size_t 120 | computeNextPowerOfTwo(size_t val) 121 | { 122 | size_t r = 1; 123 | 124 | while (r < val) 125 | r <<= 1; 126 | 127 | return r; 128 | } 129 | }; 130 | 131 | inline std::ostream& 132 | operator<<(std::ostream& os, ByteBuffer& buffer) 133 | { 134 | os.write((char*)buffer.m_buffer, buffer.m_size); 135 | return os; 136 | } 137 | } 138 | 139 | #endif 140 | -------------------------------------------------------------------------------- /include/imc_ros_bridge/imc_ros_bridge_server.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The SMaRC project (https://smarc.se/) 2 | * 3 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | * 5 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | * 7 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * 9 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * 11 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | */ 13 | 14 | #ifndef IMC_ROS_BRIDGE_SERVER_H 15 | #define IMC_ROS_BRIDGE_SERVER_H 16 | 17 | #include 18 | #include 19 | 20 | namespace ros_to_imc { 21 | 22 | template 23 | bool convert(const ROS_MSG& ros_msg, IMC_MSG& imc_msg) 24 | { 25 | static_assert(sizeof(IMC_MSG) == -1 || sizeof(ROS_MSG) == -1, "ERROR: You need to supply a convert specialization for the ROS -> IMC msg types provided"); 26 | return false; 27 | } 28 | 29 | template 30 | class BridgeServer { 31 | 32 | private: 33 | 34 | ros::Subscriber ros_sub; 35 | //ros_imc_broker::TcpLink& tcp_client_; 36 | IMCHandle& imc_handle; 37 | 38 | public: 39 | 40 | BridgeServer(ros::NodeHandle& ros_node, IMCHandle& imc_handle, const std::string& ros_topic) : imc_handle(imc_handle) 41 | { 42 | ros_sub = ros_node.subscribe(ros_topic, 10, &BridgeServer::conversion_callback, this); 43 | } 44 | 45 | void conversion_callback(const ROS_MSG& ros_msg) 46 | { 47 | IMC_MSG imc_msg; 48 | bool success = convert(ros_msg, imc_msg); 49 | if (success) { 50 | //tcp_client_.write(&imc_msg); 51 | imc_handle.write(imc_msg); 52 | } 53 | else { 54 | ROS_WARN("There was an error trying to convert imc type %s", imc_msg.getName()); 55 | } 56 | } 57 | 58 | }; 59 | 60 | } // namespace ros_to_imc 61 | 62 | namespace imc_to_ros { 63 | 64 | template 65 | bool convert(const IMC_MSG& imc_msg, ROS_MSG& ros_msg) 66 | { 67 | static_assert(sizeof(IMC_MSG) == -1 || sizeof(ROS_MSG) == -1, "ERROR: You need to supply a convert specialization for the IMC -> ROS msg types provided"); 68 | return false; 69 | } 70 | 71 | template 72 | class BridgeServer { 73 | 74 | private: 75 | 76 | ros::Publisher ros_pub; 77 | 78 | public: 79 | 80 | BridgeServer(IMCHandle& imc_handle, ros::NodeHandle& ros_node, const std::string& ros_topic) 81 | { 82 | ros_pub = ros_node.advertise(ros_topic, 10); 83 | imc_handle.tcp_subscribe(IMC_MSG::getIdStatic(), std::bind(&BridgeServer::conversion_callback, this, std::placeholders::_1)); 84 | } 85 | 86 | void conversion_callback(const IMC::Message* imc_msg) const 87 | { 88 | ROS_MSG ros_msg; 89 | bool success = convert(static_cast(*imc_msg), ros_msg); 90 | if (success) { 91 | ros_pub.publish(ros_msg); 92 | } 93 | else { 94 | ROS_WARN("There was an error trying to convert imc type %s", imc_msg->getName()); 95 | } 96 | } 97 | 98 | }; 99 | 100 | } // namespace imc_to_ros 101 | 102 | #endif // IMC_ROS_BRIDGE_SERVER_H 103 | --------------------------------------------------------------------------------