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

Free Code For Beginners

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
4 postsPage 1 of 1
4 postsPage 1 of 1

Free Code For Beginners

Post by Humanoido » Wed May 02, 2007 9:14 am

Post by Humanoido
Wed May 02, 2007 9:14 am

Ever wonder, "What is the minimal program to accomplish one move?"

Are you just starting out with your Robonova and want to keep the programming simple?

Is it too much to sort through a large template file just to make and test one simple move?

How do you know what's essential and what's not?

Dreaming for a quick start tutorial?

Consider this the answers to those questions, a mini tutorial and a free move. It will run exactly as shown with the given code, or add it to the main template.

The movie shows "minimal" code for one move - a new stance - and some sound beeps. Program comments are provided for greater understanding.

Enjoy - this is my first movie and a big thank you to everyone on the robosavvy forum that helped along the way.

humanoido

phpBB [media]


http://www.youtube.com/watch?v=WI_0Bc4DeJw
Ever wonder, "What is the minimal program to accomplish one move?"

Are you just starting out with your Robonova and want to keep the programming simple?

Is it too much to sort through a large template file just to make and test one simple move?

How do you know what's essential and what's not?

Dreaming for a quick start tutorial?

Consider this the answers to those questions, a mini tutorial and a free move. It will run exactly as shown with the given code, or add it to the main template.

The movie shows "minimal" code for one move - a new stance - and some sound beeps. Program comments are provided for greater understanding.

Enjoy - this is my first movie and a big thank you to everyone on the robosavvy forum that helped along the way.

humanoido

phpBB [media]


http://www.youtube.com/watch?v=WI_0Bc4DeJw
Humanoido
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 574
Joined: Tue Dec 05, 2006 1:00 am
Location: Deep in the Heart of Asia

Post by DirtyRoboto » Wed May 02, 2007 5:46 pm

Post by DirtyRoboto
Wed May 02, 2007 5:46 pm

My Bru' It looks like you didn't post the code!!!
My Bru' It looks like you didn't post the code!!!
In servo's we trust!
DirtyRoboto
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 412
Joined: Tue Sep 19, 2006 1:00 am
Location: London

Post by Humanoido » Thu May 03, 2007 1:59 am

Post by Humanoido
Thu May 03, 2007 1:59 am

In the original movie, the code is clear and easy to read. After being compressed and spun through YouTube it changed. So here's the original code with comments. There's only 26 program statements. Without the beeps, that could be cut to 24. There are ways to simplify it more, but then it loses clarity for beginners.
humanoido

'================================================
'NEW POSE TEMPLATE
'EXAMPLE PROGRAM BY HUMANOIDO 04.27.07
'================================================
DIM NEW_POSE AS BYTE
'================================================
DIR G6A,1,0,0,1,0,0 'SET MOTOR DIRECTIONS
DIR G6B,1,1,1,1,1,1 '0-COUNTERCLOCKWISE
DIR G6C,0,0,0,0,0,0 '1-CLOCKWISE
DIR G6D,0,1,1,0,1,0 'P86-7 ROBOBASIC MANUAL
'================================================
PTP SETON 'POINT TO POINT CONTROL FOR SMOOTH MOTION
PTP ALLON 'P88-90
'================================================
GETMOTORSET G6A,1,1,1,1,1,0 'MR-C3024 TO MOVE SERVOS TO ZERO
GETMOTORSET G6B,1,1,1,0,0,0 'DEGREES (0) POSITION OR MAINTAIN
GETMOTORSET G6C,1,1,1,0,0,0 'PRESET POSITION (1). AVOIDS SERVO
GETMOTORSET G6D,1,1,1,1,1,0 'DAMAGE, P105
SPEED 5 'SET MOTOR SPEED, P84
MOTOR G24 'POWER ON ALL MOTORS
'================================================
MAIN: 'MAIN PROGRAM
DELAY 500 'WAIT 1/2 SEC & START PROGRAM
GOSUB new_pose 'DO THE NEW STANCE
END 'END OF PROGRAM
'================================================
new_pose: 'NEW STANCE ROUTINE
TEMPO 230 'ADD SOME MUSICAL
MUSIC "CDEFG" 'BEEPS HERE
MOVE G6A,101, 75, 143, 94, 99, 100 ' MOVE SERVOS CODE
MOVE G6B,102, 63, 18, 100, 100, 100 ' ESTABLISHED FROM
MOVE G6C,100, 65, 18, 100, 100, 100 ' MOTION CAPTURE
MOVE G6D,102, 74, 141, 94, 98, 100 ' AND PASTE HERE
WAIT 'WAIT FOR FINISH
RETURN 'GO BACK TO MAIN PROGRAM
'================================================
In the original movie, the code is clear and easy to read. After being compressed and spun through YouTube it changed. So here's the original code with comments. There's only 26 program statements. Without the beeps, that could be cut to 24. There are ways to simplify it more, but then it loses clarity for beginners.
humanoido

