pr2_mechanism_msgs

Summary

pr2_mechanism_msgs
Version:

1.8.0

Description:

This package defines services that are used to communicate with the realtime control loop. It also defines messages that represent the state of the realtime controllers, the joints and the actuators.

Maintainers:
  • Wim Meeussen <wim AT hidof DOT com>
Licenses:
  • BSD
Urls:
Authors:
  • Stuart Glaser <sglaser AT willowgarage DOT com>
  • Wim Meeussen <wim AT hidof DOT com>
BuildDepends:
BuildtoolDepends:
 
BuildExportDepends:
 
ExecDepends:

Types

Message types

pr2_mechanism_msgs/ControllerStatistics
Field:
  • name (string) –
  • timestamp (time) –
  • running (bool) –
  • max_time (duration) –
  • mean_time (duration) –
  • variance_time (duration) –
  • num_control_loop_overruns (int32) –
  • time_last_control_loop_overrun (time) –

This message contains the state of one realtime controller that was spawned in pr2_mechanism_control

the name of the controller

# This message contains the state of one realtime controller
# that was spawned in pr2_mechanism_control

# the name of the controller
string name

# the time at which these controller statistics were measured
time timestamp

# bool that indicates if the controller is currently
# in a running or a stopped state
bool running

# the maximum time the update loop of the controller ever needed to complete
duration max_time

# the average time the update loop of the controller needs to complete. 
# the average is computed in a sliding time window.
duration mean_time

# the variance on the time the update loop of the controller needs to complete.
# the variance applies to a sliding time window.
duration variance_time

# the number of times this controller broke the realtime loop
int32 num_control_loop_overruns

# the timestamp of the last time this controller broke the realtime loop
time time_last_control_loop_overrun
pr2_mechanism_msgs/ActuatorStatistics
Field:
  • name (string) –
  • device_id (int32) –
  • timestamp (time) –
  • encoder_count (int32) –
  • encoder_offset (float64) –
  • position (float64) –
  • encoder_velocity (float64) –
  • velocity (float64) –
  • calibration_reading (bool) –
  • calibration_rising_edge_valid (bool) –
  • calibration_falling_edge_valid (bool) –
  • last_calibration_rising_edge (float64) –
  • last_calibration_falling_edge (float64) –
  • is_enabled (bool) –
  • halted (bool) –
  • last_commanded_current (float64) –
  • last_commanded_effort (float64) –
  • last_executed_current (float64) –
  • last_executed_effort (float64) –
  • last_measured_current (float64) –
  • last_measured_effort (float64) –
  • motor_voltage (float64) –
  • num_encoder_errors (int32) –

This message contains the state of an actuator on the pr2 robot. An actuator contains a motor and an encoder, and is connected to a joint by a transmission

the name of the actuator

# This message contains the state of an actuator on the pr2 robot.
# An actuator contains a motor and an encoder, and is connected
# to a joint by a transmission

# the name of the actuator
string name

# the sequence number of the MCB in the ethercat chain. 
# the first device in the chain gets deviced_id zero
int32 device_id

# the time at which this actuator state was measured
time timestamp

# the encoder position, represented by the number of encoder ticks
int32 encoder_count

# The angular offset (in radians) that is added to the encoder reading, 
# to get to the position of the actuator. This number is computed when the referece
# sensor is triggered during the calibration phase
float64 encoder_offset

# the encoder position in radians
float64 position

# the encoder velocity in encoder ticks per second
float64 encoder_velocity

# the encoder velocity in radians per second
float64 velocity

# the value of the calibration reading: low (false) or high (true)
bool calibration_reading

# bool to indicate if the joint already triggered the rising/falling edge of the reference sensor
bool calibration_rising_edge_valid
bool calibration_falling_edge_valid

# the encoder position when the last rising/falling edge was observed. 
# only read this value when the calibration_rising/falling_edge_valid is true
float64 last_calibration_rising_edge
float64 last_calibration_falling_edge

