Mobility
gradysim.protocol.messages.mobility
This file defines mobility commands. Mobility commands are sent to the mobility module to instruct it to perform some mobility action, like moving the node to a new location.
GotoCoordsMobilityCommand
Bases: MobilityCommand
Represents a mobility command that instructs the mobility module to move the node to a new location. The new location is specified by its x, y, and z coordinates.
Source code in gradysim/protocol/messages/mobility.py
__init__(x, y, z)
Initializes a GoToCoordsMobilityCommand
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
x coords of the new location |
required |
y |
float
|
y coords of the new location |
required |
z |
float
|
z coords of the new location |
required |
Source code in gradysim/protocol/messages/mobility.py
GotoGeoCoordsMobilityCommand
Bases: MobilityCommand
Represents a mobility command that instructs the mobility module to move the node to a new location. The new location is specified by its x, y, and z coordinates.
Source code in gradysim/protocol/messages/mobility.py
__init__(lat, lon, alt)
Initializes a GoToCoordsMobilityCommand
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lat |
float
|
The latitude of the desired location |
required |
lon |
float
|
The longitude of the desired location |
required |
alt |
float
|
The altitude of the desired location |
required |
Source code in gradysim/protocol/messages/mobility.py
MobilityCommand
dataclass
Represents a mobility command. Mobility commands are sent to the mobility module to instruct it to perform some mobility action, like moving the node to a new location. The mobility command has 6 generic parameters whose meaning changes depending on the command type. You shouldn't use this class directly, use one of the subclasses instead (e.g. GotoCoordsMobilityCommand) to have properly typed parameters.
Source code in gradysim/protocol/messages/mobility.py
command_type: MobilityCommandType
instance-attribute
The type of the mobility command
param_1: float = 0
class-attribute
instance-attribute
The first parameter of the mobility command, it's meaning changes depending on the command type
param_2: float = 0
class-attribute
instance-attribute
The second parameter of the mobility command, it's meaning changes depending on the command type
param_3: float = 0
class-attribute
instance-attribute
The third parameter of the mobility command, it's meaning changes depending on the command type
param_4: float = 0
class-attribute
instance-attribute
The fourth parameter of the mobility command, it's meaning changes depending on the command type
param_5: float = 0
class-attribute
instance-attribute
The fifth parameter of the mobility command, it's meaning changes depending on the command type
param_6: float = 0
class-attribute
instance-attribute
The sixth parameter of the mobility command, it's meaning changes depending on the command type
MobilityCommandType
Bases: int
, Enum
Enum that defines the types of mobility commands
Source code in gradysim/protocol/messages/mobility.py
GOTO_COORDS = 1
class-attribute
instance-attribute
Move the node to a new location specified by its x, y, and z euclidean coordinates
GOTO_GEO_COORDS = 2
class-attribute
instance-attribute
Move the node to a new location specified by its latitude, longitude, and altitude
SET_SPEED = 3
class-attribute
instance-attribute
Set the node's speed in m/s
SetSpeedMobilityCommand
Bases: MobilityCommand
Represents a mobility command that sets the node's speed. The only parameter of this command is the desired speed in m/s.
Source code in gradysim/protocol/messages/mobility.py
__init__(speed)
Initializes a SetSpeedMobilityCommand
Parameters:
Name | Type | Description | Default |
---|---|---|---|
speed |
float
|
The desired speed in m/s |
required |