missing a '#!' declaration at the top in ROS basic C++ tutorial
Unable to execute exercise 3.1 in ROS C++ tutorial for beginners. I am getting the the error as shown above.
Steps used to execute are:
- Create package with dependencies
roscpp
andtrajectory_by_name_srv
. - Create Cpp program under src folder using 3.1 exercise cpp code
- Create launch folder with launch file
simple_service.launch
contents:
<launch>
<include file="$(find trajectory_by_name)/launch/start_service.launch"/>
<node pkg ="service_client_pkg"
type="simple_service_client.cpp"
name="service_client"
output="screen"/>
</launch>
- run
catkin_make
- run
source devel/setup.bash
- Roslaunch the service
Edit:
Error
process[traj_by_name_node-2]: started with pid [25837]
Unable to launch [service_client-3].
If it is a script, you may be missing a '#!' declaration at the top.
The traceback for the exception was written to the log file
[service_client-3] killing on exit
[traj_by_name_node-2] killing on exit
[iri_wam_reproduce_trajectory-1] killing on exit
Traceback (most recent call last):
File "/home/simulations/public_sim_ws/src/all/iri_wam/trajectory_by_name/src/traj_by_name.py", line 21, in <module>
rospy.init_node('traj_by_name_node')
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/client.py", line 323, in init_node
raise rospy.exceptions.ROSInitException("init_node interrupted before it could complete")
rospy.exceptions.ROSInitException: init_node interrupted before it could complete
Do you have a question? Are you referring to a particular tutorial that has an issue? It's a bit tough for people to know how to help you the way the question is written.
I do have a question, i am unable to execute exercise 3.1 on ROS services, I followed the instructions but i am still getting an error
This is the error i am getting :
process[traj_by_name_node-2]: started with pid [25837] Unable to launch [service_client-3]. If it is a script, you may be missing a '#!' declaration at the top. The traceback for the exception was written to the log file [service_client-3] killing on exit [traj_by_name_node-2] killing on exit [iri_wam_reproduce_trajectory-1] killing on exit Traceback (most recent call last): File "/home/simulations/public_sim_ws/src/all/iri_wam/trajectory_by_name/src/traj_by_name.py", line 21, in <module> rospy.init_node('traj_by_name_node') File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/client.py", line 323, in init_node raise rospy.exceptions.ROSInitException("init_node interrupted before it could complete") rospy.exceptions.ROSInitException: init_node interrupted before it could complete
@krithika please make sure to update your question with this type of information rather than using a comment. It makes the question easier to follow. Also, you don't need to use HTML
<br>
tags, you can use newlines to separate content (and activate the list too)@krithika: always link to any tutorials or pages you are reading/using.
Right now we don't know what you are referring to, which complicates me helping you.
Edit: you are most likely doing some exercises created by the Construct. Have you asked them for help?