49 float App1::force_mag(
float dist)
51 return -(
epsilon/(dist+0.1)) *(pow(delta/(dist+0.1), 4) - pow(delta/(dist+0.1), 2));
63 float dist = sqrt(pow((xl-xn),2)+pow((yl-yn),2));
65 float fm = force_mag(dist)/1000;
70 float fx = (fm/(dist+0.1))*(xn-xl);
71 float fy = (fm/(dist+0.1))*(yn-yl);
86 boost::function<XY(micros_swarm::NeighborBase, XY &)> bf = boost::bind(&App1::force_sum,
this, _1, _2);
95 geometry_msgs::Twist t;
108 void App1::baseCallback(
const nav_msgs::Odometry& lmsg)
110 float x = lmsg.pose.pose.position.x;
111 float y = lmsg.pose.pose.position.y;
113 float vx = lmsg.twist.twist.linear.x;
114 float vy = lmsg.twist.twist.linear.y;
126 pub = nh.
advertise<geometry_msgs::Twist>(
"cmd_vel", 1000);
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
void init(const M_string &remappings)
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
T2 reduce(T2(*f)(Type, T2 &), T2 &t2)