Skip to content

Java Interfaces (msg srv)

Mickael Gaillard edited this page Dec 17, 2017 · 1 revision

ROS Java Interfaces

1. Background

More info on official About ROS Interfaces

2. Message Description Specification

2.1.1 Field Types

built-in-types currently supported:

Type name C++ Java DDS type
bool bool boolean boolean
byte uint8_t byte octet
char char char char
float32 float float float
float64 double double double
int8 int8_t byte octet
uint8 uint8_t byte octet
int16 int16_t short short
uint16 uint16_t short* unsigned short
int32 int32_t int long
uint32 uint32_t int* unsigned long
int64 int64_t long long long
uint64 uint64_t long* unsigned long long
string std::string java.lang.String string
  • Java doesn't provided unsigned type...

Every built-in-type can be used to define arrays:

Type name C++ Java DDS type
static array std::array<T, N> java.util.ArrayList< T > T[N]
unbounded dynamic array std::vector java.util.ArrayList< T > sequence
bounded dynamic array custom_class<T, N> java.util.ArrayList< T > sequence<T, N>
bounded string std::string java.lang.String string

*All types that are more permissive than their ROS definition enforce the ROS constraints in range and length by software