Giter Club home page Giter Club logo

libcanard's People

Contributors

a1ien avatar aasmune avatar acassis avatar adolfogc avatar ajuckler avatar antoinealb avatar bradapd avatar bugobliterator avatar davidlenfesty avatar espitall avatar kjetilkjeka avatar magshaw avatar mahibak avatar masierra avatar papatience avatar pavel-kirienko avatar petervdperk-nxp avatar rabad-matternet avatar rennerm avatar ryanf55 avatar storola avatar tridge avatar valle125 avatar wesen 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libcanard's Issues

Support for Zephyr

I am working on programming blackpill_f401cc (WeAct) as a daughter board for Pixhawk. I was using mcp2515 for can interface and Zephyr as the RTOS. How do I go about implementing libcanard there?

Raw Command Throttle Value Decoding not Standard Compliant

Hello,
im trying to decode raw throttle commands without using libcanard. The specification shows a clear way how multiple values, in this case 14bit are meant to be packed into the message. https://dronecan.github.io/Specification/figures/bit_encoding.png
However after some review of the actual traffic, there seems to be significant deviation. Only the first throttle value in a 4 channel single frame configuration is placed in compliance, to some extenend. The others are also packed, although needs shifting to fit together, in 14bit packages but have to be descattered by shifting bit pairs in an arbitrary pattern within said 14bit packets to retrieve the correct value.
Can anyone shine some light into the issue and whats the magic behind this weird encoding pattern.
Kind Regards Tobi

Build fails on Raspian

When building the test this static assert fails:

/home/pi/libcanard/tests/test_scalar_encoding.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____4()’:
/home/pi/libcanard/tests/test_scalar_encoding.cpp:129:58: error: static assertion failed: Assumption is not met, are we on a 32-bit x86 machine?
  129 |     static_assert(CANARD_MULTIFRAME_RX_PAYLOAD_HEAD_SIZE == 6, "Assumption is not met, are we on a 32-bit x86 machine?");
make[2]: *** [CMakeFiles/run_tests.dir/build.make:173: CMakeFiles/run_tests.dir/test_scalar_encoding.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:124: CMakeFiles/run_tests.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

gcc version:
gcc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110

I had to remove -m32 -Werror option from CMakeLists.txt to get compilation to work.

There is a warnig in libcanard.c, not sure if it's related.

/home/pi/libcanard/canard.c:1042:66: warning: conversion from ‘int’ to ‘uint8_t’ {aka ‘unsigned char’} may change value [-Wconversion]
 1042 |         payload_len = dlcToDataLength(dataLengthToDlc(payload_len+1))-1;

CMake: add_subdirectory given source "googletest" which is not an existing directory

add_subdirectory(googletest)

In the CMakeLists, it's not building because googletest directory doesn't exist.

Host OS: Ubuntu 22.04
CMake version: 3.22.1

Steps to reproduce:

  1. Clone
  2. cd libcanard
  3. cmake -S . -B build

I'd recommend using something along the lines of these:
https://cmake.org/cmake/help/latest/module/FindGTest.html
https://cmake.org/cmake/help/latest/module/GoogleTest.html

We are having to make workaround for this here:
ArduPilot/ardupilot#23574

Based on the design goals of the library, it says it's supposed to be portable. Considering many developers develop on Ubuntu 22.04, and cmake is the most common build system, it seems like this should be enforced to work in CI rather than making calls directly to g++ IMHO.

Issue building bootloader for ardupilot

I was trying to build bootloader for experimental AP_Periph board, but build was failing.

Traceback (most recent call last):
  File "/vagrant/modules/DroneCAN/libcanard/dsdl_compiler/libcanard_dsdlc", line 63, in <module>
    from libcanard_dsdl_compiler import run as dsdlc_run
  File "/vagrant/modules/DroneCAN/libcanard/dsdl_compiler/libcanard_dsdl_compiler/__init__.py", line 21, in <module>
    from uavcan import dsdl
ModuleNotFoundError: No module named 'uavcan' 

Appling this fix hepled:
OpenCyphal-Garage/libcyphal#318

I think that this repo should mirror this branch:
https://github.com/UAVCAN/libuavcan/tree/legacy-v0
or at least sync with it

No header guard in some of the cpp headers

Some of the cpp headers (callbacks.h cxx_wrappers.h) don't have #pragma once at the top, so they can easily get multiply included.

If I get time, I'll create a pull request for this later, but its the kind of minor annoyance that should be easy to fix.

Build fails on Ubuntu ARM running in Parallels on Mac M1

error: size of array ‘altStackMem’ is not an integral constant-expression

 6631 |     char FatalConditionHandler::altStackMem[SIGSTKSZ] = {};
      |                                             ^~~~~~~~
make[2]: *** [CMakeFiles/run_tests.dir/build.make:76: CMakeFiles/run_tests.dir/catch/test_main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/run_tests.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I deleted the -werror -m32 from the CMakeLists.txt to avoid the error mentioned in #15 but now this one. Any idea on how to fix please?

Support For TMS320F2800157

I am working on programming TMS320F2800157 as a daughter board for Pixhawk.I could not find the drivers for TI under libcanard/drivers folder. Could anyone suggest me what is the best mechanism to do so? Or is there any guideline on how to create a new driver to support a new microcontroller?

Update Examples to no longer use legacy API

I found it quite odd that among others the Servo example still uses the canardRequestOrRespond() function that is described in the canard.h file as following:

// Legacy API, try to avoid using it, as this will not be extended with new features
int16_t canardRequestOrRespond(CanardInstance* ins,             ///< Library instance
                               uint8_t destination_node_id,     ///< Node ID of the server/client
                               uint64_t data_type_signature,    ///< See above
                               uint8_t data_type_id,            ///< Refer to the specification
                               uint8_t* inout_transfer_id,      ///< Pointer to a persistent variable with transfer ID
                               uint8_t priority,                ///< Refer to definitions CANARD_TRANSFER_PRIORITY_*
                               CanardRequestResponse kind,      ///< Refer to CanardRequestResponse
                               const void* payload,             ///< Transfer payload
                               uint16_t payload_len             ///< Length of the above, in bytes

If this is legacy API, i would suggest that the examples get updated to use the new and recommended API.
I would do it myself, but i'm not deep enough into how the library is properly used.
Thanks in advance.

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.