Skip to content

Commit

Permalink
feat: Allow value 0 for acceleration limit as discussed in #10
Browse files Browse the repository at this point in the history
  • Loading branch information
2b-t committed Jun 29, 2024
1 parent 9880083 commit 3fb228a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/myactuator_rmd/actuator_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ namespace myactuator_rmd {
*
* \param[in] acceleration
* The desired acceleration/deceleration in dps with a resolution of 1 dps/s [100, 60000]
* For continuous motions the acceleration should be set to the value 0, see
* https://github.com/2b-t/myactuator_rmd/issues/10#issuecomment-2195847459
* \param[in] mode
* The mode of the desired acceleration/deceleration to be set
*/
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace myactuator_rmd {

SetAccelerationRequest::SetAccelerationRequest(std::uint32_t const acceleration, AccelerationType const mode)
: SingleMotorRequest{} {
if ((acceleration < 100) || (acceleration > 60000)) {
if ((acceleration != 0) && ((acceleration < 100) || (acceleration > 60000))) {
throw ValueRangeException("Acceleration value '" + std::to_string(acceleration) + "' out of range [100, 60000]");
}
auto const acceleration_type {static_cast<std::uint8_t>(mode)};
Expand Down

0 comments on commit 3fb228a

Please sign in to comment.