This version is outdated by a newer approved version.DiffThis version (2024/01/14 19:00) is a draft.
Approvals: 0/1

This is an old revision of the document!


test2.c
#include "canopen_dictionary.h"
 
 
/**
 * @brief Intialize the configuration and check that no error is in the OD.
 * 
 */
void test_demo_init() {
    CANopenDictionary_enum_errors error = CANOPEN_DICTIONARY_LIB_ERROR_NONE;
 
    size_t length = sizeof(dictionary_storage)/sizeof(dictionary_storage[0]);
    error = canopen_dictionary_init(&col_conf,dictionary_storage,length);
 
    if(error != CANOPEN_DICTIONARY_LIB_ERROR_NONE) {
        // error handling
        TEST_FAIL_MESSAGE("library could not be initialized!");
    }
 
    error = canopen_dictionary_registerCallbackFind(&col_conf,CANOPEN_IDX_LOW_NUMBER_001,CANOPEN_SUBIDX_LOW_NUMBER_001,&write_callback);
 
    TEST_ASSERT_MESSAGE(error==CANOPEN_DICTIONARY_LIB_ERROR_NONE,"the callback could not be registered");
}

opencv.cpp
  1. while (inputVideo.grab()) {
  2. cv::Mat image, imageCopy;
  3. image.copyTo(imageCopy);
  4. std::vector ids;
  5. std::vector> corners, rejected;
  6. detector.detectMarkers(image, corners, ids, rejected);
  7. // if at least one marker detected
  8. if (ids.size() > 0)
  9. cv::aruco::drawDetectedMarkers(imageCopy, corners, ids);
  10. cv::imshow("out", imageCopy);
  11. char key = (char) cv::waitKey(waitTime);
  12. if (key == 27)
  13. break;
  14. }

test.c
  1. #include "canopen_dictionary.h"
  2.  
  3.  
  4. /**
  5.  * @brief Intialize the configuration and check that no error is in the OD.
  6.  *
  7.  */
  8. void test_demo_init() {
  9. CANopenDictionary_enum_errors error = CANOPEN_DICTIONARY_LIB_ERROR_NONE;
  10.  
  11. size_t length = sizeof(dictionary_storage)/sizeof(dictionary_storage[0]);
  12. error = canopen_dictionary_init(&col_conf,dictionary_storage,length);
  13.  
  14. if(error != CANOPEN_DICTIONARY_LIB_ERROR_NONE) {
  15. // error handling
  16. TEST_FAIL_MESSAGE("library could not be initialized!");
  17. }
  18.  
  19. error = canopen_dictionary_registerCallbackFind(&col_conf,CANOPEN_IDX_LOW_NUMBER_001,CANOPEN_SUBIDX_LOW_NUMBER_001,&write_callback);
  20.  
  21. TEST_ASSERT_MESSAGE(error==CANOPEN_DICTIONARY_LIB_ERROR_NONE,"the callback could not be registered");
  22. }
  1. #include "canopen_dictionary.h"
  2.  
  3.  
  4. /**
  5.  * @brief Intialize the configuration and check that no error is in the OD.
  6.  *
  7.  */
  8. void test_demo_init() {
  9. CANopenDictionary_enum_errors error = CANOPEN_DICTIONARY_LIB_ERROR_NONE;
  10.  
  11. size_t length = sizeof(dictionary_storage)/sizeof(dictionary_storage[0]);
  12. error = canopen_dictionary_init(&col_conf,dictionary_storage,length);
  13.  
  14. if(error != CANOPEN_DICTIONARY_LIB_ERROR_NONE) {
  15. // error handling
  16. TEST_FAIL_MESSAGE("library could not be initialized!");
  17. }
  18.  
  19. error = canopen_dictionary_registerCallbackFind(&col_conf,CANOPEN_IDX_LOW_NUMBER_001,CANOPEN_SUBIDX_LOW_NUMBER_001,&write_callback);
  20.  
  21. TEST_ASSERT_MESSAGE(error==CANOPEN_DICTIONARY_LIB_ERROR_NONE,"the callback could not be registered");
  22. }
Step 1 Doxycode
1
#include "canopen_dictionary.h"
 
 
/**
 * @brief Intialize the configuration and check that no error is in the OD.
 * 
 */
void test_demo_init() {
    CANopenDictionary_enum_errors error = CANOPEN_DICTIONARY_LIB_ERROR_NONE;
 
    size_t length = sizeof(dictionary_storage)/sizeof(dictionary_storage[0]);
    error = canopen_dictionary_init(&col_conf,dictionary_storage,length);
 
    if(error != CANOPEN_DICTIONARY_LIB_ERROR_NONE) {
        // error handling
        TEST_FAIL_MESSAGE("library could not be initialized!");
    }
 
    error = canopen_dictionary_registerCallbackFind(&col_conf,CANOPEN_IDX_LOW_NUMBER_001,CANOPEN_SUBIDX_LOW_NUMBER_001,&write_callback);
 
    TEST_ASSERT_MESSAGE(error==CANOPEN_DICTIONARY_LIB_ERROR_NONE,"the callback could not be registered");
}
QR Code
QR Code playground:doxycode (generated for current page)