ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hi Suyash,
Without more data, and assuming that you are following the ROS wiki tutorials, here: http://wiki.ros.org/tf2/Tutorials/Writing%20a%20tf2%20broadcaster%20%28Python%29
The most probable cause for your error is that you missed the 1st line in your script, this one:
#!/usr/bin/env python
Basically, this line makes sure that your script is executed as a Python script. Try to add it at the top of your script and the error should be gone.