5 #include <Eigen/Geometry>
7 #include <SimoxUtility/math/convert/mat4f_to_pos.h>
8 #include <SimoxUtility/math/convert/mat4f_to_rpy.h>
9 #include <SimoxUtility/math/convert/mat4f_to_xyyaw.h>
15 #include <ArmarXCore/interface/serialization/Eigen/Eigen_fdi.h>
23 #include <armarx/navigation/trajectory_control/local/aron/TrajectoryFollowingControllerParams.aron.generated.h>
40 arondto::TrajectoryFollowingControllerParams dto;
51 arondto::TrajectoryFollowingControllerParams dto;
64 pidPos(params.pidPos.Kp,
67 std::numeric_limits<double>::
max(),
68 std::numeric_limits<double>::
max(),
70 std::vector<bool>{
false,
false,
false}),
71 pidPosTarget(params.pidPos.Kp / 2,
77 std::vector<bool>{
false,
false,
false}),
78 pidOri(params.pidOri.Kp,
84 std::vector<bool>{
true,
true,
true}),
85 pidOriTarget(params.pidOri.Kp,
91 std::vector<bool>{
true,
true,
true})
94 <<
VAROUT(params.limits.linear) <<
", " <<
VAROUT(params.limits.angular);
109 const auto scalePos = twist.
linear.cwiseAbs().cwiseQuotient(limits.linear.cwiseAbs());
110 const auto scaleOri = twist.
angular.cwiseAbs().cwiseQuotient(limits.angular.cwiseAbs());
115 const float scaleMax =
std::max(scalePos.maxCoeff(), scaleOri.maxCoeff());
125 constexpr
float eps = 0.001;
140 const Eigen::Isometry3f& global_T_robot)
142 if (trajectory.
points().empty())
153 using simox::math::mat4f_to_pos;
154 using simox::math::mat4f_to_rpy;
156 pidPos.
update(mat4f_to_pos(global_T_robot.matrix()), mat4f_to_pos(
target.pose.matrix()));
157 pidOri.
update(mat4f_to_rpy(global_T_robot.matrix()), mat4f_to_rpy(
target.pose.matrix()));
166 .angular = twistFeedForward.
angular + twistError.angular};
173 const auto& twistGlobal = twistLimited;
177 .
linear = global_T_robot.linear().inverse() * twistGlobal.linear,
178 .angular = twistGlobal.angular