Ask Your Question

tf view_frames syntax error

asked 2018-02-28 06:30:54 -0600

Kri gravatar image

updated 2018-03-01 03:37:01 -0600

I have Indigo ROS and Ubuntu 14.04.5 LTS. Few month ago when I run rosrun tf view_frames, it worked, but now it gives me a SyntaxError (as seen in the picture). I can't fix the syntax, because I don't have a permission to change files inside ros folder.

Is there any solution to this problem?

ubuntu@ubuntu-MS-7817:~$ rosrun tf view_frames 
  File "/opt/ros/indigo/lib/tf/view_frames", line 57
    print "Listening to /tf for %f seconds"%duration
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int "Listening to /tf for %f seconds"%duration)?
edit retag flag offensive close merge delete



I just let your post out of the moderation queue, but if I would apply the support guidelines strictly, I should immediately close it. Was:

Please DO NOT post a screenshot of the terminal or source file.

Not clear enough?

gvdhoorn gravatar imagegvdhoorn ( 2018-02-28 06:33:01 -0600 )edit

As to your issue: have you installed Anaconda or Python 3 between now and "few months ago"? If so, it could be that python3 is now the default interpreter, and view_frames has not been made Python 3 compatible yet, leading to the syntax error.

gvdhoorn gravatar imagegvdhoorn ( 2018-02-28 06:34:53 -0600 )edit

@gvdhoorn I'm sorry, I didn't see the guidelines before. Luckily my issue isn't of that sort that would require copying the error to find out what is wrong.

Kri gravatar imageKri ( 2018-03-01 02:39:28 -0600 )edit

@gvdhoorn I don't remember doing anything with python ever on this computer, but my roommates might. I wouldn't know. Is there a way how to change the default python interpreter version?

Kri gravatar imageKri ( 2018-03-01 02:41:01 -0600 )edit

I didn't see the guidelines before

they were shown to you almost fullscreen when you created your post.

my issue isn't of that sort that would require copying the error to find out what is wrong

I'd still like you to replace the image with the copy-pasted text of the error.

gvdhoorn gravatar imagegvdhoorn ( 2018-03-01 02:56:46 -0600 )edit

@gvdhoorn I have edited the question. Is this done right?

Kri gravatar imageKri ( 2018-03-01 03:37:49 -0600 )edit

That's great. Thanks.

As to your problem: what is the output of python --version?

gvdhoorn gravatar imagegvdhoorn ( 2018-03-01 04:51:30 -0600 )edit

An alternative way to view tf frames is: rosrun rqt_tf_tree rqt_tf_tree. This requires to have this into your workspace :)

simff gravatar imagesimff ( 2018-03-01 05:31:12 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-01 05:43:55 -0600

Kri gravatar image

@gvdhoorn it used to output 'python3' I have changed it into 'python2,' but the error remained. I used a command which python to see the path and discovered it leads to python2 inside miniconda3 folder. I have deleted the miniconda3 folder and now it works. Thank you for your patience and help.

edit flag offensive delete link more


Let's make this the answer. I would still it if you could check whether you are up-to-date, as the exact problem you are reporting should have been fixed (on 2017-07-24 already).

gvdhoorn gravatar imagegvdhoorn ( 2018-03-01 05:48:16 -0600 )edit

@Kri: afaict, ros/geometry#151 should have resolved some lingering python2/3 issues with tf, even on Indigo. Can you make sure you're up-to-date?

gvdhoorn gravatar imagegvdhoorn ( 2018-03-01 05:48:45 -0600 )edit

@gvdhoorn I don't know how to do that. I don't even understand what that means, which makes it hard to search for.

Kri gravatar imageKri ( 2018-03-01 06:06:13 -0600 )edit

When was the last time you did an sudo apt-get update and sudo apt-get upgrade, or used the Ubuntu Software Centre to update your ROS packages (assuming you use Ubuntu)?

gvdhoorn gravatar imagegvdhoorn ( 2018-03-01 06:07:22 -0600 )edit

Note that I'm not saying you should upgrade now. I just want to figure out why you're running into this issue which should have already been fixed quite some time ago.

gvdhoorn gravatar imagegvdhoorn ( 2018-03-01 06:07:52 -0600 )edit

That might me problematic. I did that few days ago, but since then the updated ubuntu doesn't get pass login screen (update broke something). Therefor I have to chose older version of ubuntu from GRUB. I don't know what else is not up to date when I run on the older version.

Kri gravatar imageKri ( 2018-03-01 06:20:34 -0600 )edit

Ok. Let's just chalk this up to using an unsupported Python version for now, and assume it has been fixed in recent versions of tf.

gvdhoorn gravatar imagegvdhoorn ( 2018-03-01 06:30:28 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2018-02-28 06:30:54 -0600

Seen: 249 times

Last updated: Mar 01 '18