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 3 of 71, 2, 3, 4, 5, 6, 7
93 postsPage 3 of 71, 2, 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 » Thu Apr 01, 2010 2:11 pm

Post by pepep
Thu Apr 01, 2010 2:11 pm

Don't work: I get the same combination than before ...
Don't work: I get the same combination than before ...
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Thu Apr 01, 2010 4:56 pm

Post by l3v3rz
Thu Apr 01, 2010 4:56 pm

I ve just rebuilt and reloaded the http://robobuildervc.googlecode.com/fil ... derLib.dll in case Ive slipped up can you re-try and enter this:


Code: Select all
> (reference "RobobuilderLib" )
RobobuilderLib, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null


It should report v1.5. I'm pretty sure I know what the error is and have fixed it - the problem was in wckMotion.cs

Code: Select all
        public bool wckWriteIO(int id, bool ch0, bool ch1 )
        {
            byte d1, d3;
            d1 = (byte)((7 << 5) | (id % 31));
            d3 = (byte)((byte)((ch0) ? 1 : 0) | (byte)((ch1) ? 2 : 0));
            return wckSetOper(d1, 0x64, d3, d3);
        }


In the old version it used to say

d3 = (byte)((byte)((ch0) ? 1 : 0) | (byte)((ch1) ? 3 : 0));

So d3/ch0 was set regardless of what values of ch0 was passed if ch1 was true - which I think is your problem.

Bit of a newbie error - sorry for that :) I just have no way short of disassembling a servo and putting a meter on it to test. (Unless someone wants to send me a transparent servo :])

cheers
I ve just rebuilt and reloaded the http://robobuildervc.googlecode.com/fil ... derLib.dll in case Ive slipped up can you re-try and enter this:


Code: Select all
> (reference "RobobuilderLib" )
RobobuilderLib, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null


It should report v1.5. I'm pretty sure I know what the error is and have fixed it - the problem was in wckMotion.cs

Code: Select all
        public bool wckWriteIO(int id, bool ch0, bool ch1 )
        {
            byte d1, d3;
            d1 = (byte)((7 << 5) | (id % 31));
            d3 = (byte)((byte)((ch0) ? 1 : 0) | (byte)((ch1) ? 2 : 0));
            return wckSetOper(d1, 0x64, d3, d3);
        }


In the old version it used to say

d3 = (byte)((byte)((ch0) ? 1 : 0) | (byte)((ch1) ? 3 : 0));

So d3/ch0 was set regardless of what values of ch0 was passed if ch1 was true - which I think is your problem.

Bit of a newbie error - sorry for that :) I just have no way short of disassembling a servo and putting a meter on it to test. (Unless someone wants to send me a transparent servo :])

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

Post by pepep » Thu Apr 01, 2010 5:47 pm

Post by pepep
Thu Apr 01, 2010 5:47 pm

Great! Works fine!

I think I have a problem with the Firefox cache ... I need MSIE to download a new version!

Ok, thanks again, and, if you want, I gift to you a transparent servo as a contribution for your great work in Lisp, and you give to me cylon lights instructions, ok?

If you want, send me a private message with your address!

Thank you very much!
Great! Works fine!

I think I have a problem with the Firefox cache ... I need MSIE to download a new version!

Ok, thanks again, and, if you want, I gift to you a transparent servo as a contribution for your great work in Lisp, and you give to me cylon lights instructions, ok?

If you want, send me a private message with your address!

Thank you very much!
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Thu Apr 01, 2010 6:10 pm

Post by l3v3rz
Thu Apr 01, 2010 6:10 pm

Thanks a lot - good to hear its working, I'll also add the code to the Lisp library for the future.

Incidentally - what are you building in LISP ?

cheers
Thanks a lot - good to hear its working, I'll also add the code to the Lisp library for the future.

Incidentally - what are you building in LISP ?

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

Post by pepep » Thu Apr 01, 2010 6:55 pm

Post by pepep
Thu Apr 01, 2010 6:55 pm

Nothing special!

I'm newby in Robobuilder (3 weeks ago) and I don't like the visual tools for programming, like Motion Builder, Action Builder os MRDS ... I prefer a traditional language (well, Lisp is not so traditional but I like it ...), and before to make a lot of things, I want know that L# is enought for doing anything I want in the future ...

