I’m glad you’ve got it to work! I’m using P12-14 for the PS2 remote and rewired the buttons to P4-P6. I forgot to replace it to the original pins. But I’m glad you got it to work anyway! 8)
If you check the constants you will see that true = 1 so it doesn’t matter if you put hexon to 1 or to True.
i think u are a asian Xan. the name sounds like asian.
do you know IC bot? i want build another one like that. traking faces and messuring distance… when someone there he goes backward. like the movie: youtube.com/watch?v=4oXuSXCKJeY
its so cool!
i have a wireless cam, roborealM., a serial wireless conection.
a hexapod… distance messuring
;----------------------------------------------------------------------
;PIRhigh then Hex on
PIRhigh
if pir <> prev_pir then
; The input changed
if pir = 1 then
; The input went high
piron = 1
TimerCount = 0
fTimerActive = 0
else
fTimerActive = 1
; The input went low again
endelse
endif
elseif fTimerActive = 1
TimerCount = TimerCount + 1
pause 10
; See if we exceeded our time out
if TimerCount > 1000L then
piron = 0
fTimerActive = 0
endelseif
endif
endif
gosub Readinputpir
gosub WriteLedpir
return
;--------------------------------------------------------------------
;[ReadButtons] Reading input buttons from the ABB
ReadInputpir:
input P7
prev_pir = pir
pir = in7
return
;--------------------------------------------------------------------
;[WriteLEDs] Updates the state of the leds
WriteLEDpir:
if piron = 1 then
HexOn=1
BalanceMode=1
BodyPosY = 35
low p12
else
HexOn =0
BalanceMode=0
BodyPosY = 0
high p12
endif
return
;--------------------------------------------------------------------
;[PS2Input] reads the input data from the Wiiremote and processes the
;data to the parameters.
Ps2Input:
rest code…
can it work?
i must test it today… but i dont know its good or bad.
other question
can i include roboraelM code in the xan code. does it works?
i want to make a HEAD hwo can tracking people with a webcan… send it via serial back to botboard for 2 servos which controll the head for following. its is possible or i must write a complet new code?
I’ve been thinking of giving one of my walkers some vision for some while now. But let’s say time isn’t on my side lately
To add a head you need to change some things in the IK and move the parent from the body to the head. This way the body also slightly moves if it looks around. You also need to write a pc program that recognize and tracks somebody’s head and returns it in a X, Y, Z that can be send to the hex. I’ve already started a C# program to which should be able to do that. It uses a open source C++ library.
It will involve a lot of programming if you want to get it as smooth as the IC hexapod from Matt but it can be done
Adding vision is on my To-Do list but terrain adaption is on nr 1 at the moment
I’m Dutch my the way not Asian And Jeroen is my real name, which is a typical Dutch name btw. Xan comes from Xanore (see my youtube channel) which I’m using for a long time already. The way I pronounce Xan is more with a “châ€
the “J” is pronounced as an english phonetic “y”? Had a guy from over your way work for us a few years back… spelled it Jan but pronounced in english phonetics as Yon.
I’ve checked all the battery voltages, the wiring, and all is in order. When I apply VL, its like the program gets stuck in a loop. About once a second, it will play 3 tones in ascending frequency. I’ve looked at VL on a DMM and an oscilloscope to see if the BBII is resetting due to a brownout scenario and its not.
I get the same results whether I’m tethered or wireless.
The repeating sound means that the ATOM can’t initialize the PS2 controller. This can be caused by a couple of thing.
Start by checking if you have the latest IDE 8.0.1.8 installed.
Be sure that the PS2 remote is connected as described in the phoenix tutorial (figure 41-3). Check if the jumpers for the buttons A,B,C are removed!
I don’t know which version you are using. It’s best you get the latest (V1.3) from my project page.
I was curious, are the jumpers for the A, B, C buttons a problem? I installed them to see how the lights responded and the program seems to work fine. I know they are just there for programming reference, and I see no limits being indicated when the bot is operating. All is green.
I was running “Odie” in balance mode and I noticed when L1 or L2 were pushed that the body would drop a little bit. Rotational translations seemed relatively normal. Linear translation laterally is also normal, however linear translation forward and backward cause the hex to walk in the opposite direction the analog stick is applied. It appears as a ripple gait with quick short steps. Could this be considered a bug?
Core2 & myself are planning to turn some pressure sensor mounts on my lathe for the feet in the coming weeks. We are both looking forward to uneven terrain adaptation. .
Yup thats a little bug. I’ll dig into it when I find time for it, probably not this side of the year. I recommend turning of the balance mode when doing body translation. What actually happens here is that Phoenix is trying to outbalance the translation. Sorry for this but its hopefully just a minor bug.
hi all great programmers t4ndu stupid questions are back
i have build a head for phoenix
servo ports 28 , 29
how tu implement in xan code that i can move the head with the ps 2 controller? i tink press triangel an L1 or so. then i can move head with the right stick on the ps2 controller.
is that difficult?
i set any var in the program and implement any codes for controll servoout. like legs from xan code.
what i must do for take input from ps2 controller? an controll servos?
No questions are stupid (eh… ok some are, but not yours ).
You’ve made a head for Phoenix?! Cool! Please post some pictures in your own thread.
This should be easy to do.
Start by studying Xan’s code.
You probably need two constants for the servopin.
Ex.
HeadServoPanPin con P28 ;You can call it whatever you want
HeadServoTiltPin con P29
And two sword (sbyte might be enough too) variable for the servo angle, or just a word variable for the pwm value.
Ex.
HeadPanAngle var sword
HeadTiltAngle var sword
The const and vars must be defined at the start of the code.
Navigate to the PS2Input sub. **Study this code **and try to understand what happens with the different variables when the PS2 are activated. I like to test out the code before I post an example. But a little hint would be:
HeadPanAngle = (Dualshock(5) - 128)/2
The Dualshock returns a value between 0-255, so the center value are about 128. And this code would set your HeadPanAngle variable between +/- 64 deg.
You need to add more code than this to make it work in the PS2Input sub.
Navigate to the Servodriver sub.
Just before the send command, add these two lines: