making a right turn

Post your NXJ projects, project ideas, etc here!

Moderators: 99jonathan, roger, imaqine

making a right turn

Postby ayilma » Sat Feb 09, 2008 9:38 pm

I am trying to make a simple right turn. I tried setting the speed of the two motors to different speeds but then it just goes in circles. Does anybody have any idea?
ayilma
New User
 
Posts: 4
Joined: Fri Dec 21, 2007 6:26 am

Right turn

Postby ft.zimmermann » Sun Feb 10, 2008 12:28 pm

Why don't you use pilot.steer?
ft.zimmermann
Novice
 
Posts: 35
Joined: Sat Sep 01, 2007 7:18 pm
Location: Hamburg, Germany

Postby jmernin » Wed Jun 04, 2008 9:26 pm

I use pilot.rotate(90) to cause a right turn and this works for me. There are of course issues with the accuracy of the rotation which are well documented on other threads of this forum. But nevertheless, the Pilot class is your best bet for this sort of thing.
jmernin
New User
 
Posts: 23
Joined: Thu Jan 17, 2008 11:52 pm

Postby roger » Thu Jul 03, 2008 4:02 pm

Hi Jmernin,
jmernin wrote:I use pilot.rotate(90) to cause a right turn and this works for me. There are of course issues with the accuracy of the rotation which are well documented on other threads of this forum. But nevertheless, the Pilot class is your best bet for this sort of thing.

Interesting. The rotate( int angle) method in Pilot assumes that a positive angle will increase the angle in which robot is heading. All the Pilot and Navigator methods use polar coordinates in which angle 0 is the direction of the X axis and +90 is the Y axis. So rotate(90) should cause a rotation to the left.
roger
Moderator
 
Posts: 358
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Postby jmernin » Fri Aug 29, 2008 11:08 pm

My apologies, you are correct. pilot.rotate(90) does indeed cause a left turn. However, I think you can use pilot(-90) to make a right turn instead.
jmernin
New User
 
Posts: 23
Joined: Thu Jan 17, 2008 11:52 pm


Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff