Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Program / Control your Robobuilder robot with LISP !

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
93 postsPage 6 of 71 ... 3, 4, 5, 6, 7
93 postsPage 6 of 71 ... 3, 4, 5, 6, 7

What do you think of using Lisp / L# and Robobuilder?

Poll ended at Fri Dec 25, 2009 12:13 am

(it love !)
3
75%
Bring back GOTO !
0
No votes
"Emacs is written in Lisp, which is the only computer language that is beautiful. "
1
25%
"the most intelligent way to misuse a computer"
0
No votes
 
Total votes : 4

Post by pepep » Tue May 18, 2010 6:35 pm

Post by pepep
Tue May 18, 2010 6:35 pm

OK, I try a new variant of the movement, like your maze: when the robot find a obstacle in front, it will try turn right until the obstacle disappear, and then continue the movement.

Joystick is not a priority for me: I'm trying to give to the robot (using Lisp) autonomy in his movements.

Thanks!
OK, I try a new variant of the movement, like your maze: when the robot find a obstacle in front, it will try turn right until the obstacle disappear, and then continue the movement.

Joystick is not a priority for me: I'm trying to give to the robot (using Lisp) autonomy in his movements.

Thanks!
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Wed May 19, 2010 9:14 pm

Post by l3v3rz
Wed May 19, 2010 9:14 pm

I created a couple of CSV file (like walk.csv) for turn left and turn right

They might help - you should be able to play them directly with .Playfile

http://robobuildervc.googlecode.com/files/tleft.csv

http://robobuildervc.googlecode.com/files/tright.csv
I created a couple of CSV file (like walk.csv) for turn left and turn right

They might help - you should be able to play them directly with .Playfile

http://robobuildervc.googlecode.com/files/tleft.csv

http://robobuildervc.googlecode.com/files/tright.csv
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Fri May 21, 2010 3:53 pm

Post by pepep
Fri May 21, 2010 3:53 pm

How can I load the battery with your firmware? Pushing the two botton the green led don't blink, and with others firmwares works fine with this method ...
How can I load the battery with your firmware? Pushing the two botton the green led don't blink, and with others firmwares works fine with this method ...
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Fri May 21, 2010 4:05 pm

Post by l3v3rz
Fri May 21, 2010 4:05 pm

Sorry - in DCMP theres no battery charging mode - you have to upload standard firmware - recharge and then go back. Sounds like a feature that needs adding :)
Sorry - in DCMP theres no battery charging mode - you have to upload standard firmware - recharge and then go back. Sounds like a feature that needs adding :)
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Fri May 21, 2010 6:38 pm

Post by pepep
Fri May 21, 2010 6:38 pm

Hmmmm .... yes! :wink:
Hmmmm .... yes! :wink:
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Mon May 24, 2010 6:42 pm

Post by l3v3rz
Mon May 24, 2010 6:42 pm

Coding up now, should be in a new version out at the weekend, along with some extra functions, and an update to Robobuilderlib with the matrix additions. So for instance you can now load the csv file straight into a matrix file and manipulate or playout directly.

Edit: have the sound working now as well ! Realtime response - and converts the LEDs on the back of the RBC into crude 3-bar meter. You can also read the state of last IR remote command pressed and the current voltage
Coding up now, should be in a new version out at the weekend, along with some extra functions, and an update to Robobuilderlib with the matrix additions. So for instance you can now load the csv file straight into a matrix file and manipulate or playout directly.

Edit: have the sound working now as well ! Realtime response - and converts the LEDs on the back of the RBC into crude 3-bar meter. You can also read the state of last IR remote command pressed and the current voltage
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Wed May 26, 2010 8:41 pm

Post by pepep
Wed May 26, 2010 8:41 pm

l3v3rz wrote:...converts the LEDs on the back of the RBC into crude 3-bar meter...


:lol: :lol:

Well, my wishes list isn't so hard now, don't? Your are great, man!
l3v3rz wrote:...converts the LEDs on the back of the RBC into crude 3-bar meter...


:lol: :lol:

Well, my wishes list isn't so hard now, don't? Your are great, man!
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Wed May 26, 2010 9:35 pm

Post by l3v3rz
Wed May 26, 2010 9:35 pm

Yes I'm quite pleased with the sound - I can read it off the bot and display graphically in real time - when I play a recorder I can see a sine wave appear on the screen. I've also passed it into an fft function from a .NET math library called Mathnet.numerics and plotted that at the same time.

