14 #include "../../include/xbot_node/odometry.hpp" 28 base_frame(
"base_footprint"),
29 use_imu_heading(true),
34 nh.
param(
"cmd_vel_timeout", timeout, 0.6);
41 "Xbot : no param server setting for odom_frame, using default [" 50 "Xbot : no param server setting for base_frame, using default [" 59 "Xbot : no param server setting for publish_tf, using default [" 65 ROS_INFO_STREAM(
"Xbot : not publishing transforms (see robot_pose_ekf) [" 72 "Xbot : no param server setting for use_imu_heading, using default [" 78 ROS_INFO_STREAM(
"Xbot : using encoders for heading (see robot_pose_ekf) [" 102 ecl::linear_algebra::Vector3d &pose_update_rates,
103 double imu_heading,
double imu_angular_velocity) {
108 pose.heading() = imu_heading;
109 pose_update_rates[2] = imu_angular_velocity;
113 geometry_msgs::Quaternion odom_quat =
138 const geometry_msgs::Quaternion &odom_quat,
139 const ecl::linear_algebra::Vector3d &pose_update_rates) {
142 nav_msgs::OdometryPtr odom(
new nav_msgs::Odometry);
150 odom->pose.pose.position.x =
pose.x();
151 odom->pose.pose.position.y =
pose.y();
152 odom->pose.pose.position.z = 0.0;
153 odom->pose.pose.orientation = odom_quat;
156 odom->twist.twist.linear.x = pose_update_rates[0];
157 odom->twist.twist.linear.y = pose_update_rates[1];
158 odom->twist.twist.angular.z = pose_update_rates[2];
163 odom->pose.covariance[0] = 0.1;
164 odom->pose.covariance[7] = 0.1;
167 odom->pose.covariance[14] = DBL_MAX;
168 odom->pose.covariance[21] = DBL_MAX;
169 odom->pose.covariance[28] = DBL_MAX;
ros::Duration cmd_vel_timeout
tf::TransformBroadcaster odom_broadcaster
void publish(const boost::shared_ptr< M > &message) const
ros::Publisher odom_publisher
const ros::Duration & timeout() const
void update(const ecl::Pose2D< double > &pose_update, ecl::linear_algebra::Vector3d &pose_update_rates, double imu_heading, double imu_angular_velocity)
bool commandTimeout() const
void publishTransform(const geometry_msgs::Quaternion &odom_quat)
Duration & fromSec(double t)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
geometry_msgs::TransformStamped odom_trans
ecl::Pose2D< double > pose
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
#define ROS_WARN_STREAM(args)
static geometry_msgs::Quaternion createQuaternionMsgFromYaw(double yaw)
#define ROS_INFO_STREAM(args)
void publishOdometry(const geometry_msgs::Quaternion &odom_quat, const ecl::linear_algebra::Vector3d &pose_update_rates)
bool getParam(const std::string &key, std::string &s) const
void init(ros::NodeHandle &nh, const std::string &name)