Macros | Functions | Variables
iob.cpp File Reference
#include <unistd.h>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <vector>
#include "iob.h"
Include dependency graph for iob.cpp:

Go to the source code of this file.

Macros

#define CHECK_ACCELEROMETER_ID(id)   if ((id) < 0 || (id) >= number_of_accelerometers()) return E_ID
 
#define CHECK_ATTITUDE_SENSOR_ID(id)   if ((id) < 0 || (id) >= number_of_attitude_sensors()) return E_ID
 
#define CHECK_FORCE_SENSOR_ID(id)   if ((id) < 0 || (id) >= number_of_force_sensors()) return E_ID
 
#define CHECK_GYRO_SENSOR_ID(id)   if ((id) < 0 || (id) >= number_of_gyro_sensors()) return E_ID
 
#define CHECK_JOINT_ID(id)   if ((id) < 0 || (id) >= number_of_joints()) return E_ID
 

Functions

int close_iob (void)
 close connection with joint servo process More...
 
long get_signal_period ()
 get the period of signals issued by wait_for_iob_signal() More...
 
int initializeJointAngle (const char *name, const char *option)
 initialize joint angle More...
 
int joint_calibration (int id, double angle)
 
int length_digital_input ()
 get_digital_input_length More...
 
int length_digital_output ()
 get_digital_output_length More...
 
size_t length_of_extra_servo_state (int id)
 get length of extra servo states More...
 
int lock_iob ()
 lock access to iob More...
 
int number_of_accelerometers ()
 get the number of accelerometers More...
 
int number_of_attitude_sensors ()
 get the number of attitude sensors More...
 
int number_of_force_sensors ()
 get the number of force sensors More...
 
int number_of_gyro_sensors ()
 get the number of gyro sensors More...
 
int number_of_joints ()
 get the number of joints More...
 
int number_of_substeps ()
 
int open_iob (void)
 open connection with joint servo process More...
 
int read_accelerometer (int id, double *accels)
 read output of accelerometer More...
 
int read_accelerometer_offset (int id, double *offset)
 read offset values for accelerometer output More...
 
int read_actual_angle (int id, double *angle)
 read current joint angle[rad] More...
 
int read_actual_angles (double *angles)
 read array of current joint angles[rad] More...
 
int read_actual_torques (double *torques)
 read array of current joint torques[Nm] More...
 
int read_actual_velocities (double *vels)
 read actual angular velocities[rad/s] More...
 
int read_actual_velocity (int id, double *vel)
 read actual angular velocity[rad/s] More...
 
int read_angle_offset (int id, double *angle)
 read offset value for joint[rad] More...
 
int read_attitude_sensor (int id, double *att)
 read output of attitude sensor More...
 
int read_calib_state (int id, int *s)
 read callibration state of joint More...
 
int read_command_angle (int id, double *angle)
 read command angle[rad] More...
 
int read_command_angles (double *angles)
 read array of command angles[rad] More...
 
int read_command_torque (int id, double *torque)
 read command torque[Nm] More...
 
int read_command_torques (double *torques)
 read array of command torques[Nm] More...
 
int read_command_velocities (double *vels)
 read command angular velocities[rad/s] More...
 
int read_command_velocity (int id, double *vel)
 read command angular velocity[rad/s] More...
 
int read_control_mode (int id, joint_control_mode *s)
 read joint control mode More...
 
int read_current (int id, double *mcurrent)
 
int read_current_limit (int id, double *v)
 
int read_currents (double *currents)
 
int read_dgain (int id, double *gain)
 read D gain[Nm/(rad/s)] More...
 
int read_digital_input (char *dinput)
 read_digital_input, non-applicable bits are nop More...
 
int read_digital_output (char *doutput)
 read_digital_output, non-applicable bits are nop More...
 
int read_driver_temperature (int id, unsigned char *v)
 read temperature of motor driver[Celsius] More...
 
int read_encoder_pulse (int id, double *ec)
 
int read_extra_servo_state (int id, int *state)
 read extra servo states More...
 
int read_force_offset (int id, double *offsets)
 read offset values for force sensor output More...
 
int read_force_sensor (int id, double *forces)
 read output of force sensor More...
 
