Inconsistent Hector SLAM trajectory correction
Greetings. I am having some issues regarding the Hector SLAM algorithm. I am currently trying to compare the trajectory of a tracked robot: i’m using both the data from the encoders and the SLAM algorithm to track the position of the robot. As you can see from the attached image there are quite some differences from the trajectory calculated with the encoder and the trajectory exported from the Hector SLAM. Moreover the encoder one is more consistent with the actual path of the rover than the SLAM one. As you can see the overall shape of the trajectory is the same, but the SLAM one is scaled in an odd way, and somehow rotated with respect to the encoder one. I was wondering if there was a way to make the SLAM trajectory more consistent with reality or if i am missing something in the matlab enviroment. Can someone plese enlight me about this issue? If needed, of course, i will provide further information. Thanks in advance to everyone interested.
% Load topics
topic_sys = select(bag,’Topic’,"/robo/sys");
topic_data_sys = readMessages(topic_sys);
topic_enc = select(bag,’Topic’,"/robo/enc");
topic_data_enc = readMessages(topic_enc);
topic_slam = select(bag,"Topic","/slam_out_pose");
topic_data_slam = readMessages(topic_slam);
topic_scan = select(bag,"Topic","/velodyne_points");
topic_data_scan = readMessages(topic_scan);
%% SLAM Trajectory – Finding
for i =1:length(topic_data_slam)
yTraj(i,1) = topic_data_slam{i,1}.Pose.Position.X ;
xTraj(i,1) = -topic_data_slam{i,1}.Pose.Position.Y ;
end
xTraj = xTraj – xTraj(1,1);
yTraj = yTraj – yTraj(1,1);Greetings. I am having some issues regarding the Hector SLAM algorithm. I am currently trying to compare the trajectory of a tracked robot: i’m using both the data from the encoders and the SLAM algorithm to track the position of the robot. As you can see from the attached image there are quite some differences from the trajectory calculated with the encoder and the trajectory exported from the Hector SLAM. Moreover the encoder one is more consistent with the actual path of the rover than the SLAM one. As you can see the overall shape of the trajectory is the same, but the SLAM one is scaled in an odd way, and somehow rotated with respect to the encoder one. I was wondering if there was a way to make the SLAM trajectory more consistent with reality or if i am missing something in the matlab enviroment. Can someone plese enlight me about this issue? If needed, of course, i will provide further information. Thanks in advance to everyone interested.
% Load topics
topic_sys = select(bag,’Topic’,"/robo/sys");
topic_data_sys = readMessages(topic_sys);
topic_enc = select(bag,’Topic’,"/robo/enc");
topic_data_enc = readMessages(topic_enc);
topic_slam = select(bag,"Topic","/slam_out_pose");
topic_data_slam = readMessages(topic_slam);
topic_scan = select(bag,"Topic","/velodyne_points");
topic_data_scan = readMessages(topic_scan);
%% SLAM Trajectory – Finding
for i =1:length(topic_data_slam)
yTraj(i,1) = topic_data_slam{i,1}.Pose.Position.X ;
xTraj(i,1) = -topic_data_slam{i,1}.Pose.Position.Y ;
end
xTraj = xTraj – xTraj(1,1);
yTraj = yTraj – yTraj(1,1); Greetings. I am having some issues regarding the Hector SLAM algorithm. I am currently trying to compare the trajectory of a tracked robot: i’m using both the data from the encoders and the SLAM algorithm to track the position of the robot. As you can see from the attached image there are quite some differences from the trajectory calculated with the encoder and the trajectory exported from the Hector SLAM. Moreover the encoder one is more consistent with the actual path of the rover than the SLAM one. As you can see the overall shape of the trajectory is the same, but the SLAM one is scaled in an odd way, and somehow rotated with respect to the encoder one. I was wondering if there was a way to make the SLAM trajectory more consistent with reality or if i am missing something in the matlab enviroment. Can someone plese enlight me about this issue? If needed, of course, i will provide further information. Thanks in advance to everyone interested.
% Load topics
topic_sys = select(bag,’Topic’,"/robo/sys");
topic_data_sys = readMessages(topic_sys);
topic_enc = select(bag,’Topic’,"/robo/enc");
topic_data_enc = readMessages(topic_enc);
topic_slam = select(bag,"Topic","/slam_out_pose");
topic_data_slam = readMessages(topic_slam);
topic_scan = select(bag,"Topic","/velodyne_points");
topic_data_scan = readMessages(topic_scan);
%% SLAM Trajectory – Finding
for i =1:length(topic_data_slam)
yTraj(i,1) = topic_data_slam{i,1}.Pose.Position.X ;
xTraj(i,1) = -topic_data_slam{i,1}.Pose.Position.Y ;
end
xTraj = xTraj – xTraj(1,1);
yTraj = yTraj – yTraj(1,1); slam, trajectory reconstruction, hector slam, ros MATLAB Answers — New Questions