openravepy not drawing lines when running inside a script [closed]

asked 2019-04-11 14:04:18 -0500

Hello,

I have a very simple one pendulum example. I can plot it in python with the following code I borrowed from a website and called it plotfile.py :

import openravepy
import numpy as np

if __name__ == "__main__":
    env = openravepy.Environment()
    env.Load('env.xml')
    env.SetViewer('qtcoin')
    viewer = env.GetViewer()
    robot = env.GetRobots()[0]


    T = robot.GetLinks()[-1].GetTransform()
    colors = np.array([[1,0,0], [1,0,0]])
    linelist = np.array([T[0:3,3], T[0:3,3]+1.0])
    env.drawlinelist(linelist, 1, colors)

The drawlinelist from the script doesn't do anything. However, if I type

env.drawlinelist(linelist, 1, colors)

from the ipython console, the lines show up.

Any help would be greatly appreciated!!

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant. Please see http://wiki.ros.org/Support for more details. by gvdhoorn
close date 2019-04-11 15:42:38.406767

Comments

1

This forum is dedicated to ROS support. OpenRAVE is not related to ROS. We do sometimes use parts of it, but I'd suggest you ask your question elsewhere (the OpenRAVE issue tracker perhaps?).

gvdhoorn gravatar image gvdhoorn  ( 2019-04-11 15:42:30 -0500 )edit