How to simgetObjectPosition() to match the coordinate of the robot given on the screen?

Typically: "How do I... ", "How can I... " questions
Post Reply
lukecam95
Posts: 10
Joined: 27 Feb 2017, 16:55

How to simgetObjectPosition() to match the coordinate of the robot given on the screen?

Post by lukecam95 »

Hi,

I am simulating khepera III robots, and am using the coordinate given on the screen as the absolute position starting point for each robot, however since I am noticing some errors in odometry, I wish to plot the difference in the actual and reported coordinate of each robot. Hence, I proceeded to use the simgetObjectPosition() function while passing k3Handle and -1 as arguments (k3Handle is the handle of the khepera robot and -1 since I want a absolute coordinate). However, I am getting completely different readings from the output of the function when compared to the screen robot coordinate.

Can you provide any insight into this issue?

thanks,
Luke

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: How to simgetObjectPosition() to match the coordinate of the robot given on the screen?

Post by coppelia »

Hello Luke,

I suspect that you try to compare the position of two different objects: make sure you select (in the scene hierarchy) the exact same object as the one you are using to get the position. If you can't figure out, then please post your scene.

Cheers

Post Reply