Initial commit

This commit is contained in:
2026-07-27 13:51:19 +08:00
commit 7bec56ca51
5408 changed files with 1126933 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
#ifndef COCKPIT_CORE_H
#define COCKPIT_CORE_H
#include "ros/ros.h"
#include "serial/serial.h"
#include "rc_receiver/rc.h"
#include "sensor_msgs/BatteryState.h"
#define __APP_NAME__ "cockpit_driver"
class CockPit{
public:
CockPit();
~CockPit();
void run();
private:
ros::NodeHandle nh_;
ros::NodeHandle private_nh_;
private:
/*串口号 */
std::string cockpit_com_;
/* 串口波特率 */
int baudrate_;
/* 驾驶模式控制的指令话题 */
std::string input_ctr_mode_topic_;
/* 电池状态的指令话题 */
std::string input_battery_state_topic_;
private:
uint16_t soc_ = 0;
uint8_t current_page_ = 0;
uint8_t drive_mode_ = 0;
private:
ros::Subscriber ctr_mode_sub_;
ros::Subscriber battery_state_sub_;
private:
serial::Serial serial_;
private:
void ctr_mode_callback(const rc_receiver::rc::ConstPtr &msg);
void battery_status_callback(const sensor_msgs::BatteryState::ConstPtr& msg);
void process(const ros::TimerEvent& e);
void serial_initial();
};
#endif