TrajectoryController Class Reference

Subcontroller which handles all program interaction with the modle, communicates with other controllers via signals and slots. More...

#include <RobotAPI/libraries/core/TrajectoryController.h>

Public Slots

void addWaypoint (int waypoint, bool insertAfter)
 Adds a new waypoint relative to the given waypoint. More...
 
void deleteWaypoint (int waypoint)
 Deletes the given waypoint. More...
 
void environmentChanged (EnvironmentPtr environment)
 Set the enviroment. More...
 
void exportTrajectory ()
 Stages the given trajectory for export. More...
 
void exportTrajectory (int fps)
 Stages the given trajectory for export. More...
 
void import (DesignerTrajectoryPtr designerTrajectory)
 Imports a given trajectory into the model. More...
 
void playTrajectories ()
 Play all trajectories. More...
 
void redo ()
 Redo trajectory. More...
 
void setActiveColModelName (QString activeColModelName)
 Sets the active collision model name. More...
 
void setBodyColModelsNames (QStringList bodyColModelsNames)
 Sets the body collision models names. More...
 
void undo ()
 Undo trajectroy. More...
 
void updateTCP (QString tcp)
 Updates the selected TCP. More...
 
void updateTransition (int transition, double duration)
 Updates all values of a given transition. More...
 
void updateTransition (int transition, int it)
 Updates all values of a given transition. More...
 
void updateWaypoint (int waypoint)
 Updates all values of a given waypoint. More...
 
void updateWaypoint (int waypoint, bool isBreakpoint)
 Updates isBreakpoint value of a given waypoint. More...
 
void updateWaypoint (int waypoint, int cartesianSelection)
 Updates CartesianSelection value of a given waypoint. More...
 
void updateWaypoint (int waypoint, PoseBasePtr newPoseBase)
 Updates all values of a given waypoint. More...
 
void updateWaypoint (int waypoint, std::vector< double > values)
 Updates all values of a given waypoint. More...
 

Signals

void addTransitionGui (int transition, double duration, double start, int it)
 Notifies other controllers about the addition of a transition. More...
 
void addWaypointGui (int waypoint, std::vector< double > values, int cartesianSelection, bool isBreakpoint)
 Notifies other controllers about the addition of a waypoint. More...
 
void cartesianSelectionChanged (VirtualRobot::IKSolver::CartesianSelection cs)
 cartesianSelectionChanged recalculates the configuration of the robot joints to fit the new selection More...
 
void changeTransitionGui (int transition, double duration, double start, int it)
 Notifies other controllers about changes of an existing transition. More...
 
void changeWaypointGui (int index, std::vector< double > values, int cartesianSelection, bool isBreakpoint)
 Notfies other controllers about changes of an existing waypoint. More...
 
void enableAdd (bool enable)
 Enables or disables the add button/shortcut. More...
 
void enableDeleteChange (bool enable)
 Enables or disables the delete and change button/shortcut. More...
 
void enableExportButtons (bool enable)
 Enables or disables the export buttons. More...
 
void enableIKSolutionButton (bool enable)
 Enables or disables the new IK solution button. More...
 
void enablePreview (bool enable)
 Enables or disables the prview button/shortcut. More...
 
void enablePreviewAll (bool enable)
 Enables or disables the prview all button/shortcut. More...
 
void enableRedo (bool enable)
 Enables or disables the redo button/shortcut. More...
 
void enableUndo (bool enable)
 Enables or disables the undo button/shortcut. More...
 
void exportTrajectory (std::vector< DesignerTrajectoryPtr > trajectories)
 Provides the trajectory for ExportController. More...
 
void newTrajectory (QString trajectory)
 Notifies the TCPSelcetionController about a new Trajectory. More...
 
void playTrajectories (std::vector< DesignerTrajectoryPtr > designerTrajectories)
 Provides all trajectories for VisualizationController. More...
 
