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

How to reload visualisation_canvas without exit prolog shell?

asked 2012-08-07 02:53:09 -0500

sam gravatar image

I followed KnowRob_basics.

I found when I run

  visualisation_canvas(C).

I only can run it once.

if I run again, it just shows:

  ?- visualisation_canvas(C).
  C = @'J#00000140499119889776'.

  ?-

How to call visualisation_canvas again without restart prolog?

Thank you~

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-08-07 03:20:51 -0500

moritz gravatar image

Actually, there is a way to kill the old canvas and start a new one, but it's a bit hacky (which does not have to be bad, though...)

visualisation_canvas(_). <close the="" window=""> retractall(mod_vis:v_canvas(_)), assert(mod_vis:v_canvas(fail)). visualisation_canvas(_).

cheers moritz

edit flag offensive delete link more

Comments

Thank you~~ In my case I should run: retractall(mod_vis:v_canvas(C)), assert(mod_vis:v_canvas(fail)). visualisation_canvas(C). It works!!

sam gravatar image sam  ( 2012-08-08 23:01:38 -0500 )edit
0

answered 2012-08-07 03:12:14 -0500

moritz gravatar image

Hi,

there is currrently no way to re-show the canvas once it's closed. You do, however, have a handle to a Java JFrame and can try to call its methods using the JPL interface, though I don't know if there is a method that revives a closed window.

http://www.swi-prolog.org/packages/jpl/prolog_api/overview.html#jpl_call4

best, Moritz

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-07 02:53:09 -0500

Seen: 451 times

Last updated: Aug 07 '12