Main Content


Retrieve definition of ROS message type



def = definition(msg) returns the ROS definition of the message type associated with the message object, msg. The details of the message definition include the structure, property data types, and comments from the authors of that specific message.


collapse all

Create a Point Message.

point = rosmessage('geometry_msgs/Point');

Access the definition.

def = definition(point)
def = 
    '% This contains the position of a point in free space
     double X
     double Y
     double Z

Input Arguments

collapse all

ROS message, specified as a Message object handle. This message can be created using the rosmessage function.

Output Arguments

collapse all

Details of the information inside the ROS message definition, returned as a character vector.

See Also


Introduced in R2019b