ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

tf view_frames syntax error

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

Kri gravatar image

updated 2018-03-01 03:37:01 -0500

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

Comments

3

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 image gvdhoorn  ( 2018-02-28 06:33:01 -0500 )edit
3

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 image gvdhoorn  ( 2018-02-28 06:34:53 -0500 )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 image Kri  ( 2018-03-01 02:39:28 -0500 )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 image Kri  ( 2018-03-01 02:41:01 -0500 )edit
1

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 image gvdhoorn  ( 2018-03-01 02:56:46 -0500 )edit

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

Kri gravatar image Kri  ( 2018-03-01 03:37:49 -0500 )edit
1

That's great. Thanks.

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

gvdhoorn gravatar image gvdhoorn  ( 2018-03-01 04:51:30 -0500 )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 image simff  ( 2018-03-01 05:31:12 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

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

Comments

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 image gvdhoorn  ( 2018-03-01 05:48:16 -0500 )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 image gvdhoorn  ( 2018-03-01 05:48:45 -0500 )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 image Kri  ( 2018-03-01 06:06:13 -0500 )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 image gvdhoorn  ( 2018-03-01 06:07:22 -0500 )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 image gvdhoorn  ( 2018-03-01 06:07:52 -0500 )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 image Kri  ( 2018-03-01 06:20:34 -0500 )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 image gvdhoorn  ( 2018-03-01 06:30:28 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 999 times

Last updated: Mar 01 '18