Skip to content

Latest commit

 

History

History
79 lines (64 loc) · 2.16 KB

README.md

File metadata and controls

79 lines (64 loc) · 2.16 KB

vortex_msgs

Industrial CI pre-commit.ci status

This ROS package contains all custom ROS 2 interfaces used in all workspaces

Before you add a new custom interface: are you really sure you need one?

First have a look in the common_interfaces repository to find out if any of the message and service types included in ROS 2 works for you.

Adding a new custom interface

New message definitions are added to msg.

Add the new message in the CMakeLists.txt file.

set(msg_files
   ... # other messages
   "msg/YourNewMessage.msg"
)

For services and actions it is the same way. Service definitions are added to srv, and to the CMakeLists.txt like

set(srv_files
   ... # other services
   "srv/YourNewService.srv"
)

Action definitions are added to action, and to the CMakeLists.txt like

set(action_files
   ... # other actions
   "action/YourNewAction.action"
)

Using the messages in your package

In your package.xml, add this dependency

<depend>vortex_msgs</depend>

Add it to your CMakeLists.txt

find_package(vortex_msgs REQUIRED)

If your package includes C++ code which depend on vortex_msgs you also need to add the following to the CMakeLists.txt

ament_taget_dependencies(<your_executable>
    ... # other dependencies
    vortex_msgs
)

Include the interfaces in your code

For C++

// message
#include <vortex_msgs/msg/your_new_message.hpp>

// service
#include <vortex_msgs/srv/your_new_service.hpp>

// action
#include <vortex_msgs/action/your_new_action.hpp>

For Python

# message
from vortex_msgs.msg import YourNewMessage

# service
from vortex_msgs.srv import YourNewService

# action
from vortex_msgs.action import YourNewAction