# flag to indicate if this actuator is enabled or not. 
# An actuator can only be commanded when it is enabled.
bool is_enabled

# indicates if the motor is halted. A motor can be halted because of a voltage or communication problem
bool halted

# the last current/effort command that was requested
float64 last_commanded_current
float64 last_commanded_effort

# the last current/effort command that was executed by the actuator
float64 last_executed_current
float64 last_executed_effort

# the last current/effort that was measured by the actuator
float64 last_measured_current
float64 last_measured_effort

# the motor voltate
float64 motor_voltage

# the number of detected encoder problems 
int32 num_encoder_errors
pr2_mechanism_msgs/MechanismStatistics
Field:

This message describes the state of the pr2 mechanism. It contains the state of each actuator, each joint, and each controller that is spawned in pr2_mechanism_control.

# This message describes the state of the pr2 mechanism. It contains the state of
# each actuator, each joint, and each controller that is spawned in pr2_mechanism_control.

Header header
ActuatorStatistics[] actuator_statistics
JointStatistics[] joint_statistics
ControllerStatistics[] controller_statistics
pr2_mechanism_msgs/JointStatistics
Field:
  • name (string) –
  • timestamp (time) –
  • position (float64) –
  • velocity (float64) –
  • measured_effort (float64) –
  • commanded_effort (float64) –
  • is_calibrated (bool) –
  • violated_limits (bool) –
  • odometer (float64) –
  • min_position (float64) –
  • max_position (float64) –
  • max_abs_velocity (float64) –
  • max_abs_effort (float64) –

This message contains the state of one joint of the pr2 robot. This message is specificly designed for the pr2 robot. A generic joint state message can be found in sensor_msgs::JointState

the name of the joint

# This message contains the state of one joint of the pr2 robot.
# This message is specificly designed for the pr2 robot. 
# A generic joint state message can be found in sensor_msgs::JointState

# the name of the joint
string name

# the time at which these joint statistics were measured
time timestamp

# the position of the joint in radians
float64 position

# the velocity of the joint in radians per second
float64 velocity

# the measured joint effort 
float64 measured_effort

# the effort that was commanded to the joint.
# the actual applied effort might be different
# because the safety code can limit the effort
# a joint can apply
float64 commanded_effort

# a flag indicating if the joint is calibrated or not
bool is_calibrated

# a flag inidcating if the joint violated one of its position/velocity/effort limits
# in the last publish cycle
bool violated_limits

# the total distance travelled by the joint, measured in radians.
float64 odometer

# the lowest position reached by the joint in the last publish cycle
float64 min_position

# the highest position reached by the joint in the last publish cycle
float64 max_position

# the maximum absolute velocity reached by the joint in the last publish cycle
float64 max_abs_velocity

# the maximum absolute effort applied by the joint in the last publish cycle
float64 max_abs_effort

Service types

pr2_mechanism_msgs/LoadController
Field (Request):
 
  • name (string) –
Field (Response):
 
  • ok (bool) –

The LoadController service allows you to load a single controller inside pr2_controller_manager

To load a controller, specify the “name” of the controller. The return value “ok” indicates if the controller was successfully constructed and initialized or not.

# The LoadController service allows you to load a single controller 
# inside pr2_controller_manager

# To load a controller, specify the "name" of the controller. 
# The return value "ok" indicates if the controller was successfully
# constructed and initialized or not.

string name
---
bool ok
pr2_mechanism_msgs/ListControllers
Field (Response):
 
  • controllers[] (string) –
  • state[] (string) –

The ListControllers service returns a list of controller names that are spawned inside pr2_mechanism_control, and their corresponding stats. The state is either running or stopped.

# The ListControllers service returns a list of controller names that are spawned
# inside pr2_mechanism_control, and their corresponding stats. The state is either
# running or stopped.

