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().
 
bool isTargetReached ()
 
double optimize ()
 Optimizes the joint configuration of the internal robot model regarding pointing towards the target.
 
 PointingIK (VirtualRobot::RobotPtr robot, Side side, Eigen::Vector3f &target)
 Initialize a new PointingIK.
 

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();
PointingIK(VirtualRobot::RobotPtr robot, Side side, Eigen::Vector3f &target)
Initialize a new PointingIK.
Definition PointingIK.cpp:9

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).

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.

◆ isTargetReached()

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

◆ 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.

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