ggazzo / opennero

Automatically exported from code.google.com/p/opennero
Other
0 stars 0 forks source link

Roomba module.py: agent.state.rotation.z values out of range #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Inspect the values in agent.state.rotation.z at line 381 in Roomba module.py 

What is the expected output? What do you see instead?
The expected range of values is [-180,180]. I observed several values lesser 
than -500.

What version of the product are you using? On what operating system?
I'm using Linux, and checked out version 403 from /branches/merge/

Please provide any additional information below.
A quick fix for the subsequent lines of code that depend on 
agent.state.rotation.z to be in the correct range could be to insert the 
following code after line 381 (angle = degrees(atan2(disty, distx)) - 
agent.state.rotation.z):

sign = 1
if angle < 0:
    sign = -1
angle = sign * (fabs(angle) % 360)

However, this fix still doesn't address any issues that might arise in the rest 
of the code due to agent.state.rotation.z being out of range.

Original issue reported on code.google.com by karunra...@gmail.com on 22 Jun 2010 at 10:10

GoogleCodeExporter commented 9 years ago
Looking into this...

Original comment by ikarpov on 7 Jul 2010 at 3:40

GoogleCodeExporter commented 9 years ago
Revision 442 should fix this by applying a function wrap_degrees on agent 
rotation. This ensures rotation.z is between -180 and 180 degrees. Please 
verify.

Original comment by ikarpov on 11 Aug 2010 at 7:15