Skip to content

Commit 85ae964

Browse files
committed
Do not accept manual joystick commands in auo mode
Caused the gripper to twitch when picking up cubes because it was recieving conflicting commands from the joystick.
1 parent f5f2573 commit 85ae964

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/rqt_rover_gui/src/rover_gui_plugin.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@ void RoverGUIPlugin::restoreSettings(const qt_gui_cpp::Settings& plugin_settings
249249
// Receives messages from the ROS joystick driver and used them to articulate the gripper and drive the rover.
250250
void RoverGUIPlugin::joyEventHandler(const sensor_msgs::Joy::ConstPtr& joy_msg)
251251
{
252+
// Are we in autonomous mode? If so do not process manual drive and gripper controls.
253+
if ( rover_control_state.count(selected_rover_name) == 2 )
254+
{
255+
return;
256+
}
257+
252258
// Give the array values some helpful names:
253259
int left_stick_x_axis = 0; // Gripper fingers close and open
254260
int left_stick_y_axis = 1; // Gripper wrist up and down
@@ -358,7 +364,7 @@ void RoverGUIPlugin::joyEventHandler(const sensor_msgs::Joy::ConstPtr& joy_msg)
358364

359365

360366
joystick_publisher.publish(joy_msg);
361-
}
367+
}
362368
}
363369

364370
void RoverGUIPlugin::EKFEventHandler(const ros::MessageEvent<const nav_msgs::Odometry> &event)

0 commit comments

Comments
 (0)