|
hAPI Fisica
0.1
The hAPI Fisica physics engine expands Richard Marxer's fisica for Processing. The engine wraps the jbox2d physics engine for use with the Haply Development kit and the Hapkit.
|
Public Member Functions | |
| HVirtualCoupling (float size) | |
| float | getSize () |
| void | setSize (float size) |
| void | setPosition (float x, float y) |
| void | init (FWorld world, float x, float y) |
| void | setToolPosition (float x, float y) |
| void | setToolVelocity (float x, float y) |
| void | setAvatarPosition (float x, float y) |
| void | setAvatarVelocity (float vx, float vy) |
| float | getToolPositionX () |
| float | getToolPositionY () |
| float | getToolVelocityX () |
| float | getToolVelocityY () |
| float | getAvatarPositionX () |
| float | getAvatarPositionY () |
| float | getAvatarVelocityX () |
| float | getAvatarVelocityY () |
| void | updateCouplingForce () |
| void | updateCouplingForce (float mass, float stiffness, float damping) |
| void | updateCouplingForce (float free_mass, float stiffness, float damping, float contact_mass) |
| float | getVirtualCouplingForceX () |
| float | getVirtualCouplingForceY () |
| void | setVirtualCouplingStiffness (float stiffness) |
| void | setVirtualCouplingDamping (float damping) |
| float | getVirtualCouplingStiffness () |
| float | getVirtualCouplingDamping () |
Protected Attributes | |
| float | m_size = 0.5f |
| HTool | h_tool |
| FCircle | h_avatar |
| Vec2 | vc_force = new Vec2(0.0f, 0.0f) |
| Vec2 | tool_position = new Vec2(0.0f, 0.0f) |
| Vec2 | tool_velocity = new Vec2(0.0f, 0.0f) |
| Vec2 | avatar_position = new Vec2(0.0f, 0.0f) |
| Vec2 | avatar_velocity = new Vec2(0.0f, 0.0f) |
| ArrayList< FContact > | avatarContact |
| float | vc_stiffness = 250000.0f |
| float | vc_damping = 700.0f |
| float | vc_free_mass = 0.25f |
| float | vc_contact_mass = 1.0f |
Represents a virtual coupling contact rendering scheme that can be added to the virtual world. The HVirtualCoupling class has a virtual avatar compenent that interacts with objects in the virtual world. The avatar is coupled to a haptic tool object (HTool) using a virtual spring and dashpot (PD controller). The resultant force is due to the differences in state between the haptic tool, which represents the device end-effector), and the virtual tool avatar.
world.add(myHapticTool);
Bodies
| HVirtualCoupling.HVirtualCoupling | ( | float | size | ) |
Constructs circular bodies that can be added to a world. The bodies are the haptic tool and the virtual environment tool avatar.
| size | the size of the circle |
| float HVirtualCoupling.getAvatarPositionX | ( | ) |
Returns the x position of the virtual environment avatar in centimeters
getAvatarPositionY
| float HVirtualCoupling.getAvatarPositionY | ( | ) |
Returns the y position of the virtual environment avatar in centimeters
getAvatarPositionX
| float HVirtualCoupling.getAvatarVelocityX | ( | ) |
Returns the x velocity of the virtual environment avatar in centimeters
getAvatarVelocityY
| float HVirtualCoupling.getAvatarVelocityY | ( | ) |
Returns the y velocity of the virtual environment avatar in centimeters
getAvatarVelocityX
| float HVirtualCoupling.getSize | ( | ) |
Returns the size of the haptic tool and avatar.
Bodies
| float HVirtualCoupling.getToolPositionX | ( | ) |
Returns the x position of the haptic tool in centimeters
getToolPositionY
| float HVirtualCoupling.getToolPositionY | ( | ) |
Returns the y position of the haptic tool in centimeters
getToolPositionX
| float HVirtualCoupling.getToolVelocityX | ( | ) |
Returns the x velocity of the haptic tool in centimeters
getToolVelocityY
| float HVirtualCoupling.getToolVelocityY | ( | ) |
Returns the y velocity of the haptic tool in centimeters
getToolVelocityX
| float HVirtualCoupling.getVirtualCouplingDamping | ( | ) |
Returns the virtual coupling damping.
| float HVirtualCoupling.getVirtualCouplingForceX | ( | ) |
Get the x coordinate of the force applied via the virtual coupling between the haptic tool and haptic avatar.
| float HVirtualCoupling.getVirtualCouplingForceY | ( | ) |
Get the y coordinate of the force applied via the virtual coupling between the haptic tool and haptic avatar.
| float HVirtualCoupling.getVirtualCouplingStiffness | ( | ) |
Returns the virtual coupling stiffness.
| void HVirtualCoupling.init | ( | FWorld | world, |
| float | x, | ||
| float | y | ||
| ) |
Initializes the haptic tool and virtual avatar in the physics engine.
Bodies
| size | the size of the circle |
| x | the x position in the simulated world coordinates of centimeters. |
| y | the y position in the simulated world coordinates of centimeters. |
| void HVirtualCoupling.setAvatarPosition | ( | float | x, |
| float | y | ||
| ) |
Sets the position of the virtual environment avatar representation.
setAvatarVelocity
| x | the x position in the simulated world coordinates of centimeters. |
| y | the y position in the simulated world coordinates of centimeters. |
| void HVirtualCoupling.setAvatarVelocity | ( | float | vx, |
| float | vy | ||
| ) |
Sets the velocity of the virtual environement tool avatar.
SetAvatarPosition
| x | the x velocity in the simulated world coordinates of centimeters. |
| y | the y velocity in the simulated world coordinates of centimeters. |
| void HVirtualCoupling.setPosition | ( | float | x, |
| float | y | ||
| ) |
Sets the position of the virtual tool. Under the hood the body is removed and readded to the world.
Bodies
| size | the size of the circle |
| void HVirtualCoupling.setSize | ( | float | size | ) |
Sets the size of the circular tool. Under the hood the body is removed and readded to the world.
Bodies
| size | the size of the circlar tool |
| void HVirtualCoupling.setToolPosition | ( | float | x, |
| float | y | ||
| ) |
Sets the position of the graphical representation of the haptic tool.
setToolVelocity
| x | the x position in the simulated world coordinates of centimeters. |
| y | the y position in the simulated world coordinates of centimeters. |
| void HVirtualCoupling.setToolVelocity | ( | float | x, |
| float | y | ||
| ) |
Sets the velocity of the virtual tool graphical representation. Note* the velocity data from the device is noisy so in practice we set the tool velocity to zero and calculate the environmental forces based on the avatar only.
setToolPosition
| x | the x velocity in the simulated world coordinates of centimeters. |
| y | the y velocity in the simulated world coordinates of centimeters. |
| void HVirtualCoupling.setVirtualCouplingDamping | ( | float | damping | ) |
Sets the damping of the virtual coupling for the virtual coupled contact rendering technique.
| damping | The damping of the virtual coupling. Resultant forces are proportional to difference in state between the haptic tool and haptic avatar. |
| void HVirtualCoupling.setVirtualCouplingStiffness | ( | float | stiffness | ) |
Sets the stiffness of the virtual coupling for the virtual coupled contact rendering technique.
| stiffness | The stiffness of the virtual coupling. Resultant forces are proportional to difference in state between the haptic tool and haptic avatar. |
| void HVirtualCoupling.updateCouplingForce | ( | ) |
Sets the Virtual Coupling parameters of the virtual tool to their default values.
updateCouplingForce
| void HVirtualCoupling.updateCouplingForce | ( | float | free_mass, |
| float | stiffness, | ||
| float | damping, | ||
| float | contact_mass | ||
| ) |
Sets the Virtual Coupling parameters of the virtual tool. Under the hood the body is removed and readded to the world.
| free_mass | sets the mass of the virtual avatar when in free space |
| free_stiffness | sets the virtual coupling spring stiffness when in free space |
| free_damping | sets the virtual coupling dashpot damping when in free space |
| contact_mass | sets the mass of the virtual avatar when in contact with a virtual object |
updateCouplingForce
1.8.13