Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Typically: "How do I... ", "How can I... " questions
Post Reply
alix
Posts: 35
Joined: 17 Sep 2019, 14:48

Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Post by alix » 10 Oct 2019, 15:32

Hi Everyone,

My conveyer belt script is not getting the handle of the proximity sensor. Following command is being used :

Code: Select all

    sensor=sim.getObjectHandle('conveyorBelt_sensor') 
I have rechecked the spellings etc again and again. But still getting this error:
Lua runtime error: [string "CHILD SCRIPT ConveyorBelt#0"]:5: Object does not exist. (sim.getObjectHandle)
Due to this, my whole task is not working as a proximity sensor needs to halt the belt.
My Scene is uploaded here : https://www.dropbox.com/s/vzv5y919sge3w ... 1.ttt?dl=0

Kindly please take a look at the scene and help me get rid of this problem.
Thanks A lot in advance....

RL_Niryo
Posts: 14
Joined: 03 Oct 2019, 17:05

Re: Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Post by RL_Niryo » 11 Oct 2019, 08:04

The problem seems to come from another script because if I paste your sensor line into the first line of Init(), it's working for the sensor and failing into finding your belt path

alix
Posts: 35
Joined: 17 Sep 2019, 14:48

Re: Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Post by alix » 11 Oct 2019, 08:11

RL_Niryo wrote:
11 Oct 2019, 08:04
The problem seems to come from another script because if I paste your sensor line into the first line of Init(), it's working for the sensor and failing into finding your belt path
But How could i solve it??? I am not getting any idea,

alix
Posts: 35
Joined: 17 Sep 2019, 14:48

Re: Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Post by alix » 11 Oct 2019, 09:11

Even I have tried commenting all the thread switching code lines in the "Jaco" script,
Later even i tried to remove 'Jaco' script at all.... still, the error is the same.


If Coppelia or anyone else can help, I'll be highly thankfulllll......

RL_Niryo
Posts: 14
Joined: 03 Oct 2019, 17:05

Re: Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Post by RL_Niryo » 11 Oct 2019, 10:06

Alix,

I advise you to restart from scratch with only a conveyor belt and a sensor, because I think a setting has been changed unpurposely.

If you have a problem with this basic scene, send it again and I will check out :)

alix
Posts: 35
Joined: 17 Sep 2019, 14:48

Re: Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Post by alix » 11 Oct 2019, 10:36

RL_Niryo wrote:
11 Oct 2019, 10:06
Alix,

I advise you to restart from scratch with only a conveyor belt and a sensor, because I think a setting has been changed unpurposely.

If you have a problem with this basic scene, send it again and I will check out :)
I have used "motionPlanningandGraspingDemo.ttt". What I have found out now is, that if you place a conveyor belt anywhere in that scene, and a proximity sensor, it will generate same error if you try to get its handle in the conveyor belt script. What could be wrong or different in that scene ???

RL_Niryo
Posts: 14
Joined: 03 Oct 2019, 17:05

Re: Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Post by RL_Niryo » 11 Oct 2019, 13:28

alix wrote:
11 Oct 2019, 10:36
RL_Niryo wrote:
11 Oct 2019, 10:06
Alix,

I advise you to restart from scratch with only a conveyor belt and a sensor, because I think a setting has been changed unpurposely.

If you have a problem with this basic scene, send it again and I will check out :)
I have used "motionPlanningandGraspingDemo.ttt". What I have found out now is, that if you place a conveyor belt anywhere in that scene, and a proximity sensor, it will generate same error if you try to get its handle in the conveyor belt script. What could be wrong or different in that scene ???
Yeah, I already tried that myself, that why I suggested and I still suggest you to recreate everything in a new scene

alix
Posts: 35
Joined: 17 Sep 2019, 14:48

Re: Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Post by alix » 11 Oct 2019, 14:30

RL_Niryo wrote:
11 Oct 2019, 13:28
alix wrote:
11 Oct 2019, 10:36
RL_Niryo wrote:
11 Oct 2019, 10:06
Alix,

I advise you to restart from scratch with only a conveyor belt and a sensor, because I think a setting has been changed unpurposely.

If you have a problem with this basic scene, send it again and I will check out :)
I have used "motionPlanningandGraspingDemo.ttt". What I have found out now is, that if you place a conveyor belt anywhere in that scene, and a proximity sensor, it will generate same error if you try to get its handle in the conveyor belt script. What could be wrong or different in that scene ???
Yeah, I already tried that myself, that why I suggested and I still suggest you to recreate everything in a new scene

Hi RL_Niryo,

Kindly can you please take a look at this scene and let me know what could be the problem why configs are returning nill. Targets seem to be in range, I am stuck in this problem that's why I edited original scene and faced that proximity sensor handle issue. Here the proximity sensor is fine.
Link:

Code: Select all

https://www.dropbox.com/s/8t9zo6w7rwviiau/try-jaco.ttt?dl=0

coppelia
Site Admin
Posts: 7388
Joined: 14 Dec 2012, 00:25

Re: Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Post by coppelia » 15 Oct 2019, 10:29

Just an idea... could it be that this was overseen?

If you want to access objects in an absolute fashion, simply write the whole name of the object. If it doesn't contain a #, simply append a #, like in this example:

Code: Select all

sensor=sim.getObjectHandle('conveyorBelt_sensor#') 
Cheers

alix
Posts: 35
Joined: 17 Sep 2019, 14:48

Re: Conveyor Belt Child Script is not getting the Handle of Proximity Sensor

Post by alix » 16 Oct 2019, 14:23

Hi Coppelia,

Thanks for the help. I sorted out the matter by exporting the Jaco as a model from the "MotionPlanningandGrasping" scene. Created a new scene, inserted conveyor belt, and proximity sensor, made it work. After it then added that Jaco exported model. Now it is working fine.

Post Reply