void removeAllTrajectories ()
 Removes all trajectories from the TCP selection combo box. More...
 
void removeTrajectory (QString trajectory)
 Removes the given trajectory from the TCP selection combo box. More...
 
void removeTransitionGui (int index)
 Notifies other controllers about the deletion of a given transtion. More...
 
void removeTransitionWaypointGui ()
 Notifies WaypointTab and Transition to delete all ListWidgets. More...
 
void removeWaypointGui (int index)
 Notifies other controllers about the deletion of a given waypoint. More...
 
void rnsChanged (VirtualRobot::RobotNodeSetPtr rns)
 Notifies the VisualizationController about a changed RobotNodeSet. More...
 
void showTrajectory (DesignerTrajectoryPtr designerTrajectory)
 Provides the trajectory for VisualizationController. More...
 
void updateSelectedTCP (QString trajectory)
 Updates the currently displayed trajectory of the corresponding TCP. More...
 

Public Member Functions

const Eigen::VectorXf & getCurrentError () const
 
double getCurrentTimestamp () const
 
const Eigen::VectorXf & getPositions () const
 
const TrajectoryPtrgetTraj () const
 
void onConnectComponent () override
 
void onDisconnectComponent () override
 
void onExitComponent () override
 
void onInitComponent () override
 
 TrajectoryController ()
 Creates a new TrajectoryController and assigns a QWidget to handle. More...
 
 TrajectoryController (const TrajectoryPtr &traj, float kp, float ki=0.0f, float kd=0.0f, bool threadSafe=true, float maxIntegral=std::numeric_limits< float >::max())
 
const Eigen::VectorXf & update (double deltaT, const Eigen::VectorXf &currentPosition)
 

Static Public Member Functions

static void FoldLimitlessJointPositions (TrajectoryPtr traj)
 
static void UnfoldLimitlessJointPositions (TrajectoryPtr traj)
 

Protected Attributes

Eigen::VectorXf currentError
 
double currentTimestamp
 
MultiDimPIDControllerPtr pid
 
Eigen::VectorXf positions
 
TrajectoryPtr traj
 
Eigen::VectorXf veloctities
 

Detailed Description

Subcontroller which handles all program interaction with the modle, communicates with other controllers via signals and slots.

Definition at line 32 of file TrajectoryController.h.

Constructor & Destructor Documentation

◆ TrajectoryController() [1/2]

TrajectoryController ( const TrajectoryPtr traj,
float  kp,
float  ki = 0.0f,
float  kd = 0.0f,
bool  threadSafe = true,
float  maxIntegral = std::numeric_limits<float>::max() 
)

Definition at line 31 of file TrajectoryController.cpp.

+ Here is the call graph for this function:

◆ TrajectoryController() [2/2]

Creates a new TrajectoryController and assigns a QWidget to handle.

Definition at line 31 of file TrajectoryController.cpp.

Member Function Documentation

◆ addTransitionGui

void addTransitionGui ( int  transition,
double  duration,
double  start,
int  it 
)
signal

Notifies other controllers about the addition of a transition.

Parameters
durationDuration of the transition
startStart time of the transition
itIndex of the interpolation of the transition
transitionIndex of the transition

◆ addWaypoint

void addWaypoint ( int  waypoint,
bool  insertAfter 
)
slot

Adds a new waypoint relative to the given waypoint.

Parameters
constraintsConstraints of the new waypoint: isBreakpoint, ikConstraints, insertBefore/-After
waypointIndex of the waypoint
cartesianSelectionInteger representing the cartesian selection
insertAfterBoolean determining whether to insert after the waypoint or before
isBreakpointBoolean determining whether the waypoint is a breakpoint

Definition at line 271 of file TrajectoryController.cpp.

◆ addWaypointGui

void addWaypointGui ( int  waypoint,
std::vector< double >  values,
int  cartesianSelection,
bool  isBreakpoint 
)
signal

Notifies other controllers about the addition of a waypoint.

