From a3afeb1891d31a15e3c84c3b490648841786eb57 Mon Sep 17 00:00:00 2001 From: Igorec Date: Thu, 6 Mar 2014 21:48:52 +0400 Subject: [PATCH 01/12] Add PosVel and PosVelAcc interfaces. --- hardware_interface/CMakeLists.txt | 7 + .../posvel_command_interface.h | 94 +++++++++++ .../posvelacc_command_interface.h | 89 +++++++++++ .../test/posvel_command_interface_test.cpp | 144 +++++++++++++++++ .../test/posvelacc_command_interface_test.cpp | 150 ++++++++++++++++++ 5 files changed, 484 insertions(+) create mode 100644 hardware_interface/include/hardware_interface/posvel_command_interface.h create mode 100644 hardware_interface/include/hardware_interface/posvelacc_command_interface.h create mode 100644 hardware_interface/test/posvel_command_interface_test.cpp create mode 100644 hardware_interface/test/posvelacc_command_interface_test.cpp diff --git a/hardware_interface/CMakeLists.txt b/hardware_interface/CMakeLists.txt index 38a4652ee..7c97e80f2 100644 --- a/hardware_interface/CMakeLists.txt +++ b/hardware_interface/CMakeLists.txt @@ -38,6 +38,13 @@ if(CATKIN_ENABLE_TESTING) catkin_add_gtest(interface_manager_test test/interface_manager_test.cpp) target_link_libraries(interface_manager_test ${catkin_LIBRARIES}) + + catkin_add_gtest(posvel_command_interface_test test/posvel_command_interface_test.cpp) + target_link_libraries(posvel_command_interface_test ${catkin_LIBRARIES}) + + catkin_add_gtest(posvelacc_command_interface_test test/posvelacc_command_interface_test.cpp) + target_link_libraries(posvelacc_command_interface_test ${catkin_LIBRARIES}) + endif() # Install diff --git a/hardware_interface/include/hardware_interface/posvel_command_interface.h b/hardware_interface/include/hardware_interface/posvel_command_interface.h new file mode 100644 index 000000000..9cb5d65ee --- /dev/null +++ b/hardware_interface/include/hardware_interface/posvel_command_interface.h @@ -0,0 +1,94 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2012, hiDOF INC. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of hiDOF, Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +////////////////////////////////////////////////////////////////////////////// + +/// \author Igor Kalevatykh + +#ifndef HARDWARE_INTERFACE_POSVEL_COMMAND_INTERFACE_H +#define HARDWARE_INTERFACE_POSVEL_COMMAND_INTERFACE_H + +#include +#include +#include +#include + +namespace hardware_interface +{ + +/** \brief A handle used to read and command a single joint. */ +class PosVelJointHandle : public JointStateHandle +{ +public: + PosVelJointHandle() : JointStateHandle(), cmd_pos_(0), cmd_vel_(0) {} + + /** + * \param js This joint's state handle + * \param cmd_pos A pointer to the storage for this joint's output command position + * \param cmd_vel A pointer to the storage for this joint's output command velocity + */ + PosVelJointHandle(const JointStateHandle& js, double* cmd_pos, double* cmd_vel) + : JointStateHandle(js), cmd_pos_(cmd_pos), cmd_vel_(cmd_vel) + { + if (!cmd_pos) + { + throw HardwareInterfaceException("Cannot create handle '" + js.getName() + "'. Command position pointer is null."); + } + if (!cmd_vel) + { + throw HardwareInterfaceException("Cannot create handle '" + js.getName() + "'. Command velocity pointer is null."); + } + } + + void setCommand(double cmd_pos, double cmd_vel) + { + setCommandPosition(cmd_pos); + setCommandVelocity(cmd_vel); + } + + void setCommandPosition(double cmd_pos) {assert(cmd_pos_); *cmd_pos_ = cmd_pos;} + void setCommandVelocity(double cmd_vel) {assert(cmd_vel_); *cmd_vel_ = cmd_vel;} + + double getCommandPosition() const {assert(cmd_pos_); return *cmd_pos_;} + double getCommandVelocity() const {assert(cmd_vel_); return *cmd_vel_;} + +private: + double* cmd_pos_; + double* cmd_vel_; +}; + +/** \brief Hardware interface to support commanding an array of joints. + * + * This \ref HardwareInterface supports commanding joints by position, velocity + * together in one command. + * + * \note Getting a joint handle through the getHandle() method \e will claim that resource. + * + */ +class PosVelJointInterface : public HardwareResourceManager {}; + +} + +#endif /*HARDWARE_INTERFACE_POSVEL_COMMAND_INTERFACE_H*/ diff --git a/hardware_interface/include/hardware_interface/posvelacc_command_interface.h b/hardware_interface/include/hardware_interface/posvelacc_command_interface.h new file mode 100644 index 000000000..50da7702b --- /dev/null +++ b/hardware_interface/include/hardware_interface/posvelacc_command_interface.h @@ -0,0 +1,89 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2012, hiDOF INC. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of hiDOF, Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +////////////////////////////////////////////////////////////////////////////// + +/// \author Igor Kalevatykh + +#ifndef HARDWARE_INTERFACE_POSVELACC_COMMAND_INTERFACE_H +#define HARDWARE_INTERFACE_POSVELACC_COMMAND_INTERFACE_H + +#include +#include +#include +#include + +namespace hardware_interface +{ + +/** \brief A handle used to read and command a single joint. */ +class PosVelAccJointHandle : public PosVelJointHandle +{ +public: + PosVelAccJointHandle() : PosVelJointHandle(), cmd_acc_(0) {} + + /** + * \param js This joint's state handle + * \param cmd_pos A pointer to the storage for this joint's output command position + * \param cmd_vel A pointer to the storage for this joint's output command velocity + * \param eff_cmd A pointer to the storage for this joint's output command acceleration + */ + PosVelAccJointHandle(const JointStateHandle& js, double* cmd_pos, double* cmd_vel, double* cmd_acc) + : PosVelJointHandle(js, cmd_pos, cmd_vel), cmd_acc_(cmd_acc) + { + if (!cmd_acc) + { + throw HardwareInterfaceException("Cannot create handle '" + js.getName() + "'. Command acceleration data pointer is null."); + } + } + + void setCommand(double cmd_pos, double cmd_vel, double cmd_acc) + { + setCommandPosition(cmd_pos); + setCommandVelocity(cmd_vel); + setCommandAcceleration(cmd_acc); + } + + void setCommandAcceleration(double cmd_acc) {assert(cmd_acc_); *cmd_acc_ = cmd_acc;} + double getCommandAcceleration() const {assert(cmd_acc_); return *cmd_acc_;} + +private: + double* cmd_acc_; +}; + + +/** \brief Hardware interface to support commanding an array of joints. + * + * This \ref HardwareInterface supports commanding joints by position, velocity & + * acceleration together in one command. + * + * \note Getting a joint handle through the getHandle() method \e will claim that resource. + * + */ +class PosVelAccJointInterface : public HardwareResourceManager {}; + +} + +#endif /*HARDWARE_INTERFACE_POSVELACC_COMMAND_INTERFACE_H*/ diff --git a/hardware_interface/test/posvel_command_interface_test.cpp b/hardware_interface/test/posvel_command_interface_test.cpp new file mode 100644 index 000000000..a6dd660ae --- /dev/null +++ b/hardware_interface/test/posvel_command_interface_test.cpp @@ -0,0 +1,144 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2013, PAL Robotics S.L. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of hiDOF, Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +////////////////////////////////////////////////////////////////////////////// + +/// \author Adolfo Rodriguez Tsouroukdissian + +#include +#include +#include +#include + +using std::string; +using namespace hardware_interface; + +TEST(PosVelCommandHandleTest, HandleConstruction) +{ + string name = "name1"; + double pos, vel, eff; + double cmd_pos, cmd_vel; + EXPECT_NO_THROW(PosVelJointHandle tmp(JointStateHandle(name, &pos, &vel, &eff), &cmd_pos, &cmd_vel)); + EXPECT_THROW(PosVelJointHandle tmp(JointStateHandle(name, &pos, &vel, &eff), 0, &cmd_vel), HardwareInterfaceException); + EXPECT_THROW(PosVelJointHandle tmp(JointStateHandle(name, &pos, &vel, &eff), &cmd_pos, 0), HardwareInterfaceException); + + // Print error messages + // Requires manual output inspection, but exception message should be descriptive + try {PosVelJointHandle tmp(JointStateHandle(name, &pos, &vel, &eff), 0, 0);} + catch(const HardwareInterfaceException& e) {ROS_ERROR_STREAM(e.what());} +} + +#ifndef NDEBUG // NOTE: This test validates assertion triggering, hence only gets compiled in debug mode +TEST(JointStateHandleTest, AssertionTriggering) +{ + PosVelJointHandle h; + + // Data with invalid pointers should trigger an assertion + EXPECT_DEATH(h.getPosition(), ".*"); + EXPECT_DEATH(h.getVelocity(), ".*"); + EXPECT_DEATH(h.getEffort(), ".*"); + EXPECT_DEATH(h.getCommandPosition(), ".*"); + EXPECT_DEATH(h.getCommandVelocity(), ".*"); + EXPECT_DEATH(h.setCommandPosition(2.0), ".*"); + EXPECT_DEATH(h.setCommandVelocity(3.0), ".*"); + EXPECT_DEATH(h.setCommand(1.0, 2.0), ".*"); +} +#endif // NDEBUG + +class PosVelCommandInterfaceTest : public ::testing::Test +{ +public: + PosVelCommandInterfaceTest() + : pos1(1.0), vel1(2.0), eff1(3.0), + cmd_pos1(0.0), cmd_vel1(0.0), + pos2(4.0), vel2(5.0), eff2(6.0), + cmd_pos2(0.0), cmd_vel2(0.0), + name1("name_1"), + name2("name_2"), + hs1(name1, &pos1, &vel1, &eff1), + hs2(name2, &pos2, &vel2, &eff2), + hc1(hs1, &cmd_pos1, &cmd_vel1), + hc2(hs2, &cmd_pos2, &cmd_vel2) + {} + +protected: + double pos1, vel1, eff1, cmd_pos1, cmd_vel1; + double pos2, vel2, eff2, cmd_pos2, cmd_vel2; + string name1; + string name2; + JointStateHandle hs1, hs2; + PosVelJointHandle hc1, hc2; +}; + +TEST_F(PosVelCommandInterfaceTest, ExcerciseApi) +{ + PosVelJointInterface iface; + iface.registerHandle(hc1); + iface.registerHandle(hc2); + + // Get handles + EXPECT_NO_THROW(iface.getHandle(name1)); + EXPECT_NO_THROW(iface.getHandle(name2)); + + PosVelJointHandle hc1_tmp = iface.getHandle(name1); + EXPECT_EQ(name1, hc1_tmp.getName()); + EXPECT_DOUBLE_EQ(pos1, hc1_tmp.getPosition()); + EXPECT_DOUBLE_EQ(vel1, hc1_tmp.getVelocity()); + EXPECT_DOUBLE_EQ(eff1, hc1_tmp.getEffort()); + EXPECT_DOUBLE_EQ(cmd_pos1, hc1_tmp.getCommandPosition()); + EXPECT_DOUBLE_EQ(cmd_vel1, hc1_tmp.getCommandVelocity()); + const double new_cmd_pos1 = -1.0, new_cmd_vel1 = -2.0; + hc1_tmp.setCommand(new_cmd_pos1, new_cmd_vel1); + EXPECT_DOUBLE_EQ(new_cmd_pos1, hc1_tmp.getCommandPosition()); + EXPECT_DOUBLE_EQ(new_cmd_vel1, hc1_tmp.getCommandVelocity()); + + + PosVelJointHandle hc2_tmp = iface.getHandle(name2); + EXPECT_EQ(name2, hc2_tmp.getName()); + EXPECT_DOUBLE_EQ(pos2, hc2_tmp.getPosition()); + EXPECT_DOUBLE_EQ(vel2, hc2_tmp.getVelocity()); + EXPECT_DOUBLE_EQ(eff2, hc2_tmp.getEffort()); + EXPECT_DOUBLE_EQ(cmd_pos2, hc2_tmp.getCommandPosition()); + EXPECT_DOUBLE_EQ(cmd_vel2, hc2_tmp.getCommandVelocity()); + const double new_cmd_pos2 = -1.0, new_cmd_vel2 = -2.0; + hc2_tmp.setCommand(new_cmd_pos2, new_cmd_vel2); + EXPECT_DOUBLE_EQ(new_cmd_pos2, hc2_tmp.getCommandPosition()); + EXPECT_DOUBLE_EQ(new_cmd_vel2, hc2_tmp.getCommandVelocity()); + + // This interface claims resources + EXPECT_EQ(2, iface.getClaims().size()); + + // Print error message + // Requires manual output inspection, but exception message should contain the interface name (not its base clase) + try {iface.getHandle("unknown_name");} + catch(const HardwareInterfaceException& e) {ROS_ERROR_STREAM(e.what());} +} + +int main(int argc, char** argv) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} + diff --git a/hardware_interface/test/posvelacc_command_interface_test.cpp b/hardware_interface/test/posvelacc_command_interface_test.cpp new file mode 100644 index 000000000..f2f5136c6 --- /dev/null +++ b/hardware_interface/test/posvelacc_command_interface_test.cpp @@ -0,0 +1,150 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2013, PAL Robotics S.L. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of hiDOF, Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +////////////////////////////////////////////////////////////////////////////// + +/// \author Adolfo Rodriguez Tsouroukdissian + +#include +#include +#include +#include + +using std::string; +using namespace hardware_interface; + +TEST(PosVelAccCommandHandleTest, HandleConstruction) +{ + string name = "name1"; + double pos, vel, eff; + double cmd_pos, cmd_vel, cmd_acc; + EXPECT_NO_THROW(PosVelAccJointHandle tmp(JointStateHandle(name, &pos, &vel, &eff), &cmd_pos, &cmd_vel, &cmd_acc)); + EXPECT_THROW(PosVelAccJointHandle tmp(JointStateHandle(name, &pos, &vel, &eff), 0, &cmd_vel, &cmd_acc), HardwareInterfaceException); + EXPECT_THROW(PosVelAccJointHandle tmp(JointStateHandle(name, &pos, &vel, &eff), &cmd_pos, 0, &cmd_acc), HardwareInterfaceException); + EXPECT_THROW(PosVelAccJointHandle tmp(JointStateHandle(name, &pos, &vel, &eff), &cmd_pos, &cmd_vel, 0), HardwareInterfaceException); + + // Print error messages + // Requires manual output inspection, but exception message should be descriptive + try {PosVelAccJointHandle tmp(JointStateHandle(name, &pos, &vel, &eff), 0, 0, 0);} + catch(const HardwareInterfaceException& e) {ROS_ERROR_STREAM(e.what());} +} + +#ifndef NDEBUG // NOTE: This test validates assertion triggering, hence only gets compiled in debug mode +TEST(JointStateHandleTest, AssertionTriggering) +{ + PosVelAccJointHandle h; + + // Data with invalid pointers should trigger an assertion + EXPECT_DEATH(h.getPosition(), ".*"); + EXPECT_DEATH(h.getVelocity(), ".*"); + EXPECT_DEATH(h.getEffort(), ".*"); + EXPECT_DEATH(h.getCommandPosition(), ".*"); + EXPECT_DEATH(h.getCommandVelocity(), ".*"); + EXPECT_DEATH(h.getCommandAcceleration(), ".*"); + EXPECT_DEATH(h.setCommandPosition(2.0), ".*"); + EXPECT_DEATH(h.setCommandVelocity(3.0), ".*"); + EXPECT_DEATH(h.setCommandAcceleration(4.0), ".*"); + EXPECT_DEATH(h.setCommand(1.0, 2.0, 3.0), ".*"); +} +#endif // NDEBUG + +class PosVelAccCommandInterfaceTest : public ::testing::Test +{ +public: + PosVelAccCommandInterfaceTest() + : pos1(1.0), vel1(2.0), eff1(3.0), + cmd_pos1(0.0), cmd_vel1(0.0), cmd_acc1(0.0), + pos2(4.0), vel2(5.0), eff2(6.0), + cmd_pos2(0.0), cmd_vel2(0.0), cmd_acc2(0.0), + name1("name_1"), + name2("name_2"), + hs1(name1, &pos1, &vel1, &eff1), + hs2(name2, &pos2, &vel2, &eff2), + hc1(hs1, &cmd_pos1, &cmd_vel1, &cmd_acc1), + hc2(hs2, &cmd_pos2, &cmd_vel2, &cmd_acc2) + {} + +protected: + double pos1, vel1, eff1, cmd_pos1, cmd_vel1, cmd_acc1; + double pos2, vel2, eff2, cmd_pos2, cmd_vel2, cmd_acc2; + string name1; + string name2; + JointStateHandle hs1, hs2; + PosVelAccJointHandle hc1, hc2; +}; + +TEST_F(PosVelAccCommandInterfaceTest, ExcerciseApi) +{ + PosVelAccJointInterface iface; + iface.registerHandle(hc1); + iface.registerHandle(hc2); + + // Get handles + EXPECT_NO_THROW(iface.getHandle(name1)); + EXPECT_NO_THROW(iface.getHandle(name2)); + + PosVelAccJointHandle hc1_tmp = iface.getHandle(name1); + EXPECT_EQ(name1, hc1_tmp.getName()); + EXPECT_DOUBLE_EQ(pos1, hc1_tmp.getPosition()); + EXPECT_DOUBLE_EQ(vel1, hc1_tmp.getVelocity()); + EXPECT_DOUBLE_EQ(eff1, hc1_tmp.getEffort()); + EXPECT_DOUBLE_EQ(cmd_pos1, hc1_tmp.getCommandPosition()); + EXPECT_DOUBLE_EQ(cmd_vel1, hc1_tmp.getCommandVelocity()); + EXPECT_DOUBLE_EQ(cmd_acc1, hc1_tmp.getCommandAcceleration()); + const double new_cmd_pos1 = -1.0, new_cmd_vel1 = -2.0, new_cmd_acc1 = -3.0; + hc1_tmp.setCommand(new_cmd_pos1, new_cmd_vel1, new_cmd_acc1); + EXPECT_DOUBLE_EQ(new_cmd_pos1, hc1_tmp.getCommandPosition()); + EXPECT_DOUBLE_EQ(new_cmd_vel1, hc1_tmp.getCommandVelocity()); + EXPECT_DOUBLE_EQ(new_cmd_acc1, hc1_tmp.getCommandAcceleration()); + + PosVelAccJointHandle hc2_tmp = iface.getHandle(name2); + EXPECT_EQ(name2, hc2_tmp.getName()); + EXPECT_DOUBLE_EQ(pos2, hc2_tmp.getPosition()); + EXPECT_DOUBLE_EQ(vel2, hc2_tmp.getVelocity()); + EXPECT_DOUBLE_EQ(eff2, hc2_tmp.getEffort()); + EXPECT_DOUBLE_EQ(cmd_pos2, hc2_tmp.getCommandPosition()); + EXPECT_DOUBLE_EQ(cmd_vel2, hc2_tmp.getCommandVelocity()); + EXPECT_DOUBLE_EQ(cmd_acc2, hc2_tmp.getCommandAcceleration()); + const double new_cmd_pos2 = -1.0, new_cmd_vel2 = -2.0, new_cmd_acc2 = -3.0; + hc2_tmp.setCommand(new_cmd_pos2, new_cmd_vel2, new_cmd_acc2); + EXPECT_DOUBLE_EQ(new_cmd_pos2, hc2_tmp.getCommandPosition()); + EXPECT_DOUBLE_EQ(new_cmd_vel2, hc2_tmp.getCommandVelocity()); + EXPECT_DOUBLE_EQ(new_cmd_acc2, hc2_tmp.getCommandAcceleration()); + + // This interface claims resources + EXPECT_EQ(2, iface.getClaims().size()); + + // Print error message + // Requires manual output inspection, but exception message should contain the interface name (not its base clase) + try {iface.getHandle("unknown_name");} + catch(const HardwareInterfaceException& e) {ROS_ERROR_STREAM(e.what());} +} + +int main(int argc, char** argv) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} + From 334aa60d967334912d9018c9de7a189e65fb59e0 Mon Sep 17 00:00:00 2001 From: Jonathan Bohren Date: Wed, 14 May 2014 19:48:35 -0400 Subject: [PATCH 02/12] controller_manager: spawner: adding shutdown timeout to prevent deadlocks --- controller_manager/scripts/spawner | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/controller_manager/scripts/spawner b/controller_manager/scripts/spawner index c3b9e6e93..41139975f 100755 --- a/controller_manager/scripts/spawner +++ b/controller_manager/scripts/spawner @@ -50,24 +50,33 @@ load_controller_service = "" switch_controller_service = "" unload_controller_service = "" +shutdown_timeout = 30.0 def shutdown(): - global loaded,unload_controller_service,load_controller_service,switch_controller_service + global loaded,unload_controller_service,load_controller_service,switch_controller_service,shutdown_timeout + + rospy.loginfo("Shutting down spawner. Disabling and unloading controllers...") + # NOTE: Sleep for one second to avoid race conditions inherent in wait_for_service + time.sleep(1.0) try: # unloader unload_controller = rospy.ServiceProxy(unload_controller_service, UnloadController) + unload_controller.wait_for_service(timeout=shutdown_timeout) # switcher switch_controller = rospy.ServiceProxy(switch_controller_service, SwitchController) + switch_controller.wait_for_service(timeout=shutdown_timeout) + rospy.loginfo("Disabling all controllers..."); switch_controller([], loaded, SwitchControllerRequest.STRICT) + rospy.loginfo("Unloading all loaded controllers..."); for name in reversed(loaded): rospy.logout("Trying to unload %s" % name) unload_controller(name) rospy.logout("Succeeded in unloading %s" % name) except (rospy.ServiceException, rospy.exceptions.ROSException) as exc: - rospy.logwarn("Controller Spawner couldn't reach controller_manager to take down controllers.") + rospy.logwarn("Controller Spawner couldn't reach controller_manager to take down controllers. Waited for %g second(s)." % (shutdown_timeout)) def parse_args(args=None): parser = argparse.ArgumentParser(description='Controller spawner') @@ -77,14 +86,16 @@ def parse_args(args=None): 'start controllers until it hears "True" on a topic (Bool)') parser.add_argument('--namespace', metavar='ns', help='namespace of the controller_manager services') - parser.add_argument('--timeout', metavar='T', type=int, default=30, - help='how long to wait for controller_manager services [s] (default: 30)') + parser.add_argument('--timeout', metavar='T', type=float, default=30, + help='how long to wait for controller_manager services when starting up [s] (default: 30)') + parser.add_argument('--shutdown-timeout', metavar='T', type=float, default=30, + help='how long to wait for controller_manager services when shutting down [s] (default: 30)') parser.add_argument('controllers', metavar='controller', nargs='+', help='controllers to load') return parser.parse_args(args=args) def main(): - global unload_controller_service,load_controller_service,switch_controller_service + global unload_controller_service,load_controller_service,switch_controller_service,shutdown_timeout args = parse_args(rospy.myargv()[1:]) @@ -92,6 +103,7 @@ def main(): autostart = 1 if not args.stopped else 0 robot_namespace = args.namespace or "" timeout = args.timeout + shutdown_timeout = args.shutdown_timeout rospy.init_node('spawner', anonymous=True) From e5d756fd9a16e3f9f71a5acef0ec7cf438f09a21 Mon Sep 17 00:00:00 2001 From: Jonathan Bohren Date: Fri, 3 Oct 2014 10:44:30 -0400 Subject: [PATCH 03/12] spawner: fixing shutdown message --- controller_manager/scripts/spawner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller_manager/scripts/spawner b/controller_manager/scripts/spawner index 41139975f..5eb8b677a 100755 --- a/controller_manager/scripts/spawner +++ b/controller_manager/scripts/spawner @@ -68,7 +68,7 @@ def shutdown(): switch_controller = rospy.ServiceProxy(switch_controller_service, SwitchController) switch_controller.wait_for_service(timeout=shutdown_timeout) - rospy.loginfo("Disabling all controllers..."); + rospy.loginfo("Stopping all controllers..."); switch_controller([], loaded, SwitchControllerRequest.STRICT) rospy.loginfo("Unloading all loaded controllers..."); for name in reversed(loaded): From 0258dd39ddf6267ebeb4c7853673e6f979600fd3 Mon Sep 17 00:00:00 2001 From: Jonathan Bohren Date: Fri, 3 Oct 2014 10:45:02 -0400 Subject: [PATCH 04/12] spawner: changing language --- controller_manager/scripts/spawner | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller_manager/scripts/spawner b/controller_manager/scripts/spawner index 5eb8b677a..2c177ba21 100755 --- a/controller_manager/scripts/spawner +++ b/controller_manager/scripts/spawner @@ -55,7 +55,7 @@ shutdown_timeout = 30.0 def shutdown(): global loaded,unload_controller_service,load_controller_service,switch_controller_service,shutdown_timeout - rospy.loginfo("Shutting down spawner. Disabling and unloading controllers...") + rospy.loginfo("Shutting down spawner. Stopping and unloading controllers...") # NOTE: Sleep for one second to avoid race conditions inherent in wait_for_service time.sleep(1.0) From 90cc9eeccb1cb22af828804bf329dc189e7d081a Mon Sep 17 00:00:00 2001 From: Adolfo Rodriguez Tsouroukdissian Date: Fri, 10 Oct 2014 10:55:05 +0200 Subject: [PATCH 05/12] Buildsystem fixes suggested by catkin_lint --- joint_limits_interface/CMakeLists.txt | 5 ++--- transmission_interface/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/joint_limits_interface/CMakeLists.txt b/joint_limits_interface/CMakeLists.txt index 67d44225d..00644eaf8 100644 --- a/joint_limits_interface/CMakeLists.txt +++ b/joint_limits_interface/CMakeLists.txt @@ -3,13 +3,12 @@ project(joint_limits_interface) find_package(urdfdom REQUIRED) -find_package(catkin REQUIRED +find_package(catkin REQUIRED COMPONENTS roscpp hardware_interface ) include_directories( - SYSTEM include ${catkin_INCLUDE_DIRS} ${urdfdom_INCLUDE_DIRS} @@ -30,7 +29,7 @@ catkin_package( ) if(CATKIN_ENABLE_TESTING) - find_package(rostest) + find_package(rostest REQUIRED) catkin_add_gtest(joint_limits_interface_test test/joint_limits_interface_test.cpp) target_link_libraries(joint_limits_interface_test ${catkin_LIBRARIES} diff --git a/transmission_interface/CMakeLists.txt b/transmission_interface/CMakeLists.txt index 2e410194e..5e9faf5ac 100644 --- a/transmission_interface/CMakeLists.txt +++ b/transmission_interface/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.3) project(transmission_interface) # Load catkin and all dependencies required for this package -find_package(catkin REQUIRED +find_package(catkin REQUIRED COMPONENTS hardware_interface cmake_modules pluginlib From f4b390350e0668d2caf48af7cc8d9f25557624a4 Mon Sep 17 00:00:00 2001 From: Adolfo Rodriguez Tsouroukdissian Date: Wed, 29 Oct 2014 12:56:29 +0100 Subject: [PATCH 06/12] Remove rosbuild-specific file --- CMakeLists.txt | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 7ea40351a..000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 2.4.6) -include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) - -set(ROSPACK_MAKEDIST true) - -# Append to CPACK_SOURCE_IGNORE_FILES a semicolon-separated list of -# directories (or patterns, but directories should suffice) that should -# be excluded from the distro. This is not the place to put things that -# should be ignored everywhere, like "build" directories; that happens in -# rosbuild/rosbuild.cmake. Here should be listed packages that aren't -# ready for inclusion in a distro. -# -# This list is combined with the list in rosbuild/rosbuild.cmake. Note -# that CMake 2.6 may be required to ensure that the two lists are combined -# properly. CMake 2.4 seems to have unpredictable scoping rules for such -# variables. -#list(APPEND CPACK_SOURCE_IGNORE_FILES /core/experimental) - -rosbuild_make_distribution(0.0.3) From 1c71220158a7e01e232ae59e130f8ec5b54bb9c7 Mon Sep 17 00:00:00 2001 From: Adolfo Rodriguez Tsouroukdissian Date: Fri, 31 Oct 2014 09:59:51 +0100 Subject: [PATCH 07/12] Update changelogs --- controller_interface/CHANGELOG.rst | 3 +++ controller_manager/CHANGELOG.rst | 6 ++++++ controller_manager_msgs/CHANGELOG.rst | 9 +++++++++ controller_manager_tests/CHANGELOG.rst | 6 ++++++ hardware_interface/CHANGELOG.rst | 6 ++++++ joint_limits_interface/CHANGELOG.rst | 6 ++++++ ros_control/CHANGELOG.rst | 3 +++ rqt_controller_manager/CHANGELOG.rst | 3 +++ transmission_interface/CHANGELOG.rst | 5 +++++ 9 files changed, 47 insertions(+) diff --git a/controller_interface/CHANGELOG.rst b/controller_interface/CHANGELOG.rst index cac549c72..8869815d2 100644 --- a/controller_interface/CHANGELOG.rst +++ b/controller_interface/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package controller_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- + 0.8.2 (2014-06-25) ------------------ diff --git a/controller_manager/CHANGELOG.rst b/controller_manager/CHANGELOG.rst index 237f4c7be..ddc12b6c5 100644 --- a/controller_manager/CHANGELOG.rst +++ b/controller_manager/CHANGELOG.rst @@ -2,6 +2,12 @@ Changelog for package controller_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Spawner script: adding shutdown timeout to prevent deadlocks +* Documentation fixes +* Contributors: Jonathan Bohren, shadowmanos + 0.8.2 (2014-06-25) ------------------ diff --git a/controller_manager_msgs/CHANGELOG.rst b/controller_manager_msgs/CHANGELOG.rst index 1c583a9a3..4e4ae6466 100644 --- a/controller_manager_msgs/CHANGELOG.rst +++ b/controller_manager_msgs/CHANGELOG.rst @@ -2,6 +2,15 @@ Changelog for package controller_manager_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Add Python helpers for: + - Getting all active controller managers. + - Determining if a namespace contains the controller manager ROS API. + - Filtering the output of the 'list_controllers' service by + type, name, state, hardware_interface and claimed resources. +* Contributors: Adolfo Rodriguez Tsouroukdissian + 0.8.2 (2014-06-25) ------------------ diff --git a/controller_manager_tests/CHANGELOG.rst b/controller_manager_tests/CHANGELOG.rst index 317bfee5f..8ee6fbe18 100644 --- a/controller_manager_tests/CHANGELOG.rst +++ b/controller_manager_tests/CHANGELOG.rst @@ -2,6 +2,12 @@ Changelog for package controller_manager_tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Tests for Python helpers added to controller_manager_msgs +* Buildsystem and documentation fixes +* Contributors: Adolfo Rodriguez Tsouroukdissian, Lukas Bulwahn, shadowmanos + 0.8.2 (2014-06-25) ------------------ diff --git a/hardware_interface/CHANGELOG.rst b/hardware_interface/CHANGELOG.rst index 7777ebf8a..4f69bd5eb 100644 --- a/hardware_interface/CHANGELOG.rst +++ b/hardware_interface/CHANGELOG.rst @@ -2,6 +2,12 @@ Changelog for package hardware_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Add PosVel and PosVelAcc command interfaces +* Documentation fixes +* Contributors: Igorec, shadowmanos + 0.8.2 (2014-06-25) ------------------ diff --git a/joint_limits_interface/CHANGELOG.rst b/joint_limits_interface/CHANGELOG.rst index 7a0cafcaf..7d43a9515 100644 --- a/joint_limits_interface/CHANGELOG.rst +++ b/joint_limits_interface/CHANGELOG.rst @@ -2,6 +2,12 @@ Changelog for package joint_limits_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Buildsystem and documentation fixes +* Add inline keyword to free header functions +* Contributors: Adolfo Rodriguez Tsouroukdissian, Lukas Bulwahn, shadowmanos + 0.8.2 (2014-06-25) ------------------ * Propagate urdfdom changes to CMakeLists.txt diff --git a/ros_control/CHANGELOG.rst b/ros_control/CHANGELOG.rst index 27d8f6fce..4ec11681a 100644 --- a/ros_control/CHANGELOG.rst +++ b/ros_control/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package ros_control ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- + 0.8.2 (2014-06-25) ------------------ diff --git a/rqt_controller_manager/CHANGELOG.rst b/rqt_controller_manager/CHANGELOG.rst index e1f32b121..b7204ef9a 100644 --- a/rqt_controller_manager/CHANGELOG.rst +++ b/rqt_controller_manager/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package rqt_controller_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- + 0.8.2 (2014-06-25) ------------------ diff --git a/transmission_interface/CHANGELOG.rst b/transmission_interface/CHANGELOG.rst index 1320baf64..7188b4ea8 100644 --- a/transmission_interface/CHANGELOG.rst +++ b/transmission_interface/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog for package transmission_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Buildsystem and documentation fixes +* Contributors: Adolfo Rodriguez Tsouroukdissian, shadowmanos + 0.8.2 (2014-06-25) ------------------ From 74f0d0351a39aa7a1d58a10c3b7f1a311b2f3816 Mon Sep 17 00:00:00 2001 From: Adolfo Rodriguez Tsouroukdissian Date: Fri, 31 Oct 2014 11:45:28 +0100 Subject: [PATCH 08/12] 0.9.0 --- controller_interface/CHANGELOG.rst | 4 ++-- controller_interface/package.xml | 2 +- controller_manager/CHANGELOG.rst | 4 ++-- controller_manager/package.xml | 2 +- controller_manager_msgs/CHANGELOG.rst | 4 ++-- controller_manager_msgs/package.xml | 2 +- controller_manager_tests/CHANGELOG.rst | 4 ++-- controller_manager_tests/package.xml | 2 +- hardware_interface/CHANGELOG.rst | 4 ++-- hardware_interface/package.xml | 2 +- joint_limits_interface/CHANGELOG.rst | 4 ++-- joint_limits_interface/package.xml | 2 +- ros_control/CHANGELOG.rst | 4 ++-- ros_control/package.xml | 2 +- rqt_controller_manager/CHANGELOG.rst | 4 ++-- rqt_controller_manager/package.xml | 2 +- transmission_interface/CHANGELOG.rst | 4 ++-- transmission_interface/package.xml | 2 +- 18 files changed, 27 insertions(+), 27 deletions(-) diff --git a/controller_interface/CHANGELOG.rst b/controller_interface/CHANGELOG.rst index 8869815d2..1fcb8f67d 100644 --- a/controller_interface/CHANGELOG.rst +++ b/controller_interface/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package controller_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.0 (2014-10-31) +------------------ 0.8.2 (2014-06-25) ------------------ diff --git a/controller_interface/package.xml b/controller_interface/package.xml index 24e30c2c5..dd62e5baf 100644 --- a/controller_interface/package.xml +++ b/controller_interface/package.xml @@ -1,6 +1,6 @@ controller_interface - 0.8.2 + 0.9.0 Interface base class for controllers Wim Meeussen diff --git a/controller_manager/CHANGELOG.rst b/controller_manager/CHANGELOG.rst index ddc12b6c5..e03a56579 100644 --- a/controller_manager/CHANGELOG.rst +++ b/controller_manager/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package controller_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.0 (2014-10-31) +------------------ * Spawner script: adding shutdown timeout to prevent deadlocks * Documentation fixes * Contributors: Jonathan Bohren, shadowmanos diff --git a/controller_manager/package.xml b/controller_manager/package.xml index 969a8497a..0aadf510e 100644 --- a/controller_manager/package.xml +++ b/controller_manager/package.xml @@ -1,6 +1,6 @@ controller_manager - 0.8.2 + 0.9.0 The controller manager. Wim Meeussen diff --git a/controller_manager_msgs/CHANGELOG.rst b/controller_manager_msgs/CHANGELOG.rst index 4e4ae6466..c37e95acb 100644 --- a/controller_manager_msgs/CHANGELOG.rst +++ b/controller_manager_msgs/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package controller_manager_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.0 (2014-10-31) +------------------ * Add Python helpers for: - Getting all active controller managers. - Determining if a namespace contains the controller manager ROS API. diff --git a/controller_manager_msgs/package.xml b/controller_manager_msgs/package.xml index 0a74c69f6..50562c30e 100644 --- a/controller_manager_msgs/package.xml +++ b/controller_manager_msgs/package.xml @@ -1,6 +1,6 @@ controller_manager_msgs - 0.8.2 + 0.9.0 Messages and services for the controller manager. Wim Meeussen diff --git a/controller_manager_tests/CHANGELOG.rst b/controller_manager_tests/CHANGELOG.rst index 8ee6fbe18..cda8a8fd0 100644 --- a/controller_manager_tests/CHANGELOG.rst +++ b/controller_manager_tests/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package controller_manager_tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.0 (2014-10-31) +------------------ * Tests for Python helpers added to controller_manager_msgs * Buildsystem and documentation fixes * Contributors: Adolfo Rodriguez Tsouroukdissian, Lukas Bulwahn, shadowmanos diff --git a/controller_manager_tests/package.xml b/controller_manager_tests/package.xml index 09e42f654..369f9b639 100644 --- a/controller_manager_tests/package.xml +++ b/controller_manager_tests/package.xml @@ -1,6 +1,6 @@ controller_manager_tests - 0.8.2 + 0.9.0 controller_manager_tests Vijay Pradeep diff --git a/hardware_interface/CHANGELOG.rst b/hardware_interface/CHANGELOG.rst index 4f69bd5eb..458c4a7e4 100644 --- a/hardware_interface/CHANGELOG.rst +++ b/hardware_interface/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package hardware_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.0 (2014-10-31) +------------------ * Add PosVel and PosVelAcc command interfaces * Documentation fixes * Contributors: Igorec, shadowmanos diff --git a/hardware_interface/package.xml b/hardware_interface/package.xml index d51b60b4d..c06c3fe14 100644 --- a/hardware_interface/package.xml +++ b/hardware_interface/package.xml @@ -1,6 +1,6 @@ hardware_interface - 0.8.2 + 0.9.0 Hardware Interface base class. Wim Meeussen Adolfo Rodriguez Tsouroukdissian diff --git a/joint_limits_interface/CHANGELOG.rst b/joint_limits_interface/CHANGELOG.rst index 7d43a9515..5db2e9458 100644 --- a/joint_limits_interface/CHANGELOG.rst +++ b/joint_limits_interface/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package joint_limits_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.0 (2014-10-31) +------------------ * Buildsystem and documentation fixes * Add inline keyword to free header functions * Contributors: Adolfo Rodriguez Tsouroukdissian, Lukas Bulwahn, shadowmanos diff --git a/joint_limits_interface/package.xml b/joint_limits_interface/package.xml index bfefd22e8..6897e56c4 100644 --- a/joint_limits_interface/package.xml +++ b/joint_limits_interface/package.xml @@ -1,6 +1,6 @@ joint_limits_interface - 0.8.2 + 0.9.0 Interface for enforcing joint limits. Adolfo Rodriguez Tsouroukdissian BSD diff --git a/ros_control/CHANGELOG.rst b/ros_control/CHANGELOG.rst index 4ec11681a..a7357b5b1 100644 --- a/ros_control/CHANGELOG.rst +++ b/ros_control/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package ros_control ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.0 (2014-10-31) +------------------ 0.8.2 (2014-06-25) ------------------ diff --git a/ros_control/package.xml b/ros_control/package.xml index 9fd087117..19651002e 100644 --- a/ros_control/package.xml +++ b/ros_control/package.xml @@ -1,6 +1,6 @@ ros_control - 0.8.2 + 0.9.0 A set of packages that include controller interfaces, controller managers, transmissions, hardware_interfaces and the control_toolbox. Adolfo Rodriguez Tsouroukdissian diff --git a/rqt_controller_manager/CHANGELOG.rst b/rqt_controller_manager/CHANGELOG.rst index b7204ef9a..41141373d 100644 --- a/rqt_controller_manager/CHANGELOG.rst +++ b/rqt_controller_manager/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package rqt_controller_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.0 (2014-10-31) +------------------ 0.8.2 (2014-06-25) ------------------ diff --git a/rqt_controller_manager/package.xml b/rqt_controller_manager/package.xml index b962f198d..9896a9230 100644 --- a/rqt_controller_manager/package.xml +++ b/rqt_controller_manager/package.xml @@ -1,7 +1,7 @@ rqt_controller_manager - 0.8.2 + 0.9.0 The rqt_controller_manager package Kelsey Hawkins diff --git a/transmission_interface/CHANGELOG.rst b/transmission_interface/CHANGELOG.rst index 7188b4ea8..776ab7039 100644 --- a/transmission_interface/CHANGELOG.rst +++ b/transmission_interface/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package transmission_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.0 (2014-10-31) +------------------ * Buildsystem and documentation fixes * Contributors: Adolfo Rodriguez Tsouroukdissian, shadowmanos diff --git a/transmission_interface/package.xml b/transmission_interface/package.xml index 47812a1de..a52a4e021 100644 --- a/transmission_interface/package.xml +++ b/transmission_interface/package.xml @@ -1,6 +1,6 @@ transmission_interface - 0.8.2 + 0.9.0 Transmission Interface. Adolfo Rodriguez Tsouroukdissian From 6db35abf975055b0f2d929f18de28e009ad0de5c Mon Sep 17 00:00:00 2001 From: Adolfo Rodriguez Tsouroukdissian Date: Mon, 3 Nov 2014 12:07:21 +0100 Subject: [PATCH 09/12] Update package maintainers --- controller_interface/package.xml | 2 +- controller_manager/package.xml | 2 +- controller_manager_msgs/package.xml | 2 +- controller_manager_tests/package.xml | 2 +- hardware_interface/package.xml | 1 - ros_control/package.xml | 1 - 6 files changed, 4 insertions(+), 6 deletions(-) diff --git a/controller_interface/package.xml b/controller_interface/package.xml index dd62e5baf..d15c6fc48 100644 --- a/controller_interface/package.xml +++ b/controller_interface/package.xml @@ -2,7 +2,7 @@ controller_interface 0.9.0 Interface base class for controllers - Wim Meeussen + Adolfo Rodriguez Tsouroukdissian BSD diff --git a/controller_manager/package.xml b/controller_manager/package.xml index 0aadf510e..04abffe02 100644 --- a/controller_manager/package.xml +++ b/controller_manager/package.xml @@ -2,7 +2,7 @@ controller_manager 0.9.0 The controller manager. - Wim Meeussen + Adolfo Rodriguez Tsouroukdissian BSD diff --git a/controller_manager_msgs/package.xml b/controller_manager_msgs/package.xml index 50562c30e..abf6bb812 100644 --- a/controller_manager_msgs/package.xml +++ b/controller_manager_msgs/package.xml @@ -2,7 +2,7 @@ controller_manager_msgs 0.9.0 Messages and services for the controller manager. - Wim Meeussen + Adolfo Rodriguez Tsouroukdissian BSD diff --git a/controller_manager_tests/package.xml b/controller_manager_tests/package.xml index 369f9b639..5d4014313 100644 --- a/controller_manager_tests/package.xml +++ b/controller_manager_tests/package.xml @@ -2,7 +2,7 @@ controller_manager_tests 0.9.0 controller_manager_tests - Vijay Pradeep + Adolfo Rodriguez Tsouroukdissian BSD diff --git a/hardware_interface/package.xml b/hardware_interface/package.xml index c06c3fe14..f8ffddeeb 100644 --- a/hardware_interface/package.xml +++ b/hardware_interface/package.xml @@ -2,7 +2,6 @@ hardware_interface 0.9.0 Hardware Interface base class. - Wim Meeussen Adolfo Rodriguez Tsouroukdissian BSD diff --git a/ros_control/package.xml b/ros_control/package.xml index 19651002e..1a1d1db7e 100644 --- a/ros_control/package.xml +++ b/ros_control/package.xml @@ -5,7 +5,6 @@ Adolfo Rodriguez Tsouroukdissian Dave Coleman - Wim Meeussen BSD From 4dd3beea4bfc3fc94787174a759665f31c8982e8 Mon Sep 17 00:00:00 2001 From: Adolfo Rodriguez Tsouroukdissian Date: Mon, 3 Nov 2014 18:11:08 +0100 Subject: [PATCH 10/12] Update changelogs --- controller_interface/CHANGELOG.rst | 5 +++++ controller_manager/CHANGELOG.rst | 5 +++++ controller_manager_msgs/CHANGELOG.rst | 5 +++++ controller_manager_tests/CHANGELOG.rst | 5 +++++ hardware_interface/CHANGELOG.rst | 5 +++++ joint_limits_interface/CHANGELOG.rst | 3 +++ ros_control/CHANGELOG.rst | 5 +++++ rqt_controller_manager/CHANGELOG.rst | 3 +++ transmission_interface/CHANGELOG.rst | 3 +++ 9 files changed, 39 insertions(+) diff --git a/controller_interface/CHANGELOG.rst b/controller_interface/CHANGELOG.rst index 1fcb8f67d..5b538762d 100644 --- a/controller_interface/CHANGELOG.rst +++ b/controller_interface/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog for package controller_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Update package maintainers +* Contributors: Adolfo Rodriguez Tsouroukdissian + 0.9.0 (2014-10-31) ------------------ diff --git a/controller_manager/CHANGELOG.rst b/controller_manager/CHANGELOG.rst index e03a56579..74948ea62 100644 --- a/controller_manager/CHANGELOG.rst +++ b/controller_manager/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog for package controller_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Update package maintainers +* Contributors: Adolfo Rodriguez Tsouroukdissian + 0.9.0 (2014-10-31) ------------------ * Spawner script: adding shutdown timeout to prevent deadlocks diff --git a/controller_manager_msgs/CHANGELOG.rst b/controller_manager_msgs/CHANGELOG.rst index c37e95acb..ec833c1b9 100644 --- a/controller_manager_msgs/CHANGELOG.rst +++ b/controller_manager_msgs/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog for package controller_manager_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Update package maintainers +* Contributors: Adolfo Rodriguez Tsouroukdissian + 0.9.0 (2014-10-31) ------------------ * Add Python helpers for: diff --git a/controller_manager_tests/CHANGELOG.rst b/controller_manager_tests/CHANGELOG.rst index cda8a8fd0..3bdf661da 100644 --- a/controller_manager_tests/CHANGELOG.rst +++ b/controller_manager_tests/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog for package controller_manager_tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Update package maintainers +* Contributors: Adolfo Rodriguez Tsouroukdissian + 0.9.0 (2014-10-31) ------------------ * Tests for Python helpers added to controller_manager_msgs diff --git a/hardware_interface/CHANGELOG.rst b/hardware_interface/CHANGELOG.rst index 458c4a7e4..50f048637 100644 --- a/hardware_interface/CHANGELOG.rst +++ b/hardware_interface/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog for package hardware_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Update package maintainers +* Contributors: Adolfo Rodriguez Tsouroukdissian + 0.9.0 (2014-10-31) ------------------ * Add PosVel and PosVelAcc command interfaces diff --git a/joint_limits_interface/CHANGELOG.rst b/joint_limits_interface/CHANGELOG.rst index 5db2e9458..21f153cd9 100644 --- a/joint_limits_interface/CHANGELOG.rst +++ b/joint_limits_interface/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package joint_limits_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- + 0.9.0 (2014-10-31) ------------------ * Buildsystem and documentation fixes diff --git a/ros_control/CHANGELOG.rst b/ros_control/CHANGELOG.rst index a7357b5b1..af2aeb177 100644 --- a/ros_control/CHANGELOG.rst +++ b/ros_control/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog for package ros_control ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- +* Update package maintainers +* Contributors: Adolfo Rodriguez Tsouroukdissian + 0.9.0 (2014-10-31) ------------------ diff --git a/rqt_controller_manager/CHANGELOG.rst b/rqt_controller_manager/CHANGELOG.rst index 41141373d..1667719c5 100644 --- a/rqt_controller_manager/CHANGELOG.rst +++ b/rqt_controller_manager/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package rqt_controller_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- + 0.9.0 (2014-10-31) ------------------ diff --git a/transmission_interface/CHANGELOG.rst b/transmission_interface/CHANGELOG.rst index 776ab7039..e24883d75 100644 --- a/transmission_interface/CHANGELOG.rst +++ b/transmission_interface/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package transmission_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Forthcoming +----------- + 0.9.0 (2014-10-31) ------------------ * Buildsystem and documentation fixes From 8c6a1b7b3944ab6599c49c3cc5b38c01b71e3cf6 Mon Sep 17 00:00:00 2001 From: Adolfo Rodriguez Tsouroukdissian Date: Mon, 3 Nov 2014 18:11:42 +0100 Subject: [PATCH 11/12] 0.9.1 --- controller_interface/CHANGELOG.rst | 4 ++-- controller_interface/package.xml | 2 +- controller_manager/CHANGELOG.rst | 4 ++-- controller_manager/package.xml | 2 +- controller_manager_msgs/CHANGELOG.rst | 4 ++-- controller_manager_msgs/package.xml | 2 +- controller_manager_tests/CHANGELOG.rst | 4 ++-- controller_manager_tests/package.xml | 2 +- hardware_interface/CHANGELOG.rst | 4 ++-- hardware_interface/package.xml | 2 +- joint_limits_interface/CHANGELOG.rst | 4 ++-- joint_limits_interface/package.xml | 2 +- ros_control/CHANGELOG.rst | 4 ++-- ros_control/package.xml | 2 +- rqt_controller_manager/CHANGELOG.rst | 4 ++-- rqt_controller_manager/package.xml | 2 +- transmission_interface/CHANGELOG.rst | 4 ++-- transmission_interface/package.xml | 2 +- 18 files changed, 27 insertions(+), 27 deletions(-) diff --git a/controller_interface/CHANGELOG.rst b/controller_interface/CHANGELOG.rst index 5b538762d..7e7dafee6 100644 --- a/controller_interface/CHANGELOG.rst +++ b/controller_interface/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package controller_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.1 (2014-11-03) +------------------ * Update package maintainers * Contributors: Adolfo Rodriguez Tsouroukdissian diff --git a/controller_interface/package.xml b/controller_interface/package.xml index d15c6fc48..a1efb3bea 100644 --- a/controller_interface/package.xml +++ b/controller_interface/package.xml @@ -1,6 +1,6 @@ controller_interface - 0.9.0 + 0.9.1 Interface base class for controllers Adolfo Rodriguez Tsouroukdissian diff --git a/controller_manager/CHANGELOG.rst b/controller_manager/CHANGELOG.rst index 74948ea62..f8fb76acf 100644 --- a/controller_manager/CHANGELOG.rst +++ b/controller_manager/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package controller_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.1 (2014-11-03) +------------------ * Update package maintainers * Contributors: Adolfo Rodriguez Tsouroukdissian diff --git a/controller_manager/package.xml b/controller_manager/package.xml index 04abffe02..0fe09f374 100644 --- a/controller_manager/package.xml +++ b/controller_manager/package.xml @@ -1,6 +1,6 @@ controller_manager - 0.9.0 + 0.9.1 The controller manager. Adolfo Rodriguez Tsouroukdissian diff --git a/controller_manager_msgs/CHANGELOG.rst b/controller_manager_msgs/CHANGELOG.rst index ec833c1b9..e81778fd8 100644 --- a/controller_manager_msgs/CHANGELOG.rst +++ b/controller_manager_msgs/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package controller_manager_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.1 (2014-11-03) +------------------ * Update package maintainers * Contributors: Adolfo Rodriguez Tsouroukdissian diff --git a/controller_manager_msgs/package.xml b/controller_manager_msgs/package.xml index abf6bb812..eda872de8 100644 --- a/controller_manager_msgs/package.xml +++ b/controller_manager_msgs/package.xml @@ -1,6 +1,6 @@ controller_manager_msgs - 0.9.0 + 0.9.1 Messages and services for the controller manager. Adolfo Rodriguez Tsouroukdissian diff --git a/controller_manager_tests/CHANGELOG.rst b/controller_manager_tests/CHANGELOG.rst index 3bdf661da..4ffc42b61 100644 --- a/controller_manager_tests/CHANGELOG.rst +++ b/controller_manager_tests/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package controller_manager_tests ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.1 (2014-11-03) +------------------ * Update package maintainers * Contributors: Adolfo Rodriguez Tsouroukdissian diff --git a/controller_manager_tests/package.xml b/controller_manager_tests/package.xml index 5d4014313..74aff0f70 100644 --- a/controller_manager_tests/package.xml +++ b/controller_manager_tests/package.xml @@ -1,6 +1,6 @@ controller_manager_tests - 0.9.0 + 0.9.1 controller_manager_tests Adolfo Rodriguez Tsouroukdissian diff --git a/hardware_interface/CHANGELOG.rst b/hardware_interface/CHANGELOG.rst index 50f048637..ba61a862f 100644 --- a/hardware_interface/CHANGELOG.rst +++ b/hardware_interface/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package hardware_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.1 (2014-11-03) +------------------ * Update package maintainers * Contributors: Adolfo Rodriguez Tsouroukdissian diff --git a/hardware_interface/package.xml b/hardware_interface/package.xml index f8ffddeeb..fa8e3d3ae 100644 --- a/hardware_interface/package.xml +++ b/hardware_interface/package.xml @@ -1,6 +1,6 @@ hardware_interface - 0.9.0 + 0.9.1 Hardware Interface base class. Adolfo Rodriguez Tsouroukdissian diff --git a/joint_limits_interface/CHANGELOG.rst b/joint_limits_interface/CHANGELOG.rst index 21f153cd9..316d36dab 100644 --- a/joint_limits_interface/CHANGELOG.rst +++ b/joint_limits_interface/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package joint_limits_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.1 (2014-11-03) +------------------ 0.9.0 (2014-10-31) ------------------ diff --git a/joint_limits_interface/package.xml b/joint_limits_interface/package.xml index 6897e56c4..cc8a93d1b 100644 --- a/joint_limits_interface/package.xml +++ b/joint_limits_interface/package.xml @@ -1,6 +1,6 @@ joint_limits_interface - 0.9.0 + 0.9.1 Interface for enforcing joint limits. Adolfo Rodriguez Tsouroukdissian BSD diff --git a/ros_control/CHANGELOG.rst b/ros_control/CHANGELOG.rst index af2aeb177..25dbed552 100644 --- a/ros_control/CHANGELOG.rst +++ b/ros_control/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package ros_control ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.1 (2014-11-03) +------------------ * Update package maintainers * Contributors: Adolfo Rodriguez Tsouroukdissian diff --git a/ros_control/package.xml b/ros_control/package.xml index 1a1d1db7e..1b1861e64 100644 --- a/ros_control/package.xml +++ b/ros_control/package.xml @@ -1,6 +1,6 @@ ros_control - 0.9.0 + 0.9.1 A set of packages that include controller interfaces, controller managers, transmissions, hardware_interfaces and the control_toolbox. Adolfo Rodriguez Tsouroukdissian diff --git a/rqt_controller_manager/CHANGELOG.rst b/rqt_controller_manager/CHANGELOG.rst index 1667719c5..8b2d1c2b0 100644 --- a/rqt_controller_manager/CHANGELOG.rst +++ b/rqt_controller_manager/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package rqt_controller_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.1 (2014-11-03) +------------------ 0.9.0 (2014-10-31) ------------------ diff --git a/rqt_controller_manager/package.xml b/rqt_controller_manager/package.xml index 9896a9230..6c8fff4c4 100644 --- a/rqt_controller_manager/package.xml +++ b/rqt_controller_manager/package.xml @@ -1,7 +1,7 @@ rqt_controller_manager - 0.9.0 + 0.9.1 The rqt_controller_manager package Kelsey Hawkins diff --git a/transmission_interface/CHANGELOG.rst b/transmission_interface/CHANGELOG.rst index e24883d75..f2509d918 100644 --- a/transmission_interface/CHANGELOG.rst +++ b/transmission_interface/CHANGELOG.rst @@ -2,8 +2,8 @@ Changelog for package transmission_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Forthcoming ------------ +0.9.1 (2014-11-03) +------------------ 0.9.0 (2014-10-31) ------------------ diff --git a/transmission_interface/package.xml b/transmission_interface/package.xml index a52a4e021..05006fb6d 100644 --- a/transmission_interface/package.xml +++ b/transmission_interface/package.xml @@ -1,6 +1,6 @@ transmission_interface - 0.9.0 + 0.9.1 Transmission Interface. Adolfo Rodriguez Tsouroukdissian From 900d38f1b0e00c98bf21d5bd2163dadd2904bb78 Mon Sep 17 00:00:00 2001 From: ipa-fxm Date: Fri, 26 Sep 2014 14:25:23 +0200 Subject: [PATCH 12/12] added readyForSwitch --- .../include/controller_manager/controller_manager.h | 6 ++++++ controller_manager/src/controller_manager.cpp | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/controller_manager/include/controller_manager/controller_manager.h b/controller_manager/include/controller_manager/controller_manager.h index 42cabb842..b7d84740e 100644 --- a/controller_manager/include/controller_manager/controller_manager.h +++ b/controller_manager/include/controller_manager/controller_manager.h @@ -142,6 +142,12 @@ class ControllerManager{ const std::vector& stop_controllers, const int strictness); + /** \brief Notification for switching HW-Interfaces. + * + * \param info_list A list containing ControlInfo about the controllers to be started (containing the HW-Interfaces requested by the resources) + */ + virtual bool notifyHardwareInterface(const std::list &info_list) {return true;} + /** \brief Get a controller by name. * * \param name The name of a controller diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index dcdb8c0c0..acc4f5954 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -439,6 +439,14 @@ bool ControllerManager::switchController(const std::vector& start_c start_request_.clear(); return false; } + + if(!notifyHardwareInterface(info_list)) + { + ROS_ERROR("Could not switch controllers, because switching the HWInterface failed"); + stop_request_.clear(); + start_request_.clear(); + return false; + } // start the atomic controller switching switch_strictness_ = strictness; @@ -460,8 +468,6 @@ bool ControllerManager::switchController(const std::vector& start_c - - bool ControllerManager::reloadControllerLibrariesSrv( controller_manager_msgs::ReloadControllerLibraries::Request &req, controller_manager_msgs::ReloadControllerLibraries::Response &resp)