Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Release Versions:
- [2.1.1](#211)
- [2.1.0](#210)

## Upcoming changes

- fix(controllers): reset previous joint commands (#211)

## 5.2.1

### May 15th, 2025
Expand Down
2 changes: 1 addition & 1 deletion aica-package.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "modulo"

[build]
type = "ros"
image = "v2.0.2-jazzy"
image = "v2.0.5-jazzy"

[build.dependencies]
"@aica/foss/control-libraries" = "v9.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ class RobotControllerInterface : public ControllerInterface {
*/
CallbackReturn on_activate() override;

/**
* @copydoc modulo_controllers::ControllerInterface::on_deactivate()
* @details Reset the previous joint commands
*/
CallbackReturn on_deactivate() override;

protected:
/**
* @brief Access the joint state object.
Expand Down
8 changes: 8 additions & 0 deletions source/modulo_controllers/src/RobotControllerInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn RobotC
return CallbackReturn::SUCCESS;
}

rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn RobotControllerInterface::on_deactivate() {
if (!control_type_.empty() && control_type_ != hardware_interface::HW_IF_POSITION) {
std::fill(previous_joint_command_values_.begin(), previous_joint_command_values_.end(), 0.0);
}
RCLCPP_DEBUG(get_node()->get_logger(), "Deactivation of RobotControllerInterface successful");
return CallbackReturn::SUCCESS;
}

controller_interface::return_type RobotControllerInterface::read_state_interfaces() {
auto status = ControllerInterface::read_state_interfaces();
if (status != controller_interface::return_type::OK) {
Expand Down