PointingIK Class Reference

IK to compute trajectory for a pointing gesture. More...

#include <armarx/control/pointing/core/PointingIK.h>

Public Member Functions

armarx::TrajectoryPtr getTrajectory ()
 Constructs a trajectory containing the sequence of joint configurations from the calls to optimize(). More...
 
bool isTargetReached ()
 
double optimize ()
 Optimizes the joint configuration of the internal robot model regarding pointing towards the target. More...
 
 PointingIK (VirtualRobot::RobotPtr robot, Side side, Eigen::Vector3f &target)
 Initialize a new PointingIK. More...
 

Detailed Description

IK to compute trajectory for a pointing gesture.

Wrapper for simox-control's method::example::PointingIK. Computes a trajectory for a pointing gesture that lines up the forearm with a target. Uses the robot's human mapping to obtain relevant joints: All arm-joints until (excluding) the wrist are being used.

This class keeps an internal robot model. Each call to optimize() optimizes the joint configuration regarding pointing towards the target. isTargetReached() returns whether the robot in the latest configuration already points at the target. getTrajectory() returns the sequence of generated configurations as Trajectory.

Example usage:

ik = PointingIK(...);
while (not ik.isTargetReached()) {
if (ik.optimize) < 1e-6 {
return nullptr;
}
}
return ik.getTrajectory();

Definition at line 39 of file PointingIK.h.

Constructor & Destructor Documentation

◆ PointingIK()

PointingIK ( VirtualRobot::RobotPtr  robot,
Side  side,
Eigen::Vector3f &  target 
)

Initialize a new PointingIK.

Parameters
robotRobot model with current robot configuration to be used by the IK. Must provide a human mapping.
sideSide of the arm to point with.
targetTarget position to point at in the global coordinate system (mm).

Definition at line 9 of file PointingIK.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ getTrajectory()

TrajectoryPtr getTrajectory ( )

Constructs a trajectory containing the sequence of joint configurations from the calls to optimize().

Neither the trajectory nor the end configuration are guaranteed to be self- collision free. Furthermore, the trajectories aren't efficient in reaching the end configuration.

getTrajectory()->size() will equal the number of calls to optimize() plus one for the initial joint configuration

Returns
The constructed trajectory.

Definition at line 57 of file PointingIK.cpp.

◆ isTargetReached()

bool isTargetReached ( )
Returns
Whether the robot in the latest joint configuration (from optimize()) already points at the target.

Definition at line 42 of file PointingIK.cpp.

◆ optimize()

double optimize ( )

Optimizes the joint configuration of the internal robot model regarding pointing towards the target.

Returns
Difference between the previous and new joint configurations. May be used to determine if the IK is unable to find a solution.

Definition at line 48 of file PointingIK.cpp.


The documentation for this class was generated from the following files:
armarx::control::pointing::core::PointingIK::PointingIK
PointingIK(VirtualRobot::RobotPtr robot, Side side, Eigen::Vector3f &target)
Initialize a new PointingIK.
Definition: PointingIK.cpp:9