Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
gazebo::GazeboRsvBalance Class Reference

#include <gazebo_rsv_balance.h>

Inheritance diagram for gazebo::GazeboRsvBalance:
Inheritance graph
[legend]

Public Member Functions

 GazeboRsvBalance ()
 
void Load (physics::ModelPtr _parent, sdf::ElementPtr _sdf)
 
void Reset ()
 Called when Gazebo resets world. More...
 
 ~GazeboRsvBalance ()
 

Protected Member Functions

virtual void FiniChild ()
 Called by gazebo upon exiting. More...
 
virtual void UpdateChild ()
 Gazebo step update. More...
 

Private Types

enum  { RIGHT, LEFT }
 
enum  Mode { PARK = rsv_balance_msgs::SetModeRequest::PARK, TRACTOR = rsv_balance_msgs::SetModeRequest::TRACTOR, BALANCE = rsv_balance_msgs::SetModeRequest::BALANCE }
 
enum  OdomSource { ENCODER = 0, WORLD = 1 }
 

Private Member Functions

void cmdTiltCallback (const std_msgs::Float64::ConstPtr &cmd_tilt)
 Callback to cmd_tilt. More...
 
void cmdVelCallback (const geometry_msgs::Twist::ConstPtr &cmd_msg)
 Callback to cmd_vel. More...
 
void publishOdometry ()
 Publishes odometry and desired tfs. More...
 
void publishWheelJointState ()
 Publishes wheel joint_states. More...
 
void QueueThread ()
 
bool resetOdom (std_srvs::Empty::Request &req)
 Service to reset odometry. More...
 
void resetOdometry ()
 Resets odometry by adding offset to WORLD odometry, and resetting odometry values. More...
 
bool resetOverride (std_srvs::Empty::Request &req)
 Just exposes service. Not used in simulation. More...
 
void resetVariables ()
 Resets simulation variables. More...
 
bool setInput (rsv_balance_msgs::SetInput::Request &req)
 Just exposes service. Not used in simulation. More...
 
bool setMode (rsv_balance_msgs::SetMode::Request &req)
 Sets platform operating mode. More...
 
void updateIMU ()
 Gets pitch angle values directly from Gazebo world. More...
 
void updateOdometry ()
 Updates odometry, from Gazebo world or from encoders. More...
 

Private Attributes

bool alive_
 
std::string base_frame_id_
 
boost::thread callback_queue_thread_
 
ros::Subscriber cmd_tilt_subscriber_
 
ros::Subscriber cmd_vel_subscriber_
 
std::string command_topic_
 
Mode current_mode_
 
double feedback_v_
 
double feedback_w_
 
GazeboRosPtr gazebo_ros_
 
double imu_dpitch_
 
double imu_pitch_
 
ros::Publisher joint_state_publisher_
 
std::vector< physics::JointPtr > joints_
 
common::Time last_update_time_
 
std::map< std::string, Modemode_map_
 
nav_msgs::Odometry odom_
 
std::string odom_frame_id_
 
math::Vector3 odom_offset_pos_
 
math::Vector3 odom_offset_rot_
 
OdomSource odom_source_
 
std::string odom_topic_
 
ros::Publisher odometry_publisher_
 
physics::ModelPtr parent_
 
double publish_diagnostics_rate_
 
bool publish_odom_tf_
 
bool publish_state_
 
double publish_state_rate_
 
bool publish_wheel_joint_
 
ros::CallbackQueue queue_
 
ros::ServiceServer reset_odom_server_
 
ros::ServiceServer reset_override_server_
 
double rot_desired_
 
sdf::ElementPtr sdf_
 
ros::ServiceServer set_input_server_
 
ros::ServiceServer set_mode_server_
 
balance_control::BalanceControl state_control_
 
ros::Publisher state_publisher_
 
double tilt_desired_
 
boost::shared_ptr< tf::TransformBroadcastertransform_broadcaster_
 
double * u_control_
 
event::ConnectionPtr update_connection_
 
double update_period_
 
double update_rate_
 
double wheel_radius_
 
double wheel_separation_
 
double x_desired_
 

Detailed Description

Gazebo Plugin which controls the balance platform just like the real thing.

Definition at line 45 of file gazebo_rsv_balance.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
RIGHT 
LEFT 

Definition at line 47 of file gazebo_rsv_balance.h.

Enumerator
PARK 
TRACTOR 
BALANCE 

Definition at line 57 of file gazebo_rsv_balance.h.

