Obstacle avoidance robot Run time error

Typically: "How do I... ", "How can I... " questions
Post Reply
jeev_sid
Posts: 1
Joined: 01 Jul 2019, 08:16

Obstacle avoidance robot Run time error

Post by jeev_sid » 02 Jul 2019, 06:05

The below given is the source code for obstacle avoiding robot

Code: Select all

if (sim_call_type==sim_childscriptcall_initialization) then

    LM=simGetObjectHandle("lm#0")
    RM=simGetObjectHandle("rm#0")
    sen1=simGetObjectHandle("Proximity_sensor2")
    sen2=simGetObjectHandle("Proximity_sensor0")
    sen3=simGetObjectHandle("Proximity_sensor")
    sen4=simGetObjectHandle("Proximity_sensor1")
     sen5=simGetObjectHandle("Proximity_sensor3")
   

end


if (sim_call_type==sim_childscriptcall_actuation) then

 res1=simReadProximitySensor(sen1)
 res2=simReadProximitySensor(sen2)
 res3=simReadProximitySensor(sen3)
 res4=simReadProximitySensor(sen4)
 res5=simReadProximitySensor(sen5)

 if(sen1>0) and (sen5>1) then
simSetJointTargetVelocity(RM,1)
simSetJointTargetVelocity(LM,1)
else
simSetJointTargetVelocity(RM,0)
simSetJointTargetVelocity(LM,0)
end
end
.I am getting a run time error when i run this.Please help?!
Error:[C]: in function 'simReadProximitySensor'
[string "SCRIPT Cuboid#0"]:19: in main chunk
Lua runtime error: [string "SCRIPT Cuboid#0"]:19: One of the function's argument type is not correct. (simReadProximitySensor)

Post Reply