int read_gauges (double *gauges)
 
int read_gear_ratio (int id, double *gr)
 
int read_gyro_sensor (int id, double *rates)
 read output of gyro sensor More...
 
int read_gyro_sensor_offset (int id, double *offset)
 read offset values for gyro sensor output More...
 
unsigned long long read_iob_frame ()
 
int read_limit_angle (int id, double *angle)
 
int read_llimit_angle (int id, double *angle)
 
int read_lock_owner (pid_t *pid)
 read id of the process whic is locking access to iob More...
 
int read_pgain (int id, double *gain)
 read P gain[Nm/rad] More...
 
int read_power (double *voltage, double *current)
 read status of power source More...
 
int read_power_command (int id, int *com)
 turn on/off power supply for motor driver More...
 
int read_power_state (int id, int *s)
 read power status of motor driver More...
 
int read_servo_alarm (int id, int *a)
 read servo alarms More...
 
int read_servo_state (int id, int *s)
 read servo status More...
 
int read_temperature (int id, double *v)
 read thermometer More...
 
int read_torque_const (int id, double *tc)
 
int read_torque_limit (int id, double *limit)
 
int read_touch_sensors (unsigned short *onoff)
 
int read_ulimit_angle (int id, double *angle)
 
int reset_body (void)
 
int set_number_of_accelerometers (int num)
 set the number of accelerometers More...
 
int set_number_of_attitude_sensors (int num)
 
int set_number_of_force_sensors (int num)
 set the number of force sensors More...
 
int set_number_of_gyro_sensors (int num)
 set the number of gyro sensors More...
 
int set_number_of_joints (int num)
 set the number of joints More...
 
int set_signal_period (long period_ns)
 set the period of signals issued by wait_for_iob_signal() More...
 
void timespec_add_ns (timespec *ts, long ns)
 
double timespec_compare (timespec *ts1, timespec *ts2)
 
int unlock_iob ()
 unlock access to iob More...
 
int wait_for_iob_signal ()
 wait until iob signal is issued More...
 
int write_accelerometer_offset (int id, double *offset)
 write offset values for accelerometer output More...
 
int write_angle_offset (int id, double angle)
 write offset value for joint[rad] More...
 
int write_attitude_sensor_offset (int id, double *offset)
 
int write_command_angle (int id, double angle)
 write command angle[rad] More...
 
int write_command_angles (const double *angles)
 write array of command angles[rad] More...
 
int write_command_torque (int id, double torque)
 write command torque[Nm] More...
 
int write_command_torques (const double *torques)
 write array of command torques[Nm] More...
 
int write_command_velocities (const double *vels)
 write command angular velocities[rad/s] More...
 
int write_command_velocity (int id, double vel)
 write command angular velocity[rad/s] More...
 
int write_control_mode (int id, joint_control_mode s)
 write joint control mode More...
 
int write_dgain (int id, double gain)
 write D gain[Nm/(rad/s)] More...
 
int write_digital_output (const char *doutput)
 write_digital_output, non-applicable bits are nop More...
 
int write_digital_output_with_mask (const char *doutput, const char *mask)
 write_digital_output, non-applicable bits are nop More...
 
int write_dio (unsigned short buf)
 
int write_force_offset (int id, double *offsets)
 write offset values for force sensor output More...
 
int write_gyro_sensor_offset (int id, double *offset)
 write offset values for gyro sensor output More...
 
int write_pgain (int id, double gain)
 write P gain[Nm/rad] More...
 
int write_power_command (int id, int com)
 turn on/off power supply for motor driver More...
 
int write_servo (int id, int com)
 turn on/off joint servo More...
 

Variables

static std::vector< std::vector< double > > accel_offset
 
static std::vector< std::vector< double > > accelerometers
 
static std::vector< std::vector< double > > attitude_sensors
 
static std::vector< double > command
 
static std::vector< std::vector< double > > force_offset
 
static std::vector< std::vector< double > > forces
 
static int frame = 0
 
static long g_period_ns =5000000
 
static timespec g_ts
 
static std::vector< std::vector< double > > gyro_offset
 
static std::vector< std::vector< double > > gyros
 
static bool isLocked = false
 
static std::vector< intpower
 
static std::vector< intservo
 

Macro Definition Documentation

◆ CHECK_ACCELEROMETER_ID

#define CHECK_ACCELEROMETER_ID (   id)    if ((id) < 0 || (id) >= number_of_accelerometers()) return E_ID

Definition at line 25 of file iob.cpp.

◆ CHECK_ATTITUDE_SENSOR_ID

#define CHECK_ATTITUDE_SENSOR_ID (   id)    if ((id) < 0 || (id) >= number_of_attitude_sensors()) return E_ID

Definition at line 27 of file iob.cpp.

◆ CHECK_FORCE_SENSOR_ID

#define CHECK_FORCE_SENSOR_ID (   id)    if ((id) < 0 || (id) >= number_of_force_sensors()) return E_ID

Definition at line 24 of file iob.cpp.

◆ CHECK_GYRO_SENSOR_ID

#define CHECK_GYRO_SENSOR_ID (   id)    if ((id) < 0 || (id) >= number_of_gyro_sensors()) return E_ID

Definition at line 26 of file iob.cpp.

◆ CHECK_JOINT_ID

#define CHECK_JOINT_ID (   id)    if ((id) < 0 || (id) >= number_of_joints()) return E_ID

Definition at line 23 of file iob.cpp.

Function Documentation

◆ close_iob()

int close_iob ( void  )

close connection with joint servo process

Return values
TRUEclosed successfully
FALSEotherwise

Definition at line 413 of file iob.cpp.

◆ get_signal_period()

long get_signal_period ( )

get the period of signals issued by wait_for_iob_signal()

Returns
the period of signals[ns]

Definition at line 703 of file iob.cpp.

◆ initializeJointAngle()

int initializeJointAngle ( const char *  name,
const char *  option 
)

initialize joint angle

Parameters
namejoint name, part name or "all"
optionstring of joint angle initialization
Returns
TRUE if initialized successfully, FALSE otherwise

Definition at line 708 of file iob.cpp.

◆ joint_calibration()

int joint_calibration ( int  id,
double  angle 
)

Definition at line 427 of file iob.cpp.

◆ length_digital_input()

int length_digital_input ( )

get_digital_input_length

Returns
length of digital input in bytes

Definition at line 719 of file iob.cpp.

◆ length_digital_output()

int length_digital_output ( )

get_digital_output_length

Returns
length of digital output in bytes

Definition at line 734 of file iob.cpp.

◆ length_of_extra_servo_state()

size_t length_of_extra_servo_state ( int  id)

get length of extra servo states

Parameters
idjoint id
Returns
length of extra servo states

Definition at line 687 of file iob.cpp.

◆ lock_iob()

int lock_iob ( )

lock access to iob

Return values
TRUEiob is locked successfully
FALSEsome other process is locking iob

Definition at line 493 of file iob.cpp.

◆ number_of_accelerometers()

int number_of_accelerometers ( )

get the number of accelerometers

Returns
the number of accelerometers

Definition at line 80 of file iob.cpp.

◆ number_of_attitude_sensors()

int number_of_attitude_sensors ( )

get the number of attitude sensors

Returns
the number of attitude sensors

Definition at line 85 of file iob.cpp.

◆ number_of_force_sensors()

int number_of_force_sensors ( )

get the number of force sensors

Returns
the number of force sensors

Definition at line 70 of file iob.cpp.

◆ number_of_gyro_sensors()

int number_of_gyro_sensors ( )

get the number of gyro sensors

Returns
the number of gyro sensors

Definition at line 75 of file iob.cpp.

◆ number_of_joints()

int number_of_joints ( )

get the number of joints

Returns
the number of joints

Definition at line 65 of file iob.cpp.

◆ number_of_substeps()

int number_of_substeps ( )
Returns
the number of substeps

Definition at line 558 of file iob.cpp.

◆ open_iob()

int open_iob ( void  )

open connection with joint servo process

Return values
TRUEopened successfully
FALSEotherwise

Definition at line 401 of file iob.cpp.

◆ read_accelerometer()

int read_accelerometer ( int  id,
double *  accels 
)

