IR Code formats? Which to use?

Interested in integrating USB-UIRT support into an application? Look here!

Moderator: jrhees

May take a few days

Postby Iguanaman » Sat Mar 26, 2005 1:48 am

I won't be able to try it until the USB-UIRT device arrives. Hopefully within a few days although USPS seems a bit slow where I live.
Iguanaman
 

Postby Guest » Sun Mar 27, 2005 2:57 am

jrhees wrote:Here, give this a try (copy one of your working commands in Girder and replace the Code1 with this:

Karate Chop (D6):
R08008104808221808221212180822121218082218082212121

Let me know if this works.

-Jon


Works Great!!! :D

(At least in VB6, so I assume it would work the same in Girder)

Thanks Jon. It looks like you've figured it out. I'll look forward to hearing what the conversion is.
Guest
 

Postby lafugitt » Sun Mar 27, 2005 3:02 am

anonymous wrote:
jrhees wrote:Here, give this a try (copy one of your working commands in Girder and replace the Code1 with this:
Karate Chop (D6):
R08008104808221808221212180822121218082218082212121
Let me know if this works.
-Jon

Works Great!!! :D
(At least in VB6, so I assume it would work the same in Girder)
Thanks Jon. It looks like you've figured it out. I'll look forward to hearing what the conversion is.


Sorry. I forgot I wasn't logged in on this machine. Anyway, Jon's Karate Chop code works fine when tested with my VB6 Robosapien controller software.
"Androids don't dream of electric sheep, they eat them!"
http://www.robots-dreams.com
lafugitt
 
Posts: 10
Joined: Mon Jan 17, 2005 11:51 pm

Postby jrhees » Mon Mar 28, 2005 2:09 pm

Here's the conversion process (its very manual, but will work):

1. Take the HEX code and write it out in Binary, with most-significant bit listed first. For example, $D6 would be written as:
msb lsb
1 1 0 1 0 1 1 0

2. Start with the following header to the code:

R08008104

3. For each bit, add these codes to the end of your code in progress:

for a 0 bit: 2121
for a 1 bit: 808221

-Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm

IR Codes

Postby Iguanaman » Tue Mar 29, 2005 12:53 am

Well I got the USB-UIRT and my program doesn't work! :(

This is the transmission section (written in vb.net) The code that connects to the device seems to work and indicates that it is connected. When I call this routine the intReturn value is true and the light on the front of the USB-UIRT flashes a bit. Is there something obviously wrong that anyone can see? John, you mentioned earlier that I wasn't including the frequency. Where is that set?



Public Sub RSSendCommand(ByVal IRCode As String)
'IRCode = "R08008104808221212180822121218082218082218082212121"
Dim intReturn As Boolean = False
If blnConnected Then
intReturn = UUIRTTransmitIR(hDrvHandle, IRCode, gIRCodeFormat, 0, 1000, hIrDoneEvent, 0, 0)
Else
MsgBox("No connection was found!")
End If

End Sub
Iguanaman
 

Postby Guest » Tue Mar 29, 2005 1:29 am

Yay! I finally figured it out. The line needed to look like this:

intReturn = UUIRTTransmitIR(hDrvHandle, IRCode.ToCharArray, gIRCodeFormat, 1, 0, 0, 0, 0)


It was the IRCode.ToCharArray that did the trick.
Guest
 

Postby lafugitt » Tue Mar 29, 2005 1:54 am

jrhees wrote:Here's the conversion process (its very manual, but will work):


Fantastic!!!

Thanks Jon! That's great.
I just hacked together an Excel spreadsheet with a table of the codes using HEX2BIN() and MID() to do the conversion. I want to test all the codes from 80 through FF with my Robosapien tonight, and put the corresponding movement names into the table, then I'll post a link to it here.
"Androids don't dream of electric sheep, they eat them!"
http://www.robots-dreams.com
lafugitt
 
Posts: 10
Joined: Mon Jan 17, 2005 11:51 pm

Postby lafugitt » Tue Mar 29, 2005 2:24 am

lafugitt wrote:I just hacked together an Excel spreadsheet with a table of the codes using HEX2BIN() and MID() to do the conversion. I want to test all the codes from 80 through FF with my Robosapien tonight, and put the corresponding movement names into the table, then I'll post a link to it here.


Jon,

I won't be able to run the test until I get home this evening (it's 11:15 am here right now), but just glancing through the original codes that were captured using the USBUIRT and Girder, I noticed that some of them don't match your conversion format.

For example, the original Girder code for 'walk forward' is R239B80F980842121212221212121218086208086202121

That doesn't mean that your format won't work and generate the same response from the Robosapien, just that the raw code stream is different. I'll find out this evening.

I've also noticed that sometimes Girder and the USBUIRT will report different raw codes for the same key press on a remote control. I'm assuming that this comes from syncronization/timing differences.
"Androids don't dream of electric sheep, they eat them!"
http://www.robots-dreams.com
lafugitt
 
Posts: 10
Joined: Mon Jan 17, 2005 11:51 pm

IR Codes

Postby Iguanaman » Tue Mar 29, 2005 2:40 am

I wrote a program to convert the hex codes to "R" codes and so far they are working perfectly. I have released my Robosapien controller software. I included several "user definable" buttons so if there are new commands found they can be added in. Here is a screen shot of the program:

Image

The user defined buttons also allow the hex entry and it converts the value for the user.

Here is a link to the software itself. It requires the dotnet framework to be installed on your PC.

http://showcase.netins.net/web/patrickd/RobosapienControllerInstall.zip[/url]
Iguanaman
 

Postby lafugitt » Tue Mar 29, 2005 12:05 pm

lafugitt wrote:I just hacked together an Excel spreadsheet with a table of the codes using HEX2BIN() and MID() to do the conversion. I want to test all the codes from 80 through FF with my Robosapien tonight, and put the corresponding movement names into the table, then I'll post a link to it here.


Just a quick update. I haven't been able to test all the codes yet because of time constraints this evening, but I have run through about 20 of them. Jon's code conversion seems to work perfectly. :D

I've also been pleasantly surprised at how snappy the response is. It appears that the codes are recognized faster than the original codes that were captured with Girder. 8)

Thanks again Jon. This is great!
"Androids don't dream of electric sheep, they eat them!"
http://www.robots-dreams.com
lafugitt
 
Posts: 10
Joined: Mon Jan 17, 2005 11:51 pm

Postby jrhees » Thu Mar 31, 2005 6:16 am

One other note about these codes:

You may want to experiment with a repeatCount greater than one in your transmitIR call. I do not have access to a RoboSapien remote, so it is unclear to me whether the none/some/all buttons on the remote send out a repeating IR stream when held down or simply send a single burst.

*IF* some/all of the keys send out a repetitive stream, you can simulate this by increasing the repeatCount. *HOWEVER*, in trying this, the inter-code delay value (the 'gap' between each burst) that I have coded into the code conversion discussed earlier is fixed at 0800 hex. So, if you want to experiment with repeatCounts higher than one you may also want to try shortening the 0800 time (which is rather long) to see if you can create fluid movements.

-Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm

Postby jrhees » Thu Mar 31, 2005 6:16 am

One other note about these codes:

You may want to experiment with a repeatCount greater than one in your transmitIR call. I do not have access to a RoboSapien remote, so it is unclear to me whether the none/some/all buttons on the remote send out a repeating IR stream when held down or simply send a single burst.

*IF* some/all of the keys send out a repetitive stream, you can simulate this by increasing the repeatCount. *HOWEVER*, in trying this, the inter-code delay value (the 'gap' between each burst) that I have coded into the code conversion discussed earlier is fixed at 0800 hex. So, if you want to experiment with repeatCounts higher than one you may also want to try shortening the 0800 time (which is rather long) to see if you can create fluid movements.

-Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm

Length of moves

Postby NextOne » Tue Jun 28, 2005 7:30 am

Hi !

I made a java program with USB-UIRTJ
to conrol Robosapiens and it's working great !

Does any body know where to find the duration of each moves / action ?
Because I need to wait before sending new move.

Regards
NextOne
 

Previous

Return to Developers

Who is online

Users browsing this forum: No registered users and 18 guests

cron