9 nh.
param<
int>(
"/rng_seed", seed, 0);
11 ROS_INFO(
"Using seed %d for random number generation.", seed);
74 cpswarm_msgs::GetSector clear;
80 ROS_DEBUG(
"Clear [%.2f, %.2f] size %.2f", clear.response.min, clear.response.max, clear.response.max - clear.response.min);
83 geometry_msgs::Pose goal;
87 ROS_DEBUG_THROTTLE(1,
"Checking goal [%.2f, %.2f, %.2f] in direction %.2f...", goal.position.x, goal.position.y, goal.position.z,
direction);
98 geometry_msgs::Point b1;
99 geometry_msgs::Point b2;
100 cpswarm_msgs::ClosestBound cb;
103 b1 = cb.response.coords[0];
104 b2 = cb.response.coords[1];
107 ROS_ERROR(
"Failed to get area boundary");
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
behavior_state_t
An enumeration for the state of the behavior algorithm.
bool move(geometry_msgs::Pose pose)
#define ROS_DEBUG_THROTTLE(rate,...)
bool call(MReq &req, MRes &res)
random_numbers::RandomNumberGenerator * rng
The random number generator used for selecting a random direction.
geometry_msgs::Pose get_pose() const
ServiceClient bound_client
Service client for determining closest mission area boundary to the current UGV position.
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
bool reflect()
Compute new direction as reflection from wall.
double step_size
The distance that the UGV travels in one step.
bool new_direction()
Compute new direction using rng.
double uniformReal(double lower_bound, double upper_bound)
geometry_msgs::Pose compute_goal(double distance, double direction) const
behavior_state_t step()
Move the swarm member to a new position.
ugv_random_walk()
Constructor that initializes the private member variables.
position pos
A helper object for position related tasks.
~ugv_random_walk()
Destructor that deletes the private member objects.
bool out_of_bounds(geometry_msgs::Pose pose)
ServiceClient clear_sector_client
Service client for determining the sector clear of obstacles.
geometry_msgs::Pose select_goal()
Compute goal position from direction.
ROSCPP_DECL void spinOnce()
double direction
The direction in which the UGV is traveling. It is measured in radian, clockwise starting from north...