vasant from United States  [15 posts]
14 year
Hello ,

I am using Roborealm in Robotics studio simulation.

I need to run an experiment about 500 times. So i start all the services run my experiment, stop the service remove the robot entities and put them back again and start the services.... To stop the roborealm service i send a drop message to roborealm port.

Roborealm works well for the first 10 instances or so and then i get this error.. exception communicating to roborealm

I notice that if i close the roborealm window , it restarts again and communicates properly.

I was wondering if there was any way to close roborealm through a  api call when i drop my roborealm service so that i restarts automatically the next time when the service start. I welcome any other solution to the problem as well.


Anonymous 14 year
You probably have only 10 threads for the API set ... you could increase this to 100 but that would only delay the issue.

The best way is to use the "quit" message as in


or in C# you can add this into the RR_API class

        public void  quit()
            if (connected) send("<request><quit/></request>");

vasant from United States  [15 posts] 14 year
thanks for the prompt reply !

The thread was set to 1 !! when i increased it to 100 it was ok.

I tried using the quit command as well. Roborealm does not seem to close !! (I debugged to see if the code was sent)

I then used the Close command from the existing api, and it closed in the first trial , but did not from 2nd trials..

I am using Roborealm 2.22.0 version.

Thanks and appreciate your help.
Anonymous 14 year

The 'quit' command should only terminate your connection but NOT close RoboRealm ... its a nice way to ensure that you connection is terminated so that you don't delay with reconnecting on any thread.

The 'close' command should close RoboRealm each time. Be sure that you have the API turned on and exit once normally with this setting to ensure that when RoboRealm restarts that the API is enabled. We have been unable to replicate the issue you describe above ... perhaps you can provide more information about the issue 'but did not from 2nd trials...'.

Also, why close RoboRealm inbetween trials? Should the 'quit' command not suffice or is there a reason to close down RoboRealm between each trial? Note that not closing it will cause things to move much quicker ... or perhaps there is an API command that we can add to help prevent this need for closing.

vasant from United States  [15 posts] 14 year
Thanks , I thought that the quit command closes the program. My bad.

Sorry for the delay in reply, I was finishing my experimental setup and it is done. I just need to figure out the  Roborealm part of it.

My experiment is as follows -

I have setup a pan tilt camera on a Pioneer 3dx base. I am doing blob tracking using roborealm and moving my pan tilit camera. My experiment is to fuse the robot speed and direction in to the tracking so that the overall tracking is better.

Now i have a couple of metrics i am measuring everyframe and i run the robot randomly between 2 points 500 times.

So everytime the robot starts at a random point a , goes to point b and the service drops everything. ( physical entity, Roborealm, the drive,webcam) and restarts everything.

The problem i have is that -

The first time roborealm starts it works perfectly. The after say 3rd or 4rth run i get a message on my console saying ERROR. When i close roborealm and restart it, it works fine again and after another set of runs i get the same problem. Sometimes i get message saying unable to communicate with roborealm.

I used the quit commmand and i get ERROR type message on my console.

I used the existing close command and i could close roborealm completely only once , my first run. After which it does not close at all (for the next 499 runs).

I hope i put it in a better way this time around. Sorry for the late reply and thanks for all your help.

vasant from United States  [15 posts] 14 year
oh and i agree , i dont need to close roborealm at all.

I just need to be able to reset my variables - (COG_X, COG_Y)  (After the run), and make sure it works when my camera gets inserted and after my partnerships are formed again. So the quit command is ideal.

I just need it to be consistent in behavior.

vasant from United States  [15 posts] 14 year
okay the ERROR in the previous message was not related to roborealm, it was my mistake. sorry :( .

quick question - Do i start / run stuff / send quit message /drop each of the 500 times or just start at the beginning , send quit message in each of 500 cases and drop at the end. what is your thoughts ?

Anonymous 14 year

I'd try not to close the connection unless you are completely done with it. As it does take time and resources to initiate a connection you are much better off holding it open until you no longer need the connection. This assumes that one client is doing all these connections. If you have 100s then closing the connection ASAP quickly is probably better.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index