Parameters
valuesArray containting x, y, z, coordinates as well as r, p, y euler angles of the waypoint
constraintsConstraints of the waypoint: isBreakpoint, ikConstraints
waypointIndex of the waypoint

◆ cartesianSelectionChanged

void cartesianSelectionChanged ( VirtualRobot::IKSolver::CartesianSelection  cs)
signal

cartesianSelectionChanged recalculates the configuration of the robot joints to fit the new selection

Parameters
csthe new CartesianSelection

◆ changeTransitionGui

void changeTransitionGui ( int  transition,
double  duration,
double  start,
int  it 
)
signal

Notifies other controllers about changes of an existing transition.

Parameters
durationDuration of the transition
startStart time of the transition
itIndex of interpolation of the transition
transitionIndex of the transition

◆ changeWaypointGui

void changeWaypointGui ( int  index,
std::vector< double >  values,
int  cartesianSelection,
bool  isBreakpoint 
)
signal

Notfies other controllers about changes of an existing waypoint.

Parameters
valuesArray containting x, y, z, coordinates as well as a, b, g euler angles of the waypoint
constraintsConstraints of the waypoint: isBreakpoint, ikConstraints
waypointIndex of the waypoint

◆ deleteWaypoint

void deleteWaypoint ( int  waypoint)
slot

Deletes the given waypoint.

Parameters
waypointIndex of the waypoint

Definition at line 352 of file TrajectoryController.cpp.

◆ enableAdd

void enableAdd ( bool  enable)
signal

Enables or disables the add button/shortcut.

Parameters
enableDetermines whether to enable or disable the add button/shortcut

◆ enableDeleteChange

void enableDeleteChange ( bool  enable)
signal

Enables or disables the delete and change button/shortcut.

Parameters
enableDetermines whether to enable or disable the delete and change button/shortcut

◆ enableExportButtons

void enableExportButtons ( bool  enable)
signal

Enables or disables the export buttons.

Parameters
enableDetermines whether to enable or disable the export buttons

◆ enableIKSolutionButton

void enableIKSolutionButton ( bool  enable)
signal

Enables or disables the new IK solution button.

Parameters
enableDetermines whether to enable or disable the ik solution button

◆ enablePreview

void enablePreview ( bool  enable)
signal

Enables or disables the prview button/shortcut.

Parameters
enableDetermines whether to enable or disable the previes button/shortcut

◆ enablePreviewAll

void enablePreviewAll ( bool  enable)
signal

Enables or disables the prview all button/shortcut.

Parameters
enableDetermines whether to enable or disable the previes button/shortcut

◆ enableRedo

void enableRedo ( bool  enable)
signal

Enables or disables the redo button/shortcut.

Parameters
enableDetermines whether to enable or disable the redo button/shortcut

◆ enableUndo

void enableUndo ( bool  enable)
signal

Enables or disables the undo button/shortcut.

Parameters
enableDetermines whether to enable or disable the undo button/shortcut

◆ environmentChanged

void environmentChanged ( EnvironmentPtr  environment)
slot

Set the enviroment.

Parameters
Thenew enviroment

Definition at line 535 of file TrajectoryController.cpp.

◆ exportTrajectory [1/3]

void exportTrajectory ( )
slot

Stages the given trajectory for export.

Definition at line 474 of file TrajectoryController.cpp.

+ Here is the call graph for this function:

◆ exportTrajectory [2/3]

void exportTrajectory ( int  fps)
slot

Stages the given trajectory for export.

Parameters
fpsfor export to MMM

Definition at line 457 of file TrajectoryController.cpp.

+ Here is the call graph for this function:

◆ exportTrajectory [3/3]

void exportTrajectory ( std::vector< DesignerTrajectoryPtr trajectories)
signal

Provides the trajectory for ExportController.

Parameters
trajectoryTrajectory to provide

◆ FoldLimitlessJointPositions()

