create_driver.h
Go to the documentation of this file.
1 
28 #ifndef CREATE_DRIVER_CREATE_DRIVER_H
29 #define CREATE_DRIVER_CREATE_DRIVER_H
30 #include "create_msgs/ChargingState.h"
31 #include "create_msgs/Mode.h"
32 #include "create_msgs/Bumper.h"
33 #include "create_msgs/DefineSong.h"
34 #include "create_msgs/PlaySong.h"
35 #include "create_msgs/MotorSetpoint.h"
36 
37 #include "create/create.h"
38 
40 #include <geometry_msgs/TransformStamped.h>
41 #include <geometry_msgs/Twist.h>
42 #include <nav_msgs/Odometry.h>
43 #include <ros/ros.h>
44 #include <sensor_msgs/JointState.h>
45 #include <std_msgs/Bool.h>
46 #include <std_msgs/Empty.h>
47 #include <std_msgs/Float32.h>
48 #include <std_msgs/Int16.h>
49 #include <std_msgs/UInt16.h>
50 #include <std_msgs/UInt8MultiArray.h>
52 
53 #include <string>
54 
55 static const double COVARIANCE[36] = {1e-5, 1e-5, 0.0, 0.0, 0.0, 1e-5, // NOLINT(whitespace/braces)
56  1e-5, 1e-5, 0.0, 0.0, 0.0, 1e-5,
57  0.0, 0.0, 1e-5, 0.0, 0.0, 0.0,
58  0.0, 0.0, 0.0, 1e-5, 0.0, 0.0,
59  0.0, 0.0, 0.0, 0.0, 1e-5, 0.0,
60  1e-5, 1e-5, 0.0, 0.0, 0.0, 1e-5};
61 
63 {
64 private:
67 
70 
85 
105 
107 
109 
110  create_msgs::Mode mode_msg_;
111  create_msgs::ChargingState charging_state_msg_;
112  create_msgs::Bumper bumper_msg_;
113  nav_msgs::Odometry odom_msg_;
114  geometry_msgs::TransformStamped tf_odom_;
116  std_msgs::Empty empty_msg_;
117  std_msgs::Float32 float32_msg_;
118  std_msgs::UInt16 uint16_msg_;
119  std_msgs::Int16 int16_msg_;
120  sensor_msgs::JointState joint_state_msg_;
122 
123  // ROS params
124  std::string dev_;
125  std::string base_frame_;
126  std::string odom_frame_;
128  double loop_hz_;
130  int baud_;
131 
132  void cmdVelCallback(const geometry_msgs::TwistConstPtr& msg);
133  void debrisLEDCallback(const std_msgs::BoolConstPtr& msg);
134  void spotLEDCallback(const std_msgs::BoolConstPtr& msg);
135  void dockLEDCallback(const std_msgs::BoolConstPtr& msg);
136  void checkLEDCallback(const std_msgs::BoolConstPtr& msg);
137  void powerLEDCallback(const std_msgs::UInt8MultiArrayConstPtr& msg);
138  void setASCIICallback(const std_msgs::UInt8MultiArrayConstPtr& msg);
139  void dockCallback(const std_msgs::EmptyConstPtr& msg);
140  void undockCallback(const std_msgs::EmptyConstPtr& msg);
141  void defineSongCallback(const create_msgs::DefineSongConstPtr& msg);
142  void playSongCallback(const create_msgs::PlaySongConstPtr& msg);
143  void sideBrushMotor(const create_msgs::MotorSetpointConstPtr& msg);
144  void mainBrushMotor(const create_msgs::MotorSetpointConstPtr& msg);
145  void vacuumBrushMotor(const create_msgs::MotorSetpointConstPtr& msg);
146 
147  bool update();
153  void publishOdom();
154  void publishJointState();
155  void publishBatteryInfo();
156  void publishButtonPresses() const;
157  void publishOmniChar();
158  void publishMode();
159  void publishBumperInfo();
160  void publishWheeldrop();
161 
162 public:
163  explicit CreateDriver(ros::NodeHandle& nh);
164  ~CreateDriver();
165  virtual void spin();
166  virtual void spinOnce();
167 }; // class CreateDriver
168 
169 #endif // CREATE_DRIVER_CREATE_DRIVER_H
void mainBrushMotor(const create_msgs::MotorSetpointConstPtr &msg)
void updateDriverDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat)
virtual void spinOnce()
create_msgs::Bumper bumper_msg_
std::string odom_frame_
void debrisLEDCallback(const std_msgs::BoolConstPtr &msg)
ros::Subscriber define_song_sub_
Definition: create_driver.h:80
ros::Subscriber power_led_sub_
Definition: create_driver.h:76
ros::Subscriber set_ascii_sub_
Definition: create_driver.h:77
ros::Time last_cmd_vel_time_
create_msgs::Mode mode_msg_
void checkLEDCallback(const std_msgs::BoolConstPtr &msg)
void publishBumperInfo()
ros::Subscriber dock_led_sub_
Definition: create_driver.h:74
ros::Subscriber spot_led_sub_
Definition: create_driver.h:73
ros::Publisher wheel_joint_pub_
void updateSafetyDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat)
ros::Publisher voltage_pub_
Definition: create_driver.h:93
ros::Publisher charging_state_pub_
Definition: create_driver.h:99
void updateBatteryDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat)
bool is_running_slowly_
void publishJointState()
ros::Publisher omni_char_pub_
ros::Publisher min_btn_pub_
Definition: create_driver.h:90
void publishButtonPresses() const
ros::Publisher bumper_pub_
ros::Subscriber check_led_sub_
Definition: create_driver.h:75
std_msgs::Float32 float32_msg_
diagnostic_updater::Updater diagnostics_
CreateDriver(ros::NodeHandle &nh)
std_msgs::UInt16 uint16_msg_
ros::Publisher temperature_pub_
Definition: create_driver.h:98
ros::Subscriber debris_led_sub_
Definition: create_driver.h:72
void publishWheeldrop()
void dockCallback(const std_msgs::EmptyConstPtr &msg)
ros::Subscriber side_brush_motor_sub_
Definition: create_driver.h:82
ros::Publisher clean_btn_pub_
Definition: create_driver.h:87
ros::Publisher odom_pub_
Definition: create_driver.h:86
void playSongCallback(const create_msgs::PlaySongConstPtr &msg)
ros::Subscriber play_song_sub_
Definition: create_driver.h:81
ros::Subscriber main_brush_motor_sub_
Definition: create_driver.h:83
ros::Publisher day_btn_pub_
Definition: create_driver.h:88
void cmdVelCallback(const geometry_msgs::TwistConstPtr &msg)
ros::Publisher charge_ratio_pub_
Definition: create_driver.h:96
nav_msgs::Odometry odom_msg_
void setASCIICallback(const std_msgs::UInt8MultiArrayConstPtr &msg)
void updateSerialDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat)
double latch_duration_
virtual void spin()
ros::Subscriber vacuum_motor_sub_
Definition: create_driver.h:84
ros::Publisher dock_btn_pub_
Definition: create_driver.h:91
std_msgs::Int16 int16_msg_
ros::Subscriber cmd_vel_sub_
Definition: create_driver.h:71
void spotLEDCallback(const std_msgs::BoolConstPtr &msg)
void publishOmniChar()
void updateModeDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat)
void powerLEDCallback(const std_msgs::UInt8MultiArrayConstPtr &msg)
void publishBatteryInfo()
static const double COVARIANCE[36]
Definition: create_driver.h:55
ros::Publisher hour_btn_pub_
Definition: create_driver.h:89
create_msgs::ChargingState charging_state_msg_
ros::Subscriber dock_sub_
Definition: create_driver.h:78
void sideBrushMotor(const create_msgs::MotorSetpointConstPtr &msg)
std::string base_frame_
ros::Publisher capacity_pub_
Definition: create_driver.h:97
ros::Publisher wheeldrop_pub_
std::string dev_
ros::Publisher charge_pub_
Definition: create_driver.h:95
tf2_ros::TransformBroadcaster tf_broadcaster_
std_msgs::Empty empty_msg_
void undockCallback(const std_msgs::EmptyConstPtr &msg)
void dockLEDCallback(const std_msgs::BoolConstPtr &msg)
ros::NodeHandle priv_nh_
Definition: create_driver.h:69
create::Create * robot_
Definition: create_driver.h:65
ros::Publisher mode_pub_
ros::Subscriber undock_sub_
Definition: create_driver.h:79
create::RobotModel model_
Definition: create_driver.h:66
ros::Publisher current_pub_
Definition: create_driver.h:94
ros::NodeHandle nh_
Definition: create_driver.h:68
void defineSongCallback(const create_msgs::DefineSongConstPtr &msg)
ros::Publisher spot_btn_pub_
Definition: create_driver.h:92
geometry_msgs::TransformStamped tf_odom_
void vacuumBrushMotor(const create_msgs::MotorSetpointConstPtr &msg)
sensor_msgs::JointState joint_state_msg_


create_driver
Author(s): Jacob Perron
autogenerated on Mon May 22 2023 02:31:38