ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Error: package 'my_examples_pkg' not found

asked 2020-10-14 14:35:15 -0500

wynnblevins gravatar image

I have a launch file that looks like this:

<launch>
    <node pkg="my_examples_pkg" type="cmd_vel_publisher.py" name="cmd_vel_publisher" output="screen" />
</launch>

...and a publisher that looks like this:

#! /usr/bin/env python
import rospy
from geometry_msgs.msg import Twist

rospy.init_node('cmd_vel_publisher')
pub = rospy.Publisher('/cmd_vel', Twist, queue_size=10)
cmd = Twist()
cmd.angular.x = 0
cmd.linear.z = 0

while not rospy.is_shutdown():
    pub.publish(cmd)
    rospy.spin()

However, when I try to run the launch file with the following command:

roslaunch my_examples_pkg my_examples_pkg.launch

I receive the following error: [my_examples_pkg.launch] is neither a launch file in package [my_examples_pkg] nor is [my_examples_pkg] a launch file name

and when I try to run the individual python publisher file with the following:

rosrun my_examples_pkg cmd_vel_publisher.py

I receive the following error: [rospack] Error: package 'my_examples_pkg' not found

I'm new to ROS so I apologize if this is a really basic question, but its been plaguing me for a while now. Most of the resolved questions I see online direct me to do:

source devel/setup.bash

However, this doesn't resolve my issue as I still receive the errors mentioned above afterwards. Any help/insights/guidance is greatly appreciated. Thanks in advance.

edit retag flag offensive close merge delete

Comments

Oh my gosh, I'm so embarrassed. Yes I had run catkin_make but the issue was caused by a copy paste error package.xml. Specifically, the name field was set to the incorrect value. If you would like to get credit for the answer I will mark your answer as correct! I so appreciate the help, like I said, I'm very new to ROS!

wynnblevins gravatar image wynnblevins  ( 2020-10-14 14:55:56 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-10-14 14:43:37 -0500

Do you have a package named my_examples_pkg? Is it in your workspace? Has it been built with catkin_make or catkin build? What is the name of the package in the package.xml and CMakeLists.txt (<name> tag and project() method respectively)?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-10-14 14:35:15 -0500

Seen: 337 times

Last updated: Oct 14 '20