Page 1 of 1

Error in obtaining handle in Coppeliasim 4.7.0

Posted: 22 Jun 2024, 09:31
by Lnferior
Recently, I downloaded the latest version of Coppeliasim, but during use, I found that the retrieval of handles in the script is not the same as in previous versions, and I did not understand the relevant instructions for obtaining handles in the user manual. During the simulation process, errors also occurred, as shown in the figure. What is the correct method to obtain a handle? Thank you.
Cheers
Image

Re: Error in obtaining handle in Coppeliasim 4.7.0

Posted: 24 Jun 2024, 06:00
by coppelia
Hello,

handle retrieval is exactly the same as previously: think of your script and all objects as files in a files and folder system: from the location of your script ('.'), you can access its parent ('..'), its grand-parent ('../..'), etc. But you can also access its child with alias 'A' ('./A'). Make sure to carefully read the page on accessing scene objects programmatically for additional details.

In your example, you'r access objects correctly with:

Code: Select all

Base = sim.getObject('..')
J = sim.getObject('../J')
Cheers