Ive also added a capability to play the built in sounds into DCMP - but have no way of testing - so I'll have to rely on you for that.

cheers
Yes I'm quite pleased with the sound - I can read it off the bot and display graphically in real time - when I play a recorder I can see a sine wave appear on the screen. I've also passed it into an fft function from a .NET math library called Mathnet.numerics and plotted that at the same time.

Ive also added a capability to play the built in sounds into DCMP - but have no way of testing - so I'll have to rely on you for that.

cheers
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Thu May 27, 2010 8:39 pm

Post by pepep
Thu May 27, 2010 8:39 pm

l3v3rz wrote:...Ive also added a capability to play the built in sounds into DCMP - but have no way of testing - so I'll have to rely on you for that.

cheers


When you want! I'm expecting!
l3v3rz wrote:...Ive also added a capability to play the built in sounds into DCMP - but have no way of testing - so I'll have to rely on you for that.

cheers


When you want! I'm expecting!
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Fri May 28, 2010 4:37 pm

Post by l3v3rz
Fri May 28, 2010 4:37 pm

its up ! :D

New DCMP

http://code.google.com/p/robobuilderlib ... P_r139.hex

and new RobobuilderLib.dll

http://code.google.com/p/robobuildervc/ ... l&can=2&q=

LISP examples are here:

http://code.google.com/p/robobuildervc/ ... trunk/Lisp

Look for fft.lisp for example of real time sound reading. mat.lisp for matrix examples with neural networks. Still working on back propagation (in case any one want to suggest some pointers)
its up ! :D

New DCMP

http://code.google.com/p/robobuilderlib ... P_r139.hex

and new RobobuilderLib.dll

http://code.google.com/p/robobuildervc/ ... l&can=2&q=

LISP examples are here:

http://code.google.com/p/robobuildervc/ ... trunk/Lisp

Look for fft.lisp for example of real time sound reading. mat.lisp for matrix examples with neural networks. Still working on back propagation (in case any one want to suggest some pointers)
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Sat Jun 05, 2010 1:12 pm

Post by pepep
Sat Jun 05, 2010 1:12 pm

Well, readSound os wonderfull!

I modify lpose (now spose) to readSound every time it make a simple movement in a global one. The return value of readSound adds if it is greater than a certain umbral, to compose the total sound ... b.e. "hello" has a duration aprox 0.8 seconds, more or less the same than one step. Then, all the "hello" sound sums 200 b.e, but "wonderfull" sums more, b.e. 500.

With this procedure I can program class of sounds, and make diferents things with each class (walk forward, backward, turn, wait, ...).

I must control when the sound has finish, but I don't think was a problem reading until the readSound return a minor value ...

This is the new code:
Code: Select all
(= snd 0)
(def spose (dur stp pos lpst)
   (if (or pos)
      ( do  (= lpst (.PlayPose wck dur stp (toByteArray (car pos)) false))
         ;(prn "nxt: " lpst)
         (= snd (if (> (= sndt (readSound)) 40) (+ snd sndt) snd))
         (if lpst (spose dur stp (cdr pos) false)
         )
      )
   )
   lpst
)


Do all this things all together haven't any delay in the robot movement! Great!

Some questions:
1. whats the diference between readSound and readMIC?
2. what do you want I test with runSound? In DC mode has no funtionality, no in the current DCM.lisp ...

cheers!
Well, readSound os wonderfull!

I modify lpose (now spose) to readSound every time it make a simple movement in a global one. The return value of readSound adds if it is greater than a certain umbral, to compose the total sound ... b.e. "hello" has a duration aprox 0.8 seconds, more or less the same than one step. Then, all the "hello" sound sums 200 b.e, but "wonderfull" sums more, b.e. 500.

With this procedure I can program class of sounds, and make diferents things with each class (walk forward, backward, turn, wait, ...).

I must control when the sound has finish, but I don't think was a problem reading until the readSound return a minor value ...

This is the new code:
Code: Select all
(= snd 0)
(def spose (dur stp pos lpst)
   (if (or pos)
      ( do  (= lpst (.PlayPose wck dur stp (toByteArray (car pos)) false))
         ;(prn "nxt: " lpst)
         (= snd (if (> (= sndt (readSound)) 40) (+ snd sndt) snd))
         (if lpst (spose dur stp (cdr pos) false)
         )
      )
   )
   lpst
)