'================================================
'NEW POSE TEMPLATE
'EXAMPLE PROGRAM BY HUMANOIDO 04.27.07
'================================================
DIM NEW_POSE AS BYTE
'================================================
DIR G6A,1,0,0,1,0,0 'SET MOTOR DIRECTIONS
DIR G6B,1,1,1,1,1,1 '0-COUNTERCLOCKWISE
DIR G6C,0,0,0,0,0,0 '1-CLOCKWISE
DIR G6D,0,1,1,0,1,0 'P86-7 ROBOBASIC MANUAL
'================================================
PTP SETON 'POINT TO POINT CONTROL FOR SMOOTH MOTION
PTP ALLON 'P88-90
'================================================
GETMOTORSET G6A,1,1,1,1,1,0 'MR-C3024 TO MOVE SERVOS TO ZERO
GETMOTORSET G6B,1,1,1,0,0,0 'DEGREES (0) POSITION OR MAINTAIN
GETMOTORSET G6C,1,1,1,0,0,0 'PRESET POSITION (1). AVOIDS SERVO
GETMOTORSET G6D,1,1,1,1,1,0 'DAMAGE, P105
SPEED 5 'SET MOTOR SPEED, P84
MOTOR G24 'POWER ON ALL MOTORS
'================================================
MAIN: 'MAIN PROGRAM
DELAY 500 'WAIT 1/2 SEC & START PROGRAM
GOSUB new_pose 'DO THE NEW STANCE
END 'END OF PROGRAM
'================================================
new_pose: 'NEW STANCE ROUTINE
TEMPO 230 'ADD SOME MUSICAL
MUSIC "CDEFG" 'BEEPS HERE
MOVE G6A,101, 75, 143, 94, 99, 100 ' MOVE SERVOS CODE
MOVE G6B,102, 63, 18, 100, 100, 100 ' ESTABLISHED FROM
MOVE G6C,100, 65, 18, 100, 100, 100 ' MOTION CAPTURE
MOVE G6D,102, 74, 141, 94, 98, 100 ' AND PASTE HERE
WAIT 'WAIT FOR FINISH
RETURN 'GO BACK TO MAIN PROGRAM
'================================================
Humanoido
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 574
Joined: Tue Dec 05, 2006 1:00 am
Location: Deep in the Heart of Asia

new pose

Post by engineer » Fri May 04, 2007 4:28 am

Post by engineer
Fri May 04, 2007 4:28 am

YEAHHH!!!!!!!!! 8) way to go humanoido, love the credits, and thanks for sharing the movie, it looks good for a first attaboy engineer
YEAHHH!!!!!!!!! 8) way to go humanoido, love the credits, and thanks for sharing the movie, it looks good for a first attaboy engineer
engineer
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 129
Joined: Wed Aug 09, 2006 1:00 am
Location: northern california


4 postsPage 1 of 1
4 postsPage 1 of 1