Ray sensors

Typically: "How do I... ", "How can I... " questions
Post Reply
Ranime
Posts: 3
Joined: 31 Mar 2020, 20:43

Ray sensors

Post by Ranime »

Hi, how can I implement a code so that I can put two ray sensors on each side of my robot so that it can stay in the middle of a track without colliding with the walls.
Thank you in advance!

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

Re: Ray sensors

Post by coppelia »

Hello,

you will have to write a controller for that.
Your inputs are: left and right sensor
Your outputs are: the left and right velocity of your robot wheels (for instance)

What algorithm you chose is fully up to you. Have a look at the demo model in models/robots/mobile/dr20.ttm

Cheers

Ranime
Posts: 3
Joined: 31 Mar 2020, 20:43

Re: Ray sensors

Post by Ranime »

where can I find this file?

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

Re: Ray sensors

Post by coppelia »

In the model browser on the left hand side

Post Reply