read output of accelerometer

Parameters
idaccelerometer id
accelsaccelerations [m/s^2], length of array must be 3
Returns
TRUE or E_ID

Definition at line 315 of file iob.cpp.

◆ read_accelerometer_offset()

int read_accelerometer_offset ( int  id,
double *  offset 
)

read offset values for accelerometer output

Parameters
idaccelerometer id
offsetoffset values[rad/s^2], length of array must be 3.
Return values
TRUEoffset values are read successfully
E_IDinvalid id is specified
FALSEthis function is not supported

Definition at line 448 of file iob.cpp.

◆ read_actual_angle()

int read_actual_angle ( int  id,
double *  angle 
)

read current joint angle[rad]

Parameters
idjoint id
angleactual joint angle[rad]
Return values
TRUEthis function is supported
E_IDinvalid joint id is specified
FALSEotherwise

Definition at line 206 of file iob.cpp.

◆ read_actual_angles()

int read_actual_angles ( double *  angles)

read array of current joint angles[rad]

Parameters
anglesarray of joint angle[rad], length of array must be equal to number_of_joints()
Return values
TRUEthis function is supported
FALSEotherwise

Definition at line 213 of file iob.cpp.

◆ read_actual_torques()

int read_actual_torques ( double *  torques)

read array of current joint torques[Nm]

Parameters
torquesarray of actual joint torque[Nm], length of array must be equal to number_of_joints()
Return values
TRUEthis function is supported
FALSEotherwise

Definition at line 221 of file iob.cpp.

◆ read_actual_velocities()

int read_actual_velocities ( double *  vels)

read actual angular velocities[rad/s]

Parameters
velsarray of angular velocity [rad/s]
Return values
TRUEthis function is supported
FALSEotherwise

Definition at line 370 of file iob.cpp.

◆ read_actual_velocity()

int read_actual_velocity ( int  id,
double *  vel 
)

read actual angular velocity[rad/s]

Parameters
idjoint id
velangular velocity [rad/s]
Returns
TRUE or E_ID

Definition at line 355 of file iob.cpp.

◆ read_angle_offset()

int read_angle_offset ( int  id,
double *  offset 
)

read offset value for joint[rad]

Parameters
idjoint id
offsetoffset value[rad]
Return values
TRUEoffset value is read successfully
E_IDinvalid id is specified
FALSEthis function is not supported

Definition at line 516 of file iob.cpp.

◆ read_attitude_sensor()

int read_attitude_sensor ( int  id,
double *  att 
)

read output of attitude sensor

Parameters
idattitude sensor id
attroll-pitch-yaw angle[rad], length of array must be 3
Return values
TRUEsensor values are read successfully
E_IDinvalid id is specified
FALSEthis function is not supported

Definition at line 330 of file iob.cpp.

◆ read_calib_state()

int read_calib_state ( int  id,
int s 
)

read callibration state of joint

Parameters
idjoint id
sTRUE if calibration is already done, FALSE otherwise
Return values
TRUEcalibration status is read successfully
E_IDinvalid joint id is specified
FALSEthis function is not supported

Definition at line 485 of file iob.cpp.

◆ read_command_angle()

int read_command_angle ( int  id,
double *  angle 
)

read command angle[rad]

Parameters
idjoint id
anglecommand joint angle[rad]
Return values
TRUEthis function is supported
FALSEotherwise

Definition at line 246 of file iob.cpp.

◆ read_command_angles()

int read_command_angles ( double *  angles)

read array of command angles[rad]

Parameters
anglesarray of joint angles[rad], length of array must equal to DOF
Return values
TRUEthis function is supported
FALSEotherwise

Definition at line 260 of file iob.cpp.

◆ read_command_torque()

int read_command_torque ( int  id,
double *  torque 
)

read command torque[Nm]

Parameters
idjoint id
torquejoint torque[Nm]
Return values
TRUEthis function is supported
E_IDinvalid joint id is specified
FALSEotherwise

Definition at line 226 of file iob.cpp.

◆ read_command_torques()

int read_command_torques ( double *  torques)

read array of command torques[Nm]

Parameters
torquesarray of command torques[Nm]
Return values
TRUEthis function is supported
FALSEotherwise

