[JAVA] simxgetcollectionhandle method missing
-
- Posts: 5
- Joined: 29 Jun 2016, 19:53
[JAVA] simxgetcollectionhandle method missing
I'm attempting to call simxGetCollectionHandle so that I can use simxGetObjectGroupData and get data from my collection of proximity sensors. However, when I attempt to call the method, it gives me the error that the method doesn't exist. I'm using the remoteApi.dll from VREP 3.3.1 in my src folder in Eclipse.
Re: [JAVA] simxgetcollectionhandle method missing
Hello,
for the Java remote API you need to use remoteApiJava.dll, not remoteApi.dll
Cheers
for the Java remote API you need to use remoteApiJava.dll, not remoteApi.dll
Cheers
-
- Posts: 5
- Joined: 29 Jun 2016, 19:53
Re: [JAVA] simxgetcollectionhandle method missing
I apologize, remoteApiJava.dll is the .dll file that I have installed. I got it in the 64Bit folder.
Re: [JAVA] simxgetcollectionhandle method missing
Can you show us the code you are using to call that function? Also, what is the exact error message?
Cheers
Cheers
-
- Posts: 5
- Joined: 29 Jun 2016, 19:53
Re: [JAVA] simxgetcollectionhandle method missing
Code: Select all
public int getStateTESTER() {
IntW sensor_handle = new IntW(1);
int ObjectHandle = Simulation.vrep.simxGetCollectionHandle(Simulation.clientID, "IR_Sensors", sensor_handle,
remoteApi.simx_opmode_oneshot);
// Simulation.vrep.simxGetObjectGroupData(clientID, objectType, dataType, handles, intData, floatData, stringData,
// operationMode);
return 0;
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method simxGetCollectionHandle(int, String, IntW, int) is undefined for the type remoteApi
Re: [JAVA] simxgetcollectionhandle method missing
We cannot reproduce your error.
Can you try with following simple program:
Cheers
Can you try with following simple program:
Code: Select all
import coppelia.IntW;
import coppelia.remoteApi;
public class test
{
public static void main(String[] args)
{
System.out.println("Program started");
remoteApi vrep = new remoteApi();
vrep.simxFinish(-1);
int clientID = vrep.simxStart("127.0.0.1",19997,true,true,5000,5);
if (clientID!=-1)
{
System.out.println("Connected to remote API server");
IntW collectionHandle = new IntW(-1);
int ret=vrep.simxGetCollectionHandle(clientID,"myCollection",collectionHandle,vrep.simx_opmode_blocking);
System.out.format("Function returned: %d, the collection handle is: %d\n",ret,collectionHandle.getValue());
vrep.simxFinish(clientID);
}
else
System.out.println("Failed connecting to remote API server");
System.out.println("Program ended");
}
}