vesc_to_odom.h
Go to the documentation of this file.
1 // Copyright 2020 F1TENTH Foundation
2 //
3 // Redistribution and use in source and binary forms, with or without modification, are permitted
4 // provided that the following conditions are met:
5 //
6 // 1. Redistributions of source code must retain the above copyright notice, this list of conditions
7 // and the following disclaimer.
8 //
9 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
10 // of conditions and the following disclaimer in the documentation and/or other materials
11 // provided with the distribution.
12 //
13 // 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 // to endorse or promote products derived from this software without specific prior
15 // written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
18 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19 // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
24 // WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 // -*- mode:c++; fill-column: 100; -*-
27 
28 #ifndef VESC_ACKERMANN_VESC_TO_ODOM_H_
29 #define VESC_ACKERMANN_VESC_TO_ODOM_H_
30 
31 #include <memory>
32 #include <string>
33 
34 #include <ros/ros.h>
35 #include <vesc_msgs/VescStateStamped.h>
36 #include <std_msgs/Float64.h>
38 
39 namespace vesc_ackermann
40 {
41 
43 {
44 public:
46 
47 private:
48  // ROS parameters
49  std::string odom_frame_;
50  std::string base_frame_;
53  // conversion gain and offset
56  double wheelbase_;
58 
59  // odometry state
60  double x_, y_, yaw_;
61  std_msgs::Float64::ConstPtr last_servo_cmd_;
62  vesc_msgs::VescStateStamped::ConstPtr last_state_;
63 
64  // ROS services
68  std::shared_ptr<tf::TransformBroadcaster> tf_pub_;
69 
70  // ROS callbacks
71  void vescStateCallback(const vesc_msgs::VescStateStamped::ConstPtr& state);
72  void servoCmdCallback(const std_msgs::Float64::ConstPtr& servo);
73 };
74 
75 } // namespace vesc_ackermann
76 
77 #endif // VESC_ACKERMANN_VESC_TO_ODOM_H_
void vescStateCallback(const vesc_msgs::VescStateStamped::ConstPtr &state)
vesc_msgs::VescStateStamped::ConstPtr last_state_
Last received state message.
Definition: vesc_to_odom.h:62
std::shared_ptr< tf::TransformBroadcaster > tf_pub_
Definition: vesc_to_odom.h:68
ros::Publisher odom_pub_
Definition: vesc_to_odom.h:65
void servoCmdCallback(const std_msgs::Float64::ConstPtr &servo)
std_msgs::Float64::ConstPtr last_servo_cmd_
Last servo position commanded value.
Definition: vesc_to_odom.h:61
ros::Subscriber vesc_state_sub_
Definition: vesc_to_odom.h:66
ros::Subscriber servo_sub_
Definition: vesc_to_odom.h:67
VescToOdom(ros::NodeHandle nh, ros::NodeHandle private_nh)


vesc_ackermann
Author(s): Michael T. Boulet , Joshua Whitley
autogenerated on Sun Apr 18 2021 02:47:57