Replies: 1 comment
-
` #include <toppra/algorithm/toppra.hpp> using namespace std; void write_trajectory(moveit::planning_interface::MoveGroupInterface::Plan &plan)
} int main(int argc, char **argv)
//-----------------------------------------------------------toppra VectorXd q1(kNumSamples); VectorXd qdot1(kNumSamples); for(int j=0; j<kNumSamples; j++)
const std::vector q{q1, q2, q3, q4, q5, q6}; VectorXd lower_acceleration_limit(kNumJoints); VectorXd velocity_limit(kNumJoints); // TOPPRA toppra::Vectors q_nominal_vectors; toppra::PiecewisePolyPath hermite = toppra::PiecewisePolyPath::constructHermite(q_nominal_vectors, q_dot_nominal_vectors, times); toppra::LinearConstraintPtr velocity_constraint = // set acceleration constraint // Create linear joint space constraints. // set auto gridpoints toppra::ParametrizationData data = algo->getParameterizationData(); //Create constant acceleration parametrizer. toppra::Vector vsquared = data.parametrization; // (squared path velocity) const toppra::Bound optimized_time_interval = spline_path->pathInterval(); toppra::Vector time_breaks_optimized = std::vector q_nominal_optimized_mat{}; // Now append the rest of the optimized path points generated by toppra. ros::shutdown(); ` |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm trying to use toppra with Moveit to plan a less jerky trajectory for a ur5 robot.
I started with the python API casuse and it was very easy to get my hands on it. Unfortunately when I tried to use it with ROS, I got problems with the python version. My ROS version is Melodic which supports only python 2.7. But I built my toppra libraries on python 3.7.4 as suggested ... thus I turned to CPP API, I have difficulties with C++, I read all the tests files and the issues, i barely understand ... this is the code I wrote refers to the test_issue_198.cpp. I got segmentation faults and core dumped every time.
Do you have other short easier C++ API tutorial please ? My goal is try to re-time path with velocity and acceleration bounds.
Thank you very much.
Beta Was this translation helpful? Give feedback.
All reactions