Giter Site home page Giter Site logo

magellan-spacemouse's People

Contributors

jfedor2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

magellan-spacemouse's Issues

Pintf support with tinyusb / spacemouse emulation

Hi, i'm not sure if this is the right place to ask, but I'm having troubles adapting this code to my needs.
I'm trying to write a program to emulate a spacemouse using an IMU sensor, and to test the program i'd need some debug prints to check the values obtained by the sensor.
I see that you use the function "printf" in your code, but with the tinyusb firmware loaded the pico isn't recognized as a serial device, so i can't read those prints anywhere.
I tryed to follow some examples i found online to enable CDC communication in the descriptor / tusb_config files, but unless i'm doing something wrong (likely) that seems to break the comunication with the spacemouse software.
Did you find a way to receive those prints somehow?
Or do you have a better debugging method to suggest? Thank you.

Support for CAD-MAN USB SpaceMouse

image

Would be awsm to be able to fit it for the CadMan also!

Do you think i can use the current magellan software with the cad man and be able to at least use the joystick?
How do i need to connect the USB to the PI in this case?

Thank for sharing your Work!

Internal workings

I'm trying to adapt this software to a DIY spacemouse and was wondering if you could elaborate on the internal workings a bit more.
Looking at the source code, descriptors.c seems pretty clear to me. As far as I understand it, it defines the USB manufacturer, model and some other stuff.
My understanding of magellan.c is the following:

  • It sets up UART, USB and GPIO pins
  • What does this do? ๐Ÿค”
    uint8_t init_buf[] = { '\r', 'v', 'Q', '\r', 'm', '3', '\r' };
    uart_write_blocking(SERIAL_MOUSE_UART, init_buf, sizeof(init_buf));
  • In the infinite loop, it calls tinyusb's tud_task() function to do some USB-related stuff
  • It then checks in
    if (trans_pending && tud_hid_ready()) {
    if (rot_pending && tud_hid_ready()) {
    if (buttons_pending && tud_hid_ready()) {
    if a translation, rotation or button press has occured that has to be reported via USB
  • After that, it reads a char from UART and that's basically where my understanding stops. Could you therefore please elaborate what this does?
    buf[idx] = c;
    idx = (idx + 1) % sizeof(buf);
    printf("%c", c);
    if (c == '\r') {
    printf("\n");
    switch (buf[0]) {
    case 'd': {
    if (idx != 26) {
    break;
    }
    int16_t values[6];
    for (int i = 0; i < 6; i++) {
    values[i] = -32768;
    for (int j = 0; j < 4; j++) {
    values[i] += (buf[1 + i * 4 + 3 - j] & 0xf) << (4 * j);
    }
    printf("%d %d ", i, values[i]);
    }
    printf("\n");
    trans_report[0] = values[0];
    trans_report[1] = values[2];
    trans_report[2] = -values[1];
    rot_report[0] = values[3];
    rot_report[1] = values[5];
    rot_report[2] = -values[4];
    trans_pending = 1;
    rot_pending = 1;
    break;
    }
    case 'k': {
    if (idx != 5) {
    break;
    }
    uint16_t buttons = 0;
    for (int i = 0; i < 3; i++) {
    buttons |= (buf[1 + i] & 0x0f) << (4 * i);
    }
    printf("%04x\n", buttons);
    memset(buttons_report, 0, sizeof(buttons_report));
    for (int i = 0; i < 12; i++) {
    if (buttons & (1 << i)) {
    buttons_report[button_bits[i] / 8] |= 1 << (button_bits[i] % 8);
    }
    }
    buttons_pending = 1;
    }
    default:
    break;
    }
    idx = 0;
    }
    }
    }
    return 0;
    }

    Thank you in advance ๐Ÿ˜€

Request to create firmware for space mouse classic usb

Hello. I assembled hid-remapper for your project on one raspberry pi pico board. Tried connecting my old Space Mouse Classic USB controller. On some computers, the Space Mouse Classic USB is not installed correctly. I tried with the help of your device to solve this problem. Space Mouse certainly didn't work with hid-remapper. I want to ask you to make Space Mouse Compact emulation firmware for Space Mouse Classic USB based on the hid-remapper board. Ready to become a firmware tester.

photo_2023-03-08_22-54-15

photo_2023-03-08_22-56-41

photo_2023-03-08_22-56-51

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.