-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add utils library with test fixtures
Signed-off-by: methylDragon <[email protected]>
- Loading branch information
1 parent
ff39939
commit 77a3307
Showing
12 changed files
with
777 additions
and
107 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
59 changes: 59 additions & 0 deletions
59
moveit_ros/trajectory_cache/include/moveit/trajectory_cache/utils/utils.hpp
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,59 @@ | ||
// Copyright 2024 Intrinsic Innovation LLC. | ||
// | ||
// 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 | ||
// | ||
// 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. | ||
|
||
/** @file | ||
* @brief Utilities used by the trajectory_cache package. | ||
* @author methylDragon | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include <moveit/move_group_interface/move_group_interface.h> | ||
#include <moveit_msgs/srv/get_cartesian_path.hpp> | ||
|
||
#include <warehouse_ros/message_collection.h> | ||
|
||
// Frames. ========================================================================================= | ||
|
||
/** @brief Gets workspace frame ID. | ||
* If workspace_parameters has no frame ID, fetch it from move_group. | ||
*/ | ||
std::string getWorkspaceFrameId(const moveit::planning_interface::MoveGroupInterface& move_group, | ||
const moveit_msgs::msg::WorkspaceParameters& workspace_parameters); | ||
|
||
/** @brief Gets cartesian path request frame ID. | ||
* If path_request has no frame ID, fetch it from move_group. | ||
*/ | ||
std::string getCartesianPathRequestFrameId(const moveit::planning_interface::MoveGroupInterface& move_group, | ||
const moveit_msgs::srv::GetCartesianPath::Request& path_request); | ||
|
||
// Features. ======================================================================================= | ||
|
||
/** @brief Appends a range inclusive query with some tolerance about some center value. */ | ||
void queryAppendCenterWithTolerance(warehouse_ros::Query& query, const std::string& name, double center, | ||
double tolerance); | ||
|
||
// Constraints. ==================================================================================== | ||
|
||
/** @brief Sorts a vector of joint constraints in-place by joint name. */ | ||
void sortJointConstraints(std::vector<moveit_msgs::msg::JointConstraint>& joint_constraints); | ||
|
||
/** @brief Sorts a vector of position constraints in-place by link name. */ | ||
void sortPositionConstraints(std::vector<moveit_msgs::msg::PositionConstraint>& position_constraints); | ||
|
||
/** @brief Sorts a vector of orientation constraints in-place by link name. */ | ||
void sortOrientationConstraints(std::vector<moveit_msgs::msg::OrientationConstraint>& orientation_constraints); |
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.