[Rock-dev] base::Angle

Jakob Schwendner jakob.schwendner at dfki.de
Fri Apr 12 12:37:29 CEST 2013


maybe range is not the right term here. Segment on the circle would be better,
and you can very well define a segment in the canonical form I should think. One
way of getting around the corner case from Janosch could be to have a
isInSegment(start, size) method, which actually takes the size of the segment,
which could be 2PI, since its not an angle.

On April 12, 2013 at 12:24 PM Sylvain Joyeux <sylvain.joyeux at dfki.de> wrote:
> On 04/12/2013 12:13 PM, Janosch Machowinski wrote:
> > And another interesting question :
> > Angle start(0);
> > Angle end(2*M_PI)
> >
> > Angle foo(M_PI);
> > foo.isInRange(start,end);
> >
> > returns the same as :
> > Angle start(0);
> > Angle end(0)
> >
> > Angle foo(M_PI);
> > foo.isInRange(start,end);
> >
> > How to fix this ?
> As I guess you already knew, Angle normalizes to -PI, PI (as it should
> be), so if you want the whole range you need to test against [-PI,PI]
>
> My guess would be that, if you really want to handle that case, you will
> have to create a new class AngleRange that is initialized from
> non-normalized angles, e.g.
>
> range = Angle::Range(0, 2*PI) => this internally normalizes to -PI,PI
> range.testInRange(angle)
>
> --
> Sylvain Joyeux (Dr.Ing.)
> Senior Researcher
>
> Space & Security Robotics
> Underwater Robotics
>
> !!! Achtung, neue Telefonnummer!!!
>
> Standort Bremen:
> DFKI GmbH
> Robotics Innovation Center
> Robert-Hooke-Straße 5
> 28359 Bremen, Germany
>
> Phone: +49 (0)421 178-454136
> Fax: +49 (0)421 218-454150
> E-Mail: robotik at dfki.de
>
> Weitere Informationen: http://www.dfki.de/robotik
> -----------------------------------------------------------------------
> Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
> Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
> Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
> (Vorsitzender) Dr. Walter Olthoff
> Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
> Amtsgericht Kaiserslautern, HRB 2313
> Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
> USt-Id.Nr.: DE 148646973
> Steuernummer: 19/673/0060/3
> -----------------------------------------------------------------------
>
> _______________________________________________
> Rock-dev mailing list
> Rock-dev at dfki.de
> http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
--
Jakob Schwendner, M.Sc.
Researcher

DFKI Bremen
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 17845-4120
Fax: +49 (0)421 17845-4150
E-Mail: jakob.schwendner at dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/673/0060/3
-----------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.dfki.de/pipermail/rock-dev/attachments/20130412/57e4ffbe/attachment.htm 


More information about the Rock-dev mailing list