diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3164494 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +build +devel diff --git a/.github/workflows/docker-image-robot-develop.yml b/.github/workflows/docker-image-perception-develop.yml similarity index 85% rename from .github/workflows/docker-image-robot-develop.yml rename to .github/workflows/docker-image-perception-develop.yml index 7acac19..6aa95a5 100644 --- a/.github/workflows/docker-image-robot-develop.yml +++ b/.github/workflows/docker-image-perception-develop.yml @@ -5,13 +5,13 @@ on: branches: [develop] jobs: - build-ros-robot-x86-64: - name: "Build ROS robot X86/64" + build-ros-perception-x86-64: + name: "Build ROS perception X86/64" runs-on: ubuntu-latest env: - BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_messages/sonia_messages:x86-robot-latest" + BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest" ARCH: x86 - TARGET_TYPE: robot + TARGET_TYPE: perception TARGET_VERSION: develop IMAGE_NAME: provider_actuators GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }} @@ -20,7 +20,7 @@ jobs: - name: Login to Github Package Registry run: | echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin - - name: Build the docker image (robot based) + - name: Build the docker image (perception based) run: | docker build . --tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE} @@ -37,13 +37,13 @@ jobs: run: | docker push ${GITHUB_REMOTE_URL}/${IMAGE_NAME} - build-ros-robot-arm64: - name: "Build ROS robot ARM64" + build-ros-perception-arm64: + name: "Build ROS perception ARM64" runs-on: ubuntu-latest env: - BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_messages/sonia_messages:arm64-robot-latest" + BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:arm64-perception-latest" ARCH: arm64 - TARGET_TYPE: robot + TARGET_TYPE: perception TARGET_VERSION: develop IMAGE_NAME: provider_actuators GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }} @@ -65,7 +65,7 @@ jobs: sudo apt-get install qemu binfmt-support qemu-user-static docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - name: Build the docker image (robot based) + - name: Build the docker image (perception based) run: | docker build . --tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE} @@ -85,7 +85,7 @@ jobs: notify-success: name: "Notify Slack - Success" runs-on: ubuntu-latest - needs: [build-ros-robot-x86-64, build-ros-robot-arm64] + needs: [build-ros-perception-x86-64, build-ros-perception-arm64] if: success() steps: - name: Notify Slack Success @@ -100,7 +100,7 @@ jobs: notify-fail: name: "Notify Slack - Failure" runs-on: ubuntu-latest - needs: [build-ros-robot-x86-64, build-ros-robot-arm64] + needs: [build-ros-perception-x86-64, build-ros-perception-arm64] if: failure() steps: - name: Notify Slack Fail diff --git a/.github/workflows/docker-image-robot-feature.yml b/.github/workflows/docker-image-perception-feature.yml similarity index 84% rename from .github/workflows/docker-image-robot-feature.yml rename to .github/workflows/docker-image-perception-feature.yml index 234c073..fd850bf 100644 --- a/.github/workflows/docker-image-robot-feature.yml +++ b/.github/workflows/docker-image-perception-feature.yml @@ -5,13 +5,13 @@ on: branches: [feature/**] jobs: - build-ros-robot-x86-64: - name: "Build ROS robot X86/64" + build-ros-perception-x86-64: + name: "Build ROS perception X86/64" runs-on: ubuntu-latest env: - BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_messages/sonia_messages:x86-robot-latest" + BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest" ARCH: x86 - TARGET_TYPE: robot + TARGET_TYPE: perception TARGET_VERSION: feature IMAGE_NAME: provider_actuators GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }} @@ -20,7 +20,7 @@ jobs: - name: Login to Github Package Registry run: | echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin - - name: Build the docker image (robot based) + - name: Build the docker image (perception based) run: | docker build . --tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE} @@ -32,13 +32,13 @@ jobs: run: | docker push ${GITHUB_REMOTE_URL}/${IMAGE_NAME}:${ARCH}-${TARGET_TYPE}-${TARGET_VERSION}-${GITHUB_REF##*/} - build-ros-robot-arm64: - name: "Build ROS robot ARM64" + build-ros-perception-arm64: + name: "Build ROS perception ARM64" runs-on: ubuntu-latest env: - BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_messages/sonia_messages:arm64-robot-latest" + BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:arm64-perception-latest" ARCH: arm64 - TARGET_TYPE: robot + TARGET_TYPE: perception TARGET_VERSION: feature IMAGE_NAME: provider_actuators GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }} @@ -60,7 +60,7 @@ jobs: sudo apt-get install qemu binfmt-support qemu-user-static docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - name: Build the docker image (robot based) + - name: Build the docker image (perception based) run: | docker build . --tag build-feature-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE} @@ -75,7 +75,7 @@ jobs: notify-success: name: "Notify Slack - Success" runs-on: ubuntu-latest - needs: [build-ros-robot-x86-64, build-ros-robot-arm64] + needs: [build-ros-perception-x86-64, build-ros-perception-arm64] if: success() steps: - name: Notify Slack Success @@ -90,7 +90,7 @@ jobs: notify-fail: name: "Notify Slack - Failure" runs-on: ubuntu-latest - needs: [build-ros-robot-x86-64, build-ros-robot-arm64] + needs: [build-ros-perception-x86-64, build-ros-perception-arm64] if: failure() steps: - name: Notify Slack Fail diff --git a/.github/workflows/docker-image-robot-master.yml b/.github/workflows/docker-image-perception-master.yml similarity index 87% rename from .github/workflows/docker-image-robot-master.yml rename to .github/workflows/docker-image-perception-master.yml index 46bf28a..57aee31 100644 --- a/.github/workflows/docker-image-robot-master.yml +++ b/.github/workflows/docker-image-perception-master.yml @@ -5,13 +5,13 @@ on: branches: [master] jobs: - build-ros-robot-x86-64: - name: "Build ROS robot X86/64" + build-ros-perception-x86-64: + name: "Build ROS perception X86/64" runs-on: ubuntu-latest env: - BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_messages/sonia_messages:x86-robot-latest" + BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest" ARCH: x86 - TARGET_TYPE: robot + TARGET_TYPE: perception IMAGE_NAME: provider_actuators GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }} steps: @@ -22,7 +22,7 @@ jobs: - name: Set Target version run: echo '::set-env name=TARGET_VERSION::release-'$(sed -n -e 's/.*\(.*\)<\/version>.*/\1/p' package.xml) - - name: Build the docker image (robot based) + - name: Build the docker image (perception based) run: | docker build . --tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date '+%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE} @@ -41,13 +41,13 @@ jobs: run: | docker push ${GITHUB_REMOTE_URL}/${IMAGE_NAME} - build-ros-robot-arm64: - name: "Build ROS robot ARM64" + build-ros-perception-arm64: + name: "Build ROS perception ARM64" runs-on: ubuntu-latest env: - BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_messages/sonia_messages:arm64-robot-latest" + BASE_IMAGE: "docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:arm64-perception-latest" ARCH: arm64 - TARGET_TYPE: robot + TARGET_TYPE: perception IMAGE_NAME: provider_actuators GITHUB_REMOTE_URL: docker.pkg.github.com/${{ github.repository }} steps: @@ -67,11 +67,11 @@ jobs: - name: Install QEMU to be able to compile on X86 into ARM64 run: | - + sudo apt-get update sudo apt-get install qemu binfmt-support qemu-user-static docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - name: Build the docker image (robot based) + - name: Build the docker image (perception based) run: | docker build . --tag build-${TARGET_VERSION}-${GITHUB_REF##*/}-${GITHUB_RUN_NUMBER} --build-arg BUILD_DATE=$(date '+%Y-%m-%d_%H:%M:%S') --build-arg VERSION=${GITHUB_REF##*/}-$(date ' +%Y-%m-%d_%H:%M:%S') --build-arg BASE_IMAGE=${BASE_IMAGE} @@ -92,7 +92,7 @@ jobs: create-release: name: "Create Github Release" runs-on: ubuntu-latest - needs: [build-ros-robot-x86-64, build-ros-robot-arm64] + needs: [build-ros-perception-x86-64, build-ros-perception-arm64] steps: - uses: actions/checkout@v2 - name: Set Target version @@ -118,7 +118,7 @@ jobs: notify-success: name: "Notify Slack - Success" runs-on: ubuntu-latest - needs: [build-ros-robot-x86-64, build-ros-robot-arm64, create-release] + needs: [build-ros-perception-x86-64, build-ros-perception-arm64, create-release] if: success() steps: - name: Notify Slack Success @@ -133,7 +133,7 @@ jobs: notify-fail: name: "Notify Slack - Failure" runs-on: ubuntu-latest - needs: [build-ros-robot-x86-64, build-ros-robot-arm64, create-release] + needs: [build-ros-perception-x86-64, build-ros-perception-arm64, create-release] if: failure() steps: - name: Notify Slack Fail diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a2952d..f09805e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ find_package( roscpp cmake_modules std_msgs - sonia_msgs + sonia_common ) #=============================================================================== @@ -41,7 +41,7 @@ catkin_package( CATKIN_DEPENDS roscpp std_msgs - sonia_msgs + sonia_common ) diff --git a/Dockerfile b/Dockerfile index 4bd83af..d778284 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE="docker.pkg.github.com/sonia-auv/sonia_messages/sonia_messages:x86-robot-latest" +ARG BASE_IMAGE="docker.pkg.github.com/sonia-auv/sonia_common/sonia_common:x86-perception-latest" FROM ${BASE_IMAGE} diff --git a/README.md b/README.md index 2a2f2a6..ab57764 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Add additional notes about how to deploy this on a live system Add additional project dependencies -* [ROS](http://wiki.ros.org/) - ROS robotic framework +* [ROS](http://wiki.ros.org/) - ROS perceptionic framework ## Versioning diff --git a/package.xml b/package.xml index 93710c9..9d9157d 100644 --- a/package.xml +++ b/package.xml @@ -1,7 +1,7 @@ provider_actuators - 1.0.0 + 1.1.0 The provider_actuators is responsible to communicate with IO board. @@ -17,10 +17,10 @@ roscpp std_msgs - sonia_msgs + sonia_common roscpp std_msgs - sonia_msgs + sonia_common diff --git a/src/provider_actuators/provider_actuators_node.cc b/src/provider_actuators/provider_actuators_node.cc index 686b6da..7275ce5 100644 --- a/src/provider_actuators/provider_actuators_node.cc +++ b/src/provider_actuators/provider_actuators_node.cc @@ -36,7 +36,7 @@ namespace provider_actuators { { rs485_publisherRx = - nh->advertise("/interface_rs485/dataRx", 100); + nh->advertise("/interface_rs485/dataRx", 100); rs485_subscriberTx = nh->subscribe("/interface_rs485/dataTx", 100, &ProviderActuatorsNode::CommunicationDataCallback, this); @@ -67,38 +67,38 @@ namespace provider_actuators { } } - void ProviderActuatorsNode::CommunicationDataCallback(const sonia_msgs::SendRS485Msg::ConstPtr &receivedData) { + void ProviderActuatorsNode::CommunicationDataCallback(const sonia_common::SendRS485Msg::ConstPtr &receivedData) { - if (receivedData->slave == sonia_msgs::SendRS485Msg::SLAVE_IO_CTR) + if (receivedData->slave == sonia_common::SendRS485Msg::SLAVE_IO_CTR) { switch (receivedData->cmd) { - case sonia_msgs::SendRS485Msg::CMD_IO_TEMP: + case sonia_common::SendRS485Msg::CMD_IO_TEMP: HandleTempCallback(receivedData->data); break; - case sonia_msgs::SendRS485Msg::CMD_IO_DROPPER_PORT: - case sonia_msgs::SendRS485Msg::CMD_IO_DROPPER_STARBOARD: + case sonia_common::SendRS485Msg::CMD_IO_DROPPER_PORT: + case sonia_common::SendRS485Msg::CMD_IO_DROPPER_STARBOARD: HandleDroppersCallback(receivedData->cmd, receivedData->data); break; - case sonia_msgs::SendRS485Msg::CMD_IO_TORPEDO_PORT: - case sonia_msgs::SendRS485Msg::CMD_IO_TORPEDO_STARBOARD: + case sonia_common::SendRS485Msg::CMD_IO_TORPEDO_PORT: + case sonia_common::SendRS485Msg::CMD_IO_TORPEDO_STARBOARD: HandleTorpedosCallback(receivedData->cmd, receivedData->data); break; - case sonia_msgs::SendRS485Msg::CMD_IO_LEAK_SENSOR_BACK: - case sonia_msgs::SendRS485Msg::CMD_IO_LEAK_SENSOR_FRONT: - case sonia_msgs::SendRS485Msg::CMD_IO_LEAK_SENSOR_RIGHT: - case sonia_msgs::SendRS485Msg::CMD_IO_LEAK_SENSOR_LEFT: + case sonia_common::SendRS485Msg::CMD_IO_LEAK_SENSOR_BACK: + case sonia_common::SendRS485Msg::CMD_IO_LEAK_SENSOR_FRONT: + case sonia_common::SendRS485Msg::CMD_IO_LEAK_SENSOR_RIGHT: + case sonia_common::SendRS485Msg::CMD_IO_LEAK_SENSOR_LEFT: HandleLeakSensorsCallback(receivedData->cmd); break; - case sonia_msgs::SendRS485Msg::CMD_IO_ARM_OPEN: - case sonia_msgs::SendRS485Msg::CMD_IO_ARM_CLOSE: + case sonia_common::SendRS485Msg::CMD_IO_ARM_OPEN: + case sonia_common::SendRS485Msg::CMD_IO_ARM_CLOSE: HandleArmCallback(receivedData->cmd, receivedData->data); break; @@ -108,7 +108,7 @@ namespace provider_actuators { } - void ProviderActuatorsNode::HandleTempCallback(sonia_msgs::SendRS485Msg::_data_type data) { + void ProviderActuatorsNode::HandleTempCallback(sonia_common::SendRS485Msg::_data_type data) { union Temperature { @@ -131,15 +131,15 @@ namespace provider_actuators { } - void ProviderActuatorsNode::HandleDroppersCallback(sonia_msgs::SendRS485Msg::_cmd_type cmd, sonia_msgs::SendRS485Msg::_data_type data) { + void ProviderActuatorsNode::HandleDroppersCallback(sonia_common::SendRS485Msg::_cmd_type cmd, sonia_common::SendRS485Msg::_data_type data) { std::string side; - if (cmd == sonia_msgs::SendRS485Msg::CMD_IO_DROPPER_PORT) + if (cmd == sonia_common::SendRS485Msg::CMD_IO_DROPPER_PORT) { side = "port"; } - else if (cmd == sonia_msgs::SendRS485Msg::CMD_IO_DROPPER_STARBOARD) + else if (cmd == sonia_common::SendRS485Msg::CMD_IO_DROPPER_STARBOARD) { side = "starboard"; } @@ -149,15 +149,15 @@ namespace provider_actuators { } - void ProviderActuatorsNode::HandleTorpedosCallback(sonia_msgs::SendRS485Msg::_cmd_type cmd, sonia_msgs::SendRS485Msg::_data_type data) { + void ProviderActuatorsNode::HandleTorpedosCallback(sonia_common::SendRS485Msg::_cmd_type cmd, sonia_common::SendRS485Msg::_data_type data) { std::string side; - if (cmd == sonia_msgs::SendRS485Msg::CMD_IO_TORPEDO_PORT) + if (cmd == sonia_common::SendRS485Msg::CMD_IO_TORPEDO_PORT) { side = "port"; } - else if (cmd == sonia_msgs::SendRS485Msg::CMD_IO_TORPEDO_STARBOARD) + else if (cmd == sonia_common::SendRS485Msg::CMD_IO_TORPEDO_STARBOARD) { side = "starboard"; } @@ -166,23 +166,23 @@ namespace provider_actuators { // TODO send msg } - void ProviderActuatorsNode::HandleLeakSensorsCallback(sonia_msgs::SendRS485Msg::_cmd_type cmd) { + void ProviderActuatorsNode::HandleLeakSensorsCallback(sonia_common::SendRS485Msg::_cmd_type cmd) { std::string side; - if (cmd == sonia_msgs::SendRS485Msg::CMD_IO_LEAK_SENSOR_FRONT) + if (cmd == sonia_common::SendRS485Msg::CMD_IO_LEAK_SENSOR_FRONT) { side = "front"; } - else if (cmd == sonia_msgs::SendRS485Msg::CMD_IO_LEAK_SENSOR_LEFT) + else if (cmd == sonia_common::SendRS485Msg::CMD_IO_LEAK_SENSOR_LEFT) { side = "left"; } - else if (cmd == sonia_msgs::SendRS485Msg::CMD_IO_LEAK_SENSOR_RIGHT) + else if (cmd == sonia_common::SendRS485Msg::CMD_IO_LEAK_SENSOR_RIGHT) { side = "right"; } - else if (cmd == sonia_msgs::SendRS485Msg::CMD_IO_LEAK_SENSOR_BACK) + else if (cmd == sonia_common::SendRS485Msg::CMD_IO_LEAK_SENSOR_BACK) { side = "back"; } @@ -193,15 +193,15 @@ namespace provider_actuators { } - void ProviderActuatorsNode::HandleArmCallback(sonia_msgs::SendRS485Msg::_cmd_type cmd, sonia_msgs::SendRS485Msg::_data_type data) { + void ProviderActuatorsNode::HandleArmCallback(sonia_common::SendRS485Msg::_cmd_type cmd, sonia_common::SendRS485Msg::_data_type data) { std::string side; - if (cmd == sonia_msgs::SendRS485Msg::CMD_IO_ARM_OPEN) + if (cmd == sonia_common::SendRS485Msg::CMD_IO_ARM_OPEN) { side = "open"; } - else if (cmd == sonia_msgs::SendRS485Msg::CMD_IO_ARM_CLOSE) + else if (cmd == sonia_common::SendRS485Msg::CMD_IO_ARM_CLOSE) { side = "close"; } @@ -210,43 +210,43 @@ namespace provider_actuators { // TODO send msg } - void ProviderActuatorsNode::DoActionCallback(const sonia_msgs::ActuatorDoAction::ConstPtr &receivedData) { + void ProviderActuatorsNode::DoActionCallback(const sonia_common::ActuatorDoAction::ConstPtr &receivedData) { - sonia_msgs::SendRS485Msg rs485Msg; + sonia_common::SendRS485Msg rs485Msg; - rs485Msg.slave = sonia_msgs::SendRS485Msg::SLAVE_IO_CTR; + rs485Msg.slave = sonia_common::SendRS485Msg::SLAVE_IO_CTR; - if (receivedData->element == sonia_msgs::ActuatorDoAction::ELEMENT_DROPPER - && receivedData->side == sonia_msgs::ActuatorDoAction::SIDE_PORT) + if (receivedData->element == sonia_common::ActuatorDoAction::ELEMENT_DROPPER + && receivedData->side == sonia_common::ActuatorDoAction::SIDE_PORT) { - rs485Msg.cmd = sonia_msgs::SendRS485Msg::CMD_IO_DROPPER_PORT; + rs485Msg.cmd = sonia_common::SendRS485Msg::CMD_IO_DROPPER_PORT; } - else if (receivedData->element == sonia_msgs::ActuatorDoAction::ELEMENT_DROPPER - && receivedData->side == sonia_msgs::ActuatorDoAction::SIDE_STARBOARD) + else if (receivedData->element == sonia_common::ActuatorDoAction::ELEMENT_DROPPER + && receivedData->side == sonia_common::ActuatorDoAction::SIDE_STARBOARD) { - rs485Msg.cmd = sonia_msgs::SendRS485Msg::CMD_IO_DROPPER_STARBOARD; + rs485Msg.cmd = sonia_common::SendRS485Msg::CMD_IO_DROPPER_STARBOARD; } - else if (receivedData->element == sonia_msgs::ActuatorDoAction::ELEMENT_TORPEDO - && receivedData->side == sonia_msgs::ActuatorDoAction::SIDE_PORT) + else if (receivedData->element == sonia_common::ActuatorDoAction::ELEMENT_TORPEDO + && receivedData->side == sonia_common::ActuatorDoAction::SIDE_PORT) { - rs485Msg.cmd = sonia_msgs::SendRS485Msg::CMD_IO_TORPEDO_PORT; + rs485Msg.cmd = sonia_common::SendRS485Msg::CMD_IO_TORPEDO_PORT; } - else if (receivedData->element == sonia_msgs::ActuatorDoAction::ELEMENT_TORPEDO - && receivedData->side == sonia_msgs::ActuatorDoAction::SIDE_STARBOARD) + else if (receivedData->element == sonia_common::ActuatorDoAction::ELEMENT_TORPEDO + && receivedData->side == sonia_common::ActuatorDoAction::SIDE_STARBOARD) { - rs485Msg.cmd = sonia_msgs::SendRS485Msg::CMD_IO_TORPEDO_STARBOARD; + rs485Msg.cmd = sonia_common::SendRS485Msg::CMD_IO_TORPEDO_STARBOARD; } - else if (receivedData->element == sonia_msgs::ActuatorDoAction::ELEMENT_ARM - && receivedData->side == sonia_msgs::ActuatorDoAction::ARM_OPEN) + else if (receivedData->element == sonia_common::ActuatorDoAction::ELEMENT_ARM + && receivedData->side == sonia_common::ActuatorDoAction::ARM_OPEN) { - rs485Msg.cmd = sonia_msgs::SendRS485Msg::CMD_IO_ARM_OPEN; + rs485Msg.cmd = sonia_common::SendRS485Msg::CMD_IO_ARM_OPEN; } - else if (receivedData->element == sonia_msgs::ActuatorDoAction::ELEMENT_ARM - && receivedData->side == sonia_msgs::ActuatorDoAction::ARM_CLOSE) + else if (receivedData->element == sonia_common::ActuatorDoAction::ELEMENT_ARM + && receivedData->side == sonia_common::ActuatorDoAction::ARM_CLOSE) { - rs485Msg.cmd = sonia_msgs::SendRS485Msg::CMD_IO_ARM_CLOSE; + rs485Msg.cmd = sonia_common::SendRS485Msg::CMD_IO_ARM_CLOSE; } rs485Msg.data.push_back(receivedData->action); @@ -255,10 +255,10 @@ namespace provider_actuators { } - bool ProviderActuatorsNode::DoActionSrvCallback(sonia_msgs::ActuatorDoActionSrv::Request &request, - sonia_msgs::ActuatorDoActionSrv::Response &response) { + bool ProviderActuatorsNode::DoActionSrvCallback(sonia_common::ActuatorDoActionSrv::Request &request, + sonia_common::ActuatorDoActionSrv::Response &response) { - sonia_msgs::ActuatorDoAction::Ptr msg(new sonia_msgs::ActuatorDoAction()); + sonia_common::ActuatorDoAction::Ptr msg(new sonia_common::ActuatorDoAction()); msg->action = request.action; msg->element = request.element; msg->side = request.side; diff --git a/src/provider_actuators/provider_actuators_node.h b/src/provider_actuators/provider_actuators_node.h index 84a293d..4296a11 100644 --- a/src/provider_actuators/provider_actuators_node.h +++ b/src/provider_actuators/provider_actuators_node.h @@ -27,9 +27,9 @@ #define PROVIDER_ACTUATORS_PROVIDER_ACTUATOR_NODE_H_ #include -#include -#include -#include +#include +#include +#include namespace provider_actuators { @@ -60,15 +60,15 @@ class ProviderActuatorsNode { ros::Subscriber doActionSubscriber; ros::ServiceServer doActionService; - void CommunicationDataCallback(const sonia_msgs::SendRS485Msg::ConstPtr &receivedData); - void HandleTempCallback(sonia_msgs::SendRS485Msg::_data_type data); - void HandleDroppersCallback(sonia_msgs::SendRS485Msg::_cmd_type cmd, sonia_msgs::SendRS485Msg::_data_type data); - void HandleTorpedosCallback(sonia_msgs::SendRS485Msg::_cmd_type cmd, sonia_msgs::SendRS485Msg::_data_type data); - void HandleLeakSensorsCallback(sonia_msgs::SendRS485Msg::_cmd_type cmd); - void HandleArmCallback(sonia_msgs::SendRS485Msg::_cmd_type cmd, sonia_msgs::SendRS485Msg::_data_type data); + void CommunicationDataCallback(const sonia_common::SendRS485Msg::ConstPtr &receivedData); + void HandleTempCallback(sonia_common::SendRS485Msg::_data_type data); + void HandleDroppersCallback(sonia_common::SendRS485Msg::_cmd_type cmd, sonia_common::SendRS485Msg::_data_type data); + void HandleTorpedosCallback(sonia_common::SendRS485Msg::_cmd_type cmd, sonia_common::SendRS485Msg::_data_type data); + void HandleLeakSensorsCallback(sonia_common::SendRS485Msg::_cmd_type cmd); + void HandleArmCallback(sonia_common::SendRS485Msg::_cmd_type cmd, sonia_common::SendRS485Msg::_data_type data); - void DoActionCallback(const sonia_msgs::ActuatorDoAction::ConstPtr &receivedData); - bool DoActionSrvCallback(sonia_msgs::ActuatorDoActionSrv::Request &request, sonia_msgs::ActuatorDoActionSrv::Response &response); + void DoActionCallback(const sonia_common::ActuatorDoAction::ConstPtr &receivedData); + bool DoActionSrvCallback(sonia_common::ActuatorDoActionSrv::Request &request, sonia_common::ActuatorDoActionSrv::Response &response); };