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

wck move

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
4 postsPage 1 of 1
4 postsPage 1 of 1

wck move

Post by chickenkai » Wed Oct 17, 2012 8:35 am

Post by chickenkai
Wed Oct 17, 2012 8:35 am

Hi,

I use C# to control my robobuilder, and I use RobobuilderLib.dll

Now I can let my robot stand, but it's action seens not as smoothly as the

installed motions.

How can I solve this problem?

Use the function delay_ms()? or others?

thanks!
Hi,

I use C# to control my robobuilder, and I use RobobuilderLib.dll

Now I can let my robot stand, but it's action seens not as smoothly as the

installed motions.

How can I solve this problem?

Use the function delay_ms()? or others?

thanks!
chickenkai
Savvy Roboteer
Savvy Roboteer
Posts: 30
Joined: Thu Jul 26, 2012 10:09 am

Post by l3v3rz » Wed Oct 17, 2012 9:13 am

Post by l3v3rz
Wed Oct 17, 2012 9:13 am

Its possible to achieve smooth motion with the lib. When moving between two points you need to calculate the "inbetween positions" ot tweens to get that smooth motion. So rather than a servo going from position 20 -> 40 you need it to go to 20 -> 25 -> 30 ->35 -> 40. There is a command "PlayPose" in wckMotion class that will do that for you. i.e. wckMotion.PlayPose(duration, no_steps, position_array, true); The parameters are as follows:

duration = time to take in ms i.e 1000.
no_steps = number of tweens i.e. 10 (this would make each step 100ms long (min is 25ms)
position_array = byte[] with servo positions i.e. 16 for normal robuilder
true/false = determines whether it need to read the current position of the servos first. In a sequence of moves use true for the first use and the false afterwards for speed as it remembers the last command psoition

So to take up basic pose would be as follows (roughly)

Code: Select all
PCremote p = new PCremote("com1");
wckMotion w = new wckMotion(p);

w.PlayPose(3000, 10, new byte[] {125, 179, 199, 88, 108, 126, 72, 49, 163, 141, 51, 47, 49, 199, 205, 205 }, true);


Playpose also has variations Playfile (play moves from a csv file) and PlayMatrix that takes a matrix of moves. So you can store built in moves in a csv file and play them like stock motions - I do this in my android app.

Also the interpolation by default is linear or equal steps, but there is a variation where you can pass a type in that switches modes and allows for different types (Accel, De Accel or Accel then Deaccel). This is based on code published by RN1A on this very forum.

I wish more poeple would share code .. ultimately its the code that makes robot
Its possible to achieve smooth motion with the lib. When moving between two points you need to calculate the "inbetween positions" ot tweens to get that smooth motion. So rather than a servo going from position 20 -> 40 you need it to go to 20 -> 25 -> 30 ->35 -> 40. There is a command "PlayPose" in wckMotion class that will do that for you. i.e. wckMotion.PlayPose(duration, no_steps, position_array, true); The parameters are as follows:

duration = time to take in ms i.e 1000.
no_steps = number of tweens i.e. 10 (this would make each step 100ms long (min is 25ms)
position_array = byte[] with servo positions i.e. 16 for normal robuilder
true/false = determines whether it need to read the current position of the servos first. In a sequence of moves use true for the first use and the false afterwards for speed as it remembers the last command psoition

So to take up basic pose would be as follows (roughly)

Code: Select all
PCremote p = new PCremote("com1");
wckMotion w = new wckMotion(p);

w.PlayPose(3000, 10, new byte[] {125, 179, 199, 88, 108, 126, 72, 49, 163, 141, 51, 47, 49, 199, 205, 205 }, true);


Playpose also has variations Playfile (play moves from a csv file) and PlayMatrix that takes a matrix of moves. So you can store built in moves in a csv file and play them like stock motions - I do this in my android app.

Also the interpolation by default is linear or equal steps, but there is a variation where you can pass a type in that switches modes and allows for different types (Accel, De Accel or Accel then Deaccel). This is based on code published by RN1A on this very forum.

I wish more poeple would share code .. ultimately its the code that makes robot
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by chickenkai » Wed Oct 17, 2012 2:30 pm

Post by chickenkai
Wed Oct 17, 2012 2:30 pm

thanks a lot!

Now I know how to do!
thanks a lot!

Now I know how to do!
chickenkai
Savvy Roboteer
Savvy Roboteer
Posts: 30
Joined: Thu Jul 26, 2012 10:09 am

Post by l3v3rz » Wed Oct 17, 2012 3:23 pm

Post by l3v3rz
Wed Oct 17, 2012 3:23 pm

Great - btw there is a wiki page as well

http://code.google.com/p/robobuildervc/wiki/CSharp
Great - btw there is a wiki page as well

http://code.google.com/p/robobuildervc/wiki/CSharp
l3v3rz
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm


4 postsPage 1 of 1
4 postsPage 1 of 1