This file defines data structures and API functions available only in simulation. More...
#include "haptix.h"
Go to the source code of this file.
Data Structures | |
struct | hxsColor |
A 4-tuple representing a color in RGBA space. More... | |
struct | hxsContactPoint |
Information about a contact point. More... | |
struct | hxsContactPoints |
Information about contacts. More... | |
struct | hxsJoint |
Information about a joint. A joint is a component of a model. More... | |
struct | hxsLink |
Information about a link. A link is a component of a model. More... | |
struct | hxsModel |
Information about a model. More... | |
struct | hxsQuaternion |
A quaternion. More... | |
struct | hxsSimInfo |
Simulation information. More... | |
struct | hxsTransform |
A translation and orientation constructed of a hxVector3 and hxQuaternion. More... | |
struct | hxsVector3 |
A three-tuple vector. More... | |
struct | hxsWrench |
Macros | |
#define | hxsMAXCONTACT 200 |
Maximum number of contacts. More... | |
#define | hxsMAXJOINTS 50 |
Maximum number of joints per model. More... | |
#define | hxsMAXLINKS 100 |
Maximum number of links per model. More... | |
#define | hxsMAXMODELS 50 |
Maximum number of models per simulation. More... | |
#define | hxsMAXNAMESIZE 100 |
Maximum number of characters allowed per name. More... | |
Enumerations | |
enum | hxsCollideMode { hxsNOCOLLIDE, hxsDETECTIONONLY, hxsCOLLIDE } |
Functions | |
hxResult | hxs_add_constraint (const char *_sdf, const char *_model) |
Dynamically add constraint between two links during runtime. More... | |
hxResult | hxs_add_model (const char *_sdf, const char *_name, float _x, float _y, float _z, float _roll, float _pitch, float _yaw, int _gravity_mode, hxsModel *_model) |
Add model during runtime. More... | |
hxResult | hxs_angular_velocity (const char *_name, hxsVector3 *_ang_vel) |
Get the angular velocity of a model. More... | |
hxResult | hxs_apply_force (const char *_modelName, const char *_linkName, const hxsVector3 *_force, const float _duration) |
Apply force to a link. More... | |
hxResult | hxs_apply_torque (const char *_modelName, const char *_linkName, const hxsVector3 *_torque, const float _duration) |
Apply torque to a link. More... | |
hxResult | hxs_apply_wrench (const char *_modelName, const char *_linkName, const hxsWrench *_wrench, const float _duration) |
Apply a wrench to a link. More... | |
hxResult | hxs_camera_transform (hxsTransform *_transform) |
Get information about the simulation camera. More... | |
hxResult | hxs_contacts (const char *_model, hxsContactPoints *_contact) |
Get information about active contacts for a model. More... | |
hxResult | hxs_is_logging (int *_result) |
Determine if logging is running. More... | |
hxResult | hxs_linear_velocity (const char *_name, hxsVector3 *_velocity) |
Get the linear velocity of a model. More... | |
hxResult | hxs_model_collide_mode (const char *_model, hxsCollideMode *_collide_mode) |
Get the collide mode of the object. More... | |
hxResult | hxs_model_color (const char *_model, hxsColor *_color) |
Get the color of the model. More... | |
hxResult | hxs_model_gravity_mode (const char *_name, int *_gravity_mode) |
Get whether or not this model is affected by gravity. More... | |
hxResult | hxs_model_joint_state (const char *_model, hxsModel *_state) |
Get simulation state (position and velocity) of joint named "_joint" in model "_model". More... | |
hxResult | hxs_model_transform (const char *_name, hxsTransform *_transform) |
Get model transform (position and orientation in the global coordinate frame). More... | |
hxResult | hxs_remove_constraint (const char *_name, const char *_model) |
Remove constraint. More... | |
hxResult | hxs_remove_model (const char *_name) |
Remove model. More... | |
hxResult | hxs_reset (int _resetLimbPose) |
Send world reset command/Carry over limb pose between world reset. More... | |
hxResult | hxs_set_angular_velocity (const char *_name, const hxsVector3 *_ang_vel) |
Set the angular velocity of a model. More... | |
hxResult | hxs_set_camera_transform (const hxsTransform *_transform) |
Set camera transform. More... | |
hxResult | hxs_set_linear_velocity (const char *_name, const hxsVector3 *_velocity) |
Set the linear velocity of a model. More... | |
hxResult | hxs_set_model_collide_mode (const char *_model, const hxsCollideMode *_collide_mode) |
Set the collide mode of the object. More... | |
hxResult | hxs_set_model_color (const char *_model, const hxsColor *_color) |
Set the color of the model. More... | |
hxResult | hxs_set_model_gravity_mode (const char *_name, const int _gravity_mode) |
Set whether or not this model is affected by gravity. More... | |
hxResult | hxs_set_model_joint_state (const char *_model, const char *_joint, float _pos, float _vel) |
Set simulation state (position and velocity) of joint named "_joint" in model "_model" to the desired position and velocity. More... | |
hxResult | hxs_set_model_transform (const char *_name, const hxsTransform *_transform) |
Set model transform (position and orientation in the global coordinate frame). More... | |
hxResult | hxs_sim_info (hxsSimInfo *_siminfo) |
Get simulation information. More... | |
hxResult | hxs_start_logging (const char *_dirname) |
Start recording log file. More... | |
hxResult | hxs_stop_logging () |
Stop recording log file. More... | |
This file defines data structures and API functions available only in simulation.
#define hxsMAXCONTACT 200 |
Maximum number of contacts.
#define hxsMAXJOINTS 50 |
Maximum number of joints per model.
#define hxsMAXLINKS 100 |
Maximum number of links per model.
#define hxsMAXMODELS 50 |
Maximum number of models per simulation.
#define hxsMAXNAMESIZE 100 |
Maximum number of characters allowed per name.
hxResult hxs_add_constraint | ( | const char * | _sdf, |
const char * | _model | ||
) |
Dynamically add constraint between two links during runtime.
[in] | _sdf | SDF of the joint to be created. |
[in] | _model | Name of parent model of the joint constraint. |
hxResult hxs_add_model | ( | const char * | _sdf, |
const char * | _name, | ||
float | _x, | ||
float | _y, | ||
float | _z, | ||
float | _roll, | ||
float | _pitch, | ||
float | _yaw, | ||
int | _gravity_mode, | ||
hxsModel * | _model | ||
) |
Add model during runtime.
[in] | _sdf | SDF xml description of the model. |
[in] | _name | Model name. |
[in] | _x | X position in global frame (m). |
[in] | _y | Y position in global frame (m). |
[in] | _z | Z position in global frame (m). |
[in] | _roll | Roll in global frame (radians). |
[in] | _pitch | Pitch in global frame (radians). |
[in] | _yaw | Yaw in global frame (radians). |
[in] | _gravity_mode | 1 if the model is affected by gravity, 0 otherwise. |
[out] | _model | Pointer to the new model. |
hxResult hxs_angular_velocity | ( | const char * | _name, |
hxsVector3 * | _ang_vel | ||
) |
Get the angular velocity of a model.
In the case of a model with multiple links, one of the link is designated as the canonical link of the model. We are returning the angular velocity of the canonical link's center of mass in the world frame.
[in] | _name | Name of the model. |
[out] | _ang_vel | Velocity (rad/s). |
hxResult hxs_apply_force | ( | const char * | _modelName, |
const char * | _linkName, | ||
const hxsVector3 * | _force, | ||
const float | _duration | ||
) |
Apply force to a link.
[in] | _modelName | Name of the model containing the link. |
[in] | _linkName | Name of the link. |
[in] | _force | Force (N). |
[in] | _duration | Duration of the force application in seconds. Set to 0 for persistent duration. |
hxResult hxs_apply_torque | ( | const char * | _modelName, |
const char * | _linkName, | ||
const hxsVector3 * | _torque, | ||
const float | _duration | ||
) |
Apply torque to a link.
[in] | _modelName | Name of the model containing the link. |
[in] | _linkName | Name of the link. |
[in] | _torque | Torque (N-m). |
[in] | _duration | Duration of the torque application in seconds. Set to 0 for persistent duration. |
hxResult hxs_apply_wrench | ( | const char * | _modelName, |
const char * | _linkName, | ||
const hxsWrench * | _wrench, | ||
const float | _duration | ||
) |
Apply a wrench to a link.
[in] | _modelName | Name of the model containing the link. |
[in] | _linkName | Name of the link. |
[in] | _wrench | Wrench to apply. |
[in] | _duration | Duration of the torque application in seconds. Set to 0 for persistent duration. |
hxResult hxs_camera_transform | ( | hxsTransform * | _transform | ) |
Get information about the simulation camera.
[out] | _camera | Information about the simulation camera. |
hxResult hxs_contacts | ( | const char * | _model, |
hxsContactPoints * | _contact | ||
) |
Get information about active contacts for a model.
[in] | _model | The name of the model to query. |
[out] | _contact | The latest contact information. |
hxResult hxs_is_logging | ( | int * | _result | ) |
Determine if logging is running.
[out] | _result | 1 if logging is running. |
hxResult hxs_linear_velocity | ( | const char * | _name, |
hxsVector3 * | _velocity | ||
) |
Get the linear velocity of a model.
In the case of a model with multiple links, one of the link is designated as the canonical link of the model. We are returning the linear velocity of the canonical link's center of mass in the world frame.
[in] | _name | Name of the model. |
[out] | _velocity | Velocity (m/s). |
hxResult hxs_model_collide_mode | ( | const char * | _model, |
hxsCollideMode * | _collide_mode | ||
) |
Get the collide mode of the object.
[in] | _model | Name of the model. |
[out] | _collide_mode | The collide mode of the object. |
hxResult hxs_model_color | ( | const char * | _model, |
hxsColor * | _color | ||
) |
Get the color of the model.
[in] | _model | Name of the model. |
[out] | _color | The color of the model. |
hxResult hxs_model_gravity_mode | ( | const char * | _name, |
int * | _gravity_mode | ||
) |
Get whether or not this model is affected by gravity.
[in] | _name | Name of the model. |
[in] | _gravity | If 1, the model is affected by gravity. If 0, the model is free-floating. |
hxResult hxs_model_joint_state | ( | const char * | _model, |
hxsModel * | _state | ||
) |
Get simulation state (position and velocity) of joint named "_joint" in model "_model".
Where state is defined by position and velocity.
[in] | _model | Name of the model to set. |
[out] | _state | a hxsModel data structure containing joints states. |
hxResult hxs_model_transform | ( | const char * | _name, |
hxsTransform * | _transform | ||
) |
Get model transform (position and orientation in the global coordinate frame).
[in] | _name | Name of the model. |
[out] | _transform | Current model transform. |
hxResult hxs_remove_constraint | ( | const char * | _name, |
const char * | _model | ||
) |
Remove constraint.
[in] | _name | Name of the joint/constraint to be removed. |
[in] | _model | Name of parent model of the joint constraint. |
hxResult hxs_remove_model | ( | const char * | _name | ) |
Remove model.
[in] | _name | Name of the model. |
hxResult hxs_reset | ( | int | _resetLimbPose | ) |
Send world reset command/Carry over limb pose between world reset.
[in] | _resetLimbPose | Non-zero to reset the pose of the limb. |
hxResult hxs_set_angular_velocity | ( | const char * | _name, |
const hxsVector3 * | _ang_vel | ||
) |
Set the angular velocity of a model.
This function does not support models with multiple links, unexpected behavior will result from using this function with a multi-link model. For a model with single link, this function call sets the angular velocity of the link at its center of mass in the world frame.
[in] | _name | Name of the model. |
[in] | _ang_vel | Velocity (rad/s). |
hxResult hxs_set_camera_transform | ( | const hxsTransform * | _transform | ) |
Set camera transform.
[in] | _transform | New camera transform. |
hxResult hxs_set_linear_velocity | ( | const char * | _name, |
const hxsVector3 * | _velocity | ||
) |
Set the linear velocity of a model.
In the case of a model with multiple links, we are setting the linear velocity of all links center of mass in the world frame.
[in] | _name | Name of the model. |
[in] | _velocity | Velocity (m/s). |
hxResult hxs_set_model_collide_mode | ( | const char * | _model, |
const hxsCollideMode * | _collide_mode | ||
) |
Set the collide mode of the object.
[in] | _model | Name of the model. |
[in] | _collide_mode | The collide mode of the object. |
hxResult hxs_set_model_color | ( | const char * | _model, |
const hxsColor * | _color | ||
) |
Set the color of the model.
[in] | _model | Name of the model. |
[in] | _color | The color to set. |
hxResult hxs_set_model_gravity_mode | ( | const char * | _name, |
const int | _gravity_mode | ||
) |
Set whether or not this model is affected by gravity.
[in] | _name | Name of the model. |
[in] | _gravity | If 1, the model is affected by gravity. If 0, the model is free-floating. |
hxResult hxs_set_model_joint_state | ( | const char * | _model, |
const char * | _joint, | ||
float | _pos, | ||
float | _vel | ||
) |
Set simulation state (position and velocity) of joint named "_joint" in model "_model" to the desired position and velocity.
The acceleration, torque, and reaction wrench of the joint may change based on the constraints of model's dynamic system.
[in] | _model | Name of the model to set. |
[in] | _joint | Name of the joint to set. |
[in] | _pos | Desired position of the joint. |
[in] | _vel | Desired velocity of the joint. |
hxResult hxs_set_model_transform | ( | const char * | _name, |
const hxsTransform * | _transform | ||
) |
Set model transform (position and orientation in the global coordinate frame).
[in] | _name | Name of the model. |
[in] | _transform | New model transform. |
hxResult hxs_sim_info | ( | hxsSimInfo * | _siminfo | ) |
Get simulation information.
[out] | _siminfo | Simulation information requested. |
hxResult hxs_start_logging | ( | const char * | _dirname | ) |
Start recording log file.
Only one log file may be recorded at a time.
[in] | _dirname | Path to the directory where the log file is created. |
hxResult hxs_stop_logging | ( | ) |
Stop recording log file.