Skip to content

Commit

Permalink
Check buttons size in joy msg.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmurooka committed Jan 16, 2025
1 parent 8f6d6cf commit 317bb74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/RetargetingManagerSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void RetargetingManagerSet::updateEnablement()
{
const sensor_msgs::Joy & leftHandJoyMsg = ctl().datastore().get<sensor_msgs::Joy>("HRC::ViveRos::LeftHandJoyMsg");

if(leftHandJoyMsg.buttons[0])
if(leftHandJoyMsg.buttons.size() > 0 && leftHandJoyMsg.buttons[0])
{
disableFlag = true;
}
Expand All @@ -290,7 +290,7 @@ void RetargetingManagerSet::updateEnablement()
{
const sensor_msgs::Joy & rightHandJoyMsg = ctl().datastore().get<sensor_msgs::Joy>("HRC::ViveRos::RightHandJoyMsg");

if(rightHandJoyMsg.buttons[0])
if(rightHandJoyMsg.buttons.size() > 0 && rightHandJoyMsg.buttons[0])
{
enableFlag = true;
}
Expand Down

0 comments on commit 317bb74

Please sign in to comment.