first version of transmissions for mock hardware#15
first version of transmissions for mock hardware#15
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #15 +/- ##
==========================================
- Coverage 47.53% 46.38% -1.15%
==========================================
Files 41 39 -2
Lines 3547 3253 -294
Branches 1930 1749 -181
==========================================
- Hits 1686 1509 -177
+ Misses 459 458 -1
+ Partials 1402 1286 -116
Flags with carried forward coverage won't be shown. Click here to find out more. |
| // used for the Transmission pass through. | ||
| // read: actuator_interface.state_->Transmission->joint_interface.state_ | ||
| // write: joint_interface.command_->Transmission->actuator_interface.command_ | ||
| // And StateInterface(joint_interface.state_) | ||
| struct InterfaceData | ||
| { | ||
| // TODO(Manuel) set initial to NaN and on_init initialize to given value in info or 0.0 | ||
| explicit InterfaceData(const std::string & name) | ||
| : name_(name), | ||
| command_(0.0), // command_(std::numeric_limits<double>::quiet_NaN()), | ||
| state_(0.0), // state_(std::numeric_limits<double>::quiet_NaN()), | ||
| transmission_passthrough_( | ||
| 0.0) // transmission_passthrough_(std::numeric_limits<double>::quiet_NaN()) | ||
| { | ||
| } | ||
|
|
||
| std::string name_; | ||
| double command_; | ||
| double state_; | ||
| // this is the "sink" that will be part of the transmission Joint/Actuator handles | ||
| double transmission_passthrough_; | ||
| }; |
There was a problem hiding this comment.
I am not sure about this structure. but also it looks like something that might be added to .cpp file. Especially, since we have this game with 0.0 and quiet_NaN().
I have to check the implemenation to tell more about it.
There was a problem hiding this comment.
what about the struct? need it in the .hpp since we define the lists with it
|
|
||
| transmission_interface::JointHandle joint_handle( | ||
| joint_info.name, hardware_interface::HW_IF_POSITION, | ||
| &joint_interface->transmission_passthrough_); |
There was a problem hiding this comment.
why do we need transmission pass_though?
There was a problem hiding this comment.
have to check this maybe using directly state_, command_ is fine but i think overriding was a problem
There was a problem hiding this comment.
need it because we would override the handle otherwise (Handle for actuator/joint needs a storage, but we have state and command. We could only give one of the two, so if we call the functions actuator_to_joint or joint_to_actuator we would involunatry override )
| std::for_each( | ||
| actuator_interfaces_.begin(), actuator_interfaces_.end(), | ||
| [](auto & actuator_interface) | ||
| { actuator_interface.transmission_passthrough_ = actuator_interface.state_; }); |
There was a problem hiding this comment.
Ah OK, this is just a storage. Can't we use directly actuator_interface.state_?
mock_hardware/src/generic_system.cpp
Outdated
| [](auto & actuator_interface) | ||
| { actuator_interface.command_ = actuator_interface.transmission_passthrough_; }); | ||
|
|
||
| // simulate motor motion |
There was a problem hiding this comment.
Is this important for something?
There was a problem hiding this comment.
sry what do you exactly mean? i dont understand the question
|
This pull request is in conflict. Could you fix it @mamueluth? |
5b406aa to
687b2a3
Compare
73811dd to
e27e79a
Compare
|
This pull request is in conflict. Could you fix it @mamueluth? |
|
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
|
This pull request is in conflict. Could you fix it @mamueluth? |
|
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
Can be tested with b-robotized-forks/ros2_control_demos#10
TODOS: