- `st2` - Steer with maximum turning radius and direction in mind.
- `st3` - Reeds and Shepp steer procedure.
- `st4` - Very basic closed-loop simulator.
+- `st5` - Dubins paths.
To disable *OpenMP*, add `-DCMAKE_DISABLE_FIND_PACKAGE_OpenMP=TRUE` to `cmake`
command or to `build.sh` script.
std::vector<RRTNode *> st3(RRTNode *init, RRTNode *goal);
std::vector<RRTNode *> st3(RRTNode *init, RRTNode *goal, float step);
std::vector<RRTNode *> st4(RRTNode *init, RRTNode *goal);
+std::vector<RRTNode *> st5(RRTNode *init, RRTNode *goal);
+std::vector<RRTNode *> st5(RRTNode *init, RRTNode *goal, bool bw);
+std::vector<RRTNode *> st5(RRTNode *init, RRTNode *goal, float step, bool bw);
#endif
along with I am car. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <algorithm>
#include <cmath>
#include "bcar.h"
+#include "dubins.h"
#include "reeds_shepp.h"
#include "steer.h"
#define ST4KI 0
#define ST4KD 0
+#define ST5TURNINGRADIUS 10.82
+#define ST5STEP 0.2
+
std::vector<RRTNode *> st1(RRTNode *init, RRTNode *goal)
{
float angl;
}
return nodes;
}
+
+int cb_st5(double q[3], double t, void *user_data)
+{
+ std::vector<RRTNode *> *nodes = (std::vector<RRTNode *> *) user_data;
+ nodes->push_back(new RRTNode(q[0], q[1], q[2]));
+ return 0;
+}
+
+std::vector<RRTNode *> st5(RRTNode *init, RRTNode *goal)
+{
+ return st5(init, goal, ST5STEP, false);
+}
+
+std::vector<RRTNode *> st5(RRTNode *init, RRTNode *goal, bool bw)
+{
+ return st5(init, goal, ST5STEP, bw);
+}
+
+std::vector<RRTNode *> st5(RRTNode *init, RRTNode *goal, float step, bool bw)
+{
+ std::vector<RRTNode *> nodes;
+ double q0[] = {init->x(), init->y(), init->h()};
+ double q1[] = {goal->x(), goal->y(), goal->h()};
+ DubinsPath path;
+ if (bw)
+ dubins_shortest_path(&path, q1, q0, ST5TURNINGRADIUS);
+ else
+ dubins_shortest_path(&path, q0, q1, ST5TURNINGRADIUS);
+ dubins_path_sample_many(&path, step, cb_st5, &nodes);
+ if (bw)
+ std::reverse(nodes.begin(), nodes.end());
+ return nodes;
+}