LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pure Pursuit AVC (Active Vehicle Controller)

Solved!
Go to solution

Hello:

To finish my project I am trying to implement a pure pursuit algorithm. My problem it is that in theory the code should work but when doing a field test it **bleep**s-up. The problem is that the steering angle it calculates are completely wrong. I really want and need to solve it but I don't know how. (I can't even get a straight line in a field test)

To know:

*The GPS sends the heading(orientation of the front of the vehicle) in radians from pi to -pi
*The GPS sends coordinates X and Y in an already defined plane of the corresponding UTM, sending the current position in meters away from (0,0).
*The GPS also sends the current speed, yet this is constant and is just for checking that the can message sent is retaining the current speed.
*The vehicle is an SUV, front steering, 4WD almost 4meters long 2 wide.
* On (0,0) facing forward -Y == right, X == forward,and the heading ==0
* Recorded paths by the path recording program have a minimum distance between them  of S, S=Kla*VehicleLength/12, (kla(is look ahead point constant))

*The vehicle has a relation from -40 to 40 deg answering to α ≈ 15.26108* δ, where δ(steering angle of the outer wheel) and α (steering wheel angle); resulting in a propulsion gain of 1.
*Real Position and heading is received in real time from the bus can 500kbd

*The Angle is send to the robot through the CAN BUS (This works the robot receives the wrong angle my program calculates)

 

Note: For it to run, Add the matlab codes attached to your labview matlab directory

Download All
0 Kudos
Message 1 of 12
(5,589 Views)

I probably would have chose to implement the algorithm in LabVIEW. Currently, your VI has basically no graphical code. Did you write this code from scratch or is this downloaded from somewhere?

 

If you think that the problem is with your Mathscript code, let me know if I should move your post over to the Mathscript forum. Would seem more appropriate.

0 Kudos
Message 2 of 12
(5,541 Views)

My main problem is I don't know where my error or mistake comes from. The matlab code in theory works, but apparently in real life it does not. I am asking because I am stuck and unable to understand why and what it does not work on my program

 

😞

 

 

0 Kudos
Message 3 of 12
(5,538 Views)

For example if my heading is PI/4 and i want to go from -1,-1 to 1,1 and then to 2,2 and to 3,3 and so on the angle is 0
If my heading is PI/2 I could move on in Y and the angle remains 0
and the contrary for -Pi/2
if the heading is 0 it should move on X forward with no problem

 

When I try to do this in real life it fails miserably....

0 Kudos
Message 4 of 12
(5,530 Views)

Also is there a through labview implemented pure pursuit?

that would be great help tbh!

0 Kudos
Message 5 of 12
(5,528 Views)

Can you put some reasonable default values into your control, save them as default, and re-attach your toplevel VI?

 

Your VI takes an array of x and y, but only outputs a single value.

 

As a first step add some graphical output to show the path input and result vector, eg. in an xy graph. It is much harder to troubleshoot just staring at numbers.

0 Kudos
Message 6 of 12
(5,525 Views)

Yes the value is the steering wheel angle to apply that is the only output; I don't know how to define defaults for an array. As for vehicle length any number bigger than 1 will work, Lookahead=7 works fine for tryouts, Then depending on the angle of the heading increase the direction you want to go in. As I explained before angle 0 will mean the vehicle is forward on the X angle.

0 Kudos
Message 7 of 12
(5,513 Views)

To define default values, enter the values and then right click on the control or indicator and click Data Operations > Make Current Value(s) Default.

 

Alternatively, you can go to the Edit menu and select Edit > Make Current Values Default, which will make the values default for all controls.

 

With regards to the output - it does seem hard to see what this really has to do with LabVIEW (although it is an interesting problem). 


GCentral
0 Kudos
Message 8 of 12
(5,491 Views)

I've never seen a pure pursuit implemented through LabVIEW (It's not impossible, though. Maybe you could do it), but there are several path planning VIs that may suit your application:

http://zone.ni.com/reference/en-XX/help/372983C-01/lvrobovi/path_planning_pal/

 

Kudos are welcome Robot Very Happy

Kudos are welcome 😉 marked solutions are awesome!
0 Kudos
Message 9 of 12
(5,443 Views)
Solution
Accepted by topic author LP_C

Actually it now works, I only have the basic labview and the mathscript I don't think I have the tools you linked

 

Anyway... I attach my solution

0 Kudos
Message 10 of 12
(5,431 Views)