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

I see a problem with ROS built-in primitive type, such as int16.

The only place where int16 is a legal identifier in a ROS context (ignoring custom type definitions in the various languages that have client libraries) is in the ROS msg specification. You cannot use those directly in any client code, as they are mapped onto types native to the language in which the client library is written.

For C++, int16 is mapped onto int16_t (from (c)stdint(.h)). int16 is not a type in C++, so the compiler error is to be expected.

I see a problem with ROS built-in primitive type, such as int16.

The only place where int16 is a legal identifier in a ROS context (ignoring custom type definitions in the various languages that have client libraries) is in the ROS msg specification. You cannot use those directly in any client code, as they are mapped onto types native to the language in which the client library is written.

For C++, int16 is mapped onto int16_t (from (c)stdint(.h)). . int16 is not a type in C++, so the compiler error is to be expected.

Did I forget to include any header file

Add #include <cstdint> to your .cpp file and try again.