Definition at line 236 of file iob.cpp.

◆ read_command_velocities()

int read_command_velocities ( double *  vels)

read command angular velocities[rad/s]

Parameters
velsarray of angular velocity [rad/s]
Return values
TRUEthis function is supported
FALSEotherwise

Definition at line 375 of file iob.cpp.

◆ read_command_velocity()

int read_command_velocity ( int  id,
double *  vel 
)

read command angular velocity[rad/s]

Parameters
idjoint id
velangular velocity [rad/s]
Returns
TRUE or E_ID

Definition at line 360 of file iob.cpp.

◆ read_control_mode()

int read_control_mode ( int  id,
joint_control_mode s 
)

read joint control mode

Parameters
idjoint id
sjoint control mode
Return values
TRUEthis function is supported
E_IDinvalid joint id is specified
FALSEotherwise

Definition at line 193 of file iob.cpp.

◆ read_current()

int read_current ( int  id,
double *  mcurrent 
)

Definition at line 335 of file iob.cpp.

◆ read_current_limit()

int read_current_limit ( int  id,
double *  v 
)

Definition at line 340 of file iob.cpp.

◆ read_currents()

int read_currents ( double *  currents)

Definition at line 345 of file iob.cpp.

◆ read_dgain()

int read_dgain ( int  id,
double *  gain 
)

read D gain[Nm/(rad/s)]

Parameters
idjoint id
gainD gain[Nm/(rad/s)]
Returns
TRUE or E_ID

Definition at line 286 of file iob.cpp.

◆ read_digital_input()

int read_digital_input ( char *  dinput)

read_digital_input, non-applicable bits are nop

Parameters
dinputdigital input from environment
Returns
TRUE if applicable, FALSE otherwise

Definition at line 714 of file iob.cpp.

◆ read_digital_output()

int read_digital_output ( char *  doutput)

read_digital_output, non-applicable bits are nop

Parameters
doutputdigital output to environment
Returns
TRUE if applicable, FALSE otherwise

Definition at line 739 of file iob.cpp.

◆ read_driver_temperature()

int read_driver_temperature ( int  id,
unsigned char *  v 
)

read temperature of motor driver[Celsius]

Parameters
idjoint id
vtemperature[Celsius]
Return values
TRUEtemperature is read successfully
E_IDinvalid joint id is specified
FALSEthis function is not supported

Definition at line 649 of file iob.cpp.

◆ read_encoder_pulse()

int read_encoder_pulse ( int  id,
double *  ec 
)

Definition at line 534 of file iob.cpp.

◆ read_extra_servo_state()

int read_extra_servo_state ( int  id,
int state 
)

read extra servo states

Parameters
idjoint id
statearray of int where extra servo states are stored
Returns
TRUE if read successfully, FALSE otherwise

Definition at line 692 of file iob.cpp.

◆ read_force_offset()

int read_force_offset ( int  id,
double *  offsets 
)

read offset values for force sensor output

Parameters
idforce/torque sensor id
offsetsoffset values[N][Nm], length of array must be 6.
Return values
TRUEoffset values are read successfully
E_IDinvalid id is specified
FALSEthis function is not supported

Definition at line 464 of file iob.cpp.

◆ read_force_sensor()

int read_force_sensor ( int  id,
double *  forces 
)

read output of force sensor

Parameters
idForce Sensor id
forcesarray of forces[N] and moments[Nm], length of array must be 6
Returns
TRUE or E_ID

Definition at line 296 of file iob.cpp.

◆ read_gauges()

int read_gauges ( double *  gauges)

Definition at line 350 of file iob.cpp.

◆ read_gear_ratio()

int read_gear_ratio ( int  id,
double *  gr 
)

Definition at line 538 of file iob.cpp.

◆ read_gyro_sensor()

int read_gyro_sensor ( int  id,
double *  rates 
)

read output of gyro sensor

Parameters
idgyro sensor id
ratesangular velocities [rad/s], length of array must be 3
Returns
TRUE or E_ID

Definition at line 305 of file iob.cpp.

◆ read_gyro_sensor_offset()

