|
@@ -75,6 +75,7 @@ int main(int argc, char **argv)
|
|
std::string yaw_pub_topic;
|
|
std::string yaw_pub_topic;
|
|
std::string pitch_pub_topic;
|
|
std::string pitch_pub_topic;
|
|
std::string roll_pub_topic;
|
|
std::string roll_pub_topic;
|
|
|
|
+ std::string temp_pub_topic;
|
|
std::string yaw_zero_topic;
|
|
std::string yaw_zero_topic;
|
|
std::string yaw_zero_service;
|
|
std::string yaw_zero_service;
|
|
std::string yaw_data_service;
|
|
std::string yaw_data_service;
|
|
@@ -95,6 +96,7 @@ int main(int argc, char **argv)
|
|
ros::param::get("~yaw_zero_topic", yaw_zero_topic);
|
|
ros::param::get("~yaw_zero_topic", yaw_zero_topic);
|
|
ros::param::get("~yaw_zero_service", yaw_zero_service);
|
|
ros::param::get("~yaw_zero_service", yaw_zero_service);
|
|
ros::param::get("~yaw_pub_topic", yaw_pub_topic);
|
|
ros::param::get("~yaw_pub_topic", yaw_pub_topic);
|
|
|
|
+ ros::param::get("~temp_pub_topic", temp_pub_topic);
|
|
ros::param::get("~pitch_pub_topic", pitch_pub_topic);
|
|
ros::param::get("~pitch_pub_topic", pitch_pub_topic);
|
|
ros::param::get("~roll_pub_topic", roll_pub_topic);
|
|
ros::param::get("~roll_pub_topic", roll_pub_topic);
|
|
ros::param::get("~get_yaw_data_srv", yaw_data_service);
|
|
ros::param::get("~get_yaw_data_srv", yaw_data_service);
|
|
@@ -120,6 +122,7 @@ int main(int argc, char **argv)
|
|
ros::Publisher yaw_pub = handle.advertise<std_msgs::Float32>(yaw_pub_topic, 2);
|
|
ros::Publisher yaw_pub = handle.advertise<std_msgs::Float32>(yaw_pub_topic, 2);
|
|
ros::Publisher pitch_pub = handle.advertise<std_msgs::Float32>(pitch_pub_topic, 2);
|
|
ros::Publisher pitch_pub = handle.advertise<std_msgs::Float32>(pitch_pub_topic, 2);
|
|
ros::Publisher roll_pub = handle.advertise<std_msgs::Float32>(roll_pub_topic, 2);
|
|
ros::Publisher roll_pub = handle.advertise<std_msgs::Float32>(roll_pub_topic, 2);
|
|
|
|
+ ros::Publisher temp_pub = handle.advertise<std_msgs::Float32>(temp_pub_topic, 2);
|
|
ros::Rate loop_rate(pub_topic_hz);
|
|
ros::Rate loop_rate(pub_topic_hz);
|
|
|
|
|
|
sensor_msgs::Imu imu_msg;
|
|
sensor_msgs::Imu imu_msg;
|
|
@@ -127,6 +130,7 @@ int main(int argc, char **argv)
|
|
std_msgs::Float32 yaw_msg;
|
|
std_msgs::Float32 yaw_msg;
|
|
std_msgs::Float32 pitch_msg;
|
|
std_msgs::Float32 pitch_msg;
|
|
std_msgs::Float32 roll_msg;
|
|
std_msgs::Float32 roll_msg;
|
|
|
|
+ std_msgs::Float32 temp_msg;
|
|
while(ros::ok())
|
|
while(ros::ok())
|
|
{
|
|
{
|
|
if(getImuData() < 0)
|
|
if(getImuData() < 0)
|
|
@@ -143,9 +147,11 @@ int main(int argc, char **argv)
|
|
yaw_msg.data = yaw;
|
|
yaw_msg.data = yaw;
|
|
pitch_msg.data = pitch;
|
|
pitch_msg.data = pitch;
|
|
roll_msg.data = roll;
|
|
roll_msg.data = roll;
|
|
|
|
+ temp_msg.data = getTemp();
|
|
yaw_pub.publish(yaw_msg); //将yaw值通过话题发布出去
|
|
yaw_pub.publish(yaw_msg); //将yaw值通过话题发布出去
|
|
pitch_pub.publish(pitch_msg); //将pitch值通过话题发布出去
|
|
pitch_pub.publish(pitch_msg); //将pitch值通过话题发布出去
|
|
roll_pub.publish(roll_msg); //将roll值通过话题发布出去
|
|
roll_pub.publish(roll_msg); //将roll值通过话题发布出去
|
|
|
|
+ temp_pub.publish(temp_msg); //将temp值通过话题发布出去
|
|
|
|
|
|
//ROS_INFO("yaw:%f pitch:%f roll:%f",yaw, pitch, roll);
|
|
//ROS_INFO("yaw:%f pitch:%f roll:%f",yaw, pitch, roll);
|
|
imu_msg.orientation.x = getQuat(1);
|
|
imu_msg.orientation.x = getQuat(1);
|