Page History
This code will let your vehicles In this first example we show you how to write your code in C++ how to geht your code to work in the Lab Control Center. Using this example code your vehicles will drive in a circle (not attached to the map). The code also includes a possible solution to drive a figure eight in the (see code comments).Procedure:
General Procedure to run let your vehicles drive
- Write your code in C++ or Matlab
- Compile it, if you use C++
- Upload it to the LCC (see here)
- Press "deploy"
Code description
You define the position of the target points, the speed of your vehicle for each section and the time the vehicle needs to pass a segment. In this example the target points are not connected to the map.Source Code explanation:
This vector defines the x position of a target point (m):
...
- Define the vector of your current point so that the tangent will fit with the vector/tangent from the previous point
- Be aware that the shape of the curve is not only affected by the vector of the starting point but also of the vector at the end point/next starting point
- use always a speed for both dimensions (even it is only a very small value) to ensure the right tilt of your curve. → Draw your shape first and define the signs of your vectors. It turned out to be the easiest way to ensure the right orientations.
- Remember that your are giving a trajectory to a physical system so sharp edges won't be possible
C++
Circular trajectory generation for one vehicle
MATLAB
Circular trajectory generation for one vehicle
...
Overview
Content Tools