bugGNU Octave - Bugs: bug #39521, quaternion/q2rot gives incorrect...

 
 

bug #39521: quaternion/q2rot gives incorrect result in some cases

Submitter:  None
Submitted:  Thu 18 Jul 2013 10:15:17 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Max Katsev Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.4
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 01 Nov 2013 05:33:24 AM UTC, comment #2: 

The problem is solved in the latest release, quaternion-2.0.3:

http://octave.sourceforge.net/quaternion/index.html

Thanks for your patience.

Lukas Reichlin <paramaniac>
Sun 27 Oct 2013 04:15:46 PM UTC, comment #1: 
Juan Pablo Carbajal <juanpi>
Group Member
Thu 18 Jul 2013 10:15:17 PM UTC, original submission:  

The function q2rot contains the following code:

  if (abs (theta) > pi)
    theta = theta - sign (theta) * pi;
  endif


I'm not sure what the purpose of this is (maybe force the output to be in [-pi/pi] range?), but it results in incorrect values if abs(theta)>pi, since it changes the angle by pi. This happens when q.w is negative.

Here is a test case:

[ax,an]=q2rot(rot2q([0, 1, 0], 6))
ax =

   0   1   0

an =  2.8584

Here 2.8584 rad is obviously a different rotation from 6 rad.

To fix the bug, the offending lines should be either removed completely, or (if the intention was to have the [-pi, pi] output range, replaced by

  if (abs (theta) > pi)
    theta = theta - sign (theta) * 2 * pi;
  endif


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by paramaniac (Posted a comment)
  • -email is unavailable- added by juanpi (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-01 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code