Do all this things all together haven't any delay in the robot movement! Great!

Some questions:
1. whats the diference between readSound and readMIC?
2. what do you want I test with runSound? In DC mode has no funtionality, no in the current DCM.lisp ...

cheers!
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Sat Jun 05, 2010 1:33 pm

Post by l3v3rz
Sat Jun 05, 2010 1:33 pm

ReadMIC takes the average of 50 reads so its is more of sound level - its what the standard firmware uses. But it takes about 500ms to return no good for interactive stiff.

To play sounds try this:-

Code: Select all
(def playSound (n)
  "Play Sound"     
    (.wckReadPos wck 30 (+ 64 n)) ; send sound 1 <= n <= 25
)




If you have utilities.lisp loaded try this

Code: Select all
(def soundTest ()
  (setSampling true)
  (= p1 (new "Pen" (Color.FromName "Black")))
  (.set_DashStyle p1 (System.Drawing.Drawing2D.DashStyle.DashDot))
  (createwindow "Plot Distance Demo" 250 250)
  (.show form1)
 
  (= nos 64)
   
   (while (not (console.keyavailable))
          (= history ())
          (.clear g (Color.FromName "White"))
          (for i 1 nos
             (= snd (readSound))
             (= history (cons (list (* 6 (- i 16) ) (- (* 5 snd) 20) ) history))
          )
          (drawlist g (reverse history) "Blue")                 
   )
   (setSampling false)
   (.close form1)
)


it will graphically show sound output

cheers
ReadMIC takes the average of 50 reads so its is more of sound level - its what the standard firmware uses. But it takes about 500ms to return no good for interactive stiff.

To play sounds try this:-

Code: Select all
(def playSound (n)
  "Play Sound"     
    (.wckReadPos wck 30 (+ 64 n)) ; send sound 1 <= n <= 25
)




If you have utilities.lisp loaded try this

Code: Select all
(def soundTest ()
  (setSampling true)
  (= p1 (new "Pen" (Color.FromName "Black")))
  (.set_DashStyle p1 (System.Drawing.Drawing2D.DashStyle.DashDot))
  (createwindow "Plot Distance Demo" 250 250)
  (.show form1)
 
  (= nos 64)
   
   (while (not (console.keyavailable))
          (= history ())
          (.clear g (Color.FromName "White"))
          (for i 1 nos
             (= snd (readSound))
             (= history (cons (list (* 6 (- i 16) ) (- (* 5 snd) 20) ) history))
          )
          (drawlist g (reverse history) "Blue")                 
   )
   (setSampling false)
   (.close form1)
)


it will graphically show sound output

cheers
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Sun Jun 06, 2010 9:53 am

Post by pepep
Sun Jun 06, 2010 9:53 am

playSound don't work: it freez the robot and must restart to control again ...
(.wckReadPos 30 n) where n > 64 return false ...
playSound don't work: it freez the robot and must restart to control again ...
(.wckReadPos 30 n) where n > 64 return false ...
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Sun Jun 06, 2010 11:48 am

Post by l3v3rz
Sun Jun 06, 2010 11:48 am

I think sound sampling needs to be ON (it enables the timer interrupt) - can you try it again and see if that makes a difference ?

Sorry - but its hard to debug as I don't have a sound chip

BTW : next version of DCMP will have sound sampling enabled as default - since it seems to have no effect on performance.
I think sound sampling needs to be ON (it enables the timer interrupt) - can you try it again and see if that makes a difference ?

Sorry - but its hard to debug as I don't have a sound chip

BTW : next version of DCMP will have sound sampling enabled as default - since it seems to have no effect on performance.
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Sun Jun 06, 2010 6:17 pm

Post by pepep
Sun Jun 06, 2010 6:17 pm

It's the same!

When do (setSampling true) the red led (the left up to down 3rd) start to blink, and then, when do (playSound 1), then it fixed on!

Nothing else is different ...

???
It's the same!

When do (setSampling true) the red led (the left up to down 3rd) start to blink, and then, when do (playSound 1), then it fixed on!

Nothing else is different ...

???
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

PreviousNext
93 postsPage 6 of 71 ... 3, 4, 5, 6, 7
93 postsPage 6 of 71 ... 3, 4, 5, 6, 7