corrects commander_atan

This commit is contained in:
Louis-Guillaume DUBOIS 2015-05-29 21:54:58 +02:00
parent 17a90f6d41
commit ae36147f73

View file

@ -77,29 +77,28 @@ class Run
geometry_msgs::Twist::Ptr mvt(new geometry_msgs::Twist()); geometry_msgs::Twist::Ptr mvt(new geometry_msgs::Twist());
if (fabs(in.y) > fabs(in.x)) // if (fabs(in.y) > fabs(in.x))
{ // {
out.y = f.y(in.y); out.y = f.y(in.y);
if (out.y > min.y) if (fabs(out.y) > min.y)
mvt->linear.y = out.y; mvt->linear.y = out.y;
} else { { // } else {
out.x = f.x(in.x); out.x = f.x(in.x);
if (out.x > min.x) if (fabs(out.x) > min.x)
mvt->linear.x = out.x; mvt->linear.x = out.x;
} // }
out.z = f.z(in.z); out.z = f.z(in.z);
if (out.z > min.z) if (fabs(out.z) > min.z)
mvt->linear.z = out.z; mvt->linear.z = out.z;
out.th = f.th(in.th); out.th = f.th(in.th);
if (out.th > min.th) if (fabs(out.th) > min.th)
mvt->angular.z = out.th; mvt->angular.z = out.th;
pub.publish(mvt); pub.publish(mvt);
ROS_INFO("cmd published"); ROS_INFO("cmd published");
} }
}
void reconfigure(const hand_control::Commander_atanConfig& c, const uint32_t& level) void reconfigure(const hand_control::Commander_atanConfig& c, const uint32_t& level)
{ {