---
string[] controllers
string[] state
pr2_mechanism_msgs/SwitchController
Field (Request):
 
  • start_controllers[] (string) –
  • stop_controllers[] (string) –
  • strictness (int32) –
Constant (Request):
 
  • BEST_EFFORT (int32):1
  • STRICT (int32):2
Field (Response):
 
  • ok (bool) –

The SwitchController service allows you stop a number of controllers and start a number of controllers, all in one single timestep of the pr2_mechanism_control control loop.

To switch controllers, specify
  • the list of controller names to start,

  • the list of controller names to stop, and

  • the strictness (BEST_EFFORT or STRICT) * STRICT means that switching will fail if anything goes wrong (an invalid

    controller name, a controller that failed to start, etc. )

    • BEST_EFFORT means that even when something goes wrong with on controller, the service will still try to start/stop the remaining controllers

The return value “ok” indicates if the controllers were switched successfully or not. The meaning of success depends on the specified strictness.

# The SwitchController service allows you stop a number of controllers
# and start a number of controllers, all in one single timestep of the
# pr2_mechanism_control control loop. 

# To switch controllers, specify 
#  * the list of controller names to start,
#  * the list of controller names to stop, and
#  * the strictness (BEST_EFFORT or STRICT)
#    * STRICT means that switching will fail if anything goes wrong (an invalid
#      controller name, a controller that failed to start, etc. )
#    * BEST_EFFORT means that even when something goes wrong with on controller, 
#      the service will still try to start/stop the remaining controllers

# The return value "ok" indicates if the controllers were switched
# successfully or not.  The meaning of success depends on the 
# specified strictness.


string[] start_controllers
string[] stop_controllers
int32 strictness
int32 BEST_EFFORT=1
int32 STRICT=2
---
bool ok
pr2_mechanism_msgs/UnloadController
Field (Request):
 
  • name (string) –
Field (Response):
 
  • ok (bool) –

The UnloadController service allows you to unload a single controller that is loaded in pr2_controller_manager.

To unload a controller, specify the “name” of the controller. The return value “ok” indicates if the controller was unloaded or not. There are three cases when unloadinng a controller will fail:

  • No controller with the specified name exists
  • The controller is still running
  • Another controller depends on the specified controller
# The UnloadController service allows you to unload a single controller 
# that is loaded in pr2_controller_manager. 

# To unload a controller, specify the "name" of the controller. 
# The return value "ok" indicates if the controller was unloaded or not.
# There are three cases when unloadinng a controller will fail:
#  * No controller with the specified name exists
#  * The controller is still running
#  * Another controller depends on the specified controller

string name
---
bool ok
pr2_mechanism_msgs/ReloadControllerLibraries
Field (Request):
 
  • force_kill (bool) –
Field (Response):
 
  • ok (bool) –

The ReloadControllerLibraries service will reload all controllers that are available in the system as plugins

Reloading libraries only works if there are no controllers loaded. If there are still some controllers loaded, the reloading will fail. If this bool is set to true, all loaded controllers will get killed automatically, and the reloading can succeed.

# The ReloadControllerLibraries service will reload all controllers that are available in
# the system as plugins


# Reloading libraries only works if there are no controllers loaded. If there
# are still some controllers loaded, the reloading will fail.
# If this bool is set to true, all loaded controllers will get
# killed automatically, and the reloading can succeed.
bool force_kill
---
bool ok
pr2_mechanism_msgs/ListControllerTypes
Field (Response):
 
  • types[] (string) –

The ListControllers service returns a list of controller types that are known to pr2_mechanism_control.

# The ListControllers service returns a list of controller types that are known
# to pr2_mechanism_control. 

---
string[] types

Action types

pr2_mechanism_msgs/SwitchController
Field (Goal):
  • start_controllers[] (string) –
  • stop_controllers[] (string) –
string[] start_controllers
string[] stop_controllers
---
---