EvoSim
A steppable soft-body simulator which can be initialized from an EvoWorld
instance.
Quicklinks: EvoWorld, EvoSim, EvoViewer, WorldObject, envs.EvoGymBase, helper functions and metadata
Page Outline
class EvoSim
Create, step, reset, and get data from an Evolution Gym simulation.
Args:
world
(EvoWorld): object containing world voxel specification.
method __init__
__init__(world: EvoWorld) → None
method get_actuator_indices
get_actuator_indices(robot_name: str) → ndarray
Returns the voxel indices a target robot’s actuators in the simulation.
Args:
robot_name
(str): name of robot.
Returns:
np.ndarray
:(n,)
array of actuator indices, wheren
is the number of actuators.
method get_dim_action_space
get_dim_action_space(robot_name: str) → int
Returns the number of actuators for a target robot in the simulation.
Args:
robot_name
(str): name of robot.
Returns:
int
: number of actuators.
method get_time
get_time() → int
Returns the current time as defined in the simulator. Time starts at 0
and is incremented each time the simulator steps. Time resets to 0
when the simulator is reset.
Returns:
int
: the current time.
method object_orientation_at_time
object_orientation_at_time(time: int, object_name: str) → float
Returns an estimate of the orientation of an object at time time
. Use EvoSim.get_time()
to get current measurements.
Args:
time
(int): time at which to return measurement.object_name
(str): name of object
Returns:
float
: orientation with respect to x-axis in radians (increasing counter-clockwise) from the range [0, 2π].
method object_pos_at_time
object_pos_at_time(time: int, object_name: str) → ndarray
Returns positions of all point-masses in a target object at time time
. Use EvoSim.get_time()
to get current measurements.
Args:
time
(int): time at which to return measurements.object_name
(str): name of object
Returns:
np.ndarray
:(2, n)
array of measurements, wheren
is the number of point-masses in the target object.
method object_vel_at_time
object_vel_at_time(time: int, object_name: str) → ndarray
Returns velocities of all point-masses in a target object at time time
. Use EvoSim.get_time()
to get current measurements.
Args:
time
(int): time at which to return measurements.object_name
(str): name of object
Returns:
np.ndarray
:(2, n)
array of measurements, wheren
is the number of point-masses in the target object.
method pos_at_time
pos_at_time(time: int) → ndarray
Returns positions of all point-masses in the simulation at time time
. Use EvoSim.get_time()
to get current measurements.
Args:
time
(int): time at which to return measurements.
Returns:
np.ndarray
:(2, n)
array of measurements, wheren
is the number of points in the simulation.
method reset
reset() → None
Reset the simulation to time 0
.
method set_action
set_action(robot_name: str, action: ndarray) → None
Set an action for a target robot. This function updates the robot’s actuator targets, but will not step the simulation.
Args:
robot_name
(str): name of robotaction
(np.ndarray):(n,)
array of actions, wheren
is the number of actuators of the target robot.
method step
step() → None
Step the simulation.
method vel_at_time
vel_at_time(time: int) → ndarray
Returns velocities of all point-masses in the simulation at time time
. Use EvoSim.get_time()
to get current measurements.
Args:
time
(int): time at which to return measurements.
Returns:
np.ndarray
:(2, n)
array of measurements, wheren
is the number of points in the simulation.
This file was automatically generated via lazydocs.