Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Verdant-Evolution/ik-geo-cpp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: epfl-lasa/ik-geo-cpp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 3 commits
  • 10 files changed
  • 2 contributors

Commits on Sep 3, 2024

  1. Copy the full SHA
    a626ce5 View commit details

Commits on Nov 18, 2024

  1. Copy the full SHA
    1415c93 View commit details

Commits on Dec 3, 2024

  1. [Refa] Apply clang format on files.

    Louis Munier committed Dec 3, 2024
    Copy the full SHA
    d0615c7 View commit details
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .gitmodules
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ ExternalProject_Add(
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

add_library(ik_geo INTERFACE include/ik_geo.h)
add_library(ik_geo INTERFACE)
add_dependencies(ik_geo ik_geo_lib)
target_include_directories(ik_geo INTERFACE include)

Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified example/CMakeLists.txt
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions example/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include "ik_geo.h"
#include <array>
#include <iostream>
#include <vector>

#include "ik_geo.h"

using namespace ik_geo;

int main(int argc, char const *argv[]) {
@@ -27,8 +28,7 @@ int main(int argc, char const *argv[]) {
std::cout << "Is LS: " << (solution.is_ls ? "True" : "False") << std::endl;
std::cout << "Rotation Matrix: " << std::endl;
for (std::size_t i = 0; i < 3; i++) {
for (std::size_t j = 0; j < 3; j++)
std::cout << rotation_matrix[i * 3 + j] << " ";
for (std::size_t j = 0; j < 3; j++) std::cout << rotation_matrix[i * 3 + j] << " ";
std::cout << std::endl;
}
std::cout << "Position Vector: " << std::endl;
34 changes: 15 additions & 19 deletions include/ik_geo.h
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once

#include <array>
#include <vector>
@@ -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();
@@ -40,37 +44,30 @@ class Robot {

public:
~Robot() { lib::deallocate(robot); }
static Robot gen_six_dof(const double *h, const double *p) { return Robot(lib::gen_six_dof(h, p)); }
static Robot irb66400() { return Robot(lib::irb6640()); }
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];
@@ -88,8 +85,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());
}
};
Empty file modified rust-wrapper/Cargo.lock
100644 → 100755
Empty file.
Empty file modified rust-wrapper/Cargo.toml
100644 → 100755
Empty file.
Empty file modified rust-wrapper/src/lib.rs
100644 → 100755
Empty file.