-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from ipa-fxm-cm/test_new_cartesian_controller
Finalized cob_cartesian_controller
- Loading branch information
Showing
33 changed files
with
928 additions
and
1,113 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,21 +19,23 @@ | |
* \author | ||
* Author: Christoph Mark, email: [email protected] / [email protected] | ||
* | ||
* \date Date of creation: July, 2015 | ||
* \date Date of creation: December, 2015 | ||
* | ||
* \brief | ||
* ... | ||
* This class is used to interpolate various Cartesian paths for a given velocity profile. | ||
* Supported types of Cartesian paths are Linear and Circular. | ||
* Supported types of velocity profiles are Ramp and Sinoid. | ||
* | ||
****************************************************************/ | ||
|
||
#ifndef CARTESIAN_CONTROLLER_H | ||
#define CARTESIAN_CONTROLLER_H | ||
#ifndef COB_CARTESIAN_CONTROLLER_CARTESIAN_CONTROLLER_H | ||
#define COB_CARTESIAN_CONTROLLER_CARTESIAN_CONTROLLER_H | ||
|
||
#include <ros/ros.h> | ||
#include <vector> | ||
#include <string.h> | ||
#include <string> | ||
#include <boost/shared_ptr.hpp> | ||
|
||
#include <ros/ros.h> | ||
#include <tf/transform_listener.h> | ||
#include <tf/transform_broadcaster.h> | ||
#include <tf/transform_datatypes.h> | ||
|
@@ -56,7 +58,6 @@ class CartesianController | |
|
||
// Main functions | ||
bool posePathBroadcaster(const geometry_msgs::PoseArray& cartesian_path); | ||
bool movePTP(const geometry_msgs::Pose& target_pose, double epsilon); | ||
|
||
// Helper function | ||
bool startTracking(); | ||
|
@@ -85,9 +86,6 @@ class CartesianController | |
double update_rate_; | ||
std::string root_frame_, chain_tip_link_, target_frame_; | ||
|
||
// HelperVars for movePTP | ||
bool reached_pos_; | ||
|
||
/// Action interface | ||
std::string action_name_; | ||
boost::shared_ptr<SAS_CartesianControllerAction_t> as_; | ||
|
@@ -98,4 +96,4 @@ class CartesianController | |
boost::shared_ptr< TrajectoryInterpolator > trajectory_interpolator_; | ||
}; | ||
|
||
#endif | ||
#endif // COB_CARTESIAN_CONTROLLER_CARTESIAN_CONTROLLER_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
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 |
---|---|---|
|
@@ -19,30 +19,33 @@ | |
* \author | ||
* Author: Christoph Mark, email: [email protected] / [email protected] | ||
* | ||
* \date Date of creation: July, 2015 | ||
* | ||
* \date Date of creation: December, 2015 | ||
* | ||
* \brief | ||
* ... | ||
* Helper functions used in the cob_cartesian_controller package. | ||
* | ||
****************************************************************/ | ||
|
||
#ifndef COB_CARTESIAN_CONTROLLER_UTILS_H_ | ||
#define COB_CARTESIAN_CONTROLLER_UTILS_H_ | ||
#ifndef COB_CARTESIAN_CONTROLLER_CARTESIAN_CONTROLLER_UTILS_H | ||
#define COB_CARTESIAN_CONTROLLER_CARTESIAN_CONTROLLER_UTILS_H | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include <ros/ros.h> | ||
#include <tf/transform_listener.h> | ||
#include <tf/transform_datatypes.h> | ||
|
||
#include <geometry_msgs/PoseArray.h> | ||
#include <visualization_msgs/MarkerArray.h> | ||
|
||
#include <cob_cartesian_controller/cartesian_controller_data_types.h> | ||
|
||
class CartesianControllerUtils | ||
{ | ||
public: | ||
CartesianControllerUtils() | ||
{ | ||
marker_pub_ = nh_.advertise<visualization_msgs::MarkerArray>("cartesian_controller/preview_path",1); | ||
marker_pub_ = nh_.advertise<visualization_msgs::MarkerArray>("cartesian_controller/preview_path", 1); | ||
} | ||
|
||
void transformPose(const std::string source_frame, const std::string target_frame, const geometry_msgs::Pose pose_in, geometry_msgs::Pose& pose_out); | ||
|
@@ -52,14 +55,18 @@ class CartesianControllerUtils | |
bool inEpsilonArea(const tf::StampedTransform& stamped_transform, const double epsilon); | ||
void poseToRPY(const geometry_msgs::Pose& pose, double& roll, double& pitch, double& yaw); | ||
|
||
void previewPath(const geometry_msgs::PoseArray& pose_array); | ||
void previewPath(const geometry_msgs::PoseArray pose_array); | ||
|
||
void adjustArrayLength(std::vector<cob_cartesian_controller::PathArray>& m); | ||
void copyMatrix(std::vector<double>* path_array, std::vector<cob_cartesian_controller::PathArray>& m); | ||
double roundUpToMultiplier(const double numberToRound, const double multiplier); | ||
|
||
private: | ||
ros::NodeHandle nh_; | ||
tf::TransformListener tf_listener_; | ||
visualization_msgs::MarkerArray marker_array_; | ||
|
||
ros::Publisher marker_pub_; | ||
}; | ||
|
||
#endif /* COB_CARTESIAN_CONTROLLER_UTILS_H_ */ | ||
#endif // COB_CARTESIAN_CONTROLLER_CARTESIAN_CONTROLLER_UTILS_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 |
---|---|---|
|
@@ -19,47 +19,45 @@ | |
* \author | ||
* Author: Christoph Mark, email: [email protected] / [email protected] | ||
* | ||
* \date Date of creation: July, 2015 | ||
* \date Date of creation: December, 2015 | ||
* | ||
* \brief | ||
* ... | ||
* This class contains the implementation for the linear and circular interpolation. | ||
* | ||
****************************************************************/ | ||
|
||
#ifndef COB_CARTESIAN_CONTROLLER_TRAJECTORY_INTERPOLATOR_H_ | ||
#define COB_CARTESIAN_CONTROLLER_TRAJECTORY_INTERPOLATOR_H_ | ||
#ifndef COB_CARTESIAN_CONTROLLER_TRAJECTORY_INTERPOLATOR_TRAJECTORY_INTERPOLATOR_H | ||
#define COB_CARTESIAN_CONTROLLER_TRAJECTORY_INTERPOLATOR_TRAJECTORY_INTERPOLATOR_H | ||
|
||
#include <string> | ||
#include <ros/ros.h> | ||
#include <geometry_msgs/PoseArray.h> | ||
#include <tf/transform_datatypes.h> | ||
|
||
#include <cob_cartesian_controller/cartesian_controller_data_types.h> | ||
#include <cob_cartesian_controller/trajectory_profile_generator/trajectory_profile_generator_lin.h> | ||
#include <cob_cartesian_controller/trajectory_profile_generator/trajectory_profile_generator_circ.h> | ||
|
||
#include <cob_cartesian_controller/trajectory_profile_generator/trajectory_profile_generator_builder.h> | ||
|
||
class TrajectoryInterpolator | ||
{ | ||
public: | ||
TrajectoryInterpolator(std::string root_frame, double update_rate) | ||
: root_frame_(root_frame), | ||
trajectory_profile_generator_lin_(TrajectoryProfileGeneratorLin(update_rate)), | ||
trajectory_profile_generator_circ_(TrajectoryProfileGeneratorCirc(update_rate)) | ||
: root_frame_(root_frame) | ||
{} | ||
|
||
~TrajectoryInterpolator(){} | ||
~TrajectoryInterpolator() | ||
{ | ||
trajectory_profile_generator_.reset(); | ||
} | ||
|
||
bool linearInterpolation(geometry_msgs::PoseArray& pose_array, | ||
cob_cartesian_controller::MoveLinStruct& move_lin); | ||
const cob_cartesian_controller::CartesianActionStruct as); | ||
|
||
bool circularInterpolation(geometry_msgs::PoseArray& pose_array, | ||
cob_cartesian_controller::MoveCircStruct& move_circ); | ||
const cob_cartesian_controller::CartesianActionStruct as); | ||
|
||
private: | ||
TrajectoryProfileGeneratorLin trajectory_profile_generator_lin_; | ||
TrajectoryProfileGeneratorCirc trajectory_profile_generator_circ_; | ||
|
||
std::string root_frame_; | ||
boost::shared_ptr<TrajectoryProfileBase> trajectory_profile_generator_; | ||
}; | ||
|
||
#endif /* COB_CARTESIAN_CONTROLLER_TRAJECTORY_INTERPOLATOR_H_ */ | ||
#endif // COB_CARTESIAN_CONTROLLER_TRAJECTORY_INTERPOLATOR_TRAJECTORY_INTERPOLATOR_H |
Oops, something went wrong.