int read_gyro_sensor_offset ( int  id,
double *  offset 
)

read offset values for gyro sensor output

Parameters
idgyro sensor id
offsetoffset values[rad/s], length of array must be 3.
Return values
TRUEoffset values are read successfully
E_IDinvalid id is specified
FALSEthis function is not supported

Definition at line 432 of file iob.cpp.

◆ read_iob_frame()

unsigned long long read_iob_frame ( )

Definition at line 551 of file iob.cpp.

◆ read_limit_angle()

int read_limit_angle ( int  id,
double *  angle 
)

Definition at line 511 of file iob.cpp.

◆ read_llimit_angle()

int read_llimit_angle ( int  id,
double *  angle 
)

Definition at line 530 of file iob.cpp.

◆ read_lock_owner()

int read_lock_owner ( pid_t pid)

read id of the process whic is locking access to iob

Definition at line 506 of file iob.cpp.

◆ read_pgain()

int read_pgain ( int  id,
double *  gain 
)

read P gain[Nm/rad]

Parameters
idjoint id
gainP gain[Nm/rad]
Returns
TRUE or E_ID

Definition at line 276 of file iob.cpp.

◆ read_power()

int read_power ( double *  v,
double *  a 
)

read status of power source

Parameters
vvoltage[V]
acurrent[A]
Returns
TRUE or FALSE

Definition at line 563 of file iob.cpp.

◆ read_power_command()

int read_power_command ( int  id,
int com 
)

turn on/off power supply for motor driver

Parameters
idjoint id
comON/OFF
Return values
TRUEthis function is supported
E_IDinvalid joint id is specified
FALSEotherwise

Definition at line 172 of file iob.cpp.

◆ read_power_state()

int read_power_state ( int  id,
int s 
)

read power status of motor driver

Parameters
idjoint id
sON or OFF is returned
Return values
TRUEthis function is supported
E_IDinvalid joint id is specified
FALSEotherwise

Definition at line 158 of file iob.cpp.

◆ read_servo_alarm()

int read_servo_alarm ( int  id,
int a 
)

read servo alarms

Parameters
idjoint id
aservo alarms
Return values
TRUEthis function is supported
E_IDinvalid joint id is specified
FALSEotherwise

Definition at line 186 of file iob.cpp.

◆ read_servo_state()

int read_servo_state ( int  id,
int s 
)

read servo status

Parameters
idjoint id
sON/OFF
Return values
TRUEthis function is supported
E_IDinvalid joint id is specified
FALSEotherwise

Definition at line 179 of file iob.cpp.

◆ read_temperature()

int read_temperature ( int  id,
double *  v 
)

read thermometer

Parameters
idid of thermometer
vtemperature[Celsius]
Return values
TRUEtemperature is read successfully
E_IDinvalid thermometer id is specified
FALSEthis function is not supported

Definition at line 385 of file iob.cpp.

◆ read_torque_const()

int read_torque_const ( int  id,
double *  tc 
)

Definition at line 542 of file iob.cpp.

◆ read_torque_limit()

int read_torque_limit ( int  id,
double *  limit 
)

Definition at line 546 of file iob.cpp.

◆ read_touch_sensors()

int read_touch_sensors ( unsigned short *  onoff)

Definition at line 325 of file iob.cpp.

◆ read_ulimit_angle()

int read_ulimit_angle ( int  id,
double *  angle 
)

Definition at line 526 of file iob.cpp.

◆ reset_body()

int reset_body ( void  )

Definition at line 419 of file iob.cpp.

◆ set_number_of_accelerometers()

int set_number_of_accelerometers ( int  num)

set the number of accelerometers

Parameters
numthe number of accelerometers
Returns
TRUE if the number of accelerometers is set, FALSE otherwise

Definition at line 131 of file iob.cpp.

◆ set_number_of_attitude_sensors()

int set_number_of_attitude_sensors ( int  num)

Definition at line 146 of file iob.cpp.

◆ set_number_of_force_sensors()

int set_number_of_force_sensors ( int  num)

set the number of force sensors

Parameters
numthe number of force sensors
Returns
TRUE if the number of force sensors is set, FALSE otherwise

Definition at line 101 of file iob.cpp.

◆ set_number_of_gyro_sensors()

int set_number_of_gyro_sensors ( int  num)

set the number of gyro sensors

Parameters
numthe number of gyro sensors
Returns
TRUE if the number of gyro sensors is set, FALSE otherwise

Definition at line 116 of file iob.cpp.

◆ set_number_of_joints()

int set_number_of_joints ( int  num)

set the number of joints

Parameters
numthe number of joints
Returns
TRUE if the number of joints is set, FALSE otherwise

Definition at line 90 of file iob.cpp.

◆ set_signal_period()

int set_signal_period ( long  period_ns)

set the period of signals issued by wait_for_iob_signal()

Parameters
period_nsthe period of signals[ns]
Returns
TRUE if set successfully, FALSE otherwise

Definition at line 697 of file iob.cpp.

◆ timespec_add_ns()

void timespec_add_ns ( timespec *  ts,
long  ns 
)

Definition at line 655 of file iob.cpp.

◆ timespec_compare()

double timespec_compare ( timespec *  ts1,
timespec *  ts2 
)

Definition at line 664 of file iob.cpp.

◆ unlock_iob()

int unlock_iob ( )

unlock access to iob

Definition at line 500 of file iob.cpp.

◆ wait_for_iob_signal()

int wait_for_iob_signal ( )

wait until iob signal is issued

Returns
TRUE if signal is received successfully, FALSE otherwise

Definition at line 671 of file iob.cpp.

◆ write_accelerometer_offset()

int write_accelerometer_offset ( int  id,
double *  offset 
)

write offset values for accelerometer output

Parameters
idaccelerometer id
offsetoffset values[rad/s^2], length of array must be 3.
Return values
TRUEoffset values are written successfully
E_IDinvalid id is specified
FALSEthis function is not supported

Definition at line 456 of file iob.cpp.

◆ write_angle_offset()

int write_angle_offset ( int  id,
double  offset 
)

write offset value for joint[rad]

Parameters
idjoint id
offsetoffset value[rad]
Return values
TRUEoffset values are written successfully
E_IDinvalid id is specified
FALSEthis function is not supported

Definition at line 521 of file iob.cpp.

◆ write_attitude_sensor_offset()

int write_attitude_sensor_offset ( int  id,
double *  offset 
)

Definition at line 480 of file iob.cpp.

◆ write_command_angle()

int write_command_angle ( int  id,
double  angle 
)

write command angle[rad]

Parameters
idjoint id
anglecommand joint angle[rad]
Returns
TRUE or E_ID

Definition at line 253 of file iob.cpp.

◆ write_command_angles()

int write_command_angles ( const double *  angles)

write array of command angles[rad]

Parameters
anglesarray of joint angles[rad], length of array must equal to DOF
Return values
TRUEthis function is supported
FALSEotherwise

Definition at line 268 of file iob.cpp.

◆ write_command_torque()

int write_command_torque ( int  id,
double  torque 
)

write command torque[Nm]

Parameters
idjoint id
torquejoint torque[Nm]
Returns
TRUE if this function is supported, FALSE otherwise

Definition at line 231 of file iob.cpp.

◆ write_command_torques()

int write_command_torques ( const double *  torques)

write array of command torques[Nm]

Parameters
torquesarray of command torques[Nm]
Return values
TRUEthis function is supported
FALSEotherwise

Definition at line 241 of file iob.cpp.

◆ write_command_velocities()

int write_command_velocities ( const double *  vels)

write command angular velocities[rad/s]

Parameters
velsarray of angular velocity [rad/s]
Return values
TRUEthis function is supported
FALSEotherwise

Definition at line 380 of file iob.cpp.

◆ write_command_velocity()

int write_command_velocity ( int  id,
double  vel 
)

write command angular velocity[rad/s]

Parameters
idjoint id
velangular velocity [rad/s]
Returns
TRUE or E_ID

Definition at line 365 of file iob.cpp.

◆ write_control_mode()

int write_control_mode ( int  id,
joint_control_mode  s 
)

write joint control mode

Parameters
idjoint id
sjoint control mode
Return values
TRUEthis function is supported
E_IDinvalid joint id is specified
FALSEotherwise

