Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
vesc/vesc_ackermann/include/vesc_ackermann/vesc_to_odom.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
47 lines (36 sloc)
1.23 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -*- mode:c++; fill-column: 100; -*- | |
#ifndef VESC_ACKERMANN_VESC_TO_ODOM_H_ | |
#define VESC_ACKERMANN_VESC_TO_ODOM_H_ | |
#include <ros/ros.h> | |
#include <vesc_msgs/VescStateStamped.h> | |
#include <std_msgs/Float64.h> | |
namespace vesc_ackermann | |
{ | |
class VescToOdom | |
{ | |
public: | |
VescToOdom(ros::NodeHandle nh, ros::NodeHandle private_nh); | |
private: | |
// ROS parameters | |
std::string odom_frame_; | |
std::string base_frame_; | |
/** State message does not report servo position, so use the command instead */ | |
bool use_servo_cmd_; | |
// conversion gain and offset | |
double speed_to_erpm_gain_, speed_to_erpm_offset_; | |
double steering_to_servo_gain_, steering_to_servo_offset_; | |
double wheelbase_; | |
// odometry state | |
double x_, y_, yaw_; | |
std_msgs::Float64::ConstPtr last_servo_cmd_; ///< Last servo position commanded value | |
vesc_msgs::VescStateStamped::ConstPtr last_state_; ///< Last received state message | |
// ROS services | |
ros::Publisher odom_pub_; | |
ros::Subscriber vesc_state_sub_; | |
ros::Subscriber servo_sub_; | |
// ROS callbacks | |
void vescStateCallback(const vesc_msgs::VescStateStamped::ConstPtr& state); | |
void servoCmdCallback(const std_msgs::Float64::ConstPtr& servo); | |
}; | |
} // namespace vesc_ackermann | |
#endif // VESC_ACKERMANN_VESC_TO_ODOM_H_ |