Programme

Typically: "How do I... ", "How can I... " questions
Post Reply
Jeneaux
Posts: 3
Joined: 28 Nov 2022, 21:47

Programme

Post 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

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

Re: Programme

Post 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.

Jeneaux
Posts: 3
Joined: 28 Nov 2022, 21:47

Re: Programme

Post 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.

Fery64
Posts: 88
Joined: 02 Feb 2022, 15:58

Re: Programme

Post 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

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

Re: Programme

Post 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.

Jeneaux
Posts: 3
Joined: 28 Nov 2022, 21:47

Re: Programme

Post by Jeneaux »

hello

Thanks!!

Its working now.

Post Reply