Skip to content

Commit

Permalink
quick fix for joystick teleop crash using a new controller type
Browse files Browse the repository at this point in the history
  • Loading branch information
dekent committed Jun 27, 2016
1 parent 67f160e commit 9ff13c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jaco_teleop/src/jaco_joy_teleop.cpp
Expand Up @@ -145,7 +145,7 @@ void jaco_joy_teleop::joy_cback(const sensor_msgs::Joy::ConstPtr& joy)
}

//help menu
if ((controllerType == DIGITAL && joy->axes.at(5) == -1.0) || (controllerType == ANALOG && joy->axes.at(7) == -1.0))
if ((controllerType == DIGITAL && joy->axes.at(5) == -1.0) || (controllerType == ANALOG && joy->axes.size() > 6 && joy->axes.at(7) == -1.0))
{
if (!helpDisplayed)
{
Expand Down Expand Up @@ -183,7 +183,7 @@ void jaco_joy_teleop::joy_cback(const sensor_msgs::Joy::ConstPtr& joy)
}
}
else if ((controllerType == DIGITAL && joy->axes.at(4) == 1.0)
|| (controllerType == ANALOG && joy->axes.at(6) == 1.0))
|| (controllerType == ANALOG && joy->axes.size() > 6 && joy->axes.at(6) == 1.0))
{
if (!helpDisplayed)
{
Expand Down

0 comments on commit 9ff13c7

Please sign in to comment.