RCPWM subscribe & publishe problem in BABEL


#1

Hello.

I applied the BABEL tutorial to get the sensor value and graph it on the UAVCAN GUI tool.

Now, I want to change the rpm at the certain sensor value. So I read tutorial example again. In the tutorial, RCPWM values are passed to the MCU timers.

On the contrary, can I change the RCPWM value to a random value in MCU?

If possible, can you tell which variables to modify and which functions to reference?


(Alexander Sysoev) #2

Of course you can change anything as you want. If I undesrstand your intentions correctly, you need to modify function
static void rawcmdHandleCanard(CanardRxTransfer* transfer)
there array ar[6] is being filled from parsing UAVCAN frame

    for (int i = 0; i<6; i++)
    {
        if (canardDecodeScalar(transfer, offset, 14, true, &ar[i])<14) { break; }
        offset += 14;
    }

After this step you will have your values in ar[] and you are free to make anything you want with it.