My first project is simulate natural positions, like sit, walk, ... by myself, and the leds I will use to show what servos are change in svery step ...
Nothing special!

I'm newby in Robobuilder (3 weeks ago) and I don't like the visual tools for programming, like Motion Builder, Action Builder os MRDS ... I prefer a traditional language (well, Lisp is not so traditional but I like it ...), and before to make a lot of things, I want know that L# is enought for doing anything I want in the future ...

My first project is simulate natural positions, like sit, walk, ... by myself, and the leds I will use to show what servos are change in svery step ...
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Thu Apr 01, 2010 7:11 pm

Post by l3v3rz
Thu Apr 01, 2010 7:11 pm

Nothing like a command line! - check out listen.lisp speak.lisp, maze.lisp. I particularly proud of maze.lisp as it combines motions with PSD sensor and generates a map as it goes.

In the latest version of RobobuilderLib/wckMotion theres a new feature Playfile which will load and send a CSV file of servo positions (with timings) using synchronous send. This means you can create quite smooth motion "easily" without using Motion Builder. Its basically an enhanced "smooth moves" encoded directly in C#.

Other things to mentioned in wckutils18.lisp is capture and play to record and playback motions. Another function to try is ldiff it scans the current position of servo looking for difference - you can detect loads on servos by noting minor changes in position

If you have an accelerometer check out plotaccel from utilities.lisp - its a real time displays accelerometer output in a window (all in LISP)

I have updated final.doc (
http://docs.google.com/fileview?id=0B2B ... 1&hl=en_GB ) several times in the last few months as well to hopefully improve things and add info on the speech stuff. Hopefully I'll post a video soon showing voice control of the gripper

cheers
Nothing like a command line! - check out listen.lisp speak.lisp, maze.lisp. I particularly proud of maze.lisp as it combines motions with PSD sensor and generates a map as it goes.

In the latest version of RobobuilderLib/wckMotion theres a new feature Playfile which will load and send a CSV file of servo positions (with timings) using synchronous send. This means you can create quite smooth motion "easily" without using Motion Builder. Its basically an enhanced "smooth moves" encoded directly in C#.

Other things to mentioned in wckutils18.lisp is capture and play to record and playback motions. Another function to try is ldiff it scans the current position of servo looking for difference - you can detect loads on servos by noting minor changes in position

If you have an accelerometer check out plotaccel from utilities.lisp - its a real time displays accelerometer output in a window (all in LISP)

I have updated final.doc (
http://docs.google.com/fileview?id=0B2B ... 1&hl=en_GB ) several times in the last few months as well to hopefully improve things and add info on the speech stuff. Hopefully I'll post a video soon showing voice control of the gripper

cheers
Last edited by l3v3rz on Tue Apr 06, 2010 11:46 pm, edited 2 times in total.
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Fri Apr 02, 2010 8:48 am

Post by pepep
Fri Apr 02, 2010 8:48 am

Excuse me, how can I must use PlayFile method? I try (.PlayFile "test.csv") and I get a "No such method ... on System.String" error ...

I read the wckMotion.cs and some examples in the wckutils.lisp, but I don't undertand why get this error ...

Thanks!
Excuse me, how can I must use PlayFile method? I try (.PlayFile "test.csv") and I get a "No such method ... on System.String" error ...

I read the wckMotion.cs and some examples in the wckutils.lisp, but I don't undertand why get this error ...

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

Post by l3v3rz » Fri Apr 02, 2010 12:31 pm

Post by l3v3rz
Fri Apr 02, 2010 12:31 pm

I think there are possibly two problems, the test.csv format has changed slightly and Ive been modifying the Playfile code to support variable servos. Up shot being there were bugs ! I've uploaded two new versions of

test.csv - http://robobuildervc.googlecode.com/files/test.csv

robobuilderlib (1.6) - http://robobuildervc.googlecode.com/fil ... derLib.dll

hopefully this should fix

example code:

Code: Select all
(run_robobuilder)
(dcmodeOn)
(.PlayFile wck "test.csv")


It does generate a lot of debug output (at the moment). incidentally run_robobuidler can also take an optional parameter for your COM port if you know it - and then won't prompt. i.e. (run_robobuilder "COM")

cheers.
I think there are possibly two problems, the test.csv format has changed slightly and Ive been modifying the Playfile code to support variable servos. Up shot being there were bugs ! I've uploaded two new versions of

test.csv - http://robobuildervc.googlecode.com/files/test.csv

robobuilderlib (1.6) - http://robobuildervc.googlecode.com/fil ... derLib.dll

hopefully this should fix

example code:

Code: Select all
(run_robobuilder)
(dcmodeOn)
(.PlayFile wck "test.csv")


It does generate a lot of debug output (at the moment). incidentally run_robobuidler can also take an optional parameter for your COM port if you know it - and then won't prompt. i.e. (run_robobuilder "COM")

cheers.
Last edited by l3v3rz on Sat Apr 03, 2010 8:12 pm, edited 2 times in total.
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by l3v3rz » Fri Apr 02, 2010 12:57 pm

Post by l3v3rz
Fri Apr 02, 2010 12:57 pm

I just saw this on robobuilder web site and it reminded me of your comment about not liking visual programming languages.

This is the VPL (I presume for MSRD) to enter PC control mode:

http://www.robobuilder.net/eng/board/up ... /test1.JPG
I just saw this on robobuilder web site and it reminded me of your comment about not liking visual programming languages.

This is the VPL (I presume for MSRD) to enter PC control mode:

http://www.robobuilder.net/eng/board/up ... /test1.JPG
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Fri Apr 02, 2010 4:59 pm

Post by pepep
Fri Apr 02, 2010 4:59 pm

Ufff! Is a complicated mesh of information bits ... so wide with a little real information!

By the way, is possible in L# manage exception? B.e. a movement is playing and a interrupt is generated when distance sensor is low from a value ...
Ufff! Is a complicated mesh of information bits ... so wide with a little real information!

By the way, is possible in L# manage exception? B.e. a movement is playing and a interrupt is generated when distance sensor is low from a value ...
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Fri Apr 02, 2010 6:13 pm

Post by l3v3rz
Fri Apr 02, 2010 6:13 pm

I don't think the firmware currently supports this. The best you can do is poll the sensor between move position updates (may be along with reading the accelerometer so you can tell if you've fallen over).

I may look to see if I can extend the library function PlayPose (also called by Playfile) so you can set a trigger limit which will cause it to stop playing.
I don't think the firmware currently supports this. The best you can do is poll the sensor between move position updates (may be along with reading the accelerometer so you can tell if you've fallen over).

