| Directory: | ./ |
|---|---|
| File: | tests/tools/dummy-sot-external-interface.cc |
| Date: | 2025-05-13 12:28:21 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 12 | 24 | 50.0% |
| Branches: | 12 | 24 | 50.0% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * Copyright 2011, | ||
| 3 | * Olivier Stasse, | ||
| 4 | * | ||
| 5 | * CNRS | ||
| 6 | * | ||
| 7 | */ | ||
| 8 | /* -------------------------------------------------------------------------- */ | ||
| 9 | /* --- INCLUDES ------------------------------------------------------------- */ | ||
| 10 | /* -------------------------------------------------------------------------- */ | ||
| 11 | |||
| 12 | #include "dummy-sot-external-interface.hh" | ||
| 13 | |||
| 14 | #include <iostream> | ||
| 15 | #include <sot/core/debug.hh> | ||
| 16 | |||
| 17 | using namespace std; | ||
| 18 | using namespace dynamicgraph::sot; | ||
| 19 | |||
| 20 | ✗ | void DummySotExternalInterface::setupSetSensors( | |
| 21 | std::map<std::string, dynamicgraph::sot::SensorValues> &sensorsIn) { | ||
| 22 | ✗ | nominalSetSensors(sensorsIn); | |
| 23 | ✗ | return; | |
| 24 | } | ||
| 25 | |||
| 26 | 1 | void DummySotExternalInterface::nominalSetSensors( | |
| 27 | std::map<std::string, dynamicgraph::sot::SensorValues> & /*sensorsIn*/) { | ||
| 28 | 1 | return; | |
| 29 | } | ||
| 30 | |||
| 31 | ✗ | void DummySotExternalInterface::cleanupSetSensors( | |
| 32 | std::map<std::string, dynamicgraph::sot::SensorValues> &sensorsIn) { | ||
| 33 | ✗ | nominalSetSensors(sensorsIn); | |
| 34 | ✗ | return; | |
| 35 | } | ||
| 36 | |||
| 37 | 1 | void DummySotExternalInterface::getControl( | |
| 38 | std::map<std::string, dynamicgraph::sot::ControlValues> &controlOut) { | ||
| 39 |
3/6✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
|
1 | controlOut["ctrl_map_name"] = dynamicgraph::sot::ControlValues(); |
| 40 |
4/8✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
|
1 | controlOut["ctrl_map_name"].setName("ctrl_value_name"); |
| 41 |
4/8✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
|
1 | controlOut["ctrl_map_name"].setValues(std::vector<double>(5, 3.1415)); |
| 42 | 1 | return; | |
| 43 | } | ||
| 44 | |||
| 45 | ✗ | void DummySotExternalInterface::setSecondOrderIntegration(void) { | |
| 46 | ✗ | second_integration_ = true; | |
| 47 | ✗ | return; | |
| 48 | } | ||
| 49 | |||
| 50 | ✗ | void DummySotExternalInterface::setNoIntegration(void) { | |
| 51 | ✗ | second_integration_ = false; | |
| 52 | ✗ | return; | |
| 53 | } | ||
| 54 | |||
| 55 | extern "C" { | ||
| 56 | 10 | dynamicgraph::sot::AbstractSotExternalInterface *createSotExternalInterface() { | |
| 57 | 10 | return new DummySotExternalInterface(); | |
| 58 | } | ||
| 59 | } | ||
| 60 | |||
| 61 | extern "C" { | ||
| 62 | 10 | void destroySotExternalInterface( | |
| 63 | dynamicgraph::sot::AbstractSotExternalInterface *p) { | ||
| 64 |
1/2✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
|
10 | delete p; |
| 65 | 10 | } | |
| 66 | } | ||
| 67 |