## Re: [Playerstage-users] Turn exactly 90 degrees?

 Re: [Playerstage-users] Turn exactly 90 degrees? From: Richard Vaughan - 2010-08-19 07:45:48 ```Sometimes questions here sound a lot like homework assignments. If you suspect a homework assignment, please give general advice only, and not big chunks of code. In general, it's impossible to turn _exactly_ 90 degrees. The challenge is to turn as close to 90 degrees as you need. Look up proportional (P) control, or, if delays are large, PD control. Richard/ On Thu, Aug 19, 2010 at 2:47 AM, JayF wrote: > > I'm with the same doubt > I tried to change the code laserobstaclevoid and the closest I came was: >      // Modelo de movimentação do robo pelo ambiente >      std::cout << "minR: " << minR >                << "minL: " << minL >                << std::endl; > >      double l = (1e5*minR)/500-100; >      double r = (1e5*minL)/500-100; > >      if (l > 100) >        l = 100; >      if (r > 100) >        r = 100; > >      newspeed = (r+l)/1e3; >      std::cout << "r: " << r >                << "l: " << l >                << std::endl; > >                        newturnrate = (r-l); > >                        if (r>l) >                                newturnrate = 90.0; >                        if(r                                newturnrate = -90.0; > >      //newturnrate = limit(newturnrate, -40.0, 40.0); >      newturnrate = dtor(newturnrate); > >      std::cout << "speed: " << newspeed >                << "turn: " << newturnrate >                << std::endl; > > > > But it still does not follow the strict guidelines of the 90-degree turn! > > > if someone can help me! > thanks! > John felipe > > Fernando Zuher wrote: >> >> >> Hello, >> >> My example is that: >> The robot is moving in the ambient. In a moment the robot detects a >> obstacle (through for a laser) so close to it. So it turns exactly 90 >> degrees (because of a obstacle). >> >> I want that it turns exactly 90 degrees when it turns and the robot shall >> to continue moving after of that turning. >> >> How could I do that? >> >> Regards, >> Fernando - Brazil >> _________________________________________________________________ >> Você sabia que pode acessar o Messenger direto do seu Hotmail? Descubra >> como! >> http://www.microsoft.com/brasil/windows/windowslive/products/tutoriais.aspx >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and stay >> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >> http://p.sf.net/sfu/devconference >> _______________________________________________ >> Playerstage-users mailing list >> Playerstage-users@... >> https://lists.sourceforge.net/lists/listinfo/playerstage-users >> >> > > -- > View this message in context: http://old.nabble.com/Turn-exactly-90-degrees--tp26110235p29477770.html > Sent from the playerstage-users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Playerstage-users mailing list > Playerstage-users@... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > -- Richard Vaughan Autonomy Lab / Computing Science / Simon Fraser University ```

 [Playerstage-users] Turn exactly 90 degrees? From: Fernando Zuher - 2009-10-29 10:03:11 Attachments: Message as HTML ```Hello, My example is that: The robot is moving in the ambient. In a moment the robot detects a obstacle (through for a laser) so close to it. So it turns exactly 90 degrees (because of a obstacle). I want that it turns exactly 90 degrees when it turns and the robot shall to continue moving after of that turning. How could I do that? Regards, Fernando - Brazil _________________________________________________________________ Você sabia que pode acessar o Messenger direto do seu Hotmail? Descubra como! http://www.microsoft.com/brasil/windows/windowslive/products/tutoriais.aspx```
 Re: [Playerstage-users] Turn exactly 90 degrees? From: JayF - 2010-08-19 01:47:56 ```I'm with the same doubt I tried to change the code laserobstaclevoid and the closest I came was: // Modelo de movimentação do robo pelo ambiente std::cout << "minR: " << minR << "minL: " << minL << std::endl; double l = (1e5*minR)/500-100; double r = (1e5*minL)/500-100; if (l > 100) l = 100; if (r > 100) r = 100; newspeed = (r+l)/1e3; std::cout << "r: " << r << "l: " << l << std::endl; newturnrate = (r-l); if (r>l) newturnrate = 90.0; if(r > > Hello, > > My example is that: > The robot is moving in the ambient. In a moment the robot detects a > obstacle (through for a laser) so close to it. So it turns exactly 90 > degrees (because of a obstacle). > > I want that it turns exactly 90 degrees when it turns and the robot shall > to continue moving after of that turning. > > How could I do that? > > Regards, > Fernando - Brazil > _________________________________________________________________ > Você sabia que pode acessar o Messenger direto do seu Hotmail? Descubra > como! > http://www.microsoft.com/brasil/windows/windowslive/products/tutoriais.aspx > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Playerstage-users mailing list > Playerstage-users@... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > > -- View this message in context: http://old.nabble.com/Turn-exactly-90-degrees--tp26110235p29477770.html Sent from the playerstage-users mailing list archive at Nabble.com. ```
 Re: [Playerstage-users] Turn exactly 90 degrees? From: Richard Vaughan - 2010-08-19 07:45:48 ```Sometimes questions here sound a lot like homework assignments. If you suspect a homework assignment, please give general advice only, and not big chunks of code. In general, it's impossible to turn _exactly_ 90 degrees. The challenge is to turn as close to 90 degrees as you need. Look up proportional (P) control, or, if delays are large, PD control. Richard/ On Thu, Aug 19, 2010 at 2:47 AM, JayF wrote: > > I'm with the same doubt > I tried to change the code laserobstaclevoid and the closest I came was: >      // Modelo de movimentação do robo pelo ambiente >      std::cout << "minR: " << minR >                << "minL: " << minL >                << std::endl; > >      double l = (1e5*minR)/500-100; >      double r = (1e5*minL)/500-100; > >      if (l > 100) >        l = 100; >      if (r > 100) >        r = 100; > >      newspeed = (r+l)/1e3; >      std::cout << "r: " << r >                << "l: " << l >                << std::endl; > >                        newturnrate = (r-l); > >                        if (r>l) >                                newturnrate = 90.0; >                        if(r                                newturnrate = -90.0; > >      //newturnrate = limit(newturnrate, -40.0, 40.0); >      newturnrate = dtor(newturnrate); > >      std::cout << "speed: " << newspeed >                << "turn: " << newturnrate >                << std::endl; > > > > But it still does not follow the strict guidelines of the 90-degree turn! > > > if someone can help me! > thanks! > John felipe > > Fernando Zuher wrote: >> >> >> Hello, >> >> My example is that: >> The robot is moving in the ambient. In a moment the robot detects a >> obstacle (through for a laser) so close to it. So it turns exactly 90 >> degrees (because of a obstacle). >> >> I want that it turns exactly 90 degrees when it turns and the robot shall >> to continue moving after of that turning. >> >> How could I do that? >> >> Regards, >> Fernando - Brazil >> _________________________________________________________________ >> Você sabia que pode acessar o Messenger direto do seu Hotmail? Descubra >> como! >> http://www.microsoft.com/brasil/windows/windowslive/products/tutoriais.aspx >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and stay >> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >> http://p.sf.net/sfu/devconference >> _______________________________________________ >> Playerstage-users mailing list >> Playerstage-users@... >> https://lists.sourceforge.net/lists/listinfo/playerstage-users >> >> > > -- > View this message in context: http://old.nabble.com/Turn-exactly-90-degrees--tp26110235p29477770.html > Sent from the playerstage-users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Playerstage-users mailing list > Playerstage-users@... > https://lists.sourceforge.net/lists/listinfo/playerstage-users > -- Richard Vaughan Autonomy Lab / Computing Science / Simon Fraser University ```