Subject:
|
Re: legOS lcd management and thoughts on velocities
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Mon, 29 Jan 2001 15:33:05 GMT
|
Viewed:
|
1308 times
|
| |
| |
On Jan 27, Michaël Cambay wrote:
> Thank you Jochen for your answer.
> If I well understand the ds_rotation_handler code, the timeout is set to 1
> second.
> So the velocity may drop to zero 1 second after wheels really stop.
> In the specific case of my robot (I call it R2D1), this will be a little bit
> late.
> [...]
> So I would prefer that R2D1 'guess' collisions a soon as they occurs.
> I'll try to change your timeout ( from 1000ms to 200ms ). The posibility to
> change this timeout by software may be interresting.
The timeout is really "expected time till next rotation tick + 50 %".
And the velocity will not drop to 0, because my code assumes, a new
rotation could happen any moment.
If you check for speed < 7 ticks/sec (or 142 msec/tick) you should get
a response time of 213 ms. But in your case it may be enough to
assume a collision happened when a timeout occurred. You can check if
the velocity drops while the rotation sensor has still the same value.
If you want to change the 50 %, it is hardcoded in kernel/dsensor.c
line 183:
next_rotation[channel] = time + time_diff * 3 / 2;
and line 209: ... time_diff / 2;
> There are other differences between ds_rotation_handler and my task.
> 1 )The task I wrote was naturally not as low level as yours. I used
> msleep(1) to obtain a pseudo more or less 1KHz frequency. So the
> speed I compute will not be as accurate as your velocity.
> 2)My Task will give up after only 200ms without a move and set speed
> to zero quicker.
> 3)As soon as time interval between move is growing (but still
> inferior to 200ms) the speed is updated. This enable to decrease
> speed and so to warn, before the 200ms, any other task using speed
> that the speed is going down. This feature give a very good
> reactivity to R2D1
>
> please feel free to comment or use my code ( or ideas hidden within it !).
Your code is not so different. I do 1) more elegantly by plugging
directly into the OS handler that polls the rotation sensor.
Regarding to 3) I feared to do the recalculation too often, so I added
the 50 % tolerance. And 2) is not necessary if you check if speed is <5.
Jochen
|
|
Message has 1 Reply:
Message is in Reply To:
5 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|