Level2_Robot/room_seeker_core/src/room_seeker_level1.cpp
//================================================================================================//
// Publish msgs (IMU data: angular velocity, linear acceleration, orientation)                    //
//   Future Works                                                                                 //
//================================================================================================//
Publish msgs (IMU data: angular velocity, linear acceleration, orientation)
Future Works
Publish msgs ( IMU data : angular velocity linear acceleration orientation ) Future Works
void RoomSeekerLevel1::publishImuMsg(void){
  sensor_msgs::Imu imu_msg;
  imu_msg.header.stamp          = ros::Time::now();
  imu_msg.header.frame_id       = imu_frame_id;
  imu_msg.orientation.x         = mx - mx_offset;
  imu_msg.orientation.y         = my - my_offset;
  imu_msg.orientation.z         = mz - mz_offset;
  imu_msg.orientation.w         = sqrt(pow(mx, 2) + pow(my, 2) + pow(mz, 2));
  imu_msg.angular_velocity.x    = gx;
  imu_msg.angular_velocity.y    = gy;
  imu_msg.angular_velocity.z    = gz;
  imu_msg.linear_acceleration.x = ax;
  imu_msg.linear_acceleration.y = ay;
  imu_msg.linear_acceleration.z = az;
  imu_pub.publish(imu_msg);
}
void RoomSeekerLevel1 :: publishImuMsg ( void ) { sensor_msgs :: Imu imu_msg ; imu_msg . header . stamp = ros :: Time :: now ( ) ; imu_msg . header . frame_id = imu_frame_id ; imu_msg . orientation . x = mx - mx_offset ; imu_msg . orientation . y = my - my_offset ; imu_msg . orientation . z = mz - mz_offset ; imu_msg . orientation . w = sqrt ( pow ( mx , 2 ) + pow ( my , 2 ) + pow ( mz , 2 ) ) ; imu_msg . angular_velocity . x = gx ; imu_msg . angular_velocity . y = gy ; imu_msg . angular_velocity . z = gz ; imu_msg . linear_acceleration . x = ax ; imu_msg . linear_acceleration . y = ay ; imu_msg . linear_acceleration . z = az ; imu_pub . publish ( imu_msg ) ; }
Publish msgs (IMU data: angular velocity, linear acceleration, orientation)
Future Works
Publish msgs ( IMU data : angular velocity linear acceleration orientation ) Future Works