Exeption at end of navigation moving.

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

Moderators: imaqine, 99jonathan, roger

New User
Posts: 4
Joined: Thu Feb 13, 2014 5:37 pm

Exeption at end of navigation moving.

Postby BabCom » Thu Feb 13, 2014 5:57 pm

Hi people,
i have run in a problem that i cant solve by my selfe.(so i think ^^)
I try to run a navigator, but e very time at the end of the path the NXT is popping up an exeption and stops.

Code: Select all

public class navi {

   private static NXTRegulatedMotor M1;
   private static NXTRegulatedMotor M2;
   private static DifferentialPilot pilot;
   private static OdometryPoseProvider odp;
   private static Navigator navi;
   private static NavigationListener NL;
   private static Path path;
   private static Pose currentPose; //Positions interface des Roboters
   private static Waypoint wayPoint;
   public static void main(String[] args){
       M1 = new NXTRegulatedMotor(MotorPort.A);//links
       M2 = new NXTRegulatedMotor(MotorPort.B);//rechts
       pilot = new DifferentialPilot(56,162, M1, M2,  true);
       odp = new OdometryPoseProvider(pilot);
       navi = new Navigator(pilot, odp);
       path = new Path();
       currentPose = new Pose(0, 0, 90);
       wayPoint = new Waypoint(500, 350, 90);

i dont know why it broken have i somethingvorgotten?

I use NXT firmware 0.9.1
and the same API Version

thanks BabCom

Edit: I have always test a while and figure out that the error occures at (method 230:88) lejos.robotics.navigation.Navigator.callListeners(). what can be the reason for this exeption?

New User
Posts: 4
Joined: Thu Feb 13, 2014 5:37 pm

Re: Exeption at end of navigation moving.

Postby BabCom » Fri Feb 14, 2014 3:55 pm

for my understanding:
this are the steps i need to do to run a navigator: (Please korret me if i do some wrong stuff^^)
A MoveController like the DifferentialPilot(with Motors so on)
A poseProvider like the OdometryPoseProvider
the navigator
A navigationListener(is this necessary?)
A Path to crealte an Path:
A Waypoint to set the path
A Pose to handle the position of the robot.

at firt i make a Pilot then give the pilot the poseProvider. As next i create the Navigator and set as the Constructor arguments the pilot, and the poseProvider.
at the last i set the navigationListener.

Now i need only a valid path to start moving. (i think here can be my problem??)
to get a valid path i need to set a waypoint like this wayPoint = new Waypoint(500, 350, 90); (bot is heading to the y axis).
Then i have to add the waypoint to the path withe the path.addWaypoint(wayPoint);
Now i only have to start the navigator by calling navi.followPath(path);.

I think thats the simples way t orun a navigator class do i somthing wrong??

MfG BabCom

Return to “NXJ Software”

Who is online

Users browsing this forum: No registered users and 6 guests