Ask Your Question
0

Running cob_script_server my_script.py

asked 2011-04-28 21:13:09 -0500

weissenrosen gravatar image

updated 2011-04-29 04:24:16 -0500

kwc gravatar image

Hi all..

I've been following closely the cob python script tutorial on this site.

However, I always get this error when i run it:

rosrun cob_script_server my_script.py

/opt/ros/diamondback/stacks/cob_apps/cob_script_server/scripts/my_script.py: line 5: syntax error near unexpected token 'cob_script_server'' /opt/ros/diamondback/stacks/cob_apps/cob_script_server/scripts/my_script.py: line 5: roslib.load_manifest('cob_script_server')'

Can someone tell me what is going on and how can i fix this?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2011-04-28 22:01:45 -0500

As it is a syntax error I suggest you copy-paste the source into your question.

I also notice you seem to be editing files in /opt/ros when you should work somewhere in your home directory. Create a directory somewhere in your home and add export ROS_PACKAGE_PATH=~/the_dir_you_created:$ROS_PACKAGE_PATH to the end of your ~/.bashrc. However, this is probably not the source of the problem.

edit flag offensive delete link more
1

answered 2011-04-29 04:25:18 -0500

kwc gravatar image

updated 2011-04-29 04:25:27 -0500

Looks to me like your script is probably missing

#!/usr/bin/env python

as the first line. I would also look at Felix's answer for suggestions on where to do these tutorials.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-04-28 21:13:09 -0500

Seen: 336 times

Last updated: Apr 29 '11