Structures and functions for the primary HAPTIX API. More...
Go to the source code of this file.
Data Structures | |
struct | hxCommand |
Motor command data. More... | |
struct | hxRobotInfo |
Robot information. More... | |
struct | hxSensor |
Sensor data. More... | |
struct | hxTime |
A representation of time. More... | |
Macros | |
#define | hxMAXCONTACTSENSOR 32 |
Maximum number of contact sensors. More... | |
#define | hxMAXIMU 32 |
Maximum number of IMUs. More... | |
#define | hxMAXJOINT 32 |
Maximum number of joints. More... | |
#define | hxMAXMOTOR 32 |
Maximum number of motors. More... | |
Enumerations | |
enum | hxResult { hxOK = 0, hxERROR } |
API return codes. More... | |
Functions | |
hxResult | hx_close () |
Close connection to a robot or simulator. More... | |
hxResult | hx_connect (const char *_host, int _port) |
Connect to a robot or simulator. More... | |
const char * | hx_last_result () |
Return a string that describes the last result. More... | |
hxResult | hx_read_sensors (hxSensor *_sensor) |
Similar to hx_update, this function reads the latest sensor information from the robot in a non-blocking manner. More... | |
hxResult | hx_robot_info (hxRobotInfo *_robotinfo) |
Get information for a specified robot or simulator. More... | |
hxResult | hx_update (const hxCommand *_command, hxSensor *_sensor) |
A non-blocking function that sends a command to the robot and receives the latest sensor information. More... | |
Structures and functions for the primary HAPTIX API.
#define hxMAXCONTACTSENSOR 32 |
Maximum number of contact sensors.
Defines the maximum number of contact sensors across any particular robot. It is used when allocating an hxSensor.contact object. The number of contact sensors for a particular robot is defined in _hxRobotInfo.
#define hxMAXIMU 32 |
Maximum number of IMUs.
Defines the maximum number of inertial measurement units across any particular robot. It is used when allocating sensor objects related to IMUs. The number of IMUs for a particular robot is defined in _hxRobotInfo.
#define hxMAXJOINT 32 |
Maximum number of joints.
Defines the maximum number of joints across any particular robot. It is used when allocating sensor properties related to the joints. number of joints for a particular robot is defined in _hxRobotInfo.
#define hxMAXMOTOR 32 |
Maximum number of motors.
Defines the maximum number of motors across any particular robot. It is used when allocating sensor and command objects related to the motors. The number of motors for a particular robot is defined in _hxRobotInfo.
enum hxResult |
hxResult hx_close | ( | ) |
Close connection to a robot or simulator.
hxResult hx_connect | ( | const char * | _host, |
int | _port | ||
) |
Connect to a robot or simulator.
Use this function if you want to connect to a specific host and port.
[in] | _host | When connecting to a simulator, use _host to specify the machine that is running the simulator. Use a value of NULL to perform automatic discovery. |
[in] | _port | When connecting to a simulator, use _port to specify what port the simulator is running on. If _host is NULL, then _port is ignored. |
const char* hx_last_result | ( | ) |
Return a string that describes the last result.
hxResult hx_read_sensors | ( | hxSensor * | _sensor | ) |
Similar to hx_update, this function reads the latest sensor information from the robot in a non-blocking manner.
This function may be called as often as desired, but the robot is only guaranteeed to update at a minimum of 50Hz. Return sensor data.
[out] | _sensor | Sensor data received after the update. |
hxResult hx_robot_info | ( | hxRobotInfo * | _robotinfo | ) |
Get information for a specified robot or simulator.
[out] | _robotInfo | Robot information requested. See _hxRobotInfo for a list of available fields. |
hxResult hx_update | ( | const hxCommand * | _command, |
hxSensor * | _sensor | ||
) |
A non-blocking function that sends a command to the robot and receives the latest sensor information.
This function may be used as frequently as desired, but the robot is only guaranteed to update at a minimum of 50Hz.
[in] | _command | New command to be sent. See _hxCommand for the full description of fields contained in a command request. |
[out] | _sensor | Sensor data received after the update. See _hxSensor for the full description of fields contained the state response. |