#include <pub_odometry.h>
Public Member Functions | |
bool | init (pr2_mechanism_model::RobotState *robot, ros::NodeHandle &n) |
Initializes all parameters needed for start publishing. | |
void | starting () |
Start the thread and sets last publish times to now. | |
void | stopping () |
Stops the thread. | |
void | update () |
Updates the odometry and then checks if enough time has passed to publish something by calling the private publishing methods. Called periodically. | |
Private Member Functions | |
void | computeBaseVelocity () |
Computes the linear x and y velocities and the angular (phi) velocity. Called by updateOdometry(). | |
void | getOdometryMessage (nav_msgs::Odometry &msg) |
Sets the proper values in the message given as parameter. Calls populateCovariance(). Called by publish(). | |
void | populateCovariance (nav_msgs::Odometry &msg) |
Sets the needed values in the covariance matrix of the message given as parameter. Called by getOdometryMessage(). | |
void | publish () |
Calls getOdometryMessage to 'create' an odometry message and publishes it. Calls getOdometryMessage(). Called by update(). | |
void | publishTransform () |
Publishes a new transformation message. Called by update(). | |
void | updateOdometry () |
Updates position (x,y,z,distance,angle) and updates the velocities by calling computeBaseVelocity(). Called by update(). | |
Private Attributes | |
std::string | base_footprint_frame_ |
std::string | base_link_frame_ |
ros::NodeHandle | n |
geometry_msgs::Point | odometry_ |
std::string | odometry_frame_ |
double | odometry_publish_rate_ |
geometry_msgs::Twist | odometry_vel_ |
pr2_mechanism_model::RobotState * | robot_ |
pointer to robot | |
std::string | tf_prefix_ |
boost::scoped_ptr < realtime_tools::RealtimePublisher < nav_msgs::Odometry > > | odometry_publisher_ |
boost::scoped_ptr < realtime_tools::RealtimePublisher < tf::tfMessage > > | transform_publisher_ |
bool | publish_odometry_ |
bool | publish_tf_ |
double | sigma_x_ |
double | sigma_y_ |
double | sigma_theta_ |
double | cov_x_y_ |
double | cov_x_theta_ |
double | cov_y_theta_ |
ros::Time | last_time_ |
ros::Time | current_time_ |
ros::Time | last_odometry_publish_time_ |
ros::Time | last_transform_publish_time_ |
double | expected_publish_time_ |
double | update_time |
pr2_mechanism_model::JointState * | wheel_inner_left_front_state |
pr2_mechanism_model::JointState * | wheel_inner_left_rear_state |
pr2_mechanism_model::JointState * | wheel_inner_right_front_state |
pr2_mechanism_model::JointState * | wheel_inner_right_rear_state |
double | current_vel_wheel_inner_left_front |
double | current_vel_wheel_inner_right_front |
double | current_vel_wheel_inner_left_rear |
double | current_vel_wheel_inner_right_rear |
double | current_vel_x |
double | current_vel_y |
double | current_vel_phi |
Definition at line 65 of file pub_odometry.h.
void BaseOdometry::computeBaseVelocity | ( | ) | [private] |
Computes the linear x and y velocities and the angular (phi) velocity. Called by updateOdometry().
this does not make sense, but works in simulation. Is gazebo capable of handling omniwheels??
Definition at line 212 of file pub_odometry.cpp.
void BaseOdometry::getOdometryMessage | ( | nav_msgs::Odometry & | msg | ) | [private] |
Sets the proper values in the message given as parameter. Calls populateCovariance(). Called by publish().
Definition at line 249 of file pub_odometry.cpp.
bool BaseOdometry::init | ( | pr2_mechanism_model::RobotState * | robot, |
ros::NodeHandle & | n | ||
) | [virtual] |
Initializes all parameters needed for start publishing.
Implements pr2_controller_interface::Controller.
Definition at line 64 of file pub_odometry.cpp.
void BaseOdometry::populateCovariance | ( | nav_msgs::Odometry & | msg | ) | [private] |
Sets the needed values in the covariance matrix of the message given as parameter. Called by getOdometryMessage().
Definition at line 267 of file pub_odometry.cpp.
void BaseOdometry::publish | ( | ) | [private] |
Calls getOdometryMessage to 'create' an odometry message and publishes it. Calls getOdometryMessage(). Called by update().
Definition at line 237 of file pub_odometry.cpp.
void BaseOdometry::publishTransform | ( | ) | [private] |
Publishes a new transformation message. Called by update().
Definition at line 308 of file pub_odometry.cpp.
void BaseOdometry::starting | ( | ) | [virtual] |
Start the thread and sets last publish times to now.
Reimplemented from pr2_controller_interface::Controller.
Definition at line 166 of file pub_odometry.cpp.
void BaseOdometry::stopping | ( | ) | [virtual] |
Stops the thread.
Reimplemented from pr2_controller_interface::Controller.
Definition at line 191 of file pub_odometry.cpp.
void BaseOdometry::update | ( | void | ) | [virtual] |
Updates the odometry and then checks if enough time has passed to publish something by calling the private publishing methods. Called periodically.
Implements pr2_controller_interface::Controller.
Definition at line 174 of file pub_odometry.cpp.
void BaseOdometry::updateOdometry | ( | ) | [private] |
Updates position (x,y,z,distance,angle) and updates the velocities by calling computeBaseVelocity(). Called by update().
Definition at line 195 of file pub_odometry.cpp.
std::string controller::BaseOdometry::base_footprint_frame_ [private] |
Definition at line 123 of file pub_odometry.h.
std::string controller::BaseOdometry::base_link_frame_ [private] |
Definition at line 122 of file pub_odometry.h.
double controller::BaseOdometry::cov_x_theta_ [private] |
Definition at line 128 of file pub_odometry.h.
double controller::BaseOdometry::cov_x_y_ [private] |
Definition at line 128 of file pub_odometry.h.
double controller::BaseOdometry::cov_y_theta_ [private] |
Definition at line 128 of file pub_odometry.h.
Definition at line 133 of file pub_odometry.h.
double controller::BaseOdometry::current_vel_phi [private] |
Definition at line 150 of file pub_odometry.h.
double controller::BaseOdometry::current_vel_wheel_inner_left_front [private] |
Definition at line 146 of file pub_odometry.h.
double controller::BaseOdometry::current_vel_wheel_inner_left_rear [private] |
Definition at line 146 of file pub_odometry.h.
double controller::BaseOdometry::current_vel_wheel_inner_right_front [private] |
Definition at line 146 of file pub_odometry.h.
double controller::BaseOdometry::current_vel_wheel_inner_right_rear [private] |
Definition at line 146 of file pub_odometry.h.
double controller::BaseOdometry::current_vel_x [private] |
Definition at line 150 of file pub_odometry.h.
double controller::BaseOdometry::current_vel_y [private] |
Definition at line 150 of file pub_odometry.h.
double controller::BaseOdometry::expected_publish_time_ [private] |
Definition at line 137 of file pub_odometry.h.
Definition at line 135 of file pub_odometry.h.
Definition at line 132 of file pub_odometry.h.
Definition at line 135 of file pub_odometry.h.
ros::NodeHandle controller::BaseOdometry::n [private] |
Definition at line 103 of file pub_odometry.h.
Definition at line 118 of file pub_odometry.h.
std::string controller::BaseOdometry::odometry_frame_ [private] |
Definition at line 121 of file pub_odometry.h.
double controller::BaseOdometry::odometry_publish_rate_ [private] |
Definition at line 113 of file pub_odometry.h.
boost::scoped_ptr<realtime_tools::RealtimePublisher <nav_msgs::Odometry> > controller::BaseOdometry::odometry_publisher_ [private] |
Definition at line 108 of file pub_odometry.h.
geometry_msgs::Twist controller::BaseOdometry::odometry_vel_ [private] |
Definition at line 119 of file pub_odometry.h.
bool controller::BaseOdometry::publish_odometry_ [private] |
Definition at line 115 of file pub_odometry.h.
bool controller::BaseOdometry::publish_tf_ [private] |
Definition at line 115 of file pub_odometry.h.
pointer to robot
Definition at line 105 of file pub_odometry.h.
double controller::BaseOdometry::sigma_theta_ [private] |
Definition at line 128 of file pub_odometry.h.
double controller::BaseOdometry::sigma_x_ [private] |
Covariance variables
Definition at line 128 of file pub_odometry.h.
double controller::BaseOdometry::sigma_y_ [private] |
Definition at line 128 of file pub_odometry.h.
std::string controller::BaseOdometry::tf_prefix_ [private] |
Definition at line 124 of file pub_odometry.h.
boost::scoped_ptr<realtime_tools::RealtimePublisher <tf::tfMessage> > controller::BaseOdometry::transform_publisher_ [private] |
Definition at line 110 of file pub_odometry.h.
double controller::BaseOdometry::update_time [private] |
Definition at line 138 of file pub_odometry.h.
Definition at line 142 of file pub_odometry.h.
Definition at line 143 of file pub_odometry.h.
Definition at line 144 of file pub_odometry.h.
Definition at line 145 of file pub_odometry.h.