PosturePerfection
Public Member Functions | Data Fields
PostureEstimating::PostureEstimator Class Reference

This class handles representations of the user's pose and calculates any updates to their pose that is required. More...

#include <posture_estimator.h>

Collaboration diagram for PostureEstimating::PostureEstimator:
Collaboration graph
[legend]

Public Member Functions

 PostureEstimator ()
 Construct a new PostureEstimator object. More...
 
 ~PostureEstimator ()
 Destroy a PostureEstimator object. More...
 
void update_ideal_pose (PostureEstimating::Pose pose)
 Calibrate the user's ideal_pose with a pose object. The ideal_pose is only updated if the posture_state is not Undefined. More...
 
bool set_pose_change_threshold (float threshold)
 Set the pose_change_threshold to allow user configuration. Note that this threshold is in radians and we set a maximum configurable value of 0.5 radians (28.64 degrees) More...
 
float get_pose_change_threshold (void)
 Get the currently set pose_change_threshold. Note that this threshold is in radians and we set a maximum configurable value of 0.5 radians (28.64 degrees) More...
 
PoseStatus runEstimator (PostProcessing::ProcessedResults results)
 Return a PoseStatus of the user's pose. More...
 
void analysePosture (PostureEstimating::PoseStatus pose_status, cv::Mat current_frame)
 Analyse the posture_state field of PostureEstimating::PoseStatus and use it as follows: More...
 

Data Fields

Pose current_pose
 The user's current Pose from most recent data provided. More...
 
Pose ideal_pose
 The user's ideal Pose, expected to be generated during user calibration. More...
 
Pose pose_changes
 A representation of what changes are needed to get back to ideal Pose. More...
 
float pose_change_threshold
 A representation of what absolute value changes for a pose is acceptably still a good pose. More...
 
PostureEstimating::PostureState posture_state = UndefinedAndUnset
 Whether the user is currently in a Good, Bad, Unset, Undefined or UndefinedAndUnset posture. (Unset means that the ideal_pose has not yet been set, and Undefined is if pose estimation has not found any successive co-ordinates which are Trustworthy) More...
 

Detailed Description

This class handles representations of the user's pose and calculates any updates to their pose that is required.

It stores representations of the users current pose and their calibrated ideal pose, from the PostProcessing::ProcessedResult.

This class handles:

General use should just consist of runEstimator.

Constructor & Destructor Documentation

◆ PostureEstimator()

PostureEstimating::PostureEstimator::PostureEstimator ( )

Construct a new PostureEstimator object.

◆ ~PostureEstimator()

PostureEstimating::PostureEstimator::~PostureEstimator ( )

Destroy a PostureEstimator object.

Member Function Documentation

◆ analysePosture()

void PostureEstimating::PostureEstimator::analysePosture ( PostureEstimating::PoseStatus  pose_status,
cv::Mat  current_frame 
)

Analyse the posture_state field of PostureEstimating::PoseStatus and use it as follows:

  • If Unset then indicate this to user by displaying the current pose as blue lines.
  • If Undefined then display any Trustworthy segments as grey lines.
  • If Good then display current pose as green lines.
  • If Bad then use pose_change_threshold and pose_changes to indicate which direction the user needs to move in order to return to a good posture.
Parameters
pose_statusPostureEstimating::PoseStatus The pose status for the current frame
current_framecv::Mat The current frame to overlay lines on to

◆ get_pose_change_threshold()

float PostureEstimating::PostureEstimator::get_pose_change_threshold ( void  )

Get the currently set pose_change_threshold. Note that this threshold is in radians and we set a maximum configurable value of 0.5 radians (28.64 degrees)

Returns
float The current threshold in the range [0..0.5] (radians)

◆ runEstimator()

PoseStatus PostureEstimating::PostureEstimator::runEstimator ( PostProcessing::ProcessedResults  results)

Return a PoseStatus of the user's pose.

Parameters
resultsPostProcessing::ProcessedResults struct containing user's pose data.

◆ set_pose_change_threshold()

bool PostureEstimating::PostureEstimator::set_pose_change_threshold ( float  threshold)

Set the pose_change_threshold to allow user configuration. Note that this threshold is in radians and we set a maximum configurable value of 0.5 radians (28.64 degrees)

Parameters
thresholdThe updated threshold in the range [0..0.5] (radians)
Returns
true If updating threshold succeeded
false If updating threshold failed

◆ update_ideal_pose()

void PostureEstimating::PostureEstimator::update_ideal_pose ( PostureEstimating::Pose  pose)

Calibrate the user's ideal_pose with a pose object. The ideal_pose is only updated if the posture_state is not Undefined.

Parameters
resultsPostureEstimating::Pose struct containing user's pose data.

Field Documentation

◆ current_pose

Pose PostureEstimating::PostureEstimator::current_pose

The user's current Pose from most recent data provided.

◆ ideal_pose

Pose PostureEstimating::PostureEstimator::ideal_pose

The user's ideal Pose, expected to be generated during user calibration.

◆ pose_change_threshold

float PostureEstimating::PostureEstimator::pose_change_threshold

A representation of what absolute value changes for a pose is acceptably still a good pose.

◆ pose_changes

Pose PostureEstimating::PostureEstimator::pose_changes

A representation of what changes are needed to get back to ideal Pose.

◆ posture_state

PostureEstimating::PostureState PostureEstimating::PostureEstimator::posture_state = UndefinedAndUnset

Whether the user is currently in a Good, Bad, Unset, Undefined or UndefinedAndUnset posture. (Unset means that the ideal_pose has not yet been set, and Undefined is if pose estimation has not found any successive co-ordinates which are Trustworthy)


The documentation for this class was generated from the following files: