05-14-2017 09:14 AM
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
Solved! Go to Solution.
05-14-2017 11:39 AM
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.
05-14-2017 11:48 AM
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
😞
05-14-2017 12:06 PM
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....
05-14-2017 12:11 PM
Also is there a through labview implemented pure pursuit?
that would be great help tbh!
05-14-2017 12:29 PM
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.
05-14-2017 02:57 PM
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.
05-14-2017 07:58 PM - edited 05-14-2017 07:59 PM
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).
05-16-2017 10:41 AM
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
05-17-2017 02:26 AM
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