roboteq_diff_drive.h
Go to the documentation of this file.
1 //
2 // Created by armadillo2 on 04/12/17.
3 //
4 
5 #ifndef ARMADILLO2_HW_ROBOTEQ_DIFF_DRIVE_H
6 #define ARMADILLO2_HW_ROBOTEQ_DIFF_DRIVE_H
7 
8 #include <ros/ros.h>
10 #include <roboteq/roboteq.h>
12 #include <std_msgs/String.h>
13 
14 #define ROBOTEQ_PORT_PARAM "~roboteq_port"
15 #define ROBOTEQ_BAUD_PARAM "~roboteq_baud"
16 #define RIGHT_WHEEL_JOINT_PARAM "~right_wheel_joint"
17 #define LEFT_WHEEL_JOINT_PARAM "~left_wheel_joint"
18 
19 typedef boost::chrono::steady_clock time_source;
20 
22 {
23 private:
24 
28  time_source::time_point last_time_ = time_source::now();
29 
30  std::string roboteq_port_;
32  int roboteq_baud_ = 0;
33  bool load_roboteq_hw_ = false;
34  /* if first time, subtract previous values */
35  bool first_time_ = true;
37 
38  void speakMsg(std::string msg, int sleep_time)
39  {
40  std_msgs::String speak_msg;
41  speak_msg.data = msg;
42  espeak_pub_.publish(speak_msg);
43  if (sleep_time > 0)
44  sleep(sleep_time);
45  }
46 
47 
48 public:
51  void read(const ros::Duration elapsed);
52  void write(const ros::Duration elapsed);
53  void registerHandles(hardware_interface::JointStateInterface &joint_state_interface,
54  hardware_interface::VelocityJointInterface &velocity_joint_interface);
55 };
56 
57 
58 #endif //ARMADILLO2_HW_ROBOTEQ_DIFF_DRIVE_H
void publish(const boost::shared_ptr< M > &message) const
RoboteqDiffDrive(ros::NodeHandle &nh)
void registerHandles(hardware_interface::JointStateInterface &joint_state_interface, hardware_interface::VelocityJointInterface &velocity_joint_interface)
std::string left_wheel_joint_
boost::chrono::steady_clock time_source
std::string right_wheel_joint_
ros::Publisher espeak_pub_
ros::NodeHandle * nh_
void read(const ros::Duration elapsed)
void speakMsg(std::string msg, int sleep_time)
roboteq::Roboteq * roboteq_
void write(const ros::Duration elapsed)
roboteq::serial_controller * roboteq_serial_
std::string roboteq_port_
time_source::time_point last_time_


armadillo2_hw
Author(s):
autogenerated on Wed Jan 3 2018 03:48:27