Neat!
Another quick update:
Care package arrived, will soon spend some time redoing a few things on the legs. Thanks!
USB Joysticks:
I did a quick first pass at doing an Input Driver code for using USB based Gamepads into my version of Phoenix code porting for T3.6, T4 and T4.1. I am using T4.1 with the latest board.
Right now the Hexapod is not working at all do to my IK code being screwed up. But I do have the beginnings of code to be able to use some different game pads. The two main ones I will start with are the PS3 and the PS4.
Currently I have the code in place that uses the Teensy library USBHost_t36 to talk to devices over USB. The code is setup to allow me to talk to either of these directly with a USB cable or more fun using a Bluetooth Dongle which the device is bound toā¦
I am starting off really basic and setting up some Button mapping tables and if necessary Axis mapping tables, such that the code should be able to handle a few different types of controllers, by having an appropriate table for that type of controller. I have probably mentioned in the past, but there are a few different threads up on PJRC forum talking about the joysticks and Bluetooth, including:
https://forum.pjrc.com/threads/49099-T3-6-USB-Host-Joysticks
https://forum.pjrc.com/threads/49358-T3-6-USB-Host-Bluetooth
The question for myself and others, is, should my first default bindings for this code be setup like the old PS2 code base for the Phoenix, that is probably where I will aim toward, at least at first.
With most of the controllers we have code in to receive data, maybe rumble (little or big) and maybe set LEDSā¦
There are interesting things about different controllers, like:
PS3 - There are many cheap ones you can pickup. Issues in past with things like Linux is that they donāt fully adhere to the BT protocols, but many later versions of BT have hacks in them to make them work. Also many times you needed to use an external program to bind the PS3 to the BT dongleā¦ Current USBHost_T36 Joystick Bluetooth test app has code in place that if you plug in a BT dongle and then plug in joystick (either after or same time using USB Hub), and press something like L1 or R1 and while holding one of those down press the PS3 button, it will try to do the bind process for youā¦
PS4 - When I was earlier experimenting with ROS, I found these much nicer to work with Linux, also I know they have stuff in them like Gyro and Accelā¦ Another person working with me up on PJRC for USBHost and Bluetooth has updated the JoystickBT sketch to show some of this data, like:
LX: 127, LY: 124, RX: 129, RY: 121
L-Trig: 0, R-Trig: 0
Buttons: 0
Battery Status: 110
Accel-g's: 0.245605, 0.292725, 0.931519
Gyro-deg/sec: 0.615482, 0.000000, 0.335717
Pitch/Roll: 197.445038, 194.770538
There are some other interesting Playstation options as well. I donāt remember what state the code is, for some of these. Examples are the Sony Navigation Controller, which has one button joystick, L1, L2 and HAT, which you can easily hold in one hand. Outputs from test app like:
product: Navigation Controller
*** HID Device Joystick1 54c:42f - connected ***
manufacturer: Sony
product: Navigation Controller
Joystick type: 1
LX: 22, LY: 5, RX: 121, RY: 128
L-Trig: 0, R-Trig: 0
Buttons: 0
LX: 104, LY: 102, RX: 125, RY: 133
L-Trig: 0, R-Trig: 0
Buttons: 0
LX: 120, LY: 121, RX: 125, RY: 133
L-Trig: 0, R-Trig: 0
And itās counterpart: Motion controller.
Mine my be dead, right now. It is setup for the right hand, which again detects your motion, plus has the standard buttons for the right hand side of PS3 (SQ, TRI, X, CIR), R1, R2, PS3 ā¦ Will see if having it charge for awhile in my Powered Hubs Charge port, will revive it or not.
What I am not sure of, is at one point I had a version (branch) of the library we had a code in place to allow the Bluetooth dongle to support more than one device. I am not sure if we completed it enough to do a Pull Request into the official version.
Will take a look soon. Too many diversions from making the hexapod walk.
Note: I did put up the WIP sketch with the USB stuff to github. I may probably rework most of this. Originally all of this builds as one object file with my (Phoenix in Parts) as to allow library files to be compiled with settings, i.e. everything is read as a header file, so the code can be configuredā¦
But as I build it as one sketch may convert most of the .h files into .cpp files.
That is all for now. As I said āQuick Updateā
I confirm. Thanks. Got it a while ago. Will probably make a temporary solution to connect the T4.0 to the LSS board.
Sorry for the later reply - didnāt catch the question originally. If thatās the easiest approach, and you have the hardware, seems good. Open to opinions about the āofficialā controller when the kits are released.
When I was earlier experimenting with ROS, I found these much nicer to work with Linux, also I know they have stuff in them like Gyro and Accelā¦
Colin is eager to get started with you all on the hexapod and will be able to share his experience with ROS.
Hi @cbenson - The question on what the buttons on the PS3 or the like should do is sort of secondary. Probably getting to the point that the robot can stand up, probably has a higher priority.
Sorry I am a bit slow at this, at this time of the year as busy with other stuff, like gardens and trails work, and ā¦
Also as I mentioned, I also can and do go off on different diversions
Yesterday, I finished swapping out the short C brackets for the newer one, plus put the 3d printed feet in and mounted my newer board to the top of the Hex using the new stand offsā¦
Pardon the mess:
My sketch starts up, and I believe it is seeing all of the servos. I tried a one of my diagnostic commands to get an idea of offsets and I see one servo you can see toward the middle left is off by maybe 45 degrees.
Although actually I am wondering what everyone is setting up again is the logical zero points. Should the leg be out at the 90 degrees or should the leg be lying sort of flat to the ground?
Other diversion - Arduino released a new build, which implies Teensyduino needs to release an updated version, so helping test that out, plug getting some updates in.
Joysticks - The PS3s work easily with our current stuff. PS4 I was having issues with.
Then there is the possibility of using PS3 motion with PS3 navigation joysticks, needs my not released yet Bluetooth support for multiple devices. Also my motion joystick battery failed, so ordered new one and rebuilt it this morningā¦
Then there have been questions about using XBox One joysticks, we started trying to figure out how to support it. Most other USB libraries also donāt, so now trying to reverse engineer. Plus did find a Linux one, which I want to try outā¦
But then diverted into capturing the USB/Bluetooth conversation using Saleae Logic Analyzer. But example capture, of data, the capture file was about 18mb, the CSV output from it was about 1.8 million lines, the used linux grep, plus Sublime Text edit to knock this down to about 350 linesā¦ So also now working with Saleae on the beta software, where maybe they will create what they call a āHigh Level Analyzerā, which can help with this type of dataā¦
Oops as I said many diversions
Now back to ???
Yes, I received all in good order. Exactly the components I needed. I hope share an update soon!
For those of you up in Canada, I hope you had a nice Canada day!
Sure is quiet up here.
I just pushed up some updates to my test code including some fixes to the Phoenix code. Should hopefully stand up reasonably well soon
Been distracted with other things, like recently someone up on the PJRC forum area come up with a way to use GDB to debug a T4.x (and now T3.x) without needing to do a hardware modifyā¦ GDB at the linux command line level is semi crypic, but the people at VisualMicro have a version that integrated some of this in, which I have spent some time trying to figure out how to make it workā¦ Today I had some success with it.
Although so far I have not been able to get it to dynamically set a break point by clicking on a line, but hopefully soon. Worst case when you want a new debug point you set it and then tell it it download and then connect to debug processā¦
So having some fun. Hope everyone is doing well!
Appreciated! Happy upcoming July 4th. Hopefully all the experience and insights on the Teensy will come in handy here.
Thanks,
We will continue to try to be safe and avoid the pandemicā¦
The Visual Micro code with GDB is nice. Again it allows you to setup break points, look at variablesā¦ Yesterday it showed me one of my #ifdefs was wrong and some of my tables were only 4 enteries (QUAD) instead of 6 for Hexapod which was one reason the legs were going nutsā¦
And with this I have made some progress, with connecting to robot over usb with PS3. When not active I currently have all of the legs cycling through LED colors, to remind me that it is still plugged inā¦
Befor the PS3 connect
But then when the PS3 connects, the legs go up to one position. I hit the HAT UP button and legs go higher like you see:
I press it again it lowers, and if I hit the PS3 button again it disconnects and the servos go limp:
At some point soon I will figure out how to mount a battery and plug it into to my board, so it can walk without wiresā¦
Some of the next things I will do is to add some additional PS3 stuff, plus maybe add the buzzer code, plus maybe show some feedback on the display, like which mode it is in, which gaitā¦
But thought I would show that there is some progressā¦
Hi all,
Sorry for not being active for a while. Iāve moved to our new house so this needed a bit of my attention first. But today I finally got around assembling it completely.
Next step is to dig into the stack of boxes to find some batteries and a soldering iron to get the teensy connected. I hope to send an update soon.
Xan
@xan Congratulation on the move and weāre all happy to see you back here and participating again.
Good to see some progress here. Nice build @xan!
Meanwhile Iām trying to figure out the Teensy 4. Since I also want it to work on my current code and other robots. So far I have some issues doing pullup on output pin, since the T4 is not supported in the kinetis.h. Might need to post this on another forum thoughā¦
UART0_C1 |= UART_C1_LOOPS | UART_C1_RSRC;
CORE_PIN1_CONFIG |= PORT_PCR_PE | PORT_PCR_PS; // pullup on output pin
Report error during compiling.
@xan and @zenta - good to see you both up here
UART0_C1 |= UART_C1_LOOPS | UART_C1_RSRC;
CORE_PIN1_CONFIG |= PORT_PCR_PE | PORT_PCR_PS; // pullup on output pin
Is setting up for Half duplex mode on T3.xā¦ boards. T4s have different sets of registers.
If you look at my current version of dxlSerial.cpp (BioloidSerial github project)
You will see what changes I did, to on the T4.x boards. Note: I probably should remove the Serial.print
statements from it, butā¦ Have not done much with them in awhile.
Thanks Kurt. A bit overwhelming at first sight though. Not even sure where to start. So serial 2 is using UART4?
Are you using a library to output the DXL servos? Obviously if Bioloid ones, you might simply be able to sync up to mystuff up there. Else can maybe start thread on PJRC on it and will take a look.
Hi All,
It has been quiet from my side. Iām still waiting for some additional parts to arrive. Donāt ask me why, but not from Robotshopā¦
Iāve just contacted customer service to ask when and from where the shipment was done. It turns out that the items where shipped on the 6th from the Netherlands, to the Netherlands. Customer support told me that it will take 9 to 15 business days. Fun-fact, the longest distance (north to south) of the Netherlands is only 300 km (185 mile). So I expect them to bring it on foot.
Iāll keep you updated.
They probably just found a cool spot (while walking with your package) and decided to have a hiking trip on the way or somethingā¦
In a similar way, I was waiting on a computer part for over two weeks that was picked up by Canada Post 10 km from my placeā¦ and only arrived a few days ago! Had I known it would take this long, I wouldāve picked it up myself instead of using the āfree deliveryāā¦
Morning all,
I have not been making much progress on this, this last week. Been sort of distracted.
Been playing more with getting PS4 to be more reliable when it connects up to T3.6 or T4.x with Bluetooth. Still looking into some of this.
I have been wondering if maybe some of the time for others to join in and have things up and running, is due to me wanting to use a Teensy. Note: I personally game for most things, although personally I prefer to shy away from AVR 8 bit processors, like ATMega328 as the main processor. I personally prefer ARM either MicroControllers like Teensy, Some of the Adafruit, higher end Arduino Zero?, Portenta when releasedā¦ Or Some full ARM boards, like: RPI, Odroid, Beagleā¦ or when I was earlier playing with ROS, I liked using X86 based boards by UP, but there are others for example by Odroid, Intel NUC.
So also during this last week, I received an RPI4 8MB board, which I have now installed the latest Raspberry OS (32 bits), thought about trying the 64 bit beta. I have also updated the bios to allow it to boot from USB, and have it now booting off of an SSD.
So again not sure if others would feel more comfortable going down the RPI(3 or 4) route and use something to control the servos.
Could be the LSS adapter board, which all should already have.
Could be something like LSS210 board (I have one) Althoughā¦
Could be some other form of Arduino like board (Teensy,) Personally preferably something that has either two hardware UARTS and/or hardware Uart and built in USB. (i.e. you have connection to RPI or the like (by either USB or Hardware Serial port) and another UART for controlling the servos.
And again what to use as UI Controller. Again if something like RPI, that use Bluetooth, could use some form of controller. like PS3 or PS4ā¦ Could be something XBEE based, like Arbotix Controller, or?
Again the real question I am asking, is, is there another approach that would help many of you to get up and running?
Kurt
Hi @kurte,
Wow, youāre going fast here
Iām still waiting for my order to get in. And Iām aiming for the following setup:
- LSS adapter board
- Teensy 4.0
- Xbee connected to my DIY remote (for now)
I think this setup will be the quickest way (for me) to get it up and running (or letās start with walking). Iām planning to make the software modular so it will be easy to adapt to another controller later on. I do like to use my DIY xbee since it gives me more control (read precision) then a PSx controller. But a PSx controller will be easier to come by so easier for the public.
Same for the RPI, I would like to try that out, but first Iām going to get it to walk and explore the limits of the Teensy
I got a message that the new battery will be delivered today. So I hope to do some calibrating this weekend!
Iāll keep you updated!
Xan