Potential Bug in B0 Remote API: simxGetObjects()

Report crashes, strange behaviour, or apparent bugs
Post Reply
robo_sim17
Posts: 2
Joined: 10 Jul 2020, 17:53

Potential Bug in B0 Remote API: simxGetObjects()

Post by robo_sim17 »

I am using the BlueZero Remote API for python and have had no success with the use of the simxGetObjects function, with an error in the CoppeliaSim Status console:

Code: Select all

[18:00:03.00] B0 Remote API: error while calling function 'GetObjects': [string "CUSTOMIZATION SCRIPT b0RemoteApiServer"]:819: One of the function's argument type is not correct. (sim.getObjects) 
Upon tracing the method call through the libraries, I noticed that in "lua/b0RemoteApiServer.lua" file, the function
"GetObjects(...)" has two potential issues:
1) Undefined variable "handle" on line 821
2) No iteration of i

The function copied here:

Code: Select all

 function GetObjects(...)
      debugFunc("GetObjects",...)
      local objType=...
      local retVal={}
      local i=0
      local h=sim.getObjects(i,objType)
      while h>=0 do
          retVal[#retVal+1]=handle
          h=sim.getObjects(i,objType)
      end
      return retVal
 end
1) I believe the word "handle" is supposed to be "h"
2) I believe "i = i +1" needs to be inserted before the second call to sim.getObjects(i, objType)

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Potential Bug in B0 Remote API: simxGetObjects()

Post by coppelia »

Hello,

you are absolutely right, thanks for pointing this out!

Cheers

Post Reply