# Odom Axes not in line with base_link

Hi,

I am using Powerbot to be able to build a map using gmapping algorithm. To setup my robot, I am using the ROSARIA package to be able to have control on the motors, get pose estimates from odometry etc. This is an ROS wrapper for the ARIA library provided by ActivMedia mobilerobots.

I am aware that I need some tf configuration in order to align the odometry frame with the base_link and to align the laser frame with base_link frame. I have followed the tutorials and I have understood the concept. I came across this tutorial and followed it to be able to create my transforms while using ROSARIA. However, in doing so, I have noticed that the odometry axes is not aligned with the base_link axes. The laser axes are aligned perfectly as can be seen in this screenshot. The odometry axes as the ones far off from the other two.

I am aware that ROSARIA publishes its own tf as can be seen from rosgraph.png. The current transform tree according to my code is this. The code that I am using to build the transformations is the following:

#include <ros/ros.h>
#include <nav_msgs/Odometry.h>

void poseCallback(const nav_msgs::Odometry::ConstPtr& odomsg)
{

tf::StampedTransform(
tf::Transform(tf::Quaternion(odomsg->pose.pose.orientation.x,
odomsg->pose.pose.orientation.y,
odomsg->pose.pose.orientation.z,
odomsg->pose.pose.orientation.w),
tf::Vector3(odomsg->pose.pose.position.x/1000.0,
odomsg->pose.pose.position.y/1000.0,
odomsg->pose.pose.position.z/1000.0)),
ROS_DEBUG("odometry frame sent");
ROS_INFO("odometry frame sent: y=[%f]", odomsg->pose.pose.position.y/1000.0);
}

int main(int argc, char** argv){
ros::init(argc, argv, "pioneer_tf");
ros::NodeHandle n;

ros::Rate r(100);

//subscribe to pose info
ros::Subscriber pose_sub = n.subscribe<nav_msgs::Odometry>("RosAria/pose", 100, poseCallback);

while(n.ok()){
tf::StampedTransform(
tf::Transform(tf::Quaternion(0, 0, 0), tf::Vector3(/*0.034, 0.0, 0.250*/0.385, 0, 0.17)),

ros::spinOnce();
r.sleep();
}
}


Of course, the maps created using this setup are a mess. This happens after I move the robot with the joystick for a bit. Initially, on starting up ROSARIA and the transform node the axes are aligned. It is only after the robot moves that they lose their alignment. Can someone help me understand what is wrong with my transform tree and how can I fix this? Thanks!

EDIT

This is a typical example of what happens to my robot's odometry when I drive it around a little bit. Basically, it moved forwards, then turned around a desk and then moved forwards some more. I do not expect such bad odometry.

edit retag close merge delete

Sort by » oldest newest most voted

When the robot starts up the base_link and odom frames are alligned since that's the default initial position. After that as you drive around the odom frame should stay still while the robot moves relative to that position. See REP 105 for more information.

more

ok that makes sense thanks! Does that mean that my odometry is correct then? Also, are my transforms correct to be able to run gmapping?

( 2015-02-14 02:18:39 -0500 )edit

Also, in the last EDIT of my post, I have attached a screenshot of what happens to my robot's odometry in rviz (red arrows) when driving it around...I cannot understand what happened there and why I could see so many arrows all over the place.

( 2015-02-14 02:31:17 -0500 )edit