-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59159ea
commit 425b93c
Showing
19 changed files
with
1,192 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
...e/tesseract_process_managers/task_generators/ruckig_trajectory_smoothing_task_generator.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/** | ||
* @file ruckig_trajectory_smoothing_task_generator.h | ||
* @brief Leveraging Ruckig to smooth trajectory | ||
* | ||
* @author Levi Armstrong | ||
* @date July 27, 2022 | ||
* @version TODO | ||
* @bug No known bugs | ||
* | ||
* @par License | ||
* Software License Agreement (Apache License) | ||
* @par | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* @par | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#ifndef TESSERACT_PROCESS_MANAGERS_RUCKIG_TRAJECTORY_SMOOTHING_TASK_GENERATOR_H | ||
#define TESSERACT_PROCESS_MANAGERS_RUCKIG_TRAJECTORY_SMOOTHING_TASK_GENERATOR_H | ||
|
||
#include <tesseract_common/macros.h> | ||
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH | ||
#include <boost/serialization/access.hpp> | ||
TESSERACT_COMMON_IGNORE_WARNINGS_POP | ||
|
||
#include <tesseract_process_managers/core/task_generator.h> | ||
#include <tesseract_time_parameterization/ruckig_trajectory_smoothing.h> | ||
#include <tesseract_process_managers/core/default_task_namespaces.h> | ||
|
||
namespace tesseract_planning | ||
{ | ||
class RuckigTrajectorySmoothingTaskGenerator : public TaskGenerator | ||
{ | ||
public: | ||
using UPtr = std::unique_ptr<RuckigTrajectorySmoothingTaskGenerator>; | ||
|
||
RuckigTrajectorySmoothingTaskGenerator(std::string name = profile_ns::RUCKIG_TRAJECTORY_SMOOTHING_DEFAULT_NAMESPACE); | ||
|
||
~RuckigTrajectorySmoothingTaskGenerator() override = default; | ||
RuckigTrajectorySmoothingTaskGenerator(const RuckigTrajectorySmoothingTaskGenerator&) = delete; | ||
RuckigTrajectorySmoothingTaskGenerator& operator=(const RuckigTrajectorySmoothingTaskGenerator&) = delete; | ||
RuckigTrajectorySmoothingTaskGenerator(RuckigTrajectorySmoothingTaskGenerator&&) = delete; | ||
RuckigTrajectorySmoothingTaskGenerator& operator=(RuckigTrajectorySmoothingTaskGenerator&&) = delete; | ||
|
||
int conditionalProcess(TaskInput input, std::size_t unique_id) const override final; | ||
|
||
void process(TaskInput input, std::size_t unique_id) const override final; | ||
}; | ||
|
||
class RuckigTrajectorySmoothingTaskInfo : public TaskInfo | ||
{ | ||
public: | ||
using Ptr = std::shared_ptr<RuckigTrajectorySmoothingTaskInfo>; | ||
using ConstPtr = std::shared_ptr<const RuckigTrajectorySmoothingTaskInfo>; | ||
|
||
RuckigTrajectorySmoothingTaskInfo() = default; | ||
RuckigTrajectorySmoothingTaskInfo(std::size_t unique_id, | ||
std::string name = profile_ns::RUCKIG_TRAJECTORY_SMOOTHING_DEFAULT_NAMESPACE); | ||
|
||
TaskInfo::UPtr clone() const override; | ||
|
||
bool operator==(const RuckigTrajectorySmoothingTaskInfo& rhs) const; | ||
bool operator!=(const RuckigTrajectorySmoothingTaskInfo& rhs) const; | ||
|
||
private: | ||
friend class boost::serialization::access; | ||
template <class Archive> | ||
void serialize(Archive& ar, const unsigned int version); // NOLINT | ||
}; | ||
} // namespace tesseract_planning | ||
|
||
#include <boost/serialization/export.hpp> | ||
#include <boost/serialization/tracking.hpp> | ||
BOOST_CLASS_EXPORT_KEY2(tesseract_planning::RuckigTrajectorySmoothingTaskInfo, "RuckigTrajectorySmoothingTaskInfo") | ||
|
||
#endif // TESSERACT_PROCESS_MANAGERS_RUCKIG_TRAJECTORY_SMOOTHING_TASK_GENERATOR_H |
90 changes: 90 additions & 0 deletions
90
...rs/include/tesseract_process_managers/task_profiles/ruckig_trajectory_smoothing_profile.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/** | ||
* @file ruckig_trajectory_smoothing_profile.h | ||
* @brief Leveraging Ruckig to smooth trajectory | ||
* | ||
* @author Levi Armstrong | ||
* @date July 27, 2022 | ||
* @version TODO | ||
* @bug No known bugs | ||
* | ||
* @par License | ||
* Software License Agreement (Apache License) | ||
* @par | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* @par | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#ifndef TESSERACT_PROCESS_MANAGERS_RUCKIG_TRAJECTORY_SMOOTHING_PROFILE_H | ||
#define TESSERACT_PROCESS_MANAGERS_RUCKIG_TRAJECTORY_SMOOTHING_PROFILE_H | ||
|
||
#include <tesseract_common/macros.h> | ||
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH | ||
#include <memory> | ||
TESSERACT_COMMON_IGNORE_WARNINGS_POP | ||
|
||
namespace tesseract_planning | ||
{ | ||
struct RuckigTrajectorySmoothingCompositeProfile | ||
{ | ||
using Ptr = std::shared_ptr<RuckigTrajectorySmoothingCompositeProfile>; | ||
using ConstPtr = std::shared_ptr<const RuckigTrajectorySmoothingCompositeProfile>; | ||
|
||
RuckigTrajectorySmoothingCompositeProfile() = default; | ||
RuckigTrajectorySmoothingCompositeProfile(double duration_extension_fraction, | ||
double max_duration_extension_factor, | ||
double max_velocity_scaling_factor, | ||
double max_acceleration_scaling_factor) | ||
: duration_extension_fraction(duration_extension_fraction) | ||
, max_duration_extension_factor(max_duration_extension_factor) | ||
, max_velocity_scaling_factor(max_velocity_scaling_factor) | ||
, max_acceleration_scaling_factor(max_acceleration_scaling_factor) | ||
{ | ||
} | ||
|
||
/** @brief duration_extension_fraction The amount to scale the trajectory each time */ | ||
double duration_extension_fraction{ 1.1 }; | ||
|
||
/** @brief The max allow extension factor */ | ||
double max_duration_extension_factor{ 10.0 }; | ||
|
||
/** @brief max_velocity_scaling_factor The max velocity scaling factor passed to the solver */ | ||
double max_velocity_scaling_factor{ 1.0 }; | ||
|
||
/** @brief max_velocity_scaling_factor The max acceleration scaling factor passed to the solver */ | ||
double max_acceleration_scaling_factor{ 1.0 }; | ||
|
||
/** @brief max_jerk_scaling_factor The max jerk scaling factor passed to the solver */ | ||
double max_jerk_scaling_factor{ 1.0 }; | ||
}; | ||
|
||
struct RuckigTrajectorySmoothingMoveProfile | ||
{ | ||
using Ptr = std::shared_ptr<RuckigTrajectorySmoothingMoveProfile>; | ||
using ConstPtr = std::shared_ptr<const RuckigTrajectorySmoothingMoveProfile>; | ||
|
||
RuckigTrajectorySmoothingMoveProfile() = default; | ||
RuckigTrajectorySmoothingMoveProfile(double max_velocity_scaling_factor, double max_acceleration_scaling_factor) | ||
: max_velocity_scaling_factor(max_velocity_scaling_factor) | ||
, max_acceleration_scaling_factor(max_acceleration_scaling_factor) | ||
{ | ||
} | ||
|
||
/** @brief max_velocity_scaling_factor The max velocity scaling factor passed to the solver */ | ||
double max_velocity_scaling_factor{ 1.0 }; | ||
|
||
/** @brief max_velocity_scaling_factor The max acceleration scaling factor passed to the solver */ | ||
double max_acceleration_scaling_factor{ 1.0 }; | ||
|
||
/** @brief max_jerk_scaling_factor The max jerk scaling factor passed to the solver */ | ||
double max_jerk_scaling_factor{ 1.0 }; | ||
}; | ||
} // namespace tesseract_planning | ||
|
||
#endif // TESSERACT_PROCESS_MANAGERS_RUCKIG_TRAJECTORY_SMOOTHING_PROFILE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.