Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: k4w/1473 added tilt, led, accel and OS X freeze fix #362

Merged
merged 3 commits into from
Feb 6, 2014

Conversation

ofTheo
Copy link
Contributor

@ofTheo ofTheo commented Jan 28, 2014

Tested with both K4W and 1473 devices.
Needs testing on Windows and Nix

NOTE:

  • for tilt, led, accel on K4W you need to extract the firmware from the latest SDK ( v1.8 ) which is now an exe, so harder to unpack. The firmware extracted by the current script, does not support motor controls.
  • for tilt, led, accel on 1473 you need to extract the audios.bin firmware from the Dec 2013 Xbox System Update SystemUpdate_16547_USB.zip, using py360
  • OR: you can get the fw for both ( slightly modified to be different but still work ) as a function call here: /~https://github.com/openframeworks/openFrameworks/blob/feature-kinect1473-support/addons/ofxKinect/src/extra/ofxKinectExtras.cpp . With this approach you can use the new firmware from memory functions in loader.c

pinging @zarvox @JoshBlake @zarvox

Signed-off-by: Theodore Watson theo@openframeworks.cc (ofTheo)

…up. This seems to fix a known issue for OS X users where the device renumerates within a small time period and causes a freeze. Closes OpenKinect#340 and addresses OpenKinect#316. Signed-off-by: Theodore Watson <theo@openframeworks.cc> (ofTheo)
…accel and led for K4W and 1473 device. Adds keep alive for K4W and 1473. Signed-off-by: Theodore Watson theo@openframeworks.cc (ofTheo)
@piedar
Copy link
Contributor

piedar commented Feb 1, 2014

👍
I can't really test this without a K4W, but the code looks good. If there no objections, I will merge it soon.

@piedar piedar modified the milestones: v0.4.0, v0.3.1 Feb 3, 2014
@spie0092
Copy link

spie0092 commented Feb 4, 2014

Hey Theo. Thanks for all of your work on this. I have tried to get this to work every which way, with no luck... upon the make command, it builds about 25%, then I get this error:

Linking C shared library ../lib/libfreenect.dylib
Undefined symbols for architecture x86_64:
  "_freenect_extra_keep_alive", referenced from:
      _fnusb_open_subdevices in usb_libusb10.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libfreenect.0.3.0.dylib] Error 1
make[1]: *** [src/CMakeFiles/freenect.dir/all] Error 2
make: *** [all] Error 2

Any suggestions? Same error on two different machines:

Macbook Pro (15-inch, Mid 2010)

  • OSX 10.9
  • 2.66 GHz Intel Core i7
  • 8 GB 1067 DDR3
  • NVIDIA GeForce GT 330M 512 MB

Macbook Pro (Retina, 15-inch, Late 2013)

  • OSX 10.9.1
  • 2.6 GHz Intel Core i7
  • 16GB 1600 MHz DDR3
  • NVIDIA GeForce GT 750M 2048 MB

@ofTheo
Copy link
Contributor Author

ofTheo commented Feb 4, 2014

Need to add keep_alive.c to your build. It looks like it's not being added.
:)

Sent from my iPhone

On Feb 4, 2014, at 11:08 AM, spie0092 notifications@github.com wrote:

Hey Theo. Thanks for all of your work on this. I have tried to get this to work every which way, with no luck... upon the make command, it builds about 25%, then I get this error:

Linking C shared library ../lib/libfreenect.dylib
Undefined symbols for architecture x86_64:
"_freenect_extra_keep_alive", referenced from:
_fnusb_open_subdevices in usb_libusb10.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libfreenect.0.3.0.dylib] Error 1
make[1]: *** [src/CMakeFiles/freenect.dir/all] Error 2
make: *** [all] Error 2
Any suggestions? Same error on two different machines:

Macbook Pro (15-inch, Mid 2010)

OSX 10.9
2.66 GHz Intel Core i7
8 GB 1067 DDR3
NVIDIA GeForce GT 330M 512 MB
Macbook Pro (Retina, 15-inch, Late 2013)

OSX 10.9.1
2.6 GHz Intel Core i7
16GB 1600 MHz DDR3
NVIDIA GeForce GT 750M 2048 MB

Reply to this email directly or view it on GitHub.

@spie0092
Copy link

spie0092 commented Feb 4, 2014

I do have it included in the "src" folder, of the main root (I downloaded your "feature-k4w..." repository and am building from that). Do I need to manually place it in the build folder as well?

Sorry for my unintelligent line of questioning. I am new to this, and it's been quite a struggle...

@ofTheo
Copy link
Contributor Author

ofTheo commented Feb 4, 2014

It might be that you need to add the files to the cmake build files.

I don't have a lot of experience with cmake, hence why I didn't make changes in this pr.

Looks like editing CMakeLists.txt in src/ will so the trick. Adding keep_alive.c after core.c in both places.

I can update this PR later with these changes but it should be easy enough to do.

Sent from my iPhone

On Feb 4, 2014, at 11:39 AM, spie0092 notifications@github.com wrote:

I do have it included in the "src" folder, of the main root (I downloaded your "feature-k4w..." repository and am building from that). Do I need to manually place it in the build folder as well?

Sorry for my unintelligent line of questioning. I am new to this, and it's been quite a struggle...


Reply to this email directly or view it on GitHub.

@spie0092
Copy link

spie0092 commented Feb 4, 2014

Thanks! I will test it out. I really appreciate your help!

@spie0092
Copy link

spie0092 commented Feb 4, 2014

Worked like a charm! One note, from my configurations, for the "ccmake .." setup, I needed to change all references to "/usr/" to "/opt/".

THANK YOU!

@piedar
Copy link
Contributor

piedar commented Feb 4, 2014

@ofTheo I will update src/CMakeLists.txt when I merge this.

@ofTheo
Copy link
Contributor Author

ofTheo commented Feb 4, 2014

thanks @piedar - sounds good!

@piedar piedar merged commit 50bd445 into OpenKinect:master Feb 6, 2014
@MohitShridhar
Copy link

Hi Theo! I have been trying to get 1473's tilt/accel/led working on OSX 10.9.
But when I run tiltdemo, none of these seem to work.

I get this:

led[3] tilt[9] accel[0.000000,0.000000,0.000000]
led[0] tilt[-9] accel[0.000000,0.000000,0.000000]
led[0] tilt[1] accel[0.000000,0.000000,0.000000]
led[4] tilt[-13] accel[0.000000,0.000000,0.000000]
led[4] tilt[-13] accel[0.000000,0.000000,0.000000]
led[1] tilt[7] accel[0.000000,0.000000,0.000000]

with no change in physical tilt/accel data/led status.

While building libfreenect, I used cmake -BUILD_AUDIO=ON .., and I could see that audio.bin was downloaded and placed in /usr/local/share/libfreenect/. Have I missed anything?
I tried micview; I can see the waveforms produced by the microphone array. So it seems like the audio.bin firmware has been installed properly. Or has it?!

Thanks for the help!

@ofTheo
Copy link
Contributor Author

ofTheo commented Feb 25, 2014

hi @TihomRis
for 1473 you need a newer firmware blob than the one that used to be provided by the script.

for tilt, led, accel on 1473 you need to extract the audios.bin firmware from the Dec 2013 Xbox System Update SystemUpdate_16547_USB.zip, using py360

you are probably using the older audios.bin which does audio but does not enable tilt or accel controls

@MohitShridhar
Copy link

Wow! That did the trick! I have been looking forward to this feature for a long time! Thanks a lot!

@piedar
Copy link
Contributor

piedar commented Feb 27, 2014

How is that done with py360? Is the newer firmware compatible with original Kinect? I would like to either update fwfetcher.py or replace it with py360 to use the newer firmware by default.

@hkhpeter
Copy link

hkhpeter commented Mar 2, 2014

I'm using 1473 on Ubuntu12.04, and it's working great now, thanks. But before all things work out the following have to be done.

  1. upload_firmware() in loader.c was causing troubles. When running some of the examples after installing, "Segmentation fault" occurred after case 3 inside the for loop for file search. I had to remove the entire for loop and write the path to audios.bin manually instead. The path for my computer is /usr/local/share/libfreenect/audios.bin.
  2. Not knowing how to use py360, I had to use ofxKinectExtras for the firmware as suggested by the NOTE. I tried to include the firmware as a function call, but to no avail. I at the end wrote the firmware to an audios.bin file and put it inside the build directory.
  3. Comment out the command to run fwfetcher.py in CMakeLists.txt in src. The python file is to write audios.bin for k4w. This is not needed and this would have overwritten the audios.bin in 2.
  4. Install libfreenect with BUILDAUDIO on, then things should work out.

@MohitShridhar
Copy link

I ended up using extract360.py to get it working. Followed this guide.

After extracting audios.bin from SystemUpdate_16547_USB.zip (just googled it), I manually placed it in the build directory. And then built libfreenect with BUILD_AUDIO.

I have tried the build on both 1473 and 1414. So far, it works great!

@libasoles
Copy link
Contributor

Hi @hkhpeter . Glad to know it works for you. I'm eager to make it work for me. I tried to figure out how to include ofxKinectExtras but with no luck. So I want to compile the code as you did.

As I'm not a c/c++ developer I must ask for help on this. How can I compile the audios.bin? I'm trying this but the "unsigned char" seems to be cut to just 64 B.

#include
#include "ofxKinectExtras.cpp"

int main()
{
size_t data_size = sizeof(&fwk4wBin[0]);
std::ofstream ofile("audios.bin", std::ios::binary);

for(int x=0; x<data_size; x++)
{
  ofile.write((char *)&fwk4wBin[0], data_size);
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants