rosrun: unable to locate the node robot_state_publisher
The exact error I am having is
ERROR: cannot launch node of type [robot_state_publisher/state_publisher]: can't locate node [state_publisher] in package [robot_state_publisher]
I have cloned the robot_state_publisher
from ros wiki and already had done rosmake
.
I have also sourced the terminal to devel before using rosrun
aswell as exported all the reqaquired core packages and python path to the terminal before trying to run the robot_state_publisher
.
here is the my CmakeList.txt file,
cmake_minimum_required(VERSION 2.8)
project(robot_state_publisher)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra")
find_package(orocos_kdl REQUIRED)
find_package(catkin REQUIRED
COMPONENTS roscpp rosconsole rostime tf tf2_ros tf2_kdl kdl_parser
)
find_package(Eigen3 REQUIRED)
find_package(urdfdom_headers REQUIRED)
catkin_package(
LIBRARIES ${PROJECT_NAME}_solver
INCLUDE_DIRS include
DEPENDS roscpp rosconsole rostime tf2_ros tf2_kdl kdl_parser orocos_kdl urdfdom_headers
)
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIRS})
include_directories(include ${catkin_INCLUDE_DIRS} ${orocos_kdl_INCLUDE_DIRS} ${urdfdom_headers_INCLUDE_DIRS})
link_directories(${orocos_kdl_LIBRARY_DIRS})
add_library(${PROJECT_NAME}_solver
src/robot_state_publisher.cpp src/treefksolverposfull_recursive.cpp
)
target_link_libraries(${PROJECT_NAME}_solver ${catkin_LIBRARIES} ${orocos_kdl_LIBRARIES})
add_library(joint_state_listener src/joint_state_listener.cpp)
target_link_libraries(joint_state_listener ${PROJECT_NAME}_solver ${orocos_kdl_LIBRARIES})
add_executable(${PROJECT_NAME} src/joint_state_listener.cpp)
target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_solver ${orocos_kdl_LIBRARIES})
# compile the same executable using the old name as well
add_executable(state_publisher src/joint_state_listener.cpp)
target_link_libraries(state_publisher ${PROJECT_NAME}_solver ${orocos_kdl_LIBRARIES})
Can you please help me solve this problem, I am trying to run a robot I have designed using xacro on gazebo and control it with ros. I have already installed ros_control
and ros_gazebo
packages. Thank you advance,
why?
why?
Did
sudo apt-get install ros-kinetic-robot-state-publisher
not work for you?Please remove
robot_state_publisher
from your workspace (remove yourbuild
anddevel
folders as well), install the binary version, rebuild your workspace and try again.after cloning it from the wiki, I had used rosmake to compile the cloning package. I am not sure whether its mandatory or not but I followed the same process i follow to create any new packages on catkin workspace.
rosmake
is not used for Catkin packages. That would becatkin_make
(orcatkin build
).In general: always try to use binary packages and install them using
apt
(orapt-get
). There are few cases where you'd want to / need to build packages from source.git clone
should not be your default for installing ROS packages.build and devel folders contains other ros packages that I have been using. Doesn't remove the entire folders affect the entire project in a way that I had to create them all again ? and also may I know how it is going to help ?
build
anddevel
contain only derived resources -- if you're using a normal Catkin workspace setup. .... That means that after removing
build
anddevel
, acatkin_make
should result in all the pkgs insrc
being rebuilt. In the enddevel
should contain the same packages as before.you've added
robot_state_publisher
to your workspace, ..