Something similar in just basic checking for a modem:
'set the loopback variable 1=set
loopback=0
' now find all active ports
dim port$(20)
for portNo = 1 to 20
oncomerror [trap]
found=0
open "Com";str$(portNo);":9600,n,8,1,ds0,cs0,rs" for random as #com
found=1
[trap]
if found=0 then
if ComError$<>"The device identifier is invalid or unsupported" then
print "port ";str$(portNo);" is available"
print ComError$
end if
else
print "port ";str$(portNo);" is available"
print
port$(portNo)="Com"+str$(portNo)
close #com
end if
oncomerror
next portNo
print
'cycle through active ports and send a message
'if loopback is set or sent ATZ to query the modem
found=0
for portNo = 1 to 20
if port$(portNo)<>"" then
print "Checking port ";portNo
open port$(portNo);":9600,n,8,1,ds0,cs0,rs" for random as #com
if loopback=1 then
print #com, "Test"
delay = time$("ms") + 50
while time$("ms") < delay
wend
t$=input$(#com, lof(#com))
if t$="Test" then
Print "Com port found on ";port$(portNo)
else
Print "Com port not active"
end if
else
print #com, "ATZ"
delay = time$("ms") + 1000
while time$("ms") < delay
wend
t$=input$(#com, lof(#com))
if instr(t$,"OK")>1 then
Print "Modem found on ";port$(portNo)
else
Print "Modem not active"
end if
end if
close #com
end if
next
print ""
print "modem check complete"
Now you’ve got me thinking. If I added two more command line parameters:
“send to device command” and “device acknowledgment” then the program could send a user defined command and look for a user defined result, essentially it could then search for any robot or other device on the comm port.
Big news! I have officially begun version 2.0 of HexControl. Screen shots will be up soon. I have included a list of features that I intend to implement. V2.0 will launch with at least 1-3 standard. The others will come later. Tell me what you think?
V2.0 will include the following:
Hexapod config files (no more editing variables in the code, you can load preconfigured robots, edit them, and save them all from the program
Improved COM management (thans to BR459)
An all-new interface design (onscreen controls and head support still included)
Support for gamepad control and possibly joystick control
OpenCV facetracking support! and video capture.
Many of the improvements from Xan’s IK code since his 1.2 release. Including balance calcs
Support for hexapods and quads!
Support for completely custom robots with unique leg dimension and positioning. (All legs will not have to be the same size, or in the same locations. It will all be customizable)
Hexapod config files (no more editing variables in the code, you can load preconfigured robots, edit them, and save them all from the program - Yes!
Improved COM management (thans to BR459) - Yes!
An all-new interface design (onscreen controls and head support still included) - Yes!
Support for gamepad control and possibly joystick control - Not yet
OpenCV facetracking support! and video capture. - Not yet
Many of the improvements from Xan’s IK code since his 1.2 release. Including balance calcs - 50%
Support for hexapods and quads! - Only hexapods…for now
Support for completely custom robots with unique leg dimension and positioning. (All legs will not have to be the same size, or in the same locations. It will all be customizable) - Yes!
So in summary, the beta is very stripped down, only has remote control functionaltiy right now, but it has a bunch of the other improvements like:
A seperate configurable comm port manager.
Robot characteristic files and robot editor. No more changing values in the code! Just load a robot file or build your own with the robot editor. I will be releasing pre-built robot files for the Phoenix and the MSR-01 but you might want to modifiy them if your setup is different from the standard.
All the menu functionality necessary to implement joystick control and and openCv is complete…now I jsut have to finish it!
Also includes basic balance calcs (but they are currently disabled because I don’t like them. To turn them on go to the hexengine module, mainrobotIK function and change the balancecalcs line from false to true) I will make this a button…soon.
Anyways, check it out!! Let me know what you think? Mess around with it. Load robot files. Build your own. Play with the Comm manager. Feedback is welcome…**
Hey flowbotx, you think about adding individual leg control to the mix?
Ive been trying to get my RC phoenix to try and take its front or rear 2 legs… to try and move them towards each other and pick something up while the rear 4 legs are locked in position but am having a challenging time getting them to cooperate with me.
I think individual leg control is a little out of my reach right now but the individual leg characteristics that are stored in the new robot config files are a step in that direction…
Hey if you do get a config file set up for the CH3, send me a copy so I can include it in the download.
No, but all the structural framework is in place. It will use the same exact kinematics engine and the quad balance is already implemented. I just have to put 2 and 2 together which I will do…as soon as I have some free time. You know how that goes.