Class robot_fingers::T_TriFingerPlatformFrontendCameraSynced

template<typename CameraObservation_t>
class T_TriFingerPlatformFrontendCameraSynced

Combined front end for the TriFinger Platform, synchronizing robot observations with the camera.

This class combines the front ends for robot and cameras in one class using unified time indices.

It is similar to T_TriFingerPlatformFrontend but uses the camera time steps as base for accessing observations.

So methods for accessing robot observations/actions/status take as input a camera time step t_c and internally map it to the robot time step t_r which is closest to the moment when the images where fetched from the cameras (i.e. it uses the image timestamps for synchronizing, not the timestamp of the camera observation).

append_desired_action still returns the robot time index when the action will be applied and getter methods prefixed with “robot_” are provided to access data of the corresponding steps (e.g. robot_get_robot_observation, robot_get_robot_timestamp_ms, …). Those may be useful for better analysis, e.g. to check intermediate robot states or get exact timestamps of robot actions. However, this robot time index must not be used with the regular getter methods (get_robot_observation, …) and is wrapped in a struct RobotTimeIndex to avoid accidental mix-up.

Public Types

typedef robot_interfaces::TriFingerTypes::Action Action
typedef robot_interfaces::TriFingerTypes::Observation RobotObservation
typedef robot_interfaces::Status RobotStatus
typedef CameraObservation_t CameraObservation
typedef robot_interfaces::TriFingerTypes::Action Action
typedef robot_interfaces::TriFingerTypes::Observation RobotObservation
typedef robot_interfaces::Status RobotStatus
typedef CameraObservation_t CameraObservation

Public Functions

inline T_TriFingerPlatformFrontendCameraSynced(robot_interfaces::TriFingerTypes::BaseDataPtr robot_data, std::shared_ptr<robot_interfaces::SensorData<CameraObservation>> camera_data)

Initialize with data instances for all internal frontends.

Parameters:
  • robot_data – RobotData instance used by the robot frontend.

  • object_tracker_data – ObjectTrackerData instance used by the object tracker frontend.

  • camera_data – SensorData instance, used by the camera frontend.

inline T_TriFingerPlatformFrontendCameraSynced()

Initialize with default data instances.

Creates for each internal frontend a corresponding mutli-process data instance with the default shared memory ID for the corresponding data type.

inline RobotTimeIndex append_desired_action(const Action &desired_action)

Append a desired robot action to the action queue.

Notice: The returned time index refers to the robot time series, not the camera time series. This is because it is not so easy to determine the camera time step in which this action will be applied (or if it even aligns with a specific camera step). The returned value might still be useful in some situations but it should not (and cannot) be used with functions like get_robot_observation.

See also

robot_interfaces::TriFingerTypes::Frontend::append_desired_action

Returns:

Robot time step when the action will be applied. See notice above!

inline RobotObservation get_robot_observation(const time_series::Index &t_camera) const

Get robot observation matching images in camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_observation

inline Action get_desired_action(const time_series::Index &t_camera) const

Get desired action matching images in camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_desired_action

inline Action get_applied_action(const time_series::Index &t_camera) const

Get actually applied action matching images in camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_applied_action

inline RobotStatus get_robot_status(const time_series::Index &t_camera) const

Get robot status matching images in camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_status

inline time_series::Timestamp get_robot_timestamp_ms(const time_series::Index &t_camera) const

Get timestamp (in milliseconds) matching images in camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_timestamp_ms

inline time_series::Timestamp get_camera_timestamp_ms(const time_series::Index &t_camera) const

Get timestamp (in milliseconds) of camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_timestamp_ms

inline time_series::Index get_current_timeindex() const

Get the current camera time index.

inline void wait_until_timeindex(const time_series::Index &t_camera) const

Wait until camera time step t_camera.

inline CameraObservation get_camera_observation(const time_series::Index t_camera) const

Get camera images of time step t_camera.

Parameters:

t_camera – Time index of the camera time series.

Returns:

Camera images of time step t_camera.

inline RobotObservation robot_get_robot_observation(RobotTimeIndex t_robot) const

See also

robot_interfaces::TriFingerTypes::Frontend::get_observation

