diff --git a/robot_state_publisher/include/robot_state_publisher/joint_state_listener.h b/robot_state_publisher/include/robot_state_publisher/joint_state_listener.h index d07d1ac..2990c4c 100644 --- a/robot_state_publisher/include/robot_state_publisher/joint_state_listener.h +++ b/robot_state_publisher/include/robot_state_publisher/joint_state_listener.h @@ -63,7 +63,7 @@ public: private: void callbackJointState(const JointStateConstPtr& state); - NodeHandle n_; + NodeHandle n_, n_tilde_; Rate publish_rate_; robot_state_publisher::RobotStatePublisher state_publisher_; Subscriber joint_state_sub_; diff --git a/robot_state_publisher/manifest.xml b/robot_state_publisher/manifest.xml index 083d62c..2999a6a 100644 --- a/robot_state_publisher/manifest.xml +++ b/robot_state_publisher/manifest.xml @@ -1,11 +1,13 @@ - This package allows you to publish the state of a robot to the transform library topic. Once the state - gets published, it is available to all components in the system using the transform library. - The package takes the joint angles of the robot as input and publishes the 3D poses - of the robot links, using a kinematic tree model of the robot. The package can both be used - as a library and as a ROS node. + This package allows you to publish the state of a robot to the + transform library topic. Once the state gets published, it is + available to all components in the system using the transform + library. The package takes the joint angles of the robot as input + and publishes the 3D poses of the robot links, using a kinematic + tree model of the robot. The package can both be used as a library + and as a ROS node. Wim Meeussen meeussen@willowgarage.com diff --git a/robot_state_publisher/src/joint_state_listener.cpp b/robot_state_publisher/src/joint_state_listener.cpp index 2505130..4bb67b4 100644 --- a/robot_state_publisher/src/joint_state_listener.cpp +++ b/robot_state_publisher/src/joint_state_listener.cpp @@ -46,15 +46,15 @@ using namespace robot_state_publisher; JointStateListener::JointStateListener(const KDL::Tree& tree) - : n_("~"), publish_rate_(0.0), state_publisher_(tree) + : n_tilde_("~"), publish_rate_(0.0), state_publisher_(tree) { // set publish frequency double publish_freq; - n_.param("publish_frequency", publish_freq, 50.0); + n_tilde_.param("publish_frequency", publish_freq, 50.0); publish_rate_ = Rate(publish_freq); // subscribe to mechanism state - joint_state_sub_ = n_.subscribe("/joint_states", 1, &JointStateListener::callbackJointState, this);; + joint_state_sub_ = n_.subscribe("joint_states", 1, &JointStateListener::callbackJointState, this);; }; diff --git a/robot_state_publisher/src/robot_state_publisher_node.cpp b/robot_state_publisher/src/robot_state_publisher_node.cpp index 137cafc..ec7be7c 100644 --- a/robot_state_publisher/src/robot_state_publisher_node.cpp +++ b/robot_state_publisher/src/robot_state_publisher_node.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include "robot_state_publisher/joint_state_listener.h" diff --git a/robot_state_publisher/test/test_publisher.cpp b/robot_state_publisher/test/test_publisher.cpp index 3255e3a..ae321fd 100644 --- a/robot_state_publisher/test/test_publisher.cpp +++ b/robot_state_publisher/test/test_publisher.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "robot_state_publisher/joint_state_listener.h" @@ -74,7 +74,7 @@ protected: // constructs a kdl tree from the robot model Tree tree; - if (!kdl_parser::treeFromRobotModel(robot_model, tree)) + if (!kdl_parser::treeFromUrdfModel(robot_model, tree)) ROS_ERROR("Failed to extract kdl tree from robot model"); publisher = new JointStateListener(tree); @@ -106,7 +106,7 @@ TEST_F(TestPublisher, test) ASSERT_TRUE(tf.canTransform("l_gripper_palm_link", "fl_caster_r_wheel_link", Time())); ASSERT_FALSE(tf.canTransform("base_link", "wim_link", Time())); - tf::Stamped t; + tf::StampedTransform t; tf.lookupTransform("base_link", "r_gripper_palm_link",Time(), t ); EXPECT_NEAR(t.getOrigin().x(), 0.769198, EPS); EXPECT_NEAR(t.getOrigin().y(), -0.188800, EPS);