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

need help on continuous walk

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

need help on continuous walk

Post by fuzzyoboe » Mon May 07, 2007 12:48 am

Post by fuzzyoboe
Mon May 07, 2007 12:48 am

I am new to this forum, just got my RN-1 for couple of weeks. Yester day I posted a question but I did not see it on the forum. May be I submitted it wrong. Anyway, here is my question. I like to make RN-1 walk continuously when I press k11, and make it stop when I press any other key. Here is the code I got from the archive. At the end I add an IF code.
This did not work as I like. I need to press the key 11 at the right time to make RN-1 keep walking.
Help

forward_walk:

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

fwd_walk_main:

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,
'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,

SPEED 14
'right up

MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
A = REMOCON(1)

IF A = 11 THEN
GOTO fwd_walk_main
IF A <> 11 THEN
RETURN
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I am new to this forum, just got my RN-1 for couple of weeks. Yester day I posted a question but I did not see it on the forum. May be I submitted it wrong. Anyway, here is my question. I like to make RN-1 walk continuously when I press k11, and make it stop when I press any other key. Here is the code I got from the archive. At the end I add an IF code.
This did not work as I like. I need to press the key 11 at the right time to make RN-1 keep walking.
Help

forward_walk:

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

fwd_walk_main:

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,
'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,

SPEED 14
'right up

MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
A = REMOCON(1)

IF A = 11 THEN
GOTO fwd_walk_main
IF A <> 11 THEN
RETURN
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
fuzzyoboe
Robot Builder
Robot Builder
Posts: 16
Joined: Sun May 06, 2007 2:14 am

Post by Pev » Mon May 07, 2007 8:58 am

Post by Pev
Mon May 07, 2007 8:58 am

Hi,

The issue you have is that the IR remote is not a buffered input device, thus while RN-1 is walking it is not checking or storing the IR remote input and only reads it at the end or at the 'right time' as you put it.

Bluetooth obviously overcomes this as it is a buffered input device (well the BlueSmirf is) and thus holds the command sent until it is read by the code. I guess you could check the remote repeatedly during the walking cycle and see how that works. It would be something like :

forward_walk:

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

fwd_walk_main:

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,

SPEED 14
'right up

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
A = REMOCON(1)

IF A = 11 THEN
GOTO fwd_walk_main
IF A <> 11 THEN
RETURN
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Don't forget to dimension RV at the top of your template :

DIM RV AS BYTE

This may work as it will increase the number of reads during the routine but may effect performance as it processes the reads. You could potentially improve performance by changing:

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

to

A=REMOCON(1)

The reason I have performed the longer routine above is that is protects the value of A if the 11 key isn't pressed (i.e walk forward) but this is probably overkill but is where I would start.

Hope this helps

Pev
Hi,

The issue you have is that the IR remote is not a buffered input device, thus while RN-1 is walking it is not checking or storing the IR remote input and only reads it at the end or at the 'right time' as you put it.

Bluetooth obviously overcomes this as it is a buffered input device (well the BlueSmirf is) and thus holds the command sent until it is read by the code. I guess you could check the remote repeatedly during the walking cycle and see how that works. It would be something like :

forward_walk:

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

fwd_walk_main:

SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,

SPEED 14
'right up

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
A = REMOCON(1)

IF A = 11 THEN
GOTO fwd_walk_main
IF A <> 11 THEN
RETURN
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Don't forget to dimension RV at the top of your template :

DIM RV AS BYTE

This may work as it will increase the number of reads during the routine but may effect performance as it processes the reads. You could potentially improve performance by changing:

'Check Remote
RV = 0
RV = REMOCON(1)
IF RV =11 then
A=11
END IF

to

A=REMOCON(1)

The reason I have performed the longer routine above is that is protects the value of A if the 11 key isn't pressed (i.e walk forward) but this is probably overkill but is where I would start.

Hope this helps

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

contiuuous walking

Post by fuzzyoboe » Mon May 07, 2007 7:12 pm

Post by fuzzyoboe
Mon May 07, 2007 7:12 pm

