Class MenuEntryMsg
ROS visualization_msgs/MenuEntry message.
Implements
Inherited Members
Namespace: Unity.SimulationPro.Foundation.Visualization
Assembly: Unity.SimulationPro.Foundation.dll
Syntax
[Serializable]
public class MenuEntryMsg : IMessage
Constructors
MenuEntryMsg()
Initializes a new instance with default values.
Declaration
public MenuEntryMsg()
MenuEntryMsg(uint, uint, string, string, byte)
Initializes a new instance with default values.
Declaration
public MenuEntryMsg(uint id, uint parent_id, string title, string command, byte command_type)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | id | Unique integer identifier. |
| uint | parent_id | Identifier of the parent entry. |
| string | title | Display title. |
| string | command | Command data. |
| byte | command_type | Integer code specifying the command type. |
Fields
FEEDBACK
Command_type stores the type of response desired when this menu entry is clicked. FEEDBACK: send an InteractiveMarkerFeedback message with menu_entry_id set to this entry's id. ROSRUN: execute "rosrun" with arguments given in the command field (above). ROSLAUNCH: execute "roslaunch" with arguments given in the command field (above).
Declaration
public const byte FEEDBACK = 0
Field Value
| Type | Description |
|---|---|
| byte |
ROSLAUNCH
Constant value for ROSLAUNCH.
Declaration
public const byte ROSLAUNCH = 2
Field Value
| Type | Description |
|---|---|
| byte |
ROSRUN
Constant value for ROSRUN.
Declaration
public const byte ROSRUN = 1
Field Value
| Type | Description |
|---|---|
| byte |
command
Arguments to command indicated by command_type (below)
Declaration
public string command
Field Value
| Type | Description |
|---|---|
| string |
command_type
Command type field.
Declaration
public byte command_type
Field Value
| Type | Description |
|---|---|
| byte |
id
MenuEntry message. Each InteractiveMarker message has an array of MenuEntry messages. A collection of MenuEntries together describe a menu/submenu/subsubmenu/etc tree, though they are stored in a flat array. The tree structure is represented by giving each menu entry an ID number and a "parent_id" field. Top-level entries are the ones with parent_id = 0. Menu entries are ordered within their level the same way they are ordered in the containing array. Parent entries must appear before their children. Example:
- id = 3 parent_id = 0 title = "fun"
- id = 2 parent_id = 0 title = "robot"
- id = 4 parent_id = 2 title = "pr2"
- id = 5 parent_id = 2 title = "turtle" Gives a menu tree like this:
- fun
- robot
- pr2
- turtle ID is a number for each menu entry. Must be unique within the control, and should never be 0.
Declaration
public uint id
Field Value
| Type | Description |
|---|---|
| uint |
k_MessageTypeId
Identifier for this message type.
Declaration
public static readonly MessageTypeId k_MessageTypeId
Field Value
| Type | Description |
|---|---|
| MessageTypeId |
k_MessageTypeName
The ROS message type name string used for serialization and topic matching.
Declaration
public const string k_MessageTypeName = "visualization_msgs/MenuEntry"
Field Value
| Type | Description |
|---|---|
| string |
parent_id
ID of the parent of this menu entry, if it is a submenu. If this menu entry is a top-level entry, set parent_id to 0.
Declaration
public uint parent_id
Field Value
| Type | Description |
|---|---|
| uint |
title
menu / entry title
Declaration
public string title
Field Value
| Type | Description |
|---|---|
| string |
Properties
MessageTypeId
Gets the unique runtime identifier for this message type.
Declaration
public MessageTypeId MessageTypeId { get; }
Property Value
| Type | Description |
|---|---|
| MessageTypeId |
MessageTypeName
Gets the ROS message type name for this message.
Declaration
public string MessageTypeName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Deserialize(IMessageDeserializer)
Deserializes a MenuEntryMsg from the given deserializer.
Declaration
public static MenuEntryMsg Deserialize(IMessageDeserializer deserializer)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessageDeserializer | deserializer | The deserializer. |
Returns
| Type | Description |
|---|---|
| MenuEntryMsg | A new MenuEntryMsg instance. |
Register()
Registers this message type with the MessageTypeRegistry.
Declaration
[InitializeOnLoadMethod]
public static void Register()
ToString()
Returns a human-readable string representation of this message.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string representation of this instance. |
Overrides
WriteTo(IMessageSerializer)
Serializes this message to the given serializer.
Declaration
public void WriteTo(IMessageSerializer serializer)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessageSerializer | serializer | The serializer. |