Module of all the classes related to physical joints. These are objects that link 2 bodies together.
There are two base abstract classes for all joints: Joint and ActuatedJoint. They are not coupled (at all) with ODE or any other physics or collision library/engine.
The classes that implement at least one of those interfaces are these:
There is also an auxiliary class: JointFeedback.
Bases: ars.model.robot.joints.Joint
A joint with an actuator that can exert force and/or torque to connected bodies.
This is an abstract class.
Constructor.
Parameters: |
|
---|
Bases: ars.model.robot.joints.Joint
Constructor.
Parameters: |
|
---|
Bases: ars.model.robot.joints.Joint
Constructor.
Parameters: |
|
---|
Bases: object
Entity that links 2 bodies together, enforcing one or more movement constraints.
This is an abstract class.
Constructor.
Parameters: |
|
---|
Bases: object
Data structure to hold the forces and torques resulting from the interaction of 2 bodies through a joint.
All attributes are private. The results (force1, force2, torque1, torque2) are all length-3 tuples of floats.
Constructor.
Parameters: |
|
---|
Bases: ars.model.robot.joints.ActuatedJoint
Constructor.
Parameters: |
|
---|
Apply torque about the rotation axis.
Parameters: | torque (float) – magnitude |
---|
Return the angle between the two bodies.
The zero angle is determined by the position of the bodies when joint’s anchor was set.
Returns: | value ranging -pi and +pi |
---|---|
Return type: | float |
Return the rate of change of the angle between the two bodies.
Returns: | angle rate |
---|---|
Return type: | float |
Set rotation speed to speed.
The joint will set that speed by applying a force up to max_force, so it is not guaranteed that speed will be reached.
Parameters: |
|
---|
Bases: ars.model.robot.joints.ActuatedJoint
Joint with one DOF that constrains two objects to line up along an axis.
It is different from a Piston joint (which has two DOF) in that the Slider does not allow rotation.
Constructor.
Parameters: |
|
---|
Bases: ars.model.robot.joints.Joint
Constructor.
Parameters: |
|
---|
Module of all the classes related to sensors.
There are base classes for sensors whose source is a body, joint or simulation. It also considers those which read information automatically by subscribing to certain signals.
Some abstract classes are:
Some practical sensors are:
It also contains the auxiliary classes SensorData and SensorDataQueue.
Bases: ars.model.robot.sensors.BodySensor
Calculate and retrieve a body’s linear and angular acceleration.
Warning
The provided time_step is used to calculate the acceleration based on the velocity measured at two instants in time. If subsequent calls to on_change are separated by a simulation time period different to the given time_step, the results will be invalid.
Bases: ars.model.robot.sensors.JointSensor
Sensor whose source of data is an ActuatedJoint joint.
Bases: object
Base class for sensors that handle signals with on_send().
Constructor.
Parameters: |
|
---|
Bases: object
Abstract base class for all sensors.
Sensor data is stored in a queue (data_queue), and it is usually retrieved after the simulation ends but can be accessed at any time:
measurement = sensor.data_queue.pull()
Warning
Beware that ars.utils.containers.Queue.pull() returns the first element of the queue and removes it.
Build a SensorData object and stores it in the data_queue.
Parameters: | time (number or None) – if None, current (computer’s) time is used |
---|
Bases: ars.model.robot.sensors.BaseSourceSensor
Abstract base class for sensors whose source of data is a body.
Bases: ars.model.robot.sensors.BodySensor
Retrieve a body’s XYZ position.
Bases: ars.model.robot.sensors.BodySensor
Retrieve a body’s pitch and roll.
Bases: ars.model.robot.sensors.SingleSignalSensor
Sensor measuring force ‘added’ to a joint.
Bases: ars.model.robot.sensors.MultipleSignalsSensor
Sensor measuring power applied by a joint (due to force and torque).
Bases: ars.model.robot.sensors.BaseSourceSensor
Abstract base class for sensors whose source of data is a joint.
Bases: ars.model.robot.sensors.SingleSignalSensor
Sensor measuring torque added to a joint.
Bases: ars.model.robot.sensors.BodySensor
Retrieve a body’s kinetic energy, both due to translation and rotation.
Bases: ars.model.robot.sensors.BaseSourceSensor
Laser scanner.
Bases: ars.model.robot.sensors.BaseSignalSensor
Abstract base class for sensors subscribed to multiple signals.
Constructor.
Parameters: | signals (iterable) – signals to subscribe to |
---|
Bases: ars.model.robot.sensors.BodySensor
Retrieve a body’s potential energy.
Calculated based on the current position (x) and world’s gravitational acceleration (g).
Bases: ars.model.robot.sensors.ActuatedJointSensor
Sensor measuring the angle (and its rate) of a rotary joint.
Bases: object
Data structure to pack a sensor measurement’s information.
Bases: ars.utils.containers.Queue
Queue-like container for sensor measurements.
Bases: ars.model.robot.sensors.BaseSourceSensor
Abstract base class for sensors whose source of data is a simulation.
Constructor.
Parameters: | sim (ars.model.simulator.Simulation) – simulation |
---|
Return the simulation object.
Returns: | simulation |
---|---|
Return type: | ars.model.simulator.Simulation |
Bases: ars.model.robot.sensors.BaseSignalSensor
Abstract base class for sensors subscribed to one signal.
Constructor.
Parameters: | signal – signal to subscribe to |
---|
Bases: ars.model.robot.sensors.SimulationSensor
Retrieve a system’s total potential and kinetic energy.
It considers all bodies in the simulation. The kinetic energy accounts for translation and rotation.
Bases: ars.model.robot.sensors.BodySensor
Retrieve a body’s potential and kinetic energy.
The kinetic energy accounts for translation and rotation.
Bases: ars.model.robot.sensors.BodySensor
Calculate and retrieve a body’s linear and angular velocity.
This module contains string values defining different signals related to the ars.model.robot package.