This is an error report.
Screenshot of the error
Error details
Hi all,
I’m working with ROS and have created a custom message, Age.msg, to publish data about age (years, months, days) via a publisher to a topic. However, I am encountering an error when launching the node. Below is the setup and error details:
ROS Launch File (publish_age.launch):
<launch>
<node pkg="exercise_33" type="publish_age.py" name="publish_age_node" output="screen" />
</launch>
Custom Message (Age.msg):
float32 years
float32 months
float32 days
Python Script (publish_age.py):
#! /usr/bin/env python
import rospy
from exercise_33.msg import Age # Import Age message from the exercise_33 package
rospy.init_node('publish_age_node')
pub = rospy.Publisher('/age_info', Age, queue_size=1) # Create a Publisher that will publish in the /age_info topic
rate = rospy.Rate(2)
age = Age() # Create an Age message object
age.years = 5 # Fill the values of the message
age.months = 10
age.days = 21
while not rospy.is_shutdown():
pub.publish(age) # Publish the message into the defined topic /age_info
rate.sleep()
CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(exercise_33)
find_package(catkin REQUIRED COMPONENTS
std_msgs
message_generation
)
add_message_files(
FILES
Age.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(
CATKIN_DEPENDS rospy message_runtime
)
include_directories(
${catkin_INCLUDE_DIRS}
)
package.xml:
<package format="2">
<name>exercise_33</name>
<version>0.0.0</version>
<description>The exercise_33 package</description>
<maintainer email="user@todo.todo">user</maintainer>
<license>TODO</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>message_generation</build_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<build_export_depend>message_runtime</build_export_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>message_runtime</exec_depend>
<export>
</export>
</package>
Error Message:
roslaunch exercise_33 publish_age.launch
RLException: [publish_age.launch] is neither a launch file in package [exercise_33] nor is [exercise_33] a launch file name
The traceback for the exception was written to the log file
Questions:
Is there something I’m missing in the package structure or configuration files?
Why is ROS not finding the publish_age.launch file?
Any help would be greatly appreciated!
Thanks in advance!