Robot following another robot

Post your NXJ projects, project ideas, etc here!

Moderators: roger, 99jonathan, imaqine

Robot following another robot

Postby ragezor » Tue Nov 13, 2012 1:40 am

So we made a line follower robot and wall follower robot. Now we need a robot that follows the first two robots without any sensors just by communicating via bluetooth.

We are currently sending tacho counts of wheels to follower robot periodically. The problem is the movement is very abrupt because the robot breaks and accelerates in between moves.

My question is this also the problem with DifferentialPilot, and can we somehow smoothen the transition between moves? Can you somehow record a path made with first robot without having to use DiffPilot since we are using PID and Power controlled motors for line and wall following?

We looked into it and we can't find how to tell NXTRegulatedMotor to go into floating mode, so now after rotate() method he stops and then accelerates even though he has the next action in the queue. We could set acceleration low but this reduces speed of the robot.

We will release the code and document it when the competition at our school ends :)
ragezor
New User
 
Posts: 1
Joined: Tue Nov 13, 2012 1:23 am

Re: Robot following another robot

Postby skyminer » Wed Jan 23, 2013 6:37 pm

Not sure if you still need help:

How accurate does the follower have to be?
If it only needs to be approximate, then calculate the distance traveled in x and y coordinates. Then, do a little trig (you can find it on Wikipedia), and figure out the angle the robot would have to travel to get from its current location to that location, and the distance to do so. Do this process every 5-ish seconds. Decrease the time for more accuracy, increase the time for less "joltyness".
Otherwise, I checked the API and it says to use [NXTRegulatedMotor].flt() or [NXTRegulatedMotor].flt([boolean immediateReturn]) to set it to float. This acts the same way as stop, however, it does cause it to coast rather than perform a dead stop. Tell it to continue moving and it will go right ahead. I suppose you may want to use this one, but, as a warning, as it does coast past the point where you told it to stop, there will be some inaccuracy.
skyminer
New User
 
Posts: 2
Joined: Sun Dec 02, 2012 7:28 pm

Re: Robot following another robot

Postby roger » Sun Jan 27, 2013 11:47 pm

Take a look at the OdometryPoseProvider which uses the tacho counts of the motors to update the robot pose, and the Navigator class that takes the robot through a sequence of waypoints.
roger
Moderator
 
Posts: 307
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA


Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff