1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
|
description {
@brief An array of actuators
The actuator array interface provides access to an array of actuators.
}
message { REQ, POWER, 1, player_actarray_power_config_t };
message { REQ, BRAKES, 2, player_actarray_brakes_config_t };
message { REQ, GET_GEOM, 3, player_actarray_geom_t };
message { REQ, SPEED, 4, player_actarray_speed_config_t };
message { REQ, ACCEL, 5, player_actarray_accel_config_t };
message { CMD, POS, 1, player_actarray_position_cmd_t };
message { CMD, MULTI_POS, 2, player_actarray_multi_position_cmd_t };
message { CMD, SPEED, 3, player_actarray_speed_cmd_t };
message { CMD, MULTI_SPEED, 4, player_actarray_multi_speed_cmd_t };
message { CMD, HOME, 5, player_actarray_home_cmd_t };
message { CMD, CURRENT, 6, player_actarray_current_cmd_t };
message { CMD, MULTI_CURRENT, 7, player_actarray_multi_current_cmd_t };
message { DATA, STATE, 1, player_actarray_data_t };
/** Idle state code */
#define PLAYER_ACTARRAY_ACTSTATE_IDLE 1
/** Moving state code */
#define PLAYER_ACTARRAY_ACTSTATE_MOVING 2
/** Braked state code */
#define PLAYER_ACTARRAY_ACTSTATE_BRAKED 4
/** Stalled state code */
#define PLAYER_ACTARRAY_ACTSTATE_STALLED 8
/** Linear type code */
#define PLAYER_ACTARRAY_TYPE_LINEAR 1
/** Rotary type code */
#define PLAYER_ACTARRAY_TYPE_ROTARY 2
/** @brief Structure containing a single actuator's information */
typedef struct player_actarray_actuator
{
/** The position of the actuator in m or rad depending on the type. */
float position;
/** The speed of the actuator in m/s or rad/s depending on the type. */
float speed;
/** The acceleration of the actuator in m/s^2 or rad/s^2 depending on the type. */
float acceleration;
/** The current of the actuator in A. */
float current;
/** The current state of the actuator. */
uint8_t state;
} player_actarray_actuator_t;
/** @brief Data: state (@ref PLAYER_ACTARRAY_DATA_STATE)
The actuator array data packet. */
typedef struct player_actarray_data
{
/** The number of actuators in the array. */
uint32_t actuators_count;
/** The actuator data. */
player_actarray_actuator_t *actuators;
/** power state */
uint8_t motor_state;
} player_actarray_data_t;
/** @brief Actuator geometry */
typedef struct player_actarray_actuatorgeom
{
/** The type of the actuator - linear or rotary. */
uint8_t type;
/** The length of this actuator's link to the next actuator. For linear
actuators, this should be its length when at 0 position. */
float length;
/** The orientation of this actuator when it is in its rest position. When
combined with the length of the actuator's link, this will give the position
in space of the next actuator in the array in the coordinate space of this
actuator (i.e., it is the direction to the next actuator). */
player_orientation_3d_t orientation;
/** The axis of rotation for this actuator if it is rotary, or axis along
which it moves if it is linear. In both cases, it is a vector. */
player_point_3d_t axis;
/** The range of motion of the actuator, in m or rad depending on the type. */
float min;
/** The range of motion of the actuator, in m or rad depending on the type. */
float centre;
/** The range of motion of the actuator, in m or rad depending on the type. */
float max;
/** The range of motion of the actuator, in m or rad depending on the type. */
float home;
/** The configured speed setting of the actuator - different from current speed. */
float config_speed;
/** If the actuator has brakes or not. */
uint8_t hasbrakes;
} player_actarray_actuatorgeom_t;
/** @brief Request/reply: get geometry
Send a null @ref PLAYER_ACTARRAY_REQ_GET_GEOM request to receive the geometry in
this form. */
typedef struct player_actarray_geom
{
/** The number of actuators in the array. */
uint32_t actuators_count;
/** The geometry information for each actuator in the array. */
player_actarray_actuatorgeom_t *actuators;
/** The position of the base of the actarray. This should always be the
position of the first actuator in the array. */
player_point_3d_t base_pos;
/** The orientation of the base of the actarray. This is distinct from the
orientation of the first actuator in the array. */
player_orientation_3d_t base_orientation;
} player_actarray_geom_t;
/** @brief Command: Joint position control (@ref PLAYER_ACTARRAY_CMD_POS)
Tells a joint/actuator to attempt to move to a requested position. */
typedef struct player_actarray_position_cmd
{
/** The joint/actuator to command. */
int32_t joint;
/** The position to move to. */
float position;
} player_actarray_position_cmd_t;
/** @brief Command: Multiple Joint position control (@ref PLAYER_ACTARRAY_CMD_MULTI_POS)
Tells all joints/actuators to attempt to move to the given positions. */
typedef struct player_actarray_multi_position_cmd
{
/** The number of actuators in the array. */
uint32_t positions_count;
/** The positions for each joint/actuator. */
float *positions;
} player_actarray_multi_position_cmd_t;
/** @brief Command: Joint speed control (@ref PLAYER_ACTARRAY_CMD_SPEED)
Tells a joint/actuator to attempt to move with the given speed. */
typedef struct player_actarray_speed_cmd
{
/** The joint/actuator to command. */
int32_t joint;
/** The speed to move with. */
float speed;
} player_actarray_speed_cmd_t;
/** @brief Command: Multiple Joint speed control (@ref PLAYER_ACTARRAY_CMD_MULTI_SPEED)
Tells all joints/actuators to attempt to move with the given velocities. */
typedef struct player_actarray_multi_speed_cmd
{
/** The number of actuators in the array. */
uint32_t speeds_count;
/** The speed to move with. */
float *speeds;
} player_actarray_multi_speed_cmd_t;
/** @brief Command: Joint home (@ref PLAYER_CMD_ACTARRAY_HOME)
Tells a joint/actuator (or the whole array) to go to home position. */
typedef struct player_actarray_home_cmd
{
/** The joint/actuator to command - set to -1 to command all. */
int32_t joint;
} player_actarray_home_cmd_t;
/** @brief Command: Joint current control (@ref PLAYER_ACTARRAY_CMD_CURRENT)
Tells a joint/actuator to attempt to move with the given current. */
typedef struct player_actarray_current_cmd
{
/** The joint/actuator to command - set to -1 to command all. */
int32_t joint;
/** The current to move with. */
float current;
} player_actarray_current_cmd_t;
/** @brief Command: Multiple Joint current control (@ref PLAYER_ACTARRAY_CMD_MULTI_CURRENT)
Tells all joints/actuators to attempt to move with the given current. */
typedef struct player_actarray_multi_current_cmd
{
/** The number of actuators in the array. */
uint32_t currents_count;
/** The current for the motors of the whole array */
float *currents;
} player_actarray_multi_current_cmd_t;
/** @brief Request/reply: Power.
Send a @ref PLAYER_ACTARRAY_REQ_POWER request to turn the power to all actuators
in the array on or off. Be careful when turning power on that the array is
not obstructed from its home position in case it moves to it (common
behaviour). Null response. */
typedef struct player_actarray_power_config
{
/** Power setting; 0 for off, 1 for on. */
uint8_t value;
} player_actarray_power_config_t;
/** @brief Request/reply: Brakes.
Send a @ref PLAYER_ACTARRAY_REQ_BRAKES request to turn the brakes of all
actuators in the array (that have them) on or off. Null response.*/
typedef struct player_actarray_brakes_config
{
/** Brake setting; 0 for off, 1 for on. */
uint8_t value;
} player_actarray_brakes_config_t;
/** @brief Request/reply: Speed.
Send a @ref PLAYER_ACTARRAY_REQ_SPEED request to set the speed of a joint for
all subsequent movements. Null response. */
typedef struct player_actarray_speed_config
{
/** Joint to set speed for. */
int32_t joint;
/** Speed setting in m/s or rad/s. */
float speed;
} player_actarray_speed_config_t;
/** @brief Request/reply: Acceleration.
Send a @ref PLAYER_ACTARRAY_REQ_ACCEL request to set the acceleration of a joint for
all subsequent movements. Null response. */
typedef struct player_actarray_accel_config
{
/** Joint to set acceleration for. */
int32_t joint;
/** Acceleration setting in m/s^2 or rad/s^2. */
float accel;
} player_actarray_accel_config_t;
|