|
Dynamically Including (adding) roborealm xml in to a roborealm program Rob from Canada [2 posts] |
17 year
|
I have a predicament here which I'm hoping someone has come across before. What I'm trying to do is to dynamically append a roborealm file or it's xml into a running program, the problem is that the only way i see to do anything like this is by parsing the robo realm files in an external program, merging them and then sending them through the api server to be executed as roborealm xml. This is not exactly what I am going for for 2 reasons: first its very slow and second it will overwrite my current program removing any other dynamically added modules which i'd like to add.
So how do i do this? Is there another methodology that I'm overlooking? Essentially I want this capability so that my submarine's machine vision computer can easily swap between algorithms and load multiple algorithms at the same time. To do this I figured i would just append each algorithm to the same pipeline and remove it when it's no longer needed. Another option is just to run as many instances of roborealm as needed for each machine vision task but this would add allot of overhead and needlessly increase the number of threads on an already overtaxed single cpu.
Any help in this matter would be greatly appreciated.
(and for those who are currious - my submarine: http://arise.site.uottawa.ca/ARISEMarine/tabid/64/language/en-US/Default.aspx
)
|
|
|
Anonymous |
17 year
|
Rob,
We will see what we can do next week to make that kind of capability easier to accomplish ... i.e. allow several programs to be loaded at once in RoboRealm and then allow a single API call to switch between the programs as needed.
In the meantime, what you can probably try is to load in all modules that you think you will need into the pipeline and then surround them with IF statements with specific variables guarding their execution. So basically it would look something like:
if do_sobel then
sobel
/if
if do_red_filter then
RGBFilter
/if
etc.
and you would then use the api to set the variables to achieve the desired combination:
setVariable do_sobel, 1
setVariable do_red_filter, 0
etc. See attached robofile as an example. It will not do anything unless either variable is set to a 1.
Does this scheme seem like it would work for you needs? If not could you include a more specific example as that would help us to come up with a more elegant, easier and faster solution.
STeven.
program.robo
|
|
|
Rob from Canada [2 posts] |
17 year
|
Hey Steven,
That should do it, the only reason for wanting to load multiple programs at once or append them to one another was so that components of our mission (we have to look for multiple object types each of which require a unique machine vision algorithm) could be developed independently. However if i take this if statement concept and develop a external app to combine multiple .robo xml files (removing the <head/>) with if statements inserted as needed then we can continue doing that.
Thanks for your help, you guys really have something amazing here with roborealm.
|
|