1 #ifndef PHEENO_ROS_PHEENO_ROBOT_H 2 #define PHEENO_ROS_PHEENO_ROBOT_H 5 #include "std_msgs/Float32.h" 6 #include "std_msgs/Int16.h" 7 #include "geometry_msgs/Twist.h" 8 #include "geometry_msgs/Vector3.h" 9 #include "nav_msgs/Odometry.h" 70 bool irSensorTriggered(
float sensor_limits);
73 double randomTurn(
float angular = 0.06);
74 void avoidObstaclesLinear(
double &linear,
double &angular,
75 float angular_velocity = 1.2,
float linear_velocity = 0.08,
76 double range_to_avoid = 20.0);
77 void avoidObstaclesAngular(
double &angular,
double &random_turn_value,
78 float angular_velocity = 1.2,
double range_to_avoid = 20.0);
81 void publish(geometry_msgs::Twist velocity);
84 bool checkFrontColor(
int color);
112 void irSensorCenterCallback(
const std_msgs::Float32::ConstPtr& msg);
113 void irSensorBackCallback(
const std_msgs::Float32::ConstPtr& msg);
114 void irSensorRightCallback(
const std_msgs::Float32::ConstPtr& msg);
115 void irSensorLeftCallback(
const std_msgs::Float32::ConstPtr& msg);
116 void irSensorCRightCallback(
const std_msgs::Float32::ConstPtr& msg);
117 void irSensorCLeftCallback(
const std_msgs::Float32::ConstPtr& msg);
118 void irSensorBottomCallback(
const std_msgs::Int16::ConstPtr& msg);
121 void odomCallback(
const nav_msgs::Odometry::ConstPtr& msg);
124 void encoderLLCallback(
const std_msgs::Int16::ConstPtr& msg);
125 void encoderLRCallback(
const std_msgs::Int16::ConstPtr& msg);
126 void encoderRLCallback(
const std_msgs::Int16::ConstPtr& msg);
127 void encoderRRCallback(
const std_msgs::Int16::ConstPtr& msg);
130 void magnetometerCallback(
const geometry_msgs::Vector3::ConstPtr& msg);
131 void gyroscopeCallback(
const geometry_msgs::Vector3::ConstPtr& msg);
132 void accelerometerCallback(
const geometry_msgs::Vector3::ConstPtr& msg);
135 void piCamCallback();
138 #endif // PHEENO_ROS_PHEENO_ROBOT_H
std::vector< double > gyroscope_vals_
ros::Subscriber sub_pheeno_cam_
ros::Subscriber sub_ir_cr_
ros::Subscriber sub_odom_
std_msgs::Float32 ir_sensor_back_
std_msgs::Float32 ir_sensor_center_
ros::Subscriber sub_gyroscope_
std::vector< double > odom_pose_position_
ros::Subscriber sub_encoder_RL_
ros::Subscriber sub_magnetometer_
nav_msgs::Odometry odom_msg_
ros::Subscriber sub_ir_left_
ros::Subscriber sub_encoder_LR_
std_msgs::Int16 ir_sensor_bottom_
std_msgs::Float32 ir_sensor_c_right_
std::vector< double > odom_twist_angular_
ros::Subscriber sub_ir_bottom_
std::vector< double > accelerometer_vals_
std::vector< double > odom_pose_orient_
std_msgs::Float32 ir_sensor_c_left_
std_msgs::Float32 ir_sensor_right_
std::vector< int > encoder_vals_
ros::Subscriber sub_encoder_RR_
ros::Subscriber sub_ir_center_
ros::Subscriber sub_ir_right_
std::vector< double > odom_twist_linear_
ros::Subscriber sub_accelerometer_
ros::Subscriber sub_encoder_LL_
std::vector< double > magnetometer_vals_
ros::Publisher pub_cmd_vel_
ros::Subscriber sub_ir_back_
ros::Subscriber sub_ir_cl_
std_msgs::Float32 ir_sensor_left_
std::vector< double > ir_sensor_vals_
std::string pheeno_namespace_id_
std::vector< bool > color_state_facing_