ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I get the GPS/INS position in lat, long, alt, roll, pitch, yaw. Compute the utm odometry using the gps_common package. so I now have the value in meters (x,y,z,roll,pitch,yaw). Then publish a transform using this position. Look at the code below for reference
void poseCallback(const gps_common::GPSFixConstPtr& msg){
static tf::TransformBroadcaster br;
tf::Transform transform;
double x,y;
std::string zone;
gps_common::LLtoUTM(msg->latitude, msg->longitude, northing, easting, zone);
transform.setOrigin(tf::Vector3( (easting), (northing), 0.0));
tf::Quaternion q;
q.setRPY(msg->roll ,msg->pitch, msg->track );
transform.setRotation(q);
br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "world", "vehicle"));
publish_map_tf(msg);
}
I also publish a static transform between the vehicle and the velodyne frame which is the x,y,z translation and r,p,y rotation between the co-ordinate frame of the GPS/INS and the Laser Sensor. Hope that helps