Pegasus Interface
Classes:
PegasusInterface is a singleton class (there is only one object instance at any given time) that will be used to |
- class pegasus.simulator.logic.interface.pegasus_interface.PegasusInterface
Bases:
object
PegasusInterface is a singleton class (there is only one object instance at any given time) that will be used to
Methods:
__del__
()Destructor for the object.
__init__
()Initialize the PegasusInterface singleton object (only runs once at a time)
__new__
(cls)Allocates the memory and creates the actual PegasusInterface object is not instance exists yet.
Method that when invoked will clear all vehicles and the simulation environment, leaving only an empty world with a physics environment.
_summary_
Method that returns a list of vehicles that are considered active in the simulator
Method that returns a dictionary containing all the default simulation environments and their path
get_vehicle
(stage_prefix)Method that returns the vehicle object given its 'stage_prefix', i.e., the name the vehicle was spawned with in the simulator.
Method that initializes the world object
load_asset
(usd_asset, stage_prefix)Method that will attempt to load an asset into the current simulation world, given the USD asset path.
load_environment
(usd_path[, force_clear])Method that loads a given world (specified in the usd_path) into the simulator.
load_environment_async
(usd_path[, backend, ...])Method that loads a given world (specified in the usd_path) into the simulator asynchronously.
load_nvidia_environment
([environment_asset])Method that is used to load NVidia internally provided USD stages into the simulaton World
set_ardupilot_default_airframe
(airframe)Method that allows a user to save a new ArduPilot default airframe for the extension.
set_ardupilot_path
(path)Method that allows a user to save a new ArduPilot directory in the configuration files of the extension.
Method that sets the latitude, longitude and altitude from the pegasus interface to the default global coordinates specified in the extension configuration file
set_global_coordinates
([latitude, ...])Method that can be used to set the latitude, longitude and altitude of the simulation world at the origin.
set_px4_default_airframe
(airframe)Method that allows a user to save a new px4 default airframe for the extension.
set_px4_path
(path)Method that allows a user to save a new px4 directory in the configuration files of the extension.
set_viewport_camera
(camera_position, ...)Sets the viewport camera to given position and makes it point to another target position.
set_world_settings
([physics_dt, ...])Set the current world settings to the pre-defined settings.
Attributes:
The altitude of the origin of the simulated world in meters.
A string with the ArduPilot default airframe (if it was setup).
A string with the installation directory for ArduPilot (if it was setup).
The latitude of the origin of the simulated world in degrees.
The longitude of the origin of the simulated world in degrees.
A string with the PX4 default airframe (if it was setup).
A string with the installation directory for PX4 (if it was setup).
The instance of the VehicleManager.
The current omni.isaac.core.world World instance
- __del__()
Destructor for the object. Destroys the only existing instance of this class.
- __init__()
Initialize the PegasusInterface singleton object (only runs once at a time)
- static __new__(cls)
Allocates the memory and creates the actual PegasusInterface object is not instance exists yet. Otherwise, returns the existing instance of the PegasusInterface class.
- Returns:
the single instance of the VehicleManager class
- Return type:
VehicleManger
- clear_scene()
Method that when invoked will clear all vehicles and the simulation environment, leaving only an empty world with a physics environment.
- generate_quadrotor_config_from_yaml(file)
_summary_
- Parameters:
file (str) – _description_
- Returns:
_description_
- Return type:
_type_
- get_all_vehicles()
Method that returns a list of vehicles that are considered active in the simulator
- Returns:
A list of all vehicles that are currently instantiated.
- Return type:
- get_default_environments()
Method that returns a dictionary containing all the default simulation environments and their path
- get_vehicle(stage_prefix)
Method that returns the vehicle object given its ‘stage_prefix’, i.e., the name the vehicle was spawned with in the simulator.
- initialize_world()
Method that initializes the world object
- load_asset(usd_asset, stage_prefix)
Method that will attempt to load an asset into the current simulation world, given the USD asset path.
- load_environment(usd_path, force_clear=False)
Method that loads a given world (specified in the usd_path) into the simulator. If invoked from a python app, this method should have force_clear=False, as the world reset and stop are performed asynchronously by this method, and when we are operating in App mode, we want everything to run in sync.
- async load_environment_async(usd_path, backend='px4', force_clear=False)
Method that loads a given world (specified in the usd_path) into the simulator asynchronously.
- load_nvidia_environment(environment_asset='Hospital/hospital.usd')
Method that is used to load NVidia internally provided USD stages into the simulaton World
- Parameters:
environment_asset (str) – The name of the nvidia asset inside the /Isaac/Environments folder. Default to Hospital/hospital.usd.
- set_ardupilot_default_airframe(airframe)
Method that allows a user to save a new ArduPilot default airframe for the extension.
- Parameters:
airframe (str) – The new ArduPilot default airframe
- set_ardupilot_path(path)
Method that allows a user to save a new ArduPilot directory in the configuration files of the extension.
- Parameters:
absolute_path (str) – The new path of the ArduPilot installation directory
- set_default_global_coordinates()
Method that sets the latitude, longitude and altitude from the pegasus interface to the default global coordinates specified in the extension configuration file
- set_global_coordinates(latitude=None, longitude=None, altitude=None)
Method that can be used to set the latitude, longitude and altitude of the simulation world at the origin.
- Parameters:
- set_new_default_global_coordinates(latitude=None, longitude=None, altitude=None)
- set_px4_default_airframe(airframe)
Method that allows a user to save a new px4 default airframe for the extension.
- Parameters:
absolute_path (str) – The new px4 default airframe
- set_px4_path(path)
Method that allows a user to save a new px4 directory in the configuration files of the extension.
- Parameters:
absolute_path (str) – The new path of the px4-autopilot installation directory
- set_viewport_camera(camera_position, camera_target)
Sets the viewport camera to given position and makes it point to another target position.
- set_world_settings(physics_dt=None, stage_units_in_meters=None, rendering_dt=None, device=None)
Set the current world settings to the pre-defined settings. TODO - finish the implementation of this method. For now these new setting will never override the default ones.
- property altitude
The altitude of the origin of the simulated world in meters.
- Returns:
The latitude of the origin of the simulated world in meters.
- Return type:
- property ardupilot_default_airframe
A string with the ArduPilot default airframe (if it was setup). Otherwise it is None.
- Returns:
A string with the ArduPilot default airframe (if it was setup). Otherwise it is None.
- Return type:
- property ardupilot_path
A string with the installation directory for ArduPilot (if it was setup). Otherwise it is None.
- Returns:
A string with the installation directory for ArduPilot (if it was setup). Otherwise it is None.
- Return type:
- property latitude
The latitude of the origin of the simulated world in degrees.
- Returns:
The latitude of the origin of the simulated world in degrees.
- Return type:
- property longitude
The longitude of the origin of the simulated world in degrees.
- Returns:
The longitude of the origin of the simulated world in degrees.
- Return type:
- property px4_default_airframe
A string with the PX4 default airframe (if it was setup). Otherwise it is None.
- Returns:
A string with the PX4 default airframe (if it was setup). Otherwise it is None.
- Return type:
- property px4_path
A string with the installation directory for PX4 (if it was setup). Otherwise it is None.
- Returns:
A string with the installation directory for PX4 (if it was setup). Otherwise it is None.
- Return type:
- property vehicle_manager
The instance of the VehicleManager.
- Returns:
The current instance of the VehicleManager.
- Return type:
- property world
The current omni.isaac.core.world World instance
- Returns:
The world instance
- Return type:
omni.isaac.core.world