MILDRobotModelWithExactIK.hpp
Go to the documentation of this file.
1 
20 #pragma once
21 
22 #include <boost/tuple/tuple.hpp>
26 #include "geometry_msgs/Pose.h"
27 #include <ros/ros.h>
28 #include <tf/transform_listener.h>
31 
32 namespace robot_model_services {
40  typedef std::tuple<double,double> PTUConfig; //Pan and tilt angle of the ptu
42  private:
43 
44  //Maximum number of iterations for the IK angle iteration method
45  const unsigned int IKVisualizationMaximunIterationCount = 6;
46 
48 
53 
57  double h_tilt;
68 
73 
77  Eigen::Affine3d tiltToCameraEigen;
78 
82  Eigen::Affine3d panToTiltEigen;
83  Eigen::Affine3d tiltToPanEigen;
84 
88  Eigen::Affine3d baseToPanEigen;
89  Eigen::Affine3d panToBaseEigen;
90 
91  double x_product;
92 
97 
98  //For Tests only
101 
105  bool setUpTFParameters();
109  double acosClamped(double value);
113  double getBaseAngleFromBaseFrame(Eigen::Affine3d &baseFrame);
117  double getPanAngleFromPanJointPose(Eigen::Affine3d &panJointFrame, MILDRobotStatePtr &robotState);
122  bool getTiltAngleAndTiltBasePointProjected(Eigen::Vector3d &planeNormal, Eigen::Vector3d &targetViewVector, Eigen::Vector3d &target_view_center_point, double &tilt, Eigen::Vector3d &tilt_base_point_projected);
126  Eigen::Affine3d getTiltJointFrame(Eigen::Vector3d &planeNormal, Eigen::Vector3d &targetViewVector, Eigen::Vector3d &tilt_base_point);
130  void visualizeIKcalculation(Eigen::Vector3d &base_point, Eigen::Vector3d &base_orientation, Eigen::Vector3d &pan_joint_point, Eigen::Vector3d & pan_rotated_point, Eigen::Vector3d &tilt_base_point, Eigen::Vector3d &tilt_base_point_projected, Eigen::Vector3d &cam_point, Eigen::Vector3d &actual_view_center_point);
134  void visualizeCameraPoseCorrection(Eigen::Vector3d &base_point, Eigen::Vector3d &base_orientation, Eigen::Vector3d &pan_joint_point, Eigen::Vector3d & pan_rotated_point, Eigen::Vector3d &tilt_base_point, Eigen::Vector3d &cam_point, Eigen::Vector3d &actual_view_center_point);
138  void visualizeIKCameraTarget(Eigen::Vector3d &target_view_center_point, Eigen::Vector3d &target_camera_point);
142  void resetIKVisualization();
146  void visualizeIKPoint(Eigen::Vector3d &point, Eigen::Vector4d &colorRGBA, std::string ns, int id);
150  void visualizeIKArrowLarge(Eigen::Vector3d &pointStart, Eigen::Vector3d &pointEnd, Eigen::Vector4d &colorRGBA, std::string ns, int id);
154  void visualizeIKArrowSmall(Eigen::Vector3d &pointStart, Eigen::Vector3d &pointEnd, Eigen::Vector4d &colorRGBA, std::string ns, int id);
158  void visualizeIKArrow(Eigen::Vector3d &pointStart, Eigen::Vector3d &pointEnd, Eigen::Vector4d &colorRGBA, std::string ns, Eigen::Vector3d &scaleParameters, int id);
159 
160  public:
161 
166 
170  virtual ~MILDRobotModelWithExactIK();
171 
172 
176  RobotStatePtr calculateRobotState(const RobotStatePtr &sourceRobotState, const SimpleVector3 &position, const SimpleQuaternion &orientation);
177 
181  PTUConfig calculateCameraPoseCorrection(const RobotStatePtr &sourceRobotState, const SimpleVector3 &position, const SimpleQuaternion &orientation);
182 
186  void setViewPointDistance(float viewPointDistance);
187 
189  };
190 
192 }
std::tuple< double, double > PTUConfig
MILDRobotModelWithExactIK implements a model of pan tilt unit robot where the inverse kinematic is ca...
MILDRobotModel implements a model of pan tilt unit robot.
virtual ~MILDRobotModelWithExactIK()
destructor of the MILDRobotModelWithExactIK
void visualizeIKPoint(Eigen::Vector3d &point, Eigen::Vector4d &colorRGBA, std::string ns, int id)
Eigen::Matrix< Precision, 3, 1 > SimpleVector3
Definition: typedef.hpp:50
MILDRobotModelWithExactIK()
constructor of the MILDRobotModelWithExactIK
void setViewPointDistance(float viewPointDistance)
Sets the distance between the desired view center point and the camera.
void visualizeIKArrow(Eigen::Vector3d &pointStart, Eigen::Vector3d &pointEnd, Eigen::Vector4d &colorRGBA, std::string ns, Eigen::Vector3d &scaleParameters, int id)
double getBaseAngleFromBaseFrame(Eigen::Affine3d &baseFrame)
this namespace contains all generally usable classes.
Definition: DebugHelper.hpp:27
void visualizeCameraPoseCorrection(Eigen::Vector3d &base_point, Eigen::Vector3d &base_orientation, Eigen::Vector3d &pan_joint_point, Eigen::Vector3d &pan_rotated_point, Eigen::Vector3d &tilt_base_point, Eigen::Vector3d &cam_point, Eigen::Vector3d &actual_view_center_point)
void visualizeIKcalculation(Eigen::Vector3d &base_point, Eigen::Vector3d &base_orientation, Eigen::Vector3d &pan_joint_point, Eigen::Vector3d &pan_rotated_point, Eigen::Vector3d &tilt_base_point, Eigen::Vector3d &tilt_base_point_projected, Eigen::Vector3d &cam_point, Eigen::Vector3d &actual_view_center_point)
void visualizeIKArrowSmall(Eigen::Vector3d &pointStart, Eigen::Vector3d &pointEnd, Eigen::Vector4d &colorRGBA, std::string ns, int id)
bool getTiltAngleAndTiltBasePointProjected(Eigen::Vector3d &planeNormal, Eigen::Vector3d &targetViewVector, Eigen::Vector3d &target_view_center_point, double &tilt, Eigen::Vector3d &tilt_base_point_projected)
Eigen::Affine3d getTiltJointFrame(Eigen::Vector3d &planeNormal, Eigen::Vector3d &targetViewVector, Eigen::Vector3d &tilt_base_point)
void visualizeIKCameraTarget(Eigen::Vector3d &target_view_center_point, Eigen::Vector3d &target_camera_point)
boost::shared_ptr< MILDRobotModelWithExactIK > MILDRobotModelWithExactIKPtr
PTUConfig calculateCameraPoseCorrection(const RobotStatePtr &sourceRobotState, const SimpleVector3 &position, const SimpleQuaternion &orientation)
Calculates the best approximation for the given camera pose from the current base position...
RobotStatePtr calculateRobotState(const RobotStatePtr &sourceRobotState, const SimpleVector3 &position, const SimpleQuaternion &orientation)
Calculates the inverse kinematics for the given camera pose.
void visualizeIKArrowLarge(Eigen::Vector3d &pointStart, Eigen::Vector3d &pointEnd, Eigen::Vector4d &colorRGBA, std::string ns, int id)
Eigen::Quaternion< Precision > SimpleQuaternion
Definition: typedef.hpp:64
double getPanAngleFromPanJointPose(Eigen::Affine3d &panJointFrame, MILDRobotStatePtr &robotState)


asr_robot_model_services
Author(s): Aumann Florian, Borella Jocelyn, Heller Florian, Meißner Pascal, Schleicher Ralf, Stöckle Patrick, Stroh Daniel, Trautmann Jeremias, Walter Milena, Wittenbeck Valerij
autogenerated on Mon Jun 10 2019 12:49:59