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

library method anki_vehicle_msg_turn_180() does nothing #26

Open
OpenHelios opened this issue Jan 5, 2016 · 2 comments
Open

library method anki_vehicle_msg_turn_180() does nothing #26

OpenHelios opened this issue Jan 5, 2016 · 2 comments

Comments

@OpenHelios
Copy link

Using the library method anki_vehicle_msg_turn_180() does nothing. For testing I have added a command turn:

{ "turn",          cmd_anki_vehicle_turn,  "turn vehicle", "turn the vehicle by 180°"},

and the following method:

static void cmd_anki_vehicle_turn(int argcp, char **argvp) {
        uint8_t* value;
    size_t plen;
        int handle;
        if (conn_state != STATE_CONNECTED) {
                failed("Disconnected\n");
                return;
        }
        handle = vehicle.write_char.value_handle;
        rl_printf("turn 180°\n");
        anki_vehicle_msg_t msg;
        plen = anki_vehicle_msg_turn_180(&msg);
        value = (uint8_t *)&msg;
        gatt_write_char(attrib, handle, value, plen, NULL, NULL);
}

Commands used with vehicle-tool:

connect
sdk-mode 1
set-speed 400
turn
@OpenHelios
Copy link
Author

@chapados Thanks a lot for updating to firmware version 0x266e.

With the recently published pull request #27 on branch firmware-version-266e the turn method works (car use firmware 0x266e) after fixing the bug introduced with this pull request:

diff --git a/src/protocol.c b/src/protocol.c
index 0c5f3eb..0c00133 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -192,7 +192,7 @@ uint8_t anki_vehicle_msg_turn(anki_vehicle_msg_t *msg,

     anki_vehicle_msg_turn_t *m = (anki_vehicle_msg_turn_t *)msg;
     memset(m, 0, sizeof(anki_vehicle_msg_turn_t));
-    m->size = ANKI_VEHICLE_MSG_BASE_SIZE;
+    m->size = ANKI_VEHICLE_MSG_C2V_TURN_SIZE;
     m->msg_id = ANKI_VEHICLE_MSG_C2V_TURN;
     m->type = (uint8_t)type;
     m->trigger = (uint8_t)trigger;

@82MHz
Copy link

82MHz commented Feb 4, 2016

@chapados Thanks for updating the sdk to work with the overdrive firmware!

I'm involved in this project: https://github.com/NoveroResearch/tragediy

We also noticed the bug mentioned by @OpenHelios regarding the turn message.

We were also wondering if there was any possibility of changing the behaviour of the vehicles in case they leave the track and try to find it again. Right now especially the vehicles with overdrive firmware run a lot of "rescue maneuvers", meaning they drive in circles or spin around their own axis etc., trying to find the track.
From our perspective this is not ideal and it would be great if this could be influenced or turned off somehow, so I wanted to ask if there is any way to influence this behaviour via an (undocumented) message.

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

No branches or pull requests

2 participants