#include <ros/ros.h>
#include <nav_msgs/Odometry.h>
#include <nav_msgs/Path.h>
#include <move_base_msgs/MoveBaseAction.h>
#include <actionlib/client/simple_action_client.h>
#include <tf/transform_datatypes.h>
#include <tf/transform_broadcaster.h>
#include <tf/transform_listener.h>
#include <geometry_msgs/PoseWithCovarianceStamped.h>
#include <ar_pose/ARMarkers.h>
#include <ar_pose/ARMarker.h>
#include "std_msgs/String.h"
#include "humanPoses.h"
#include "TrajectoryObservation.h"
Go to the source code of this file.
Typedefs | |
typedef actionlib::SimpleActionClient < move_base_msgs::MoveBaseAction > | MoveBaseClient |
Functions | |
void | ar_pose_callback (const ar_pose::ARMarkers::ConstPtr &markers) |
void | dyn_objects_callback (const trajectory_simulator::TrajectoryObservation::ConstPtr &dyn_objects) |
double | euclidean_dist (double x1, double y1, double x2, double y2) |
void | leader_goal_callback (const geometry_msgs::PoseStamped::ConstPtr &msg) |
void | robot_goal_callback (const geometry_msgs::PoseStamped::ConstPtr &msg) |
void | robot_pose_callback (const geometry_msgs::PoseWithCovarianceStamped::ConstPtr &msg) |
void | target_pose_callback (const nav_msgs::Odometry::ConstPtr &msg) |
Variables | |
ros::Subscriber | ar_pose_sub |
trajectory_simulator::TrajectoryObservation | candidate_ |
geometry_msgs::Twist | cmd_vel |
double | d |
double | dist |
double | dmax = 15.0 |
double | dmin = 1.5 |
ros::Subscriber | dyn_objects_subscriber |
move_base_msgs::MoveBaseGoal | goal |
double | goals_distance = 99 |
double | leader2goal_distance |
bool | leader_found = false |
geometry_msgs::PoseStamped | leader_goal [4] |
ros::Subscriber | leader_goal_subscriber |
uint | leader_id = 99 |
nav_msgs::Path | leader_path |
geometry_msgs::PoseStamped | leader_pose |
tf::TransformListener * | listener = NULL |
int | marker_id |
int | marker_type |
geometry_msgs::PoseStamped | next_pose |
ros::Publisher | next_posePublisher |
int | num_markers |
bool | path_initialized = false |
ros::Publisher | pathPublisher |
ros::Subscriber | pose_subscriber |
double | robot2goal_distance |
ros::Publisher | robot_cmd_vel |
geometry_msgs::PoseStamped | robot_goal |
ros::Subscriber | robot_goal_subscriber |
geometry_msgs::PoseWithCovarianceStamped | robot_pose |
ros::Subscriber | robot_pose_subscriber |
bool | send_goal = true |
geometry_msgs::PoseStamped | source_pose |
bool | start_to_follow = false |
geometry_msgs::PoseStamped | target_pose |
double | theta |
double | theta_max = M_PI |
double | tlast |
double | tnow |
tf::StampedTransform | transform |
typedef actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> MoveBaseClient |
Definition at line 77 of file leader_follower.h.
void ar_pose_callback | ( | const ar_pose::ARMarkers::ConstPtr & | markers | ) |
void dyn_objects_callback | ( | const trajectory_simulator::TrajectoryObservation::ConstPtr & | dyn_objects | ) |
received a dynamic object, store as candidate
check if received message refers to leader and if the robot should start following it, if so, track its path
store path according to time step
only executes on first message
simple following part
Definition at line 56 of file leader_follower.cpp.
double euclidean_dist | ( | double | x1, | |
double | y1, | |||
double | x2, | |||
double | y2 | |||
) |
Definition at line 98 of file leader_follower.h.
void leader_goal_callback | ( | const geometry_msgs::PoseStamped::ConstPtr & | msg | ) |
Definition at line 169 of file leader_follower.cpp.
void robot_goal_callback | ( | const geometry_msgs::PoseStamped::ConstPtr & | msg | ) |
Definition at line 177 of file leader_follower.cpp.
void robot_pose_callback | ( | const geometry_msgs::PoseWithCovarianceStamped::ConstPtr & | msg | ) |
Definition at line 184 of file leader_follower.cpp.
void target_pose_callback | ( | const nav_msgs::Odometry::ConstPtr & | msg | ) |
Definition at line 39 of file leader_follower.cpp.
ros::Subscriber ar_pose_sub |
Definition at line 67 of file leader_follower.h.
Definition at line 59 of file leader_follower.h.
geometry_msgs::Twist cmd_vel |
Definition at line 58 of file leader_follower.h.
double d |
Definition at line 89 of file leader_follower.h.
double dist |
Definition at line 88 of file leader_follower.h.
double dmax = 15.0 |
Definition at line 88 of file leader_follower.h.
double dmin = 1.5 |
Definition at line 88 of file leader_follower.h.
ros::Subscriber dyn_objects_subscriber |
Definition at line 68 of file leader_follower.h.
move_base_msgs::MoveBaseGoal goal |
Definition at line 56 of file leader_follower.h.
double goals_distance = 99 |
Definition at line 82 of file leader_follower.h.
double leader2goal_distance |
Definition at line 83 of file leader_follower.h.
bool leader_found = false |
Definition at line 87 of file leader_follower.h.
geometry_msgs::PoseStamped leader_goal[4] |
Definition at line 52 of file leader_follower.h.
ros::Subscriber leader_goal_subscriber |
Definition at line 69 of file leader_follower.h.
uint leader_id = 99 |
Definition at line 81 of file leader_follower.h.
nav_msgs::Path leader_path |
Definition at line 57 of file leader_follower.h.
geometry_msgs::PoseStamped leader_pose |
Definition at line 51 of file leader_follower.h.
tf::TransformListener* listener = NULL |
Definition at line 61 of file leader_follower.h.
int marker_id |
Definition at line 80 of file leader_follower.h.
int marker_type |
Definition at line 80 of file leader_follower.h.
geometry_msgs::PoseStamped next_pose |
Definition at line 54 of file leader_follower.h.
ros::Publisher next_posePublisher |
Definition at line 75 of file leader_follower.h.
int num_markers |
Definition at line 79 of file leader_follower.h.
bool path_initialized = false |
Definition at line 84 of file leader_follower.h.
ros::Publisher pathPublisher |
Definition at line 73 of file leader_follower.h.
ros::Subscriber pose_subscriber |
Definition at line 66 of file leader_follower.h.
double robot2goal_distance |
Definition at line 83 of file leader_follower.h.
ros::Publisher robot_cmd_vel |
Definition at line 74 of file leader_follower.h.
geometry_msgs::PoseStamped robot_goal |
Definition at line 53 of file leader_follower.h.
ros::Subscriber robot_goal_subscriber |
Definition at line 70 of file leader_follower.h.
geometry_msgs::PoseWithCovarianceStamped robot_pose |
Definition at line 55 of file leader_follower.h.
ros::Subscriber robot_pose_subscriber |
Definition at line 71 of file leader_follower.h.
bool send_goal = true |
Definition at line 85 of file leader_follower.h.
geometry_msgs::PoseStamped source_pose |
Definition at line 63 of file leader_follower.h.
bool start_to_follow = false |
Definition at line 86 of file leader_follower.h.
geometry_msgs::PoseStamped target_pose |
Definition at line 64 of file leader_follower.h.
double theta |
Definition at line 88 of file leader_follower.h.
double theta_max = M_PI |
Definition at line 88 of file leader_follower.h.
double tlast |
Definition at line 89 of file leader_follower.h.
double tnow |
Definition at line 89 of file leader_follower.h.
tf::StampedTransform transform |
Definition at line 62 of file leader_follower.h.