The attached patch describes how the follower should behave.It will enable the trajectory follower only to send motion commands as long as it is processing a trajectory.
If you are fine with these changes, I would like to push it to master by end of today.
Regards, Christian Am 21.03.2014 13:06, schrieb Janosch Machowinski:
I like my robot to stop if it reaches the end of the trajectory. For the case of no pose and no trajectory, we could drop the 0,0 command Greetings Janosch On 21.03.2014 10:56, Christian Rauch wrote:Hi, the TrajectoryFollower::Task is currently writing stop motion commands (0,0) if: - there is no pose - there is no trajectory set - it reached the end of the trajectory I would like to have the task only sending motion commands when it actually follows a trajectory. In all of the cases above the TrajectoryFollower has nothing to follow and should therefore not generate any commands. The reason is that the TrajectoryFollower blocks other tasks from writing motion commands to the driver, even if it does not has anything to do. Opinions? Regards, Christian _______________________________________________ Rock-dev mailing list [email protected] http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev_______________________________________________ Rock-dev mailing list [email protected] http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
-- Christian Rauch Space Robotics Universität Bremen FB 3 - Mathematik und Informatik AG Robotik Robert-Hooke-Straße 1 28359 Bremen, Germany Zentrale: +49 421 178 45-6611 Besuchsadresse der Nebengeschäftstelle: Robert-Hooke-Straße 5 28359 Bremen, Germany Tel: +49 421 178 45-6619 Empfang: +49 421 178 45-6600 Fax: +49 421 178 45-4150 E-Mail: [email protected] Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
From 15734ab844a4e9f9a2dc4acf1d498bf7164fec90 Mon Sep 17 00:00:00 2001 From: Christian Rauch <[email protected]> Date: Fri, 21 Mar 2014 13:42:08 +0100 Subject: [PATCH] Only send motion commands if there is a real trajectory to follow. --- tasks/Task.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tasks/Task.cpp b/tasks/Task.cpp index ef0a70e..4d8591e 100644 --- a/tasks/Task.cpp +++ b/tasks/Task.cpp @@ -86,7 +86,6 @@ void Task::updateHook() { trajectories.clear(); trFollower->removeTrajectory(); - _motion_command.write(mc); return; } @@ -95,7 +94,6 @@ void Task::updateHook() { trajectories.clear(); trFollower->removeTrajectory(); - _motion_command.write(mc); return; } else if (trajectory_status == RTT::NewData) @@ -145,14 +143,17 @@ void Task::updateHook() RTT::log(RTT::Error) << "Trajectory follower failed" << RTT::endlog(); break; } - - mc.translation = motionCmd(0); - mc.rotation = motionCmd(1); - - _motion_command.write(mc); - _currentCurvePoint.write(trFollower->getCurvePoint()); - _poseError.write(trFollower->getControlError()); - _currentPose.write(trFollower->getPose()); + + // only write if we are actually following a trajectory + if(status == TrajectoryFollower::RUNNING) { + mc.translation = motionCmd(0); + mc.rotation = motionCmd(1); + + _motion_command.write(mc); + _currentCurvePoint.write(trFollower->getCurvePoint()); + _poseError.write(trFollower->getControlError()); + _currentPose.write(trFollower->getPose()); + } } // void Task::errorHook() -- 1.7.9.5
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ Rock-dev mailing list [email protected] http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