I may look to see if I can extend the library function PlayPose (also called by Playfile) so you can set a trigger limit which will cause it to stop playing.
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Fri Apr 02, 2010 6:18 pm

Post by pepep
Fri Apr 02, 2010 6:18 pm

l3v3rz wrote:robobuilderlib (1.6) - http://robobuildervc.googlecode.com/fil ... derLib.dll

hopefully this should fix

example code:

Code: Select all
(run_robobuilder)
(dcmodeOn)
(.PlayFile wck "test.csv")




Works fine, thanks!

I (modified and) tried walk.csv and is a great job! Perfect, I think that I have the basic procedure to build anything else...
l3v3rz wrote:robobuilderlib (1.6) - http://robobuildervc.googlecode.com/fil ... derLib.dll

hopefully this should fix

example code:

Code: Select all
(run_robobuilder)
(dcmodeOn)
(.PlayFile wck "test.csv")




Works fine, thanks!

I (modified and) tried walk.csv and is a great job! Perfect, I think that I have the basic procedure to build anything else...
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

Post by l3v3rz » Fri Apr 02, 2010 8:34 pm

Post by l3v3rz
Fri Apr 02, 2010 8:34 pm

Good stuff - if you create any exciting csv files you want to share - email me and I'll up load onto the google project site.

I did wonder if its possible to generate the files with a genetic algorithm and then test each one - may be a fitness factor of how long its up right, and then bred the best and repeat etc - so you end up with a fully computer generated optimised CSV file. Now that could be fun!

cheers
Good stuff - if you create any exciting csv files you want to share - email me and I'll up load onto the google project site.

I did wonder if its possible to generate the files with a genetic algorithm and then test each one - may be a fitness factor of how long its up right, and then bred the best and repeat etc - so you end up with a fully computer generated optimised CSV file. Now that could be fun!

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

Post by l3v3rz » Tue Apr 06, 2010 11:58 am

Post by l3v3rz
Tue Apr 06, 2010 11:58 am

couple of things to mention

