Skip to content

Commit 81ee08a

Browse files
authored
Merge pull request #410 from ros-industrial/fix/fake-slave
Fix fake slave accept new goal
2 parents 1f9aaef + 4d44ee2 commit 81ee08a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

canopen_fake_slaves/include/canopen_fake_slaves/cia402_slave.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,14 @@ class CIA402MockSlave : public canopen::BasicSlave
574574

575575
if (old_operation_mode.load() != operation_mode.load())
576576
{
577+
// Clear homing-related/ack bits on mode change so new targets are accepted
578+
clear_status_bit(SW_Operation_mode_specific0);
579+
clear_status_bit(SW_Target_reached);
580+
{
581+
std::scoped_lock<std::mutex> lock(w_mutex);
582+
(*this)[0x6041][0] = status_word;
583+
this->TpdoEvent(1);
584+
}
577585
if (profiled_position_mode.joinable())
578586
{
579587
RCLCPP_INFO(rclcpp::get_logger("cia402_slave"), "Joined profiled_position_mode thread.");

0 commit comments

Comments
 (0)