Class robot_fingers::T_TriFingerPlatformLog

template<typename CameraObservation_t>
class T_TriFingerPlatformLog

Load robot and camera log and match observations like during runtime.

The robot and camera observations are provided asynchronously. To access both through a common time index, the TriFingerPlatformFrontend class maps “robot time indices” to the corresponding camera observations based on the time stamps. This mapping is not explicitly saved in the log files. Therefore, the TriFingerPlatformLog class provides an interface to load robot and camera logs together and performs the mapping from robot to camera time index in the same way as it is happening in TriFingerPlatformFrontend.

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_TriFingerPlatformLog(const std::string &robot_log_file, const std::string &camera_log_file)
inline const robot_interfaces::TriFingerTypes::BinaryLogReader &get_robot_log() const

Access the robot log.

inline const robot_interfaces::SensorLogReader<CameraObservation> &get_camera_log() const

Access the camera log.

inline const std::vector<int> &get_map_robot_to_camera_index() const

Access the index mapping from robot to camera log.

Note that the robot observation index does not necessarily match with the time index!

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

Get robot observation of the time step t.

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

Get desired action of time step t.

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

Get actually applied action of time step t.

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

Get robot status of time step t.

inline time_series::Timestamp get_timestamp_ms(const time_series::Index &t) const

Get timestamp (in milliseconds) of time step t.

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

Get camera images of time step t.

Parameters:

t – Time index of the robot time series. This is internally mapped to the corresponding time index of the camera time series.

Returns:

Camera images of time step t.

inline time_series::Index get_first_timeindex() const

Get the time index of the first time step in the log.

inline time_series::Index get_last_timeindex() const

Get the time index of the last time step in the log.

inline T_TriFingerPlatformLog(const std::string &robot_log_file, const std::string &camera_log_file)
inline const robot_interfaces::TriFingerTypes::BinaryLogReader &get_robot_log() const

Access the robot log.

inline const robot_interfaces::SensorLogReader<CameraObservation> &get_camera_log() const

Access the camera log.

inline const std::vector<int> &get_map_robot_to_camera_index() const

Access the index mapping from robot to camera log.

Note that the robot observation index does not necessarily match with the time index!

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

Get robot observation of the time step t.

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

Get desired action of time step t.

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

Get actually applied action of time step t.

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

Get robot status of time step t.

inline time_series::Timestamp get_timestamp_ms(const time_series::Index &t) const

Get timestamp (in milliseconds) of time step t.

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

Get camera images of time step t.

Parameters:

t – Time index of the robot time series. This is internally mapped to the corresponding time index of the camera time series.

Returns:

Camera images of time step t.

inline time_series::Index get_first_timeindex() const

Get the time index of the first time step in the log.

inline time_series::Index get_last_timeindex() const

Get the time index of the last time step in the log.