Thanks a lot, Pev.
I will try the code tonight, I think that is the only way to make the RN-1 walk continuously. Now I understand the problem is the IR control. If I change the controller to a RC radio control, can it work as I liked ? eg. I keep pressing the stick, then the RN keep walking, I release it, then RN stop. Or I press the stick once, the RN walk continuously until I press the stick again, then it stops.
Thanks a lot, Pev.
I will try the code tonight, I think that is the only way to make the RN-1 walk continuously. Now I understand the problem is the IR control. If I change the controller to a RC radio control, can it work as I liked ? eg. I keep pressing the stick, then the RN keep walking, I release it, then RN stop. Or I press the stick once, the RN walk continuously until I press the stick again, then it stops.
fuzzyoboe
Robot Builder
Robot Builder
Posts: 16
Joined: Sun May 06, 2007 2:14 am

Post by Pev » Mon May 07, 2007 7:24 pm

Post by Pev
Mon May 07, 2007 7:24 pm

I did a little with RC and yes I had it so that the RN-1 walked while the stick was pressed forward then stopped when it was released. THis is a little easier as the value sent is sent as a continuous stream and thus much easier to read using the approach you have taken in your first post (the code particularly).

Pev
I did a little with RC and yes I had it so that the RN-1 walked while the stick was pressed forward then stopped when it was released. THis is a little easier as the value sent is sent as a continuous stream and thus much easier to read using the approach you have taken in your first post (the code particularly).

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by fuzzyoboe » Tue May 08, 2007 5:12 am

Post by fuzzyoboe
Tue May 08, 2007 5:12 am

I tried the code, it did not work. Checking the remote frequently slow down the walking movement a lot, the RN fell down after few steps. This happened even I tried without using IF statement.
I tried the code, it did not work. Checking the remote frequently slow down the walking movement a lot, the RN fell down after few steps. This happened even I tried without using IF statement.
fuzzyoboe
Robot Builder
Robot Builder
Posts: 16
Joined: Sun May 06, 2007 2:14 am

Post by Humanoido » Tue May 08, 2007 5:18 am

Post by Humanoido
Tue May 08, 2007 5:18 am

Did you install the battery voltage circuit and modify the software accordingly? There's a section about it at the end of the manual. In some RNs, the controller IR signals cannot easily get through when the blue LED is flashing. There are several robosavvy threads on that topic.

humanoido
Did you install the battery voltage circuit and modify the software accordingly? There's a section about it at the end of the manual. In some RNs, the controller IR signals cannot easily get through when the blue LED is flashing. There are several robosavvy threads on that topic.

humanoido
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 » Tue May 08, 2007 5:27 am

Post by DirtyRoboto
Tue May 08, 2007 5:27 am

Adding Remcon calls with the bot in neg/pos balance is not good. ie. if the bot has a foot off the floor and is not at a balance point. It you put 2 checks, one after the left step and one after the right step, this should be alot smoother.
Adding Remcon calls with the bot in neg/pos balance is not good. ie. if the bot has a foot off the floor and is not at a balance point. It you put 2 checks, one after the left step and one after the right step, this should be alot smoother.
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 Pev » Tue May 08, 2007 7:02 am

Post by Pev
Tue May 08, 2007 7:02 am

DirtyRoboto wrote:Adding Remcon calls with the bot in neg/pos balance is not good. ie. if the bot has a foot off the floor and is not at a balance point. It you put 2 checks, one after the left step and one after the right step, this should be alot smoother.


Dirty is completely right, the very slow processing speed of RoboBasic means that a read of the remote will make the RN-1 pause and if in an unstable pose that will have dire consequences. Most people have moved away from the IR remote, there are many reasons why but these are the types of issues people are seeing.

Pev
DirtyRoboto wrote:Adding Remcon calls with the bot in neg/pos balance is not good. ie. if the bot has a foot off the floor and is not at a balance point. It you put 2 checks, one after the left step and one after the right step, this should be alot smoother.


Dirty is completely right, the very slow processing speed of RoboBasic means that a read of the remote will make the RN-1 pause and if in an unstable pose that will have dire consequences. Most people have moved away from the IR remote, there are many reasons why but these are the types of issues people are seeing.

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by fuzzyoboe » Tue May 08, 2007 3:39 pm

Post by fuzzyoboe
Tue May 08, 2007 3:39 pm

