Skip to content

Commit

Permalink
allow setting individual RMD accelerations
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Jun 20, 2023
1 parent a89c2ef commit 047f720
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/module_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ Although `get_acceleration()` prints only one acceleration per motor, `set_accel
3. acceleration for speed mode
4. deceleration for speed mode

You can pass `0` to skip parameters, i.e. to keep individual acceleration values unchanged.

## RMD Motor Pair

The RMD motor pair module allows to synchronize two RMD motors.
Expand Down
5 changes: 4 additions & 1 deletion main/modules/rmd_motor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ void RmdMotor::call(const std::string method_name, const std::vector<ConstExpres
} else if (method_name == "set_acceleration") {
Module::expect(arguments, 4, integer, integer, integer, integer);
for (uint8_t i = 0; i < 4; ++i) {
set_acceleration(i, arguments[i]->evaluate_integer());
int acceleration = arguments[i]->evaluate_integer();
if (acceleration > 0) {
set_acceleration(i, acceleration);
}
}
} else if (method_name == "clear_errors") {
Module::expect(arguments, 0);
Expand Down

0 comments on commit 047f720

Please sign in to comment.