3 #include <nav_msgs/Odometry.h> 5 #include <geometry_msgs/Twist.h> 6 #include <geometry_msgs/TransformStamped.h> 7 #include <geometry_msgs/Vector3.h> 8 #include <geometry_msgs/Pose2D.h> 9 #include <pioneer_mrs/Pose2D.h> 10 #include <dynamic_reconfigure/server.h> 11 #include <pioneer_mrs/PioneerConfig.h> 51 dynamic_reconfigure::Server<pioneer_mrs::PioneerConfig> *
cfg_server;
58 geometry_msgs::Twist
vel;
69 nh_private.
param(
"hostname",
HOSTNAME, std::string(
"robot1") );
75 nh_private.
param(
"pose",
POSE, std::string(
"odom") );
80 else if(
POSE ==
"gazebo")
91 cfg_server =
new dynamic_reconfigure::Server<pioneer_mrs::PioneerConfig>;
117 tf::Quaternion q(msg.pose.pose.orientation.x, msg.pose.pose.orientation.y, msg.pose.pose.orientation.z, msg.pose.pose.orientation.w);
119 double roll, pitch, yaw;
120 m.
getRPY(roll, pitch, yaw);
124 geometry_msgs::Pose2D pose;
125 pose.x = msg.pose.pose.position.x;
126 pose.y = msg.pose.pose.position.y;
127 pose.y = pose.y - (
HOSTNUM - 2);
137 tf::Quaternion q(msg.pose.pose.orientation.x, msg.pose.pose.orientation.y, msg.pose.pose.orientation.z, msg.pose.pose.orientation.w);
139 double roll, pitch, yaw;
140 m.
getRPY(roll, pitch, yaw);
144 geometry_msgs::Pose2D pose;
145 pose.x = msg.pose.pose.position.x;
146 pose.y = msg.pose.pose.position.y;
156 tf::Quaternion q(msg.transform.rotation.x, msg.transform.rotation.y, msg.transform.rotation.z, msg.transform.rotation.w);
158 double roll, pitch, yaw;
159 m.
getRPY(roll, pitch, yaw);
162 this->
pose_hp.x = msg.transform.translation.x;
163 this->
pose_hp.y = msg.transform.translation.y;
170 res.theta = this->
pose_hp.theta;
181 value = config.handpoint_offset;
193 double x,
y, v,
w, theta;
203 v = x*cos(theta) + y*sin(theta);
218 int main(
int argc,
char **argv)
void handpointVelocityCallBack(const geometry_msgs::Vector3 &)
int main(int argc, char **argv)
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ros::Subscriber vicon_pose_sub
void odomPoseCallBack(const nav_msgs::Odometry &)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
geometry_msgs::Pose2D pose_hp
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
ros::ServiceServer pose_server
TFSIMD_FORCE_INLINE const tfScalar & y() const
geometry_msgs::Vector3 vel_hp
ROSCPP_DECL void spin(Spinner &spinner)
ros::Subscriber odom_pose_sub
void getRPY(tfScalar &roll, tfScalar &pitch, tfScalar &yaw, unsigned int solution_number=1) const
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
void viconPoseCallBack(const geometry_msgs::TransformStamped &)
TFSIMD_FORCE_INLINE const tfScalar & x() const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
#define ROS_DEBUG_STREAM(args)
void handpointOffsetReconfigureCallBack(pioneer_mrs::PioneerConfig &, uint32_t)
TFSIMD_FORCE_INLINE const tfScalar & w() const
ros::Subscriber vel_hp_sub
#define ROS_INFO_STREAM(args)
bool poseServiceCallBack(pioneer_mrs::Pose2DRequest &, pioneer_mrs::Pose2DResponse &)
Pioneer(ros::NodeHandle &nh, ros::NodeHandle &nh_private)
dynamic_reconfigure::Server< pioneer_mrs::PioneerConfig > * cfg_server
void gazeboPoseCallBack(const nav_msgs::Odometry &)
ros::Subscriber gazebo_pose_sub