Thanks everybody. I tried Dirty's suggestion, and it works. But I think only one check of remocon like my original code is ok, I just need to have a good timing to press the remote.
Since this limitation of IR, I am thinking switch to RC, what is a good RC for RN ? I need a 4 channel one right ? Also need to have as small a receiver as possible ? Any recommendations ? Where should I put my receiver ? As I purchased a ready to walk RN, I do not know too much about the construction of RN.
Thanks everybody. I tried Dirty's suggestion, and it works. But I think only one check of remocon like my original code is ok, I just need to have a good timing to press the remote.
Since this limitation of IR, I am thinking switch to RC, what is a good RC for RN ? I need a 4 channel one right ? Also need to have as small a receiver as possible ? Any recommendations ? Where should I put my receiver ? As I purchased a ready to walk RN, I do not know too much about the construction of RN.
fuzzyoboe
Robot Builder
Robot Builder
Posts: 16
Joined: Sun May 06, 2007 2:14 am

Post by Pev » Tue May 08, 2007 3:46 pm

Post by Pev
Tue May 08, 2007 3:46 pm

Hi,

This thread shows the RC receiver I used. Also covers some code but I have some other code I can share if you want to PM me when you are ready

http://robosavvy.com/forum/viewtopic.php?t=219

Pev
Hi,

This thread shows the RC receiver I used. Also covers some code but I have some other code I can share if you want to PM me when you are ready

http://robosavvy.com/forum/viewtopic.php?t=219

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by fuzzyoboe » Tue May 08, 2007 4:46 pm

Post by fuzzyoboe
Tue May 08, 2007 4:46 pm

Thanks, Pev. I will check the link and let you know.
Thanks, Pev. I will check the link and let you know.
fuzzyoboe
Robot Builder
Robot Builder
Posts: 16
Joined: Sun May 06, 2007 2:14 am

Post by DirtyRoboto » Tue May 08, 2007 5:01 pm

Post by DirtyRoboto
Tue May 08, 2007 5:01 pm

The other method that I used too use was to input the number of loops with the remcon and then select the pose routine to execute "loop" amount of times.
With this method you could say "foward 3 steps" then "left 5 steps", "rotate right 3 steps", "cartwheel left 2 times".

Marcus.
The other method that I used too use was to input the number of loops with the remcon and then select the pose routine to execute "loop" amount of times.
With this method you could say "foward 3 steps" then "left 5 steps", "rotate right 3 steps", "cartwheel left 2 times".

Marcus.
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 fuzzyoboe » Tue May 08, 2007 6:45 pm

Post by fuzzyoboe
Tue May 08, 2007 6:45 pm

Thanks, Dirtyroboto. But this is kind of batch processing. I like to do some continuously control in real time like you control an RC airplane.
Thanks, Dirtyroboto. But this is kind of batch processing. I like to do some continuously control in real time like you control an RC airplane.
fuzzyoboe
Robot Builder
Robot Builder
Posts: 16
Joined: Sun May 06, 2007 2:14 am

Post by DirtyRoboto » Tue May 08, 2007 9:07 pm

Post by DirtyRoboto
Tue May 08, 2007 9:07 pm

Ahh! A game player and not a game maker!!!!
Ahh! A game player and not a game maker!!!!
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 fuzzyoboe » Wed May 09, 2007 1:34 am

Post by fuzzyoboe
Wed May 09, 2007 1:34 am

Hi' dirty roboto, you are exactly right. Since I just got my RN recently, I have a lot to lean how to produce motion sequences. I downloaded a lots of routines and played all of them, had lots of fun thank to you guys.
My next thing is to learn how to make it conducting music. Since I am in a chamber music group, when we practice, we always us a metronome, if I can have RN to do the conducting, it will be lots of fun.
Hi' dirty roboto, you are exactly right. Since I just got my RN recently, I have a lot to lean how to produce motion sequences. I downloaded a lots of routines and played all of them, had lots of fun thank to you guys.
My next thing is to learn how to make it conducting music. Since I am in a chamber music group, when we practice, we always us a metronome, if I can have RN to do the conducting, it will be lots of fun.
fuzzyoboe
Robot Builder
Robot Builder
Posts: 16
Joined: Sun May 06, 2007 2:14 am


15 postsPage 1 of 1
15 postsPage 1 of 1