Enumerator
ENCODER 
WORLD 

Definition at line 52 of file gazebo_rsv_balance.h.

Constructor & Destructor Documentation

gazebo::GazeboRsvBalance::GazeboRsvBalance ( )

Definition at line 19 of file gazebo_rsv_balance.cpp.

gazebo::GazeboRsvBalance::~GazeboRsvBalance ( )

Definition at line 21 of file gazebo_rsv_balance.cpp.

Member Function Documentation

void gazebo::GazeboRsvBalance::cmdTiltCallback ( const std_msgs::Float64::ConstPtr &  cmd_tilt)
private

Callback to cmd_tilt.

Definition at line 229 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::cmdVelCallback ( const geometry_msgs::Twist::ConstPtr &  cmd_msg)
private

Callback to cmd_vel.

Definition at line 220 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::FiniChild ( )
protectedvirtual

Called by gazebo upon exiting.

Definition at line 436 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::Load ( physics::ModelPtr  _parent,
sdf::ElementPtr  _sdf 
)

Definition at line 23 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::publishOdometry ( )
private

Publishes odometry and desired tfs.

Todo:
User configurable covariance

Definition at line 302 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::publishWheelJointState ( )
private

Publishes wheel joint_states.

Definition at line 340 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::QueueThread ( )
private

Definition at line 445 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::Reset ( )

Called when Gazebo resets world.

Definition at line 362 of file gazebo_rsv_balance.cpp.

bool gazebo::GazeboRsvBalance::resetOdom ( std_srvs::Empty::Request &  req)
private

Service to reset odometry.

Definition at line 210 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::resetOdometry ( )
private

Resets odometry by adding offset to WORLD odometry, and resetting odometry values.

Todo:
Actually implement it

Definition at line 250 of file gazebo_rsv_balance.cpp.

bool gazebo::GazeboRsvBalance::resetOverride ( std_srvs::Empty::Request &  req)
private

Just exposes service. Not used in simulation.

Definition at line 200 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::resetVariables ( )
private

Resets simulation variables.

Used when starting and when gazebo reset world or model

Definition at line 153 of file gazebo_rsv_balance.cpp.

bool gazebo::GazeboRsvBalance::setInput ( rsv_balance_msgs::SetInput::Request &  req)
private

Just exposes service. Not used in simulation.

Definition at line 190 of file gazebo_rsv_balance.cpp.

bool gazebo::GazeboRsvBalance::setMode ( rsv_balance_msgs::SetMode::Request &  req)
private

Sets platform operating mode.

Definition at line 164 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::UpdateChild ( )
protectedvirtual

Gazebo step update.

Definition at line 378 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::updateIMU ( )
private

Gets pitch angle values directly from Gazebo world.

Definition at line 237 of file gazebo_rsv_balance.cpp.

void gazebo::GazeboRsvBalance::updateOdometry ( )
private

Updates odometry, from Gazebo world or from encoders.

Todo:
Implement encoder odometry

Definition at line 261 of file gazebo_rsv_balance.cpp.

Member Data Documentation

bool gazebo::GazeboRsvBalance::alive_
private

Definition at line 81 of file gazebo_rsv_balance.h.

std::string gazebo::GazeboRsvBalance::base_frame_id_
private

Definition at line 111 of file gazebo_rsv_balance.h.

boost::thread gazebo::GazeboRsvBalance::callback_queue_thread_
private

Definition at line 83 of file gazebo_rsv_balance.h.

ros::Subscriber gazebo::GazeboRsvBalance::cmd_tilt_subscriber_
private

Definition at line 93 of file gazebo_rsv_balance.h.

ros::Subscriber gazebo::GazeboRsvBalance::cmd_vel_subscriber_
private

Definition at line 92 of file gazebo_rsv_balance.h.

std::string gazebo::GazeboRsvBalance::command_topic_
private

Definition at line 87 of file gazebo_rsv_balance.h.

Mode gazebo::GazeboRsvBalance::current_mode_
private

Definition at line 122 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::feedback_v_
private

Definition at line 131 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::feedback_w_
private

Definition at line 132 of file gazebo_rsv_balance.h.

GazeboRosPtr gazebo::GazeboRsvBalance::gazebo_ros_
private

Definition at line 75 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::imu_dpitch_
private

Definition at line 130 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::imu_pitch_
private

Definition at line 129 of file gazebo_rsv_balance.h.

ros::Publisher gazebo::GazeboRsvBalance::joint_state_publisher_
private

