mubeipeng / objectSLAM

75 stars 27 forks source link

matlab tips #2

Open JadBatmobile opened 6 years ago

JadBatmobile commented 6 years ago

the odoms(1,:) and odoms(2,:) fields are not filled in the generateSimdata.m script. Only odoms(3,:) is.

That means that the mainSimulation will not work with new data.

Should i add the lines:

odoms(i,1)=truth_traj(i,1); odoms(i,2) = truth_traj(i,2);

to line 37 in generateSim.data?

Thanks

JadBatmobile commented 6 years ago

I added those lines.. The algorithm does not converge on my dataset however. Can you perhaps review generateSim.data? The algorithm works on the data you provide in simulation.mat... but any other attempts have failed.

JadBatmobile commented 6 years ago

Also, I received this error when running generateSim.data:

Array indices must be positive integers or logical values.

Error in Processer/setupobjects (line 29) obj.objects(i).P(lm_edge.label(i))=1;

I had to change line 64 from:

lm_edge.label=[lm_edge.label truth_objects(idx,3)'];

to: lm_edge.label=[lm_edge.label truth_objects(idx,3)'+1];

Havling zeros in lm_edge.label causes Processer.m to fail.

mubeipeng commented 6 years ago

When the window pop out, you are supposed to click a few waypoints, which represents the trajectory of the robot. If you skip that step, the trajectory would be empty and there would be problems

JadBatmobile commented 6 years ago

Yes, but the problem is that node_edge.dpos(:,i)= R'*(odoms(i,1:2)-odoms(i-1,1:2))'

But odoms(1:2) are empty! So node_edge.dpos ends up being empty, and therefore the data cannot be used...

In the code:

for i=1:length(truth_traj)-1 odoms(i,3)=atan2(truth_traj(i+1,2)-truth_traj(i,2),truth_traj(i+1,1)-truth_traj(i,1)); end odoms(end,3)=odoms(end-1,3);

Notice that odoms(i,3) are filled, but odoms (i,1) and odoms(i,2) are not! So node_edge.dpos is not filled.

JadBatmobile commented 6 years ago

In my application, i have a bunch of pose and observation data. The pose is w.r.t to a global reference frame (like truth_traj in your code). The observations are w.r.t to the vehicle.

I need to translate these readings to node_edge and lm_edge objects for utilizing with your framework.

I am having trouble doing this translation. I am looking at your simulation.mat provided file, and i can't seem to relate node_edge.dpos / dtheta with the truth_traj provided.

For example, truth_traj as theta values -3.1298 for the first 7 index.. however node_edge.dtheta is non-zero for those index. How can that be?

Ethan-Zhou commented 5 years ago

I come across the same issue as @JadBatmobile does. The generateSimData.m does not work as expected. Also, the definition of the orientation seems not correct. How is the rotation matrix defined? R_w_c or R_c_w? Finally, the visualization of the groundtruth is somehow 180-deg flipped compared to the one shown in your arxive paper. Please fix these problems!!

heemonsu commented 5 years ago

I faced the same problem and have fixed the issues as best as I could. I have added a pull request for the same, but I guess this repository isn't maintained anymore by the author. If anyone is interested, you can take a look at my forked version of this repo. I have also added comments to explain some parts of the code.

mubeipeng commented 5 years ago

Thanks for the question and updates on the code! Yes I don't have much time maintaining the code as of now... The flow of the simulation is as follows: (1) system randomly generates some landmarks (2) the screen pop up and the user designs a trajectory with the generated landmarks by clicking a sequence of waypoints on the graph, press enter to finish the process. (3) the system will then simulate observations with the newly generated landmarks and trajectory.

My guess is you it gets stuck on generating the trajectory? It's a user interface but without enough instructions...

On Sat, Dec 15, 2018 at 7:07 AM Himanshu Raghuvanshi < notifications@github.com> wrote:

I faced the same problem and have fixed the issues the issues as best as I could. I have added a pull request for the same, but I guess this repository isn't maintained anymore by the author. If anyone is interested, you can take a look at my forked version of this repo.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BeipengMu/objectSLAM/issues/2#issuecomment-447505532, or mute the thread https://github.com/notifications/unsubscribe-auth/AQY9q1pGm4sdmal_7kyUPL2rUNeGZvZ7ks5u5C83gaJpZM4U4bMg .