API Constants not working with simxSetModelProperty

Typically: "How do I... ", "How can I... " questions
Post Reply
Rex
Posts: 15
Joined: 22 Jan 2018, 07:45

API Constants not working with simxSetModelProperty

Post by Rex » 19 Feb 2018, 10:20

Hi,

I'm encountering issues when trying to set a model to have non-dynamic property using the C++ Remote API:

When I try to use the API constant 'sim.modelproperty_not_dynamic', the compiler throws: ‘sim’ was not declared in this scope

Here's the code I'm using

Code: Select all

//remove robot from physics engine
int prop;
simxGetModelProperty(clientID, objectHandle, &prop, simx_opmode_blocking);
simxSetModelProperty(clientID, objectHandle, prop|sim.modelproperty_not_dynamic, simx_opmode_oneshot);
//Set Object Position
const float position[] = {2,2,0};
int simxSetObjectPosition(clientID, objectHandle, -1,  position, simx_opmode_oneshot)
//Place robot back into physics engine
SetModelProperty(ModelHandleIDs.back(), prop);
The code compiles fine and doesn't encounter runtime errors if the parameters changed to:

Code: Select all

simxSetModelProperty(clientID, objectHandle, prop, simx_opmode_oneshot);
I have made the includes mentioned in http://www.coppeliarobotics.com/helpFil ... ntSide.htm in the makefile, and have no issues using remote API functions like simxLoadModel, simxSetObjectPosition etc.

Is there a different set of API constants for the Remote API? I'm using the constants listed on this page: http://www.coppeliarobotics.com/helpFil ... Properties

It was linked from the simxGetModelProperty documentation.

Thanks in advance!

fferri
Posts: 206
Joined: 09 Sep 2013, 19:28

Re: API Constants not working with simxSetModelProperty

Post by fferri » 19 Feb 2018, 13:48

In C/C++ you use sim_modelproperty_not_dynamic and not sim.modelproperty_not_dynamic.
The latter is used in V-REP Lua scripts only.

Rex
Posts: 15
Joined: 22 Jan 2018, 07:45

Re: API Constants not working with simxSetModelProperty

Post by Rex » 19 Feb 2018, 17:33

I see! Thanks for the help!

Post Reply