void FoldLimitlessJointPositions ( TrajectoryPtr  traj)
static

Definition at line 161 of file TrajectoryController.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentError()

const Eigen::VectorXf & getCurrentError ( ) const

Definition at line 186 of file TrajectoryController.cpp.

◆ getCurrentTimestamp()

double getCurrentTimestamp ( ) const

Definition at line 115 of file TrajectoryController.cpp.

+ Here is the caller graph for this function:

◆ getPositions()

const Eigen::VectorXf & getPositions ( ) const

Definition at line 191 of file TrajectoryController.cpp.

◆ getTraj()

const TrajectoryPtr & getTraj ( ) const

Definition at line 120 of file TrajectoryController.cpp.

+ Here is the caller graph for this function:

◆ import

void import ( DesignerTrajectoryPtr  designerTrajectory)
slot

Imports a given trajectory into the model.

Parameters
designerTrajectoryTrajectory which is being imported

Definition at line 425 of file TrajectoryController.cpp.

◆ newTrajectory

void newTrajectory ( QString  trajectory)
signal

Notifies the TCPSelcetionController about a new Trajectory.

Parameters
trajectorynew trajectory

◆ onConnectComponent()

void onConnectComponent ( )
override
See also
AbstractController

Definition at line 14 of file TrajectoryController.cpp.

◆ onDisconnectComponent()

void onDisconnectComponent ( )
override
See also
AbstractController

Definition at line 19 of file TrajectoryController.cpp.

◆ onExitComponent()

void onExitComponent ( )
override
See also
AbstractController

Definition at line 24 of file TrajectoryController.cpp.

◆ onInitComponent()

void onInitComponent ( )
override
See also
AbstractController

Definition at line 9 of file TrajectoryController.cpp.

◆ playTrajectories [1/2]

void playTrajectories ( )
slot

Play all trajectories.

Definition at line 522 of file TrajectoryController.cpp.

+ Here is the call graph for this function:

◆ playTrajectories [2/2]

void playTrajectories ( std::vector< DesignerTrajectoryPtr designerTrajectories)
signal

Provides all trajectories for VisualizationController.

Parameters
designerTrajectoriesTrajectories to play

◆ redo

void redo ( )
slot

Redo trajectory.

Definition at line 506 of file TrajectoryController.cpp.

◆ removeAllTrajectories

void removeAllTrajectories ( )
signal

Removes all trajectories from the TCP selection combo box.

◆ removeTrajectory

void removeTrajectory ( QString  trajectory)
signal

Removes the given trajectory from the TCP selection combo box.

Parameters
trajectoryString identifier of the trajectory

◆ removeTransitionGui

void removeTransitionGui ( int  index)
signal

Notifies other controllers about the deletion of a given transtion.

Parameters
indexIndex of the transition

◆ removeTransitionWaypointGui

void removeTransitionWaypointGui ( )
signal

Notifies WaypointTab and Transition to delete all ListWidgets.

◆ removeWaypointGui

void removeWaypointGui ( int  index)
signal

Notifies other controllers about the deletion of a given waypoint.

Parameters
indexIndex of the waypoitn

◆ rnsChanged

void rnsChanged ( VirtualRobot::RobotNodeSetPtr  rns)
signal

Notifies the VisualizationController about a changed RobotNodeSet.

Parameters
rnsnew RobotNodeSet

◆ setActiveColModelName

void setActiveColModelName ( QString  activeColModelName)
slot

Sets the active collision model name.

Parameters
activeColModelNameActive collision model name

Definition at line 547 of file TrajectoryController.cpp.

◆ setBodyColModelsNames

void setBodyColModelsNames ( QStringList  bodyColModelsNames)
slot

Sets the body collision models names.

Parameters
activeColModelNameBody collision models names

Definition at line 553 of file TrajectoryController.cpp.

◆ showTrajectory

void showTrajectory ( DesignerTrajectoryPtr  designerTrajectory)
signal

