Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Finalizing/Testing of TwistController features #51

Merged
merged 92 commits into from
Aug 25, 2015
Merged
Show file tree
Hide file tree
Changes from 87 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
34203da
restructured
MaChristoph Jul 1, 2015
479d684
added headers..
MaChristoph Jul 1, 2015
c7f79be
restructured functions
MaChristoph Jul 1, 2015
5c7d1d9
fix install tags
MaChristoph Jul 1, 2015
b86b249
added action server
MaChristoph Jul 1, 2015
892339e
restructured cartesian controller with action interface
MaChristoph Jul 16, 2015
3faf6a1
renamed variable
MaChristoph Jul 16, 2015
bb01493
code styling cob_control_mode_adapter
fmessmer Jul 16, 2015
43574c1
code styling cob_frame_tracker
fmessmer Jul 16, 2015
eb6ee0b
code styling cob_model_identifier
fmessmer Jul 16, 2015
326228c
code styling cob_cartesian_controller
fmessmer Jul 16, 2015
c117cb0
Reduced granularity of a fcl::shape representation. Replaced arm_1_co…
Jul 21, 2015
3165f11
Added Python package to collect data and write collected data into a …
Jul 21, 2015
0f7d580
Merge branch 'mesh_repr_of_registered_links' of github.com:ipa-fxm/co…
Jul 22, 2015
e77fa7a
Fixed integer size. There might never be 2^64 joints. But maybe more …
Jul 22, 2015
bcf0dbe
Merge branch 'cartesian_controller_with_action_server' of github.com:…
Jul 22, 2015
3581f63
Merge branch 'mesh_repr_of_registered_links' of github.com:ipa-fxm/co…
Jul 22, 2015
5020869
Merge branch 'cartesian_controller_with_action_server' of github.com:…
Jul 22, 2015
320b793
Merge with code style fixes.
Jul 22, 2015
329a4bb
Added generated const from .cfg; Styling
Jul 22, 2015
dba933e
Made cob_cartesian_controller work again: Added CartesianController::…
Jul 22, 2015
d46abda
Further tests and adaptations for test.
Jul 23, 2015
efdf119
added interactive_obstacle test node, less sleep time on marker publi…
fmessmer Jul 25, 2015
a83fece
restructure and simplify cartesian_controller_utils, beautification
fmessmer Jul 25, 2015
0902c42
allow target_frame to be configured via private param, beautifying
fmessmer Jul 25, 2015
4d8cb88
get rid of holdPosition, replaced by rospy.sleep()
fmessmer Jul 25, 2015
91b1218
replace .prog files with according .py scripts, use rospy.sleep() ins…
fmessmer Jul 25, 2015
c7b8371
check for frame existence
fmessmer Jul 25, 2015
ba932d8
draft for example
fmessmer Jul 25, 2015
3d90963
re-work of ActionServer: more failure handling
fmessmer Jul 25, 2015
83ae4ec
simplify data_type conversion, cleanup
fmessmer Jul 25, 2015
df80713
split and restructure ProfileGenerator
fmessmer Jul 25, 2015
dc59770
added publisher for path preview
fmessmer Jul 26, 2015
89096ff
re-work message structure use pose and frame_id, proper handling tran…
fmessmer Jul 26, 2015
02856f0
first draft for python interface
fmessmer Jul 26, 2015
9fa492c
fix cartesian_interface
fmessmer Jul 27, 2015
f356416
- Removed PredictDistance Service (not necessary anymore; found a lig…
Jul 27, 2015
f2a5393
simplify simpson
fmessmer Jul 27, 2015
276d2fc
Made movinge average generic for other data types. Using moving avera…
Jul 28, 2015
a09d191
- Corrected JLA constraint. - Added weighting of GPM prio dependent. …
Jul 29, 2015
551af3b
Separated JLA and CA constraints from constraint_impl.h
Jul 29, 2015
39b4fa6
Merged with ipa-fxm/test_of_feature branch.
Jul 29, 2015
5b259c6
Fixed bugs in cartesian_controller: waitFor last available transform …
Jul 29, 2015
006dbde
Created test, Removed commends, Removed output.
Jul 29, 2015
232ea4d
print result, use sci in test scripts
fmessmer Aug 2, 2015
3e6289b
Implemented Python package to set dyn_reconfigure params. Made test_m…
Aug 4, 2015
3fbeda2
updates from ipa320
fmessmer Aug 5, 2015
3e3b403
updates from ipa-fxm-mb
fmessmer Aug 5, 2015
e5e8ce1
review dependencies
fmessmer Aug 5, 2015
46216ac
Merge branch 'indigo_dev' of github.com:ipa320/cob_control into test_…
fmessmer Aug 5, 2015
3230110
- For BVH introduced a shared_ptr member -> so a collision object can…
Aug 5, 2015
f6c4733
Merge branch 'test_of_feature' of github.com:ipa-fxm-mb/cob_control i…
fmessmer Aug 6, 2015
fa3fabd
- Removed experiment solvers for task stacks. Now the dynamic_tasks_r…
Aug 6, 2015
45883d8
consider PR review comments
fmessmer Aug 6, 2015
083619d
fix HardwareInterfacePosition
fmessmer Aug 6, 2015
6602c6e
resolve possible endless-loop
fmessmer Aug 6, 2015
86e2685
- Renamed dynamics_tasks_readjust_solver -> stack_of_tasks_solver. Th…
Aug 6, 2015
6788bcb
Deleted unnecessary files.
Aug 6, 2015
cbb440c
Merge branch 'test_of_feature' of github.com:ipa-fxm/cob_control into…
Aug 6, 2015
6614be8
- Avoided drawing of self-collision frames -> can be done via rviz.
Aug 6, 2015
1d45bba
- Removed unnecessary function.
Aug 6, 2015
24f7c6f
- Added handling of no exception: Save files.
Aug 7, 2015
1bfc628
- Removed unnecessary commented code.
Aug 7, 2015
bf942c8
merge with package_xml_2
fmessmer Aug 9, 2015
2d1ccaf
more fixes for migration afer merge
fmessmer Aug 9, 2015
3e1c97a
Resolved merge conflicts.
Aug 10, 2015
0d6eab0
- Renaming obstacle_marker_server for interactive obstacle
Aug 10, 2015
89f727a
Due to restructuring of self-collision YYAMLs also restructured compu…
Aug 11, 2015
885e2b3
Fixed bug when obstacles move away from robot. Clear distances list w…
Aug 11, 2015
953d7ae
merge
fmessmer Aug 11, 2015
f455cb0
- Removed parameter mu. - Added obstacle id for identification of col…
Aug 11, 2015
9b8e6a0
- CA: Increased exp. decay from 0.1 to 0.2 - Added comments. - Moved …
Aug 12, 2015
19dff1f
- Added parameters for activation buffer and critical threshold of CA…
Aug 13, 2015
a795ede
- Added functionality to hold twist in case of deviation of cart. dis…
Aug 13, 2015
1f63876
Some preparations for test: IMarker smaller, Alpha settings, More scr…
Aug 13, 2015
b9bbb60
Overwritten numerical_filtering with false.
Aug 14, 2015
039844b
Merge branch 'test_of_feature' into test_of_feature_with_adapt_frame_…
Aug 14, 2015
cba34b8
Merge branch 'package_xml_2' of github.com:ipa-fxm/cob_control into t…
fmessmer Aug 16, 2015
a6a429b
boost revision
fmessmer Aug 16, 2015
450dc3a
Added comment to activation buffer.
Aug 17, 2015
270d965
Merge branch 'test_of_feature' into test_of_feature_with_adapt_frame_…
Aug 17, 2015
0fb27e4
Merge branch 'indigo_dev' into test_of_feature
fmessmer Aug 17, 2015
4cbf0dd
- Made some changes for test. - Decreased Duration time for markers. …
Aug 17, 2015
a2d8794
In config file avoided setting of 0 tolerance (DIV/0!). Removed addit…
Aug 18, 2015
2fc3b5f
Added new script for raw3-1.
Aug 18, 2015
9341816
- Added more text to package.xml
Aug 19, 2015
803e0a4
- Fixed bug in constraint implementation: sign was "-" but must be "+".
Aug 21, 2015
be69d89
Merge branch 'test_of_feature_with_adapt_frame_tracker' of github.com…
fmessmer Aug 24, 2015
080690f
Corrections integrated from PR: [WIP] Finalizing/Testing of TwistCont…
Aug 24, 2015
1481442
Merge branch 'test_of_feature_with_adapt_frame_tracker' of github.com…
fmessmer Aug 24, 2015
1530538
authors in package xml
fmessmer Aug 24, 2015
2399687
review dependencies
fmessmer Aug 24, 2015
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
55 changes: 45 additions & 10 deletions cob_cartesian_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,60 @@
cmake_minimum_required(VERSION 2.8.3)
project(cob_cartesian_controller)

find_package(catkin REQUIRED COMPONENTS cmake_modules cob_srvs geometry_msgs roscpp roslib std_msgs std_srvs tf visualization_msgs)
find_package(catkin REQUIRED COMPONENTS actionlib_msgs actionlib cob_srvs geometry_msgs message_generation roscpp std_msgs std_srvs tf visualization_msgs)

find_package(TinyXML REQUIRED)
find_package(Boost REQUIRED)

catkin_python_setup()

### Message Generation ###
add_action_files(
DIRECTORY action
FILES CartesianController.action
)

add_message_files(
DIRECTORY msg
FILES MoveLin.msg
MoveCirc.msg
Profile.msg
)

generate_messages(
DEPENDENCIES actionlib_msgs geometry_msgs std_msgs
)

catkin_package(
CATKIN_DEPENDS cob_srvs geometry_msgs roscpp roslib std_msgs std_srvs tf visualization_msgs
DEPENDS TinyXML
CATKIN_DEPENDS actionlib_msgs actionlib cob_srvs geometry_msgs message_runtime roscpp std_msgs std_srvs tf visualization_msgs
DEPENDS Boost
INCLUDE_DIRS include
LIBRARIES cartesian_controller
LIBRARIES profile_generator trajectory_interpolator cartesian_controller cartesian_controller_utils
)

### BUILD ###
include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

add_library(cartesian_controller_utils src/cartesian_controller_utils.cpp)
add_dependencies(cartesian_controller_utils ${catkin_EXPORTED_TARGETS})
target_link_libraries(cartesian_controller_utils ${catkin_LIBRARIES})

add_library(profile_generator src/trajectory_profile_generator/trajectory_profile_generator_lin.cpp src/trajectory_profile_generator/trajectory_profile_generator_circ.cpp)
add_dependencies(profile_generator ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(profile_generator ${catkin_LIBRARIES})

add_library(trajectory_interpolator src/trajectory_interpolator/trajectory_interpolator.cpp)
add_dependencies(trajectory_interpolator ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(trajectory_interpolator profile_generator ${catkin_LIBRARIES})

add_library(cartesian_controller src/cartesian_controller.cpp)
add_dependencies(cartesian_controller ${catkin_EXPORTED_TARGETS})
target_link_libraries(cartesian_controller ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(cartesian_controller ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(cartesian_controller trajectory_interpolator cartesian_controller_utils ${catkin_LIBRARIES} ${Boost_LIBRARIES})

add_executable(cartesian_controller_node src/cartesian_controller_node.cpp)
target_link_libraries(cartesian_controller_node cartesian_controller ${catkin_LIBRARIES})

### INSTALL ##
install(TARGETS cartesian_controller cartesian_controller_node
install(TARGETS profile_generator trajectory_interpolator cartesian_controller cartesian_controller_utils cartesian_controller_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
Expand All @@ -33,6 +64,10 @@ install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)

install(DIRECTORY launch movement
install(PROGRAMS scripts/test_move_lin.py scripts/test_move_circ.py scripts/test_move_santa.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}/scripts
)

install(DIRECTORY config launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
16 changes: 16 additions & 0 deletions cob_cartesian_controller/action/CartesianController.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# goal definition
uint8 LIN=1
uint8 CIRC=2
uint8 move_type

cob_cartesian_controller/MoveLin move_lin
cob_cartesian_controller/MoveCirc move_circ

---
# result definition
bool success
string message
---
# Define a feedback message
uint8 state
string message
23 changes: 23 additions & 0 deletions cob_cartesian_controller/config/example_cartesian_controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## joint_names
joint_names: [arm_1_joint, arm_2_joint, arm_3_joint, arm_4_joint, arm_5_joint, arm_6_joint, arm_7_joint]

## Cartesian controller parameters
chain_base_link: arm_podest_link
chain_tip_link: arm_7_link
root_frame: world

# twist controller parameters
twist_controller:
hardware_interface_type: 2 #Velocity 0, Position 1, JointStates 2

# frame_tracker + interactive_marker
frame_tracker:
tracking_frame: arm_7_target
movable_trans: true
movable_rot: true
pid_trans_x: {p: 4.0, i: 0.0, d: 0.0, i_clamp: 0.0}
pid_trans_y: {p: 4.0, i: 0.0, d: 0.0, i_clamp: 0.0}
pid_trans_z: {p: 4.0, i: 0.0, d: 0.0, i_clamp: 0.0}
pid_rot_x: {p: 4.0, i: 0.0, d: 0.0, i_clamp: 0.0}
pid_rot_y: {p: 4.0, i: 0.0, d: 0.0, i_clamp: 0.0}
pid_rot_z: {p: 4.0, i: 0.0, d: 0.0, i_clamp: 0.0}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

/*!
*****************************************************************
* \file
*
* \note
* Copyright (c) 2014 \n
* Copyright (c) 2015 \n
* Fraunhofer Institute for Manufacturing Engineering
* and Automation (IPA) \n\n
*
Expand All @@ -18,86 +17,85 @@
* ROS package name: cob_cartesian_controller
*
* \author
* Author: Christoph Mark, email: [email protected]
* Author: Christoph Mark, email: [email protected] / [email protected]
*
* \date Date of creation: August, 2014
* \date Date of creation: July, 2015
*
* \brief
* ...
*
****************************************************************/

#ifndef CARTESIAN_CONTROLLER_H
#define CARTESIAN_CONTROLLER_H

#include <ros/ros.h>
#include <vector>
#include <tinyxml.h>
#include <string.h>
#include <boost/shared_ptr.hpp>

#include <ros/ros.h>
#include <std_msgs/Float64.h>
#include <geometry_msgs/Pose.h>
#include <visualization_msgs/Marker.h>
#include <tf/transform_broadcaster.h>
#include <tf/transform_listener.h>
#include <tf/transform_broadcaster.h>
#include <tf/transform_datatypes.h>

#include <actionlib/server/simple_action_server.h>
#include <cob_cartesian_controller/CartesianControllerAction.h>

#include <cob_cartesian_controller/trajectory_interpolator/trajectory_interpolator.h>
#include <cob_cartesian_controller/cartesian_controller_data_types.h>
#include <cob_cartesian_controller/cartesian_controller_utils.h>

typedef actionlib::SimpleActionServer<cob_cartesian_controller::CartesianControllerAction> SAS_CartesianControllerAction_t;

#define DEFAULT_CARTESIAN_TARGET "cartesian_target"

class CartesianController
{
public:
bool initialize();
void load();

// Main functions
void pose_path_broadcaster(std::vector <geometry_msgs::Pose> *poseVector);
void linear_interpolation(std::vector <geometry_msgs::Pose> *poseVector,geometry_msgs::Pose, geometry_msgs::Pose,double,double,std::string,bool);
void circular_interpolation(std::vector<geometry_msgs::Pose> *poseVector,double,double,double,double,double,double,double,double,double,double,double,std::string);
void move_ptp(geometry_msgs::Pose targetPose, double epsilon);
void hold_position(geometry_msgs::Pose);

// Helper function
bool epsilon_area(double,double,double,double,double,double,double);
geometry_msgs::Pose getEndeffectorPose();
void showMarker(tf::StampedTransform,int,double,double,double,std::string);
void showDot(double,double,double,int,double,double,double,std::string);
void showLevel(tf::Transform,int,double,double,double,std::string);
void timerCallback(const ros::TimerEvent&);
void calculateProfile(std::vector<double>*,double,double,double,std::string);
void calculateProfileForAngularMovements(std::vector<double> *pathMatrix,double,double,double,double,double,double,double,double,double,std::string,bool);
void generatePath(std::vector<double>*,double,double,double,double,int,std::string);
void generatePathWithTe(std::vector<double> *pathArray,double T_IPO, double te, double AcclMax,double Se_max, int steps_max,double start_angle,std::string profile);
void start_tracking();
void stop_tracking();
void PoseToRPY(geometry_msgs::Pose pose,double &roll, double &pitch, double &yaw);
bool initialize();

// Main functions
bool posePathBroadcaster(const geometry_msgs::PoseArray& cartesian_path);
bool movePTP(const geometry_msgs::Pose& target_pose, double epsilon);

// Helper function
bool startTracking();
bool stopTracking();

/// Action interface
void goalCallback();
void preemptCallback();
void actionSuccess(const bool success, const std::string& message);
void actionPreempt(const bool success, const std::string& message);
void actionAbort(const bool success, const std::string& message);

cob_cartesian_controller::CartesianActionStruct acceptGoal(boost::shared_ptr<const cob_cartesian_controller::CartesianControllerGoal> goal);
cob_cartesian_controller::MoveLinStruct convertMoveLin(const cob_cartesian_controller::MoveLin& move_lin_msg);
cob_cartesian_controller::MoveCircStruct convertMoveCirc(const cob_cartesian_controller::MoveCirc& move_circ_msg);

private:
ros::NodeHandle nh_;

// Publisher
ros::Publisher vis_pub_;
ros::Publisher path_pub_;
ros::Publisher speed_pub_;
ros::Publisher accl_pub_;
ros::Publisher jerk_pub_;
ros::ServiceClient startTracking_;
ros::ServiceClient stopTracking_;

//TF Broadcaster-Var
tf::TransformBroadcaster br_;
tf::Transform transform_;
tf::Quaternion q_;
tf::TransformListener listener_;
tf::StampedTransform currentEndeffectorStampedTransform_;

// Var for PTP Movement and hold Position
bool reached_pos_,hold_;

// yaml params
double update_rate_;
std::string stringPath_, fileName_;
std::string referenceFrame_,targetFrame_;
std::string chain_tip_link_;
const char* charPath_;

int marker1_;
ros::NodeHandle nh_;
tf::TransformListener tf_listener_;
tf::TransformBroadcaster tf_broadcaster_;

ros::ServiceClient start_tracking_;
ros::ServiceClient stop_tracking_;
bool tracking_;

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_;
cob_cartesian_controller::CartesianControllerFeedback action_feedback_;
cob_cartesian_controller::CartesianControllerResult action_result_;

CartesianControllerUtils utils_;
boost::shared_ptr< TrajectoryInterpolator > trajectory_interpolator_;
};

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*!
*****************************************************************
* \file
*
* \note
* Copyright (c) 2015 \n
* Fraunhofer Institute for Manufacturing Engineering
* and Automation (IPA) \n\n
*
*****************************************************************
*
* \note
* Project name: care-o-bot
* \note
* ROS stack name: cob_control
* \note
* ROS package name: cob_cartesian_controller
*
* \author
* Author: Christoph Mark, email: [email protected] / [email protected]
*
* \date Date of creation: July, 2015
*
* \brief
* ...
*
****************************************************************/

#ifndef COB_CARTESIAN_CONTROLLER_DATA_STRUCTURES_H_
#define COB_CARTESIAN_CONTROLLER_DATA_STRUCTURES_H_

#include <std_msgs/Float64.h>
#include <geometry_msgs/Pose.h>
#include <exception>

namespace cob_cartesian_controller
{
struct ProfileStruct
{
unsigned int profile_type;
double vel, accl;
};

struct MoveLinStruct
{
geometry_msgs::Pose start, end;
bool rotate_only;

ProfileStruct profile;
};

struct MoveCircStruct
{
geometry_msgs::Pose pose_center;
double start_angle, end_angle;
double radius;
bool rotate_only;

ProfileStruct profile;
};

struct CartesianActionStruct
{
unsigned int move_type;
MoveLinStruct move_lin;
MoveCircStruct move_circ;
};

}//namespace


#endif /* COB_CARTESIAN_CONTROLLER_DATA_STRUCTURES_H_ */
Loading