Definition at line 200 of file iob.cpp.

◆ write_dgain()

int write_dgain ( int  id,
double  gain 
)

write D gain[Nm/(rad/s)]

Parameters
idjoint id
gainD gain[Nm/(rad/s)]
Returns
TRUE or E_ID

Definition at line 291 of file iob.cpp.

◆ write_digital_output()

int write_digital_output ( const char *  doutput)

write_digital_output, non-applicable bits are nop

Parameters
doutputset digital output to environment
Returns
TRUE if applicable, FALSE otherwise

Definition at line 724 of file iob.cpp.

◆ write_digital_output_with_mask()

int write_digital_output_with_mask ( const char *  doutput,
const char *  dmask 
)

write_digital_output, non-applicable bits are nop

Parameters
doutputset digital output to environment
maskbinary vector which selects output to be set
Returns
TRUE if applicable, FALSE otherwise

Definition at line 729 of file iob.cpp.

◆ write_dio()

int write_dio ( unsigned short  buf)

Definition at line 396 of file iob.cpp.

◆ write_force_offset()

int write_force_offset ( int  id,
double *  offsets 
)

write offset values for force sensor output

Parameters
idforce/torque id
offsetsoffset values[N][Nm], length of array must be 6.
Return values
TRUEoffset values are written successfully
E_IDinvalid id is specified
FALSEthis function is not supported

Definition at line 472 of file iob.cpp.

◆ write_gyro_sensor_offset()

int write_gyro_sensor_offset ( int  id,
double *  offset 
)

write offset values for gyro sensor output

Parameters
idgyro sensor id
offsetoffset values[rad/s], length of array must be 3.
Return values
TRUEoffset values are written successfully
E_IDinvalid id is specified
FALSEthis function is not supported

Definition at line 440 of file iob.cpp.

◆ write_pgain()

int write_pgain ( int  id,
double  gain 
)

write P gain[Nm/rad]

Parameters
idjoint id
gainP gain[Nm/rad]
Returns
TRUE or E_ID

Definition at line 281 of file iob.cpp.

◆ write_power_command()

int write_power_command ( int  id,
int  com 
)

turn on/off power supply for motor driver

Parameters
idjoint id
comON/OFF
Return values
TRUEthis function is supported
E_IDinvalid joint id is specified
FALSEotherwise

Definition at line 165 of file iob.cpp.

◆ write_servo()

int write_servo ( int  id,
int  com 
)

turn on/off joint servo

Parameters
idjoint id
comON/OFF
Returns
TRUE if this function is supported, FALSE otherwise

Definition at line 390 of file iob.cpp.

Variable Documentation

◆ accel_offset

std::vector<std::vector<double> > accel_offset
static

Definition at line 15 of file iob.cpp.

◆ accelerometers

std::vector<std::vector<double> > accelerometers
static

Definition at line 11 of file iob.cpp.

◆ attitude_sensors

std::vector<std::vector<double> > attitude_sensors
static

Definition at line 12 of file iob.cpp.

◆ command

std::vector<double> command
static

Definition at line 8 of file iob.cpp.

◆ force_offset

std::vector<std::vector<double> > force_offset
static

Definition at line 13 of file iob.cpp.

◆ forces

std::vector<std::vector<double> > forces
static

Definition at line 9 of file iob.cpp.

◆ frame

int frame = 0
static

Definition at line 19 of file iob.cpp.

◆ g_period_ns

long g_period_ns =5000000
static

Definition at line 21 of file iob.cpp.

◆ g_ts

timespec g_ts
static

Definition at line 20 of file iob.cpp.

◆ gyro_offset

std::vector<std::vector<double> > gyro_offset
static

Definition at line 14 of file iob.cpp.

◆ gyros

std::vector<std::vector<double> > gyros
static

Definition at line 10 of file iob.cpp.

◆ isLocked

bool isLocked = false
static

Definition at line 18 of file iob.cpp.

◆ power

std::vector<int> power
static

Definition at line 16 of file iob.cpp.

◆ servo

std::vector<int> servo
static

Definition at line 17 of file iob.cpp.



hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Sat Dec 17 2022 03:52:21