Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,10 @@ if (BUILD_EXAMPLES)
endif ()

install(FILES
"${PROJECT_SOURCE_DIR}/utilities.hpp"
"${PROJECT_SOURCE_DIR}/bezier.hpp"
"${PROJECT_SOURCE_DIR}/planning_space.hpp"
"${PROJECT_SOURCE_DIR}/planner.hpp"
"${PROJECT_SOURCE_DIR}/LinearJointVelocityVarying.hpp"
"${PROJECT_SOURCE_DIR}/sea_current.hpp"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
57 changes: 57 additions & 0 deletions LinearJointVelocityVarying.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#pragma once

#include <iostream>
#include <vector>
#include <cmath>
#include <complex>
#include <numbers>
#include <algorithm>
#include <tuple>
#include <functional>
#include <queue>
#include <limits>
#include <unordered_set>
#include <unordered_map>
#include <optional>
#include <string>

#include <Eigen/Dense>
#include <unsupported/Eigen/FFT>

#include <toppra/toppra.hpp>
#include <toppra/geometric_path.hpp>
#include <toppra/geometric_path/piecewise_poly_path.hpp>
#include <toppra/constraint/linear_joint_velocity.hpp>
#include <toppra/constraint/linear_joint_acceleration.hpp>
#include <toppra/algorithm/toppra.hpp>
#include <toppra/parametrizer.hpp>
#include <toppra/parametrizer/spline.hpp>

#include "utilities.hpp"
#include "planning_space.hpp"
#include "planner.hpp"
#include "bezier.hpp"

using toppra::value_type;
using toppra::constraint::LinearJointVelocity;
using vel_lim_func = std::function<std::tuple<toppra::Vector, toppra::Vector>(value_type time)>;

class LinearJointVelocityVarying : public LinearJointVelocity {
public:
vel_lim_func calc_lim;
LinearJointVelocityVarying(int nDof, vel_lim_func calc_lim);

protected:
void computeVelocityLimits(value_type time);
};


LinearJointVelocityVarying::LinearJointVelocityVarying(int nDof, vel_lim_func calc_lim) :
LinearJointVelocity (-1*toppra::Vector::Ones(1), 1*toppra::Vector::Ones(1)) {
this->calc_lim = calc_lim;
computeVelocityLimits(0);
}

void LinearJointVelocityVarying::computeVelocityLimits(value_type time) {
std::tie(m_lower, m_upper) = calc_lim(time);
}
Loading