1. I have LSharpConsole.exe working on Mono - running on a fresh install of Ubuntu 10.4 beta 1 - but it did require (minor) changes to L# and the lisp code to get working - contact me if you want details

Code: Select all
phil@phil-desktop:~/Desktop/Debug$ mono LSharpConsole.exe MONO
L Sharp Console modified for Mono
Copyright (c) Rob Blackwell. All rights reserved.
Mods by L3v3rz.
> (load "final.lisp")
..................Robobuilder is Go! type : (run_robobuilder)
.
READY!
> (run_robobuilder)
Available Ports:
/dev/ttyS0
/dev/ttyS1
/dev/ttyS2
/dev/ttyS3
Select:
 

I've not fully tested this so I'm not sure every thing works.

2. I've added a trigger mechanism to PlayFile so that it will stop if a trigger condition is reached. So you can set range values for PSD and accelerometer.

Code: Select all
   (= trg (new "RobobuilderLib.trigger"))
   (.set_PSD   trg 30 60)
   (.set_timer trg 250)
   (.print     trg)
   (.set_trigger wck trg)
   (.activate  trg true)
 
   (.Playfile wck "walk2.csv")


So the above creates a PSD trigger to stop motion if PSD value is <30> 60. and it checks every 250ms (approx) during Playfile. Reading the PSD sensor takes about 18ms - so the motions don't appear affected

This will be in v1.7 of RobobuilderLib.dll

For more details , see

http://docs.google.com/fileview?id=0B2B ... 1&hl=en_GB
couple of things to mention

1. I have LSharpConsole.exe working on Mono - running on a fresh install of Ubuntu 10.4 beta 1 - but it did require (minor) changes to L# and the lisp code to get working - contact me if you want details

Code: Select all
phil@phil-desktop:~/Desktop/Debug$ mono LSharpConsole.exe MONO
L Sharp Console modified for Mono
Copyright (c) Rob Blackwell. All rights reserved.
Mods by L3v3rz.
> (load "final.lisp")
..................Robobuilder is Go! type : (run_robobuilder)
.
READY!
> (run_robobuilder)
Available Ports:
/dev/ttyS0
/dev/ttyS1
/dev/ttyS2
/dev/ttyS3
Select:
 

I've not fully tested this so I'm not sure every thing works.

2. I've added a trigger mechanism to PlayFile so that it will stop if a trigger condition is reached. So you can set range values for PSD and accelerometer.

Code: Select all
   (= trg (new "RobobuilderLib.trigger"))
   (.set_PSD   trg 30 60)
   (.set_timer trg 250)
   (.print     trg)
   (.set_trigger wck trg)
   (.activate  trg true)
 
   (.Playfile wck "walk2.csv")


So the above creates a PSD trigger to stop motion if PSD value is <30> 60. and it checks every 250ms (approx) during Playfile. Reading the PSD sensor takes about 18ms - so the motions don't appear affected

This will be in v1.7 of RobobuilderLib.dll

For more details , see

http://docs.google.com/fileview?id=0B2B ... 1&hl=en_GB
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by pepep » Tue Apr 06, 2010 7:37 pm

Post by pepep
Tue Apr 06, 2010 7:37 pm

Triggers: GREAT, THANKS!!!

Only one issue about PlayFile Method: perhaps will be a better idea pass the information like a list os list, not by file.
The idea is to have a program that calculate and generate movements on-line, then transfer it to .PlayFile with the triggers activates!
Is this procedure, write and read from a file is slowest than write and read from memory, don't?

What do you think?

EDIT: I see .PlayPose method. Will be a solution I explain, but is necesary change it to pass the position like a list or something else, not lika a instance variable, don't? Thanks!
Triggers: GREAT, THANKS!!!

Only one issue about PlayFile Method: perhaps will be a better idea pass the information like a list os list, not by file.
The idea is to have a program that calculate and generate movements on-line, then transfer it to .PlayFile with the triggers activates!
Is this procedure, write and read from a file is slowest than write and read from memory, don't?

What do you think?

EDIT: I see .PlayPose method. Will be a solution I explain, but is necesary change it to pass the position like a list or something else, not lika a instance variable, don't? Thanks!
pepep
Savvy Roboteer
Savvy Roboteer
Posts: 38
Joined: Sun Mar 28, 2010 7:14 pm

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