Page 1 of 1
Programme
Posted: 29 Nov 2022, 09:54
by Jeneaux
> Hello
>
> I am working on a project for school.
> I am making a roboticarm that will pick something up from a conveyerbelt.
>
> I found a video on youtube with some instructions.
> The person in the video is using the following functions, but i can't find
> them in the program.
> sim.getObjectHandle and sim.getPathPosition and sim.setPathPosition.
>
> Are there other functions for this?
>
> regards
>
> Jeneaux
Re: Programme
Posted: 29 Nov 2022, 11:10
by fferri
That video is old, and those APIs are deprecated.
Nowadays you would use sim.getObject to retrieve object handles.
Depending on what you want to do, you can use
Path objects, or you can simply generate the path data as sequences of 3D (or 7D for poses) points.
Always refer to the
manual for the most up-to-date way of doing things.
Re: Programme
Posted: 29 Nov 2022, 11:49
by Jeneaux
hello fferri
Thank you for your reply!!
So I have a conveyerbelt with a proximitysensor, on top of the belt there is a cube.
If the sensor detects the cube, the belt has to stop.
I am really struggling with this.
Re: Programme
Posted: 29 Nov 2022, 13:21
by Fery64
Jeneaux wrote: ↑29 Nov 2022, 11:49
hello fferri
Thank you for your reply!!
So I have a conveyerbelt with a proximitysensor, on top of the belt there is a cube.
If the sensor detects the cube, the belt has to stop.
I am really struggling with this.
I think you might need to get the handle of conveyour and put the movement option to false when you get a signal from the sensor
Re: Programme
Posted: 29 Nov 2022, 14:44
by fferri
Hi Jeneaux,
first, the cube has to be set 'Detectable' in its properties.
Then you would use (e.g. in the sensing phase of a child script) sim.readProximitySensor(sensorHandle) and if something is detected (result==1), you would react with some action controlling the conveyor model; have a look at the conveyor model's script for information on how to control it.
Re: Programme
Posted: 29 Nov 2022, 21:46
by Jeneaux
hello
Thanks!!
Its working now.