ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Have a look under Constants of this link https://mhanckow.students.wmi.amu.edu.pl/corba/IDL.html#281057
I think you have to use const before the constant like in C++.

Also this is an example of what rosidl_generate_interfaces generates:

ROS2 ConstTest.msg:

uint8 CONST1=1
uint8 CONST2=2
uint8 CONST3=3

uint8 data

ConstTest.idl:

module package_name {
  module msg {
    module ConstTest_Constants {
      const uint8 FAILSAFE_MODE1 = 1;
      const uint8 FAILSAFE_MODE2 = 2;
      const uint8 FAILSAFE_MODE3 = 3;
    };
    struct ConstTest {
      uint8 data;
    };
  };
};