1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-10 10:00:48 +02:00

Bugfix in calculating servoj commands

This commit is contained in:
Thomas Timm Andersen
2015-09-09 11:15:14 +02:00
parent 28e033f5b3
commit cb38c1f028
2 changed files with 7 additions and 8 deletions

View File

@@ -30,15 +30,14 @@ class URTrajectoryFollower {
protected:
ros::NodeHandle nh_;
actionlib::SimpleActionServer<control_msgs::FollowJointTrajectoryAction> as_;
std::string action_name_;
actionlib::SimpleActionServer<control_msgs::FollowJointTrajectoryAction>::Goal goal_;
control_msgs::FollowJointTrajectoryFeedback feedback_;
control_msgs::FollowJointTrajectoryResult result_;
ros::Subscriber sub_;
UrDriver* robot_;
public:
URTrajectoryFollower(UrDriver* robot, std::string name) :
as_(nh_, "follow_joint_trajectory", false), action_name_(name) {
URTrajectoryFollower(UrDriver* robot) :
as_(nh_, "follow_joint_trajectory", false) {
robot_ = robot;
//register the goal and feeback callbacks
as_.registerGoalCallback(
@@ -88,7 +87,7 @@ public:
}
void preemptCB() {
ROS_INFO("%s: Preempted", action_name_.c_str());
ROS_INFO("on_cancel");
// set the action state to preempted
robot_->stopTraj();
as_.setPreempted();
@@ -216,7 +215,7 @@ int main(int argc, char **argv) {
robot.start();
std::thread rt_publish_thread(publishRTMsg, robot);
URTrajectoryFollower action_server(&robot, ros::this_node::getName());
URTrajectoryFollower action_server(&robot);
ros::spin();
robot.halt();