Skip to content

Commit

Permalink
Improved error handling for grasp_object example
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Boneberger committed Oct 20, 2023
1 parent 23b114c commit 52f83c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/grasp_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ fn main() -> FrankaResult<()> {
eprintln!("Object is too large for the current fingers on the gripper.");
std::process::exit(-1);
}
gripper.grasp(args.object_width, 0.1, 60., None, None)?;
if !gripper.grasp(args.object_width, 0.1, 60., None, None)? {
eprintln!("Failed to grasp object.");
std::process::exit(-1);
}
std::thread::sleep(Duration::from_secs(3));
let state = gripper.read_once()?;
if !state.is_grasped {
Expand Down

0 comments on commit 52f83c6

Please sign in to comment.