Provides the trajectory for VisualizationController.

Parameters
designerTrajectoryTrajectory to provide

◆ undo

void undo ( )
slot

Undo trajectroy.

Definition at line 490 of file TrajectoryController.cpp.

◆ UnfoldLimitlessJointPositions()

void UnfoldLimitlessJointPositions ( TrajectoryPtr  traj)
static

Definition at line 125 of file TrajectoryController.cpp.

+ Here is the caller graph for this function:

◆ update()

const Eigen::VectorXf & update ( double  deltaT,
const Eigen::VectorXf &  currentPosition 
)

Definition at line 54 of file TrajectoryController.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSelectedTCP

void updateSelectedTCP ( QString  trajectory)
signal

Updates the currently displayed trajectory of the corresponding TCP.

Parameters
trajectoryString identifier of the trajectory

◆ updateTCP

void updateTCP ( QString  tcp)
slot

Updates the selected TCP.

Parameters
indexIndex of the selected TCP

Definition at line 37 of file TrajectoryController.cpp.

◆ updateTransition [1/2]

void updateTransition ( int  transition,
double  duration 
)
slot

Updates all values of a given transition.

Parameters
transitionIndex of the transition
durationDuration of the transition

Definition at line 119 of file TrajectoryController.cpp.

◆ updateTransition [2/2]

void updateTransition ( int  transition,
int  it 
)
slot

Updates all values of a given transition.

Parameters
transitionIndex of the transition
itIndex of the interpolation of the transition

Definition at line 92 of file TrajectoryController.cpp.

◆ updateWaypoint [1/5]

void updateWaypoint ( int  waypoint)
slot

Updates all values of a given waypoint.

Parameters
waypointIndex of the waypoint

Definition at line 164 of file TrajectoryController.cpp.

◆ updateWaypoint [2/5]

void updateWaypoint ( int  waypoint,
bool  isBreakpoint 
)
slot

Updates isBreakpoint value of a given waypoint.

Parameters
waypointIndex of the waypoint
isBreakpointBoolean determining whether the waypoint is a breakpoint

Definition at line 243 of file TrajectoryController.cpp.

◆ updateWaypoint [3/5]

void updateWaypoint ( int  waypoint,
int  cartesianSelection 
)
slot

Updates CartesianSelection value of a given waypoint.

Parameters
waypointIndex of the waypoint
cartesianSelectionInteger representing the cartesian selection or before

Definition at line 215 of file TrajectoryController.cpp.

◆ updateWaypoint [4/5]

void updateWaypoint ( int  waypoint,
PoseBasePtr  newPoseBase 
)
slot

Updates all values of a given waypoint.

Parameters
waypointIndex of the waypoint
newPoseBaseIs the new PoseBase of the waypoint

Definition at line 188 of file TrajectoryController.cpp.

◆ updateWaypoint [5/5]

void updateWaypoint ( int  waypoint,
std::vector< double >  values 
)
slot

Updates all values of a given waypoint.

Parameters
waypointIndex of the waypoint
valuesArray containing the x, y, z, coordinates of a waypoint as well as the r, p, y euler angles

Definition at line 139 of file TrajectoryController.cpp.

Member Data Documentation

◆ currentError

Eigen::VectorXf currentError
protected

Definition at line 58 of file TrajectoryController.h.

◆ currentTimestamp

double currentTimestamp
protected

Definition at line 55 of file TrajectoryController.h.

◆ pid

MultiDimPIDControllerPtr pid
protected

Definition at line 53 of file TrajectoryController.h.

◆ positions

Eigen::VectorXf positions
protected

Definition at line 56 of file TrajectoryController.h.

◆ traj

TrajectoryPtr traj
protected

Definition at line 52 of file TrajectoryController.h.

◆ veloctities

Eigen::VectorXf veloctities
protected

Definition at line 57 of file TrajectoryController.h.


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