Skip to content

Commit

Permalink
[Fix] Solve multiple ik_geo header inclusions by adding '#pragma once'.
Browse files Browse the repository at this point in the history
  • Loading branch information
lmunier committed Nov 18, 2024
1 parent a626ce5 commit 1415c93
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions include/ik_geo.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once

#include <array>
#include <vector>
Expand All @@ -8,10 +9,13 @@ extern "C" {
struct Robot;
void deallocate(Robot *robot);
Robot *gen_six_dof(const double *h, const double *p);
void ik(const Robot *robot, const double *rotation, const double *translation,
std::size_t *n_solutions, double *qs, bool *is_ls);
void fk(const Robot *robot, const double *qs, double *rot_matrix,
double *pos_vector);
void ik(const Robot *robot,
const double *rotation,
const double *translation,
std::size_t *n_solutions,
double *qs,
bool *is_ls);
void fk(const Robot *robot, const double *qs, double *rot_matrix, double *pos_vector);
Robot *irb6640();
Robot *spherical(const double *h, const double *p);
Robot *spherical_bot();
Expand Down Expand Up @@ -44,33 +48,25 @@ class Robot {
static Robot spherical_bot() { return Robot(lib::spherical_bot()); }
static Robot three_parallel_bot() { return Robot(lib::three_parallel_bot()); }
static Robot ur5() { return Robot(lib::ur5()); }
static Robot spherical(const double *h, const double *p) {
return Robot(lib::spherical(h, p));
}
static Robot spherical(const double *h, const double *p) { return Robot(lib::spherical(h, p)); }
static Robot spherical_two_intersecting(const double *h, const double *p) {
return Robot(lib::spherical_two_intersecting(h, p));
}
static Robot spherical_two_parallel(const double *h, const double *p) {
return Robot(lib::spherical_two_parallel(h, p));
}
static Robot three_parallel(const double *h, const double *p) {
return Robot(lib::three_parallel(h, p));
}
static Robot three_parallel_two_intersecting(const double *h,
const double *p) {
static Robot three_parallel(const double *h, const double *p) { return Robot(lib::three_parallel(h, p)); }
static Robot three_parallel_two_intersecting(const double *h, const double *p) {
return Robot(lib::three_parallel_two_intersecting(h, p));
}
static Robot two_intersecting(const double *h, const double *p) {
return Robot(lib::two_intersecting(h, p));
}
static Robot two_intersecting(const double *h, const double *p) { return Robot(lib::two_intersecting(h, p)); }

/// @brief
/// @param rotation - Row-major 3x3 rotation matrix
/// @param translation - 3D translation vector
/// @param solutions - Vector of all found solutions and whether or not they
/// are exact.
void ik(const double *rotation, const double *translation,
std::vector<Solution> &solutions) {
void ik(const double *rotation, const double *translation, std::vector<Solution> &solutions) {
const std::size_t MAX_SOLUTIONS = 16;
double qs[6 * MAX_SOLUTIONS];
bool is_ls[MAX_SOLUTIONS];
Expand All @@ -88,8 +84,7 @@ class Robot {
}
}

void fk(const std::array<double, 6> &q, std::array<double, 9> &rotation,
std::array<double, 3> &translation) {
void fk(const std::array<double, 6> &q, std::array<double, 9> &rotation, std::array<double, 3> &translation) {
lib::fk(robot, q.data(), rotation.data(), translation.data());
}
};
Expand Down

0 comments on commit 1415c93

Please sign in to comment.