HAPTIX API

 All Data Structures Files Functions Variables Enumerations Enumerator Macros Pages
Data Structures | Macros | Functions
haptix_sim.h File Reference

Structures and functions for simulation specific functionality. More...

#include "haptix/comm/haptix.h"
Include dependency graph for haptix_sim.h:

Go to the source code of this file.

Data Structures

struct  hxsBody
 Information about bodies. More...
 
struct  hxsContact
 Information about contacts. More...
 
struct  hxsDeviceInfo
 Simulated device information, beyond the information provided in hxDeviceInfo. More...
 
struct  hxsJoint
 Information about joints. More...
 

Macros

#define hxsMAXBODY   30
 Maximum number of bodies. More...
 
#define hxsMAXCONTACT   30
 Maximum number of contacts. More...
 

Functions

hxResult hxs_getbody (int _target, hxsBody *_body)
 Get information about bodies. More...
 
hxResult hxs_getcontact (int _target, hxsContact *_contact)
 Get information about active contacts. More...
 
hxResult hxs_getdeviceinfo (int _target, hxsDeviceInfo *_deviceinfo)
 Get simulation information. More...
 
hxResult hxs_getjacobian (int _target, int _link, const float *_point, float *_jacobian)
 Get Jacobian of global point attached to robot link (index between 1 and njoint-1) size of Jacobian matrix is 3-by-njoint, in row-major format. More...
 
hxResult hxs_getjoint (int _target, hxsJoint *_joint)
 Get information about joints. More...
 
hxResult hxs_message (const char *_message)
 Display a text message in the simulator. More...
 
hxResult hxs_setstate (int _target, const hxsBody *_body, const hxsJoint *_joint)
 Set simulation state (position and velocity) as follows: the robot base and objects are set from hxBody. More...
 
hxResult hxs_updatedirect (int _target, const float *_torque, hxSensor *_sensor, int _flg_sleep)
 Synchronous update with direct torque control: More...
 

Detailed Description

Structures and functions for simulation specific functionality.

This header is not needed for use with Gazebo but added for code compatibility with other simulators.

Macro Definition Documentation

#define hxsMAXBODY   30

Maximum number of bodies.

#define hxsMAXCONTACT   30

Maximum number of contacts.

Function Documentation

hxResult hxs_getbody ( int  _target,
hxsBody *  _body 
)

Get information about bodies.

Parameters
[in]_targetRequested device.
[out]_bodyBody information requested.
Returns
'hxOK' if the operation succeed or an error code otherwise.
hxResult hxs_getcontact ( int  _target,
hxsContact *  _contact 
)

Get information about active contacts.

Parameters
[in]_targetRequested device.
[out]_contactContact information requested.
Returns
'hxOK' if the operation succeed or an error code otherwise.
hxResult hxs_getdeviceinfo ( int  _target,
hxsDeviceInfo *  _deviceinfo 
)

Get simulation information.

Parameters
[in]_targetRequested device.
[out]_deviceinfoDevice information requested.
Returns
'hxOK' if the disconnection succeed or an error code otherwise.
hxResult hxs_getjacobian ( int  _target,
int  _link,
const float *  _point,
float *  _jacobian 
)

Get Jacobian of global point attached to robot link (index between 1 and njoint-1) size of Jacobian matrix is 3-by-njoint, in row-major format.

Parameters
[in]_targetRequested device.
[in]_linkRequested link index.
[in]_pointPoint information requested.
[out]_jacobianJacobian information requested.
Returns
'hxOK' if the operation succeed or an error code otherwise.
hxResult hxs_getjoint ( int  _target,
hxsJoint *  _joint 
)

Get information about joints.

Parameters
[in]_targetRequested device.
[out]_jointJoint information requested.
Returns
'hxOK' if the operation succeed or an error code otherwise.
hxResult hxs_message ( const char *  _message)

Display a text message in the simulator.

Parameters
[in]_messageMessage to display.
Returns
'hxOK' if the operation succeeded or an error code otherwise.
hxResult hxs_setstate ( int  _target,
const hxsBody *  _body,
const hxsJoint *  _joint 
)

Set simulation state (position and velocity) as follows: the robot base and objects are set from hxBody.

the robot links are set from hxJoint via forward kinematics. the robot link data in hxBody, and all acceleration and torque data are ignored.

Parameters
[in]_targetRequested device.
[in]_bodyNew body value.
[in]_jointNew joint value.
Returns
'hxOK' if the operation succeed or an error code otherwise.
hxResult hxs_updatedirect ( int  _target,
const float *  _torque,
hxSensor *  _sensor,
int  _flg_sleep 
)

Synchronous update with direct torque control:

  1. set joint torques ignoring actuator model.
  2. advance simulation state, sleep for remainder of update step only if requested.
  3. return simulated sensor data.
    Parameters
    [in]_targetRequested device.
    [in]_torqueNew torque value.
    [out]_sensorSensor data received after the update.
    [in]_flg_sleepAdvance simulation step this time.
    Returns
    'hxOK' if the operation succeed or an error code otherwise.