anki / drive-sdk

Anki Drive SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No description for all cars answers

ValleZ opened this issue · comments

say I receive answers with message types 0x36, 0x3f, 0x86. How to parse those answers?
received unknown response, type 86 full [11, -122, 11, 0, 35, 8, 0, 0, 8, 16, 0, 0]
received unknown response, type 86 full [11, -122, 2, 0, 36, 8, 0, 0, -50, 10, 0, 0]
received unknown response, type 36 full [3, 54, -24, 3]
received unknown response, type 36 full [3, 54, 0, 0]
received unknown response, type 36 full [3, 54, -24, 3]
received unknown response, type 36 full [3, 54, 0, 0]
received unknown response, type 36 full [3, 54, -24, 3]
received unknown response, type 36 full [3, 54, 0, 0]
received unknown response, type 36 full [3, 54, -24, 3]
received unknown response, type 36 full [3, 54, 0, 0]
received unknown response, type 36 full [3, 54, -24, 3]
received unknown response, type 36 full [3, 54, 0, 0]
received unknown response, type 36 full [3, 54, -24, 3]
received unknown response, type 36 full [3, 54, 0, 0]
received unknown response, type 36 full [3, 54, -24, 3]
received unknown response, type 36 full [3, 54, 0, 0]
received unknown response, type 3f full [5, 63, 0, 0, 0, 1]
received unknown response, type 3f full [5, 63, 0, 0, 0, 1]
received unknown response, type 86 full [11, -122, 57, 0, 33, 8, 0, 0, 0, 15, 0, 0]
received unknown response, type 86 full [11, -122, 24, 0, 37, 8, 0, 0, 113, 14, 0, 0]
received unknown response, type 36 full [3, 54, 0, 100]
received unknown response, type 36 full [3, 54, 0, 0]
received unknown response, type 36 full [3, 54, 39, 16]
received unknown response, type 36 full [3, 54, 0, 0]
received unknown response, type 3f full [5, 63, 0, 0, 0, 1]
received unknown response, type 3f full [5, 63, 0, 0, 0, 1]
received unknown response, type 86 full [11, -122, 41, 0, 36, 8, 0, 0, -90, 15, 0, 0]
received unknown response, type 86 full [11, -122, 28, 0, 35, 8, 0, 0, -107, 14, 0, 0]

upd: What does messages 0x43 (0143) and 0x44 (0144) mean? Thanks

same for 0x41
received unknown response, type 41 full 0e4100004842000020c16400e80384
received unknown response, type 41 full 0e41989939c1989939c10000e80384
received unknown response, type 41 full 0e41894186c2894186c20000e80381

Hi @ValleZ,

Some of these responses are related to position, and the vehicle currently doesn't have all of the data it needs to these to make any sense. Here are the ones in that list that might be useful:

Speed Update

This one is mostly irrelevant, since right now the cars are probably not going to change speed without being commanded to do so.

ANKI_VEHICLE_MSG_V2C_SPEED_UPDATE = 0x36;
typedef struct anki_vehicle_msg_speed_update {
    uint8_t     size;
    uint8_t     msg_id;
    uint16_t    speed_mm_per_sec;
} ATTRIBUTE_PACKED anki_vehicle_msg_speed_update_t;

Status Update

This message conveys some basic info about the vehicle, similar to what is in the advertisement packet, but this is sent once you are connected to a vehicle.

ANKI_VEHICLE_MSG_V2C_STATUS_UPDATE = 0x3f;
typedef struct anki_vehicle_msg_status_update {
    uint8_t     size;
    uint8_t     msg_id;
    uint8_t     reserved0;
    uint8_t     on_charger;
    uint8_t     battery_low;
    uint8_t     battery_full;
} ATTRIBUTE_PACKED anki_vehicle_msg_status_update_t;

You should ignore 0x86, 0x43 and 0x44. The are only relevant for the Anki Drive app right now.

0x41 is related to lane changes, but I need to see if the data coming back will make any sense without the vehicle having info about the track.

In the meantime, if you want to add support for the other two, that would awesome!

Thanks for responces! I'm trying to control cars using android phone and this is very helpful. I'll check it out today. What is the best place to post questions? I managed to make cars moving but right now I'm trying to change car h positions (changing lane) and it doesn't work well...

https://github.com/ValleZ/AnkiDriveAndroid

Opening issues for stuff like this is fine. For more general questions, you might be better off posting in our google group, there there are more people monitoring that.

https://groups.google.com/a/anki.com/forum/#!forum/anki-dev

Also, to change lane/horizontal positions, you should look at the vehicle-tool example code. Right now, you need to set the offset_from_road_center to 0 (msg id is ANKI_VEHICLE_MSG_C2V_SET_OFFSET_FROM_ROAD_CENTER), before sending the lane change command in order for the vehicle to interpret the horizontal distance as a relative change