Understanding logID

Post Reply
Posts: 43
Joined: Fri Feb 17, 2017 5:44 am

Understanding logID

Post by H0stname »


I am trying to control a ground vehicle with accessories in a similar manner as evoggy's crazycar project, sending data over UART to an arduino connected to various higher current drivers. At this point, the crazyflie is being used as a great rxtx solution using crtp!

My code has evolved from evoggy's crazycar.c on hackster: https://www.hackster.io/evoggy/crazycar-3c14b6

I looked at the following c and header files:
#include "FreeRTOS.h"
#include "timers.h"
#include "uart2.h"
#include "debug.h"
#include "log.h"
as well as log.c, crtp, examined

Code: Select all

function and a few others hoping to find some log variable info.

I also checked these wiki pages:
https://wiki.bitcraze.io/projects:crazy ... tp:console
and some others

Based on the analysis, I think I can define a "yaw" and "thrust" (this looks to be scaled differently) and get some results similar to this part of the code in crazycar.c:
line 107:

Code: Select all

static void crazycarDeckInit(DeckInfo *info)
    logIdRoll = logGetVarId("ctrltarget", "roll");
    logIdPitch = logGetVarId("ctrltarget", "pitch");
to use the other thumbstick on my controller

But, what would the buttons be called? How do I figure out the other strings to pass to the `logGetVarId`? I expect binary/boolean output, but don't know where to start mapping this controller or really, crazyflie log values that are actuated by input on the controller.

Edit: In case not clear, I am just trying to figure out the other log variable names for buttons or where to find this information in the code.

It also appears what evoggy did might not be the best way to do this, but he wanted a quick hack, because uart2SendData is for large debug information. However, I have not seen any problems so far, so I am ok with proceeding this way, but any further improvement is welcome!

Edit 2: Thinking about this some more, I realized the log variables I am targeting respond to events, so I will have to map my desired buttons to something in the cfclient, and then need the log variable name of the function, such as alt 1, 2, assisted control, kill switch, or mux switch (What does this mux do?) as far as I can tell. Still don't know where valid strings are found in the code though.

Edit 3: I searched the forum for 'evoggy', and see his stuff on hackster, but I thought he was a member of the Bitcraze team? Perhaps I was mistaken, I don't expect you guys to support/dig into code that is not yours.
Post Reply