troubles with cognew and LaserRangeFinder-Functions.
nomad
Posts: 276
Hi,
i have some trouble and problems with cognew and my LRF-Functions
i working on the Software of a Quadcopter with the PropellerProtoBoard
for testing "cognew" and my LRF-Code i make a little testprogram for this
-> as attachment : mylrftest2.spin
1)
problem on PUB main after repeat, cognew(testing,@stack) is OK, programm with the
LRFdatas-function.
but when i make cognew(LRFdatas, @stack1) nothing runs.
what make i wrong ???
2)
in my prototype.spin -program
the problem is : if i wrote in line 254 LRFdatas, nothing goes extremly sloow
i think its a timing problem
for this i want make a cognew(LRFdatas,@stack ???)
is this possible ???
in the program LRFdatas are multible access
in line 744
in line 1004
only in the function landing on line 1038 its ok, (the copter should be verry slow landing)
Many Thanks for Help, Hints and tricks
nomad
i have some trouble and problems with cognew and my LRF-Functions
i working on the Software of a Quadcopter with the PropellerProtoBoard
for testing "cognew" and my LRF-Code i make a little testprogram for this
-> as attachment : mylrftest2.spin
1)
problem on PUB main after repeat, cognew(testing,@stack) is OK, programm with the
LRFdatas-function.
but when i make cognew(LRFdatas, @stack1) nothing runs.
what make i wrong ???
2)
in my prototype.spin -program
the problem is : if i wrote in line 254 LRFdatas, nothing goes extremly sloow
i think its a timing problem
for this i want make a cognew(LRFdatas,@stack ???)
is this possible ???
in the program LRFdatas are multible access
in line 744
in line 1004
only in the function landing on line 1038 its ok, (the copter should be verry slow landing)
Many Thanks for Help, Hints and tricks
nomad
Comments
I think it would be very useful if the LRF could measure the altitude of a quadcopter. I'm very skeptical that it would be able to sense the altitude of a quadcopter when used outside. I've tested my LRF outside and found it had a hard time getting a reading in sunlight. When the LRF was able to measure distance outside in the sun, it would only do so for short distances < 2 meters and only if the LRF was held very still. I think the movement of the quadcopter will make it harder for the LRF to work.
Have you done any testing yourself?
I've wondered if using a brighter laser would make it more reliable when using it outside in sunlight.
@ kuroneko
thanks for your answer
excuse, but to programming with cogs (threading) i'm a newbie
and have some troubles to understand your answer
please can you me explain your answer with this code-snippets
- i have translate your answer to german the understanding is not
better for me:
- what i want is this:
1) lrfInit
2) loop
- read LRF-Datas (1.cog)
- working with LRF-Datas (testing) (2.cog)
---code
PUB main
pst.Start(115_200)
LRFinit
REPEAT
cognew(testing,@stack)
LRFdatas
'cognew(LRFdatas,@stack1)
thanks for your help.
@DuaneDegn
thanks for your answer:
i am testing the lrf-datas inside
- the device looks to ground
- i am testing too device looks horizontal to the windows in my room
(sun)
- its run ok
my idea is:
- working with lrf
- on starting from the ground (hover) distance < 2 meters
- landing to control the distance < 2 meters
- for all other distance measure -> GPS-NMEA -> altitude
@ all:
please excuse my bad english. ;-)
thanks for help hints and tricks
nomad
Versuch mal ob Du mit der Version hier klarkommst (Zeile 23 bitte loeschen, der Aufruf simuliert den LRF): Diese Version startet beide cogs nur einmal. Sie halten sich dann selbst am Leben (repeat) und koennen ihre Daten dann ueber globale Variablen austauschen.
vielen dank fuer deine antwort in deutsch,
erleichtert mir vieles.
vielen dank fuer deinen spin-code.
da ich gestern meinen quadcopter voellig demontiert habe incl. LRF,
muss heute oder besser morgen lrf auf meinen propeller-proto-board wieder zum laufen bekommen,
dann teste ich deinen code.
melde mich dann wieder.
nochmals vielen dank fuer deine hilfe
nomad
@kuroneko:
vielen dank fuer deine Hilfe, dein code ist genau das was ich gesucht habe ,
Code Run OK, tempcounter ok, lrf-distance OK
Thanks :-)
regards nomad