Skip to content

Commit 1869916

Browse files
authored
Merge pull request #248 from 321Aurora/imagetransmission
Add the function of change position
2 parents c5367f9 + c1d4a8f commit 1869916

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

rm_common/include/rm_common/decision/command_sender.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,12 @@ class JointPositionBinaryCommandSender : public CommandSenderBase<std_msgs::Floa
652652
msg_.data = off_pos_;
653653
state = false;
654654
}
655+
void changePosition(double scale)
656+
{
657+
current_position_ = msg_.data;
658+
change_position_ = current_position_ + scale * per_change_position_;
659+
msg_.data = change_position_;
660+
}
655661
bool getState() const
656662
{
657663
return state;
@@ -664,7 +670,7 @@ class JointPositionBinaryCommandSender : public CommandSenderBase<std_msgs::Floa
664670

665671
private:
666672
bool state{};
667-
double on_pos_{}, off_pos_{};
673+
double on_pos_{}, off_pos_{}, current_position_{}, change_position_{}, per_change_position_{ 0.05 };
668674
};
669675

670676
class CardCommandSender : public CommandSenderBase<std_msgs::Float64>

0 commit comments

Comments
 (0)