inline Action robot_get_desired_action(RobotTimeIndex t_robot) const

See also

robot_interfaces::TriFingerTypes::Frontend::get_desired_action

inline Action robot_get_applied_action(RobotTimeIndex t_robot) const

See also

robot_interfaces::TriFingerTypes::Frontend::get_applied_action

inline RobotStatus robot_get_robot_status(RobotTimeIndex t_robot) const

See also

robot_interfaces::TriFingerTypes::Frontend::get_status

inline time_series::Timestamp robot_get_robot_timestamp_ms(RobotTimeIndex t_robot) const

See also

robot_interfaces::TriFingerTypes::Frontend::get_timestamp_ms

inline RobotTimeIndex robot_get_current_timeindex() const

Get the current robot time index.

inline T_TriFingerPlatformFrontendCameraSynced(robot_interfaces::TriFingerTypes::BaseDataPtr robot_data, std::shared_ptr<robot_interfaces::SensorData<CameraObservation>> camera_data)

Initialize with data instances for all internal frontends.

Parameters:
  • robot_data – RobotData instance used by the robot frontend.

  • object_tracker_data – ObjectTrackerData instance used by the object tracker frontend.

  • camera_data – SensorData instance, used by the camera frontend.

inline T_TriFingerPlatformFrontendCameraSynced()

Initialize with default data instances.

Creates for each internal frontend a corresponding mutli-process data instance with the default shared memory ID for the corresponding data type.

inline RobotTimeIndex append_desired_action(const Action &desired_action)

Append a desired robot action to the action queue.

Notice: The returned time index refers to the robot time series, not the camera time series. This is because it is not so easy to determine the camera time step in which this action will be applied (or if it even aligns with a specific camera step). The returned value might still be useful in some situations but it should not (and cannot) be used with functions like get_robot_observation.

See also

robot_interfaces::TriFingerTypes::Frontend::append_desired_action

Returns:

Robot time step when the action will be applied. See notice above!

inline RobotObservation get_robot_observation(const time_series::Index &t_camera) const

Get robot observation matching images in camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_observation

inline Action get_desired_action(const time_series::Index &t_camera) const

Get desired action matching images in camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_desired_action

inline Action get_applied_action(const time_series::Index &t_camera) const

Get actually applied action matching images in camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_applied_action

inline RobotStatus get_robot_status(const time_series::Index &t_camera) const

Get robot status matching images in camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_status

inline time_series::Timestamp get_robot_timestamp_ms(const time_series::Index &t_camera) const

Get timestamp (in milliseconds) matching images in camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_timestamp_ms

inline time_series::Timestamp get_camera_timestamp_ms(const time_series::Index &t_camera) const

Get timestamp (in milliseconds) of camera time step t_camera.

See also

robot_interfaces::TriFingerTypes::Frontend::get_timestamp_ms

inline time_series::Index get_current_timeindex() const

Get the current camera time index.

inline void wait_until_timeindex(const time_series::Index &t_camera) const

Wait until camera time step t_camera.

inline CameraObservation get_camera_observation(const time_series::Index t_camera) const

Get camera images of time step t_camera.

Parameters:

t_camera – Time index of the camera time series.

Returns:

Camera images of time step t_camera.

inline RobotObservation robot_get_robot_observation(RobotTimeIndex t_robot) const

See also

robot_interfaces::TriFingerTypes::Frontend::get_observation

inline Action robot_get_desired_action(RobotTimeIndex t_robot) const

See also

robot_interfaces::TriFingerTypes::Frontend::get_desired_action

inline Action robot_get_applied_action(RobotTimeIndex t_robot) const

See also

robot_interfaces::TriFingerTypes::Frontend::get_applied_action

inline RobotStatus robot_get_robot_status(RobotTimeIndex t_robot) const

See also

robot_interfaces::TriFingerTypes::Frontend::get_status

inline time_series::Timestamp robot_get_robot_timestamp_ms(RobotTimeIndex t_robot) const

See also

robot_interfaces::TriFingerTypes::Frontend::get_timestamp_ms

inline RobotTimeIndex robot_get_current_timeindex() const

Get the current robot time index.