Definition at line 91 of file gazebo_rsv_balance.h.

std::vector<physics::JointPtr> gazebo::GazeboRsvBalance::joints_
private

Definition at line 125 of file gazebo_rsv_balance.h.

common::Time gazebo::GazeboRsvBalance::last_update_time_
private

Definition at line 147 of file gazebo_rsv_balance.h.

std::map<std::string, Mode> gazebo::GazeboRsvBalance::mode_map_
private

Definition at line 121 of file gazebo_rsv_balance.h.

nav_msgs::Odometry gazebo::GazeboRsvBalance::odom_
private

Definition at line 137 of file gazebo_rsv_balance.h.

std::string gazebo::GazeboRsvBalance::odom_frame_id_
private

Definition at line 112 of file gazebo_rsv_balance.h.

math::Vector3 gazebo::GazeboRsvBalance::odom_offset_pos_
private

Definition at line 133 of file gazebo_rsv_balance.h.

math::Vector3 gazebo::GazeboRsvBalance::odom_offset_rot_
private

Definition at line 134 of file gazebo_rsv_balance.h.

OdomSource gazebo::GazeboRsvBalance::odom_source_
private

Definition at line 113 of file gazebo_rsv_balance.h.

std::string gazebo::GazeboRsvBalance::odom_topic_
private

Definition at line 88 of file gazebo_rsv_balance.h.

ros::Publisher gazebo::GazeboRsvBalance::odometry_publisher_
private

Definition at line 89 of file gazebo_rsv_balance.h.

physics::ModelPtr gazebo::GazeboRsvBalance::parent_
private

Definition at line 76 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::publish_diagnostics_rate_
private

Definition at line 116 of file gazebo_rsv_balance.h.

bool gazebo::GazeboRsvBalance::publish_odom_tf_
private

Definition at line 109 of file gazebo_rsv_balance.h.

bool gazebo::GazeboRsvBalance::publish_state_
private

Definition at line 114 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::publish_state_rate_
private

Definition at line 115 of file gazebo_rsv_balance.h.

bool gazebo::GazeboRsvBalance::publish_wheel_joint_
private

Definition at line 110 of file gazebo_rsv_balance.h.

ros::CallbackQueue gazebo::GazeboRsvBalance::queue_
private

Definition at line 82 of file gazebo_rsv_balance.h.

ros::ServiceServer gazebo::GazeboRsvBalance::reset_odom_server_
private

Definition at line 97 of file gazebo_rsv_balance.h.

ros::ServiceServer gazebo::GazeboRsvBalance::reset_override_server_
private

Definition at line 96 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::rot_desired_
private

Definition at line 127 of file gazebo_rsv_balance.h.

sdf::ElementPtr gazebo::GazeboRsvBalance::sdf_
private

Definition at line 77 of file gazebo_rsv_balance.h.

ros::ServiceServer gazebo::GazeboRsvBalance::set_input_server_
private

Definition at line 95 of file gazebo_rsv_balance.h.

ros::ServiceServer gazebo::GazeboRsvBalance::set_mode_server_
private

Definition at line 94 of file gazebo_rsv_balance.h.

balance_control::BalanceControl gazebo::GazeboRsvBalance::state_control_
private

Definition at line 148 of file gazebo_rsv_balance.h.

ros::Publisher gazebo::GazeboRsvBalance::state_publisher_
private

Definition at line 90 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::tilt_desired_
private

Definition at line 128 of file gazebo_rsv_balance.h.

boost::shared_ptr<tf::TransformBroadcaster> gazebo::GazeboRsvBalance::transform_broadcaster_
private

Definition at line 98 of file gazebo_rsv_balance.h.

double* gazebo::GazeboRsvBalance::u_control_
private

Definition at line 149 of file gazebo_rsv_balance.h.

event::ConnectionPtr gazebo::GazeboRsvBalance::update_connection_
private

Definition at line 78 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::update_period_
private

Definition at line 146 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::update_rate_
private

Definition at line 145 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::wheel_radius_
private

Definition at line 119 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::wheel_separation_
private

Definition at line 118 of file gazebo_rsv_balance.h.

double gazebo::GazeboRsvBalance::x_desired_
private

Definition at line 126 of file gazebo_rsv_balance.h.


The documentation for this class was generated from the following files:


rsv_balance_gazebo
Author(s): Vitor Matos
autogenerated on Mon Jun 10 2019 15:06:42