leJOS Navigator can't change movment speed

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

leJOS Navigator can't change movment speed

Postby BabCom » Thu Apr 24, 2014 1:51 pm

Hi guys,
i hav a problem with my bot.
I used a leJOS Navigator with an Differential Pilot and an Odometry Pose Provider.
Code: Select all
public class Movement {
.
.
.
   private Navigator nav;
   private NXTRegulatedMotor M1;
   private NXTRegulatedMotor M2;
   private DifferentialPilot pilot;
   private OdometryPoseProvider odp;
   private NavigationListener NL;
   private Pose currentPose; //Positions interface des Roboters
.
.
.

    public int init(float wheeldiameter, float trackwidth, float speed, float turnSpeed,
                float xMax, float yMax, float adjustmentDistance, float angel,
                float xStart, float yStart){
      
       M1 = new NXTRegulatedMotor(MotorPort.A);//links
       M2 = new NXTRegulatedMotor(MotorPort.B);//rechts
       pilot = new DifferentialPilot(wheeldiameter,trackwidth, M1, M2);
       odp = new OdometryPoseProvider(pilot);
       pilot.addMoveListener(odp);
       nav = new Navigator(pilot, odp);
       currentPose = new Pose(xStart, yStart, angel);
       odp.setPose(currentPose);//Position aktualisieren
       //Startposition aktualisieren;
       this.speed = speed;
       this.turnSpeed = turnSpeed;
      
.
.
.
       pilot.setTravelSpeed(speed);
       pilot.setRotateSpeed(turnSpeed);
       return 0;
.
.
.
   }

my problem is, if i use the navigator to move my bot it is moving verry fast. And i cant change the movment speed:(
if i use the pilot it works fine.

wheeldiameter: 5,6 cm
//7 this is only a test values ^^
speed: 7
turnspeed: 30^

so what have i to do, to change the travelspeed while following an setet path?

hope someone can help me,
MfG BabCom
BabCom
New User
 
Posts: 4
Joined: Thu Feb 13, 2014 5:37 pm

Re: leJOS Navigator can't change movment speed

Postby gloomyandy » Thu Apr 24, 2014 2:07 pm

I think you need to explain a little more what your problem is. What exactly does not work? What is it you do and what is you expect to happen? Does the posted code do what you want it to do? Post the code that works and the code that doesn't and tell us what you expect to happen and what actually happens.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4180
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS Navigator can't change movment speed

Postby BabCom » Thu Apr 24, 2014 2:53 pm

Hi,
I have two diffrent modes to move my bot.
The fist mode, i search the ball. for this movement i use directly the pilot. This works fine.
The second mode i use to travel to predefinded positions on the playingground.
this mode i used first.

But if i set a path an then try to use the nav.travelPath() function it dont work(?).
My bot is moving but its moves in this mode verry fast. not the speed i set.
( pilot.setTravelSpeed(speed);
pilot.setRotateSpeed(turnSpeed);)
Have i set an extra speed value in the Navigator Object?
BabCom
New User
 
Posts: 4
Joined: Thu Feb 13, 2014 5:37 pm

Re: leJOS Navigator can't change movment speed

Postby gloomyandy » Fri Apr 25, 2014 8:30 am

You should not have to set a sped on the navigator just on the pilot being used by the navigator. I assume you only have a single pilot? It is not a good idea to have more than one. Please post and example of your code showing how you are creating the navigator and pilot, and code that shows how you are using them along with a description of what actually happens.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4180
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff