Subject:
|
Re: Rover Programming
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Thu, 27 Jun 2002 13:27:37 GMT
|
Original-From:
|
Simon Brooke <SIMON@JASMINE.ORG.UKspamless>
|
Reply-To:
|
simon@jasmine.NOMORESPAMorg.uk
|
Viewed:
|
947 times
|
| |
| |
On Thursday 27 Jun 2002 2:04 pm, David Martineau wrote:
> In lugnet.robotics, simon@jasmine.org.uk writes:
> > Essentially I think you need a 'home' location which the robot can
> > recognise (perhaps with a uniquely coloured floor tile), and which
> > it can regularly return to - i.e. drive to where you think home
> > should be, then drive around in a spiral till you find it, then
> > reset your co-ordinates.
>
> While we're talking about programming rovers, could someone give me
> an example of a 'spiral drive around behavior' in either RCX Code
> (v1.5) or Gordon's Brick Programmer? Or how about code with two
> rotation sensors attached to the differential-drive robot's wheels
> which drive straight forward a certain # of clicks,clears the count,
> turns left 90 deg., clears the count, goes forward a little bit more,
> clears again, then turns right 90 deg.?
Try this (leJos):
import josx.platform.rcx.*;
import josx.util.*;
import josx.robotics.Navigator;
public class Test
{
public static void main (String[] arg)
throws Exception
{
int size = 100;
Navigator nav = new
RotationNavigator( ( float)8.5, // wheel diameter in cm
( float)10.5, // track in cm
( float)5.0); // gearing ratio between
// wheel and rotation sensor
nav.gotoPoint( size, 0);
nav.gotoPoint( size, size);
nav.gotoAngle( 0);
nav.stop();
System.exit( 0);
}
}
--
simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/
;; when in the shit, the wise man plants courgettes
|
|
Message is in Reply To:
| | Re: Rover Programming
|
| (...) While we're talking about programming rovers, could someone give me an example of a 'spiral drive around behavior' in either RCX Code (v1.5) or Gordon's Brick Programmer? Or how about code with two rotation sensors attached to the (...) (22 years ago, 27-Jun-02, to lugnet.robotics)
|
24 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|