diff --git a/robot_state_publisher/CMakeLists.txt b/robot_state_publisher/CMakeLists.txt index 71711b7..3cffa58 100644 --- a/robot_state_publisher/CMakeLists.txt +++ b/robot_state_publisher/CMakeLists.txt @@ -24,7 +24,7 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) rosbuild_add_library(${PROJECT_NAME} src/joint_state_listener.cpp src/robot_state_publisher.cpp src/treefksolverposfull_recursive.cpp) -rosbuild_add_executable(state_publisher src/state_publisher.cpp ) +rosbuild_add_executable(state_publisher src/robot_state_publisher_node.cpp ) target_link_libraries(state_publisher ${PROJECT_NAME}) rosbuild_add_executable(test_publisher test/test_publisher.cpp ) diff --git a/robot_state_publisher/doc.dox b/robot_state_publisher/doc.dox index ed23c6a..9267270 100644 --- a/robot_state_publisher/doc.dox +++ b/robot_state_publisher/doc.dox @@ -3,8 +3,9 @@ @htmlinclude manifest.html -This package contains the robot state publisher, which can be used as a library or as a ROS node. - \li LIbrary use: robot_state_publisher::RobotStatePublisher - \li Node use: robot_state_publisher::JointStateListener +This package contains the robot state publisher, which can be used as +a library or as a ROS node. The API documentation for the library can +be found here: robot_state_publisher::RobotStatePublisher + **/ diff --git a/robot_state_publisher/include/robot_state_publisher/robot_state_publisher.h b/robot_state_publisher/include/robot_state_publisher/robot_state_publisher.h index 755c288..e889420 100644 --- a/robot_state_publisher/include/robot_state_publisher/robot_state_publisher.h +++ b/robot_state_publisher/include/robot_state_publisher/robot_state_publisher.h @@ -59,6 +59,7 @@ public: /** Publish transforms to tf * \param joint_positions A map of joint names and joint positions. * \param time The time at which the joint positions were recorded + * returns true on success; return false when the joint positions don't match the kinematic robot model */ bool publishTransforms(const std::map& joint_positions, const ros::Time& time); diff --git a/robot_state_publisher/src/joint_state_listener.cpp b/robot_state_publisher/src/joint_state_listener.cpp index 89ba292..2505130 100644 --- a/robot_state_publisher/src/joint_state_listener.cpp +++ b/robot_state_publisher/src/joint_state_listener.cpp @@ -54,9 +54,7 @@ JointStateListener::JointStateListener(const KDL::Tree& tree) publish_rate_ = Rate(publish_freq); // subscribe to mechanism state - string joint_state_topic; - n_.param("joint_state_topic", joint_state_topic, string("/joint_states")); - joint_state_sub_ = n_.subscribe(joint_state_topic, 1, &JointStateListener::callbackJointState, this);; + joint_state_sub_ = n_.subscribe("/joint_states", 1, &JointStateListener::callbackJointState, this);; }; diff --git a/robot_state_publisher/src/state_publisher.cpp b/robot_state_publisher/src/robot_state_publisher_node.cpp similarity index 94% rename from robot_state_publisher/src/state_publisher.cpp rename to robot_state_publisher/src/robot_state_publisher_node.cpp index 6fb4143..137cafc 100644 --- a/robot_state_publisher/src/state_publisher.cpp +++ b/robot_state_publisher/src/robot_state_publisher_node.cpp @@ -57,9 +57,8 @@ int main(int argc, char** argv) NodeHandle node; // gets the location of the robot description on the parameter server - string param_name, full_param_name; - node.param("~/robot_desc_param", param_name, string("robot_description")); - node.searchParam(param_name,full_param_name); + string full_param_name; + node.searchParam("robot_description",full_param_name); string robot_desc; // constructs a kdl tree from the robot model