11 nh.param(this_node::getName() +
"/target_velocity",
target_velocity, 0.5);
13 nh.param(this_node::getName() +
"/queue_size", queue_size, 1);
14 nh.param(this_node::getName() +
"/tolerance",
tolerance, 0.5);
17 wp_getter = nh.serviceClient<cpswarm_msgs::GetWaypoint>(
"coverage_path/waypoint");
21 get_wp.request.position =
pos.get_pose().position;
24 ROS_ERROR(
"Failed to get waypoint, cannot perform coverage!");
45 get_wp.request.position =
pos.get_pose().position;
48 ROS_ERROR(
"Failed to get waypoint, cannot perform coverage!");
56 geometry_msgs::Pose goal =
pos.get_pose();
61 if (
get_wp.response.valid ==
false) {
62 ROS_INFO(
"Path completely traversed, stop coverage!");
67 else if (
pos.out_of_bounds(goal)) {
68 ROS_ERROR(
"Waypoint out of allowed area, stop coverage!");
73 else if (
pos.occupied(goal)) {
74 ROS_ERROR(
"Obstacle ahead, stop coverage!");
79 else if (
pos.move(goal) ==
false)
89 geometry_msgs::Vector3 velocity;
geometry_msgs::Point waypoint
Current waypoint to navigate to.
uav_optimal_coverage()
Constructor that initializes the private member variables.
double target_velocity
Target velocity of the UAV.
velocity vel
A helper object for velocity related tasks.
ServiceClient wp_getter
Service client to get the current waypoint to navigate to.
~uav_optimal_coverage()
Destructor that deletes the private member objects.
behavior_state_t state
The state of the behavior algorithm.
behavior_state_t step()
Move the swarm member to a new position.
cpswarm_msgs::GetWaypoint get_wp
Service message to get the current waypoint.
behavior_state_t
An enumeration for the state of the behavior algorithm.
position pos
A helper object for position related tasks.