Cannot launch node of type [joint_state_publisher/joint_state_publisher]

asked 2020-02-17 01:16:08 -0500

ixtiyoruz gravatar image

I installed the joint state publisher using this command:

sudo apt-get install ros-kinetic-joint-state-publisher

but when I tried to lunch tutorials with joint state publisher, I am getting the error :

ERROR: cannot launch node of type [joint_state_publisher/joint_state_publisher]: can't locate node [joint_state_publisher] in package [joint_state_publisher]

If someone knows the solution please share?

edit retag flag offensive close merge delete

Comments

What does rospack find joint_state_publisher returns ? I suspect you haven't sourced your environment.

Delb gravatar image Delb  ( 2020-02-17 02:08:26 -0500 )edit

thanks for the response, it is returning

rospack find joint_state_publisher
/opt/ros/kinetic/share/joint_state_publisher
ixtiyoruz gravatar image ixtiyoruz  ( 2020-02-17 03:26:19 -0500 )edit

Alright, that means the package is correctly installed and your envirronment propperly sourced. Can you add more details about what you are actually launching ? You can edit your question to add the launch file responsible of the error message and how (i.e. the command) you launch it please ?

Delb gravatar image Delb  ( 2020-02-17 03:51:26 -0500 )edit

Sorry for the late reply, I am putting a [link] to GitHub gist as I do not have permission to upload files yet. (https://gist.github.com/ixtiyoruz/f7d...)

ixtiyoruz gravatar image ixtiyoruz  ( 2020-02-17 18:10:44 -0500 )edit

I still need to know all the commands you run to get this error. I couldn't reproduce it so I can't help you if I don't know what exactly you are doing (including how you sourced the workspace, if you have openned a new terminal, if you have something related to ROS your .bashrc etc..).

Delb gravatar image Delb  ( 2020-02-18 03:04:06 -0500 )edit

sorry, I found the problem, it was I think because of aliasing. In my bashrc I had aliased python3 to python2 or vise versa. I deleted it yesterday now ros started working normally. Thank you.

ixtiyoruz gravatar image ixtiyoruz  ( 2020-02-18 19:56:25 -0500 )edit

so the things I have done to solve the error are:

  1. delete all the things related to ros in bashrc, and delete python aliases as well if they exist
  2. echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
  3. source ~/.bashrc
  4. sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
  5. sudo rosdep init
  6. rosdep update
  7. go to your workspace and do rm -r build devel install
  8. catkin_make
  9. source devel/setup.bash
ixtiyoruz gravatar image ixtiyoruz  ( 2020-02-18 20:02:59 -0500 )edit