physics Package¶
base Module¶
-
class
Body(mass=None, density=None, pos=None, rot=None, *args, **kwargs)[source]¶ Bases:
object-
calc_potential_energy(gravity)[source]¶ Calculate the potential energy of the body due to its position (x) and the gravitational acceleration (g).

Parameters: gravity (tuple of 3 floats) – gravitational acceleration vector Returns: potential energy Return type: float
-
calc_rotation_kinetic_energy()[source]¶ Calculate the kinetic energy of the body due to rotational movement.

Returns: kinetic energy Return type: float
-
calc_translation_kinetic_energy()[source]¶ Calculate the kinetic energy of the body due to translational movement.

Returns: kinetic energy Return type: float
-
get_position()[source]¶ Get the position of the body.
Returns: position Return type: 3-sequence of floats
-
get_rotation()[source]¶ Get the orientation of the body.
Returns: rotation matrix Return type: 9-sequence of floats
-
inner_object¶
-
save_velocities()[source]¶ Retrieve the actual velocities (linear and angular) of the body and save them.
-
-
class
Box(size, *args, **kwargs)[source]¶ Bases:
ars.model.physics.base.Body-
size¶
-
-
class
Capsule(length, radius, *args, **kwargs)[source]¶ Bases:
ars.model.physics.base.Body-
length¶
-
radius¶
-
-
class
Cone(height, radius, *args, **kwargs)[source]¶ Bases:
ars.model.physics.base.Body-
height¶
-
radius¶
-
-
class
Cylinder(length, radius, *args, **kwargs)[source]¶ Bases:
ars.model.physics.base.Body-
length¶
-
radius¶
-
-
class
Sphere(radius, *args, **kwargs)[source]¶ Bases:
ars.model.physics.base.Body-
radius¶
-
ode_adapter Module¶
Classes and functions to interface the ODE physics engine with
the API defined in physics.
-
class
Body(world, space, mass=None, density=None, *args, **kwargs)[source]¶ Bases:
objectAbstract class, sort of equivalent to
ode.Body.Constructor.
Parameters: - world (
base.World) – - space (
collision.base.Space) – - mass (float or None) –
- density (float or None) –
-
get_position()[source]¶ Get the position of the body.
Returns: position Return type: 3-sequence of floats
-
get_rotation()[source]¶ Get the orientation of the body.
Returns: rotation matrix Return type: 9-sequence of floats
- world (
-
class
Box(world, space, size, mass=None, density=None)[source]¶ Bases:
ars.model.physics.ode_adapter.Body,ars.model.physics.base.Box
-
class
Capsule(world, space, length, radius, mass=None, density=None)[source]¶ Bases:
ars.model.physics.ode_adapter.Body,ars.model.physics.base.Capsulecreate capsule body (aligned along the z-axis so that it matches the Geom created below, which is aligned along the Z-axis by default)
-
class
Cylinder(world, space, length, radius, mass=None, density=None)[source]¶ Bases:
ars.model.physics.ode_adapter.Body,ars.model.physics.base.Cylindercreate cylinder body (aligned along the z-axis so that it matches the Geom created below, which is aligned along the Z-axis by default)
-
class
Engine[source]¶ Bases:
ars.model.physics.base.EngineAdapter to the ODE physics engine
-
class
Sphere(world, space, radius, mass=None, density=None)[source]¶ Bases:
ars.model.physics.ode_adapter.Body,ars.model.physics.base.Sphere
-
class
World(gravity=(0.0, -9.81, 0.0), ERP=0.2, CFM=1e-10, *args, **kwargs)[source]¶ Bases:
ars.model.physics.base.WorldAdapter to
ode.World.See also
Read abouth ERP and CFM in ODE’s wiki http://ode-wiki.org/wiki/index.php?title=Manual:_Concepts
Constructor.
Parameters: - gravity (3-sequence of floats) – gravity acceleration vector
- ERP (float) – Error Reduction Parameter
- CFM (float) – Constraint Force Mixing
-
gravity¶
ode_objects_factories Module¶
ODE objects factories i.e. functions that create ODE objects.
-
create_ode_box(world, size, mass=None, density=None)[source]¶ Create an ODE body with box-like mass parameters.
Parameters: - world (
ode.World) – - size (3-sequence of floats) –
- mass (float or None) –
- density (float or None) –
Returns: box body
Return type: ode.Body- world (
-
create_ode_capsule(world, length, radius, mass=None, density=None)[source]¶ Create an ODE body with capsule-like mass parameters.
Parameters: - world (
ode.World) – - length (float) –
- radius (float) –
- mass (float or None) –
- density (float or None) –
Returns: capsule body
Return type: ode.Body- world (
-
create_ode_cylinder(world, length, radius, mass=None, density=None)[source]¶ Create an ODE body with cylinder-like mass parameters.
Parameters: - world (
ode.World) – - length (float) –
- radius (float) –
- mass (float or None) –
- density (float or None) –
Returns: cylinder body
Return type: ode.Body- world (
signals Module¶
This module contains string values defining different signals related to
the ars.model.physics package.