pub struct GripperCommand {
pub act: bool,
pub gto: bool,
pub atr: bool,
pub ard: bool,
pub pos_req: u8,
pub speed: u8,
pub force: u8,
}Expand description
Robot Output/ Functionalities
Write to registers starting at 1000, 6 byte of data.
specified the command parameter e.g. request position, speed, force …
§Reset
To reset the gripper send a command with act = false.
§Activating the gripper
To activate the gripper, send a command with act = true.
act need to remain true in all following command, otherwise the gripper will reset.
Fields§
§act: boolFirst action to be made prior to any other actions, rACT bit will activate the gripper.
Clear the rACT bit to reset the gripper and clear any fault status
§Warning
when setting act = true(rACT == 1), the gripper will begin movement to complete its activation feature.
§Info
Power loss will set rACT == 1; the rACT bit must be clear act = false(rACT = 0),
then set again to allow operation of the gripper
§Caution
The rACT bit must stay on (act = true) afterward for any other action to be performed.
gto: boolThe “Go To” action moves the gripper fingers to the requested position using the configuration defined by the other register,
gto(rGTO) will engage motion while byte 3,4,5 will determine aimed position, force, and speed.
The only motions performed without gto(rGTO) bit are activation and automation release routines.
atr: boolAutomatic Release routine action slowly opens the gripper fingers until all motion axes reach their mechanical limits
After all motion are completed, the gripper sends a fault signal and needed to be reinitalized before any other motion is performed.
The atr(rATR) bit overrides all other commands excluding the activation bit act(rACT).
ard: boolAuto-release direction.
When auto-releasing, ard(rARD) commands the direction of the movement. The ard(rARD) bit should be set prior to
or at the same time as the atr(rATR) bit. as the motion direction is set when the auto-release is initated.
pos_req: u8This register is used to set the target position for the gripper’s fingers.
The position 0x00 and 0xFF correspond respectively to the fully opened and fully closed mechanical stops.
For detail finger trajectory, please refer to the Specifications section of repective manual.
0x00- Open position0xFF- Close position
§Info
The activation will allow the gripper to adjust to any fingertips.
No matter what is the size and/or shape of the fingertips,
0 will always be fully opened and 255 fully closed,
with a quasi-linear relationship between the two values.
speed: u8This register is used to set the gripper closing and opening speed in real time, however, setting a speed will not initiate a motion.
0x00- Minimum speed0xFF- Maximum speed
force: u8The force setting defines the final gripper force for the gripper. The force will fix the maximum current sent to the motor. If the current limit is exceeded, the fingers stop and trigger an object detection notification. Please refer to the “Picking Features” section of respective manual.
0x00- Minimum force0xFF- Maximum force
Implementations§
Source§impl GripperCommand
impl GripperCommand
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new default gripper command.
Examples found in repository?
4async fn main() -> Result<(), RobotiqError> {
5 // The serial port path
6 let path = "COM17";
7
8 // create a connection to serial RS485 modbus
9 let mut gripper = RobotiqGripper::from_path(path)?;
10
11 // Reset and Activation of Gripper
12 //
13 // reset gripper, recommended
14 gripper.reset().await?;
15 // activate the gripper, it will try to open and close.
16 gripper.activate().await?.await_activate().await?;
17 println!("finished activation.");
18 std::thread::sleep(std::time::Duration::from_millis(1000));
19
20 // Basic Gripper Command
21 //
22 // set gripper with position, speed and force
23 gripper.go_to(0x08, 0x00, 0x00).await?;
24 // the result of the setting command, return whether or not it have clamp an object
25 let obj_detect_status = gripper.await_go_to().await?;
26 println!("Object Detect Status : {:?}", obj_detect_status);
27 std::thread::sleep(std::time::Duration::from_millis(1000));
28
29 // Chained command
30 //
31 // chained command with builder pattern
32 let obj_detect_status = gripper.go_to(0xFF, 0xFF, 0xFF).await?.await_go_to().await?;
33 println!("Object Detect Status : {:?}", obj_detect_status);
34 std::thread::sleep(std::time::Duration::from_millis(1000));
35
36 // Automatic Release Routine
37 //
38 // set the gripper into motion
39 gripper.go_to(0x08, 0x00, 0x00).await?;
40 std::thread::sleep(std::time::Duration::from_millis(100));
41 gripper.automatic_release(false).await?;
42 // you will need to reset and reactivate the gripper after automatic release routine
43 gripper
44 .reset()
45 .await?
46 .activate()
47 .await?
48 .await_activate()
49 .await?;
50 std::thread::sleep(std::time::Duration::from_millis(1000));
51 gripper.go_to(0x08, 0x00, 0x00).await?;
52 std::thread::sleep(std::time::Duration::from_millis(1000));
53
54 // Gripper Command
55 //
56 // Construct GripperCommand to command gripper
57 //
58 // a null command, all zero, will deactivate and reset the gripper
59 let cmd_null = GripperCommand::new();
60 // command to activate the gripper
61 let cmd_act = GripperCommand::new().act(true);
62 // commands to set the gripper with position requested, speed, and force
63 let cmd_goto_1 = GripperCommand::new()
64 .act(true)
65 .gto(true)
66 .pos_req(0x08)
67 .speed(0x00)
68 .force(0x00);
69 let cmd_goto_2 = GripperCommand::new()
70 .act(true)
71 .gto(true)
72 .pos_req(0xFF)
73 .speed(0xFF)
74 .force(0xFF);
75 // command to perform automatic release routine
76 let cmd_atr = GripperCommand::new().act(true).atr(true).ard(true);
77
78 //
79 //
80 gripper.write_async(cmd_null).await?;
81 gripper.write_async(cmd_act).await?;
82 while gripper.read_async().await?.sta != ActivationStatus::Completed {
83 std::thread::sleep(std::time::Duration::from_millis(100));
84 }
85 std::thread::sleep(std::time::Duration::from_millis(1000));
86
87 //
88 //
89 gripper.write_async(cmd_goto_1).await?;
90 while gripper.read_async().await?.obj == ObjDetectStatus::InMotion {
91 std::thread::sleep(std::time::Duration::from_millis(100));
92 }
93 std::thread::sleep(std::time::Duration::from_millis(1000));
94
95 //
96 //
97 gripper.write_async(cmd_goto_2).await?;
98 std::thread::sleep(std::time::Duration::from_millis(100));
99 gripper.write_async(cmd_atr).await?;
100 while gripper.read_async().await?.fault != GripperFault::AutomaticReleaseCompleted {
101 std::thread::sleep(std::time::Duration::from_millis(100));
102 }
103 std::thread::sleep(std::time::Duration::from_millis(1000));
104
105 gripper
106 .reset()
107 .await?
108 .activate()
109 .await?
110 .await_activate()
111 .await?
112 .go_to(0x00, 0xFF, 0xFF)
113 .await?
114 .await_go_to()
115 .await?;
116
117 Ok(())
118}Sourcepub fn act(self, b: bool) -> Self
pub fn act(self, b: bool) -> Self
First action to be made prior to any other actions, rACT bit will activate the gripper.
Clear the rACT bit to reset the gripper and clear any fault status
§Warning
when setting act = true(rACT == 1), the gripper will begin movement to complete its activation feature.
§Info
Power loss will set rACT == 1; the rACT bit must be clear act = false(rACT = 0),
then set again to allow operation of the gripper
§Caution
The rACT bit must stay on (act = true) afterward for any other action to be performed.
Examples found in repository?
4async fn main() -> Result<(), RobotiqError> {
5 // The serial port path
6 let path = "COM17";
7
8 // create a connection to serial RS485 modbus
9 let mut gripper = RobotiqGripper::from_path(path)?;
10
11 // Reset and Activation of Gripper
12 //
13 // reset gripper, recommended
14 gripper.reset().await?;
15 // activate the gripper, it will try to open and close.
16 gripper.activate().await?.await_activate().await?;
17 println!("finished activation.");
18 std::thread::sleep(std::time::Duration::from_millis(1000));
19
20 // Basic Gripper Command
21 //
22 // set gripper with position, speed and force
23 gripper.go_to(0x08, 0x00, 0x00).await?;
24 // the result of the setting command, return whether or not it have clamp an object
25 let obj_detect_status = gripper.await_go_to().await?;
26 println!("Object Detect Status : {:?}", obj_detect_status);
27 std::thread::sleep(std::time::Duration::from_millis(1000));
28
29 // Chained command
30 //
31 // chained command with builder pattern
32 let obj_detect_status = gripper.go_to(0xFF, 0xFF, 0xFF).await?.await_go_to().await?;
33 println!("Object Detect Status : {:?}", obj_detect_status);
34 std::thread::sleep(std::time::Duration::from_millis(1000));
35
36 // Automatic Release Routine
37 //
38 // set the gripper into motion
39 gripper.go_to(0x08, 0x00, 0x00).await?;
40 std::thread::sleep(std::time::Duration::from_millis(100));
41 gripper.automatic_release(false).await?;
42 // you will need to reset and reactivate the gripper after automatic release routine
43 gripper
44 .reset()
45 .await?
46 .activate()
47 .await?
48 .await_activate()
49 .await?;
50 std::thread::sleep(std::time::Duration::from_millis(1000));
51 gripper.go_to(0x08, 0x00, 0x00).await?;
52 std::thread::sleep(std::time::Duration::from_millis(1000));
53
54 // Gripper Command
55 //
56 // Construct GripperCommand to command gripper
57 //
58 // a null command, all zero, will deactivate and reset the gripper
59 let cmd_null = GripperCommand::new();
60 // command to activate the gripper
61 let cmd_act = GripperCommand::new().act(true);
62 // commands to set the gripper with position requested, speed, and force
63 let cmd_goto_1 = GripperCommand::new()
64 .act(true)
65 .gto(true)
66 .pos_req(0x08)
67 .speed(0x00)
68 .force(0x00);
69 let cmd_goto_2 = GripperCommand::new()
70 .act(true)
71 .gto(true)
72 .pos_req(0xFF)
73 .speed(0xFF)
74 .force(0xFF);
75 // command to perform automatic release routine
76 let cmd_atr = GripperCommand::new().act(true).atr(true).ard(true);
77
78 //
79 //
80 gripper.write_async(cmd_null).await?;
81 gripper.write_async(cmd_act).await?;
82 while gripper.read_async().await?.sta != ActivationStatus::Completed {
83 std::thread::sleep(std::time::Duration::from_millis(100));
84 }
85 std::thread::sleep(std::time::Duration::from_millis(1000));
86
87 //
88 //
89 gripper.write_async(cmd_goto_1).await?;
90 while gripper.read_async().await?.obj == ObjDetectStatus::InMotion {
91 std::thread::sleep(std::time::Duration::from_millis(100));
92 }
93 std::thread::sleep(std::time::Duration::from_millis(1000));
94
95 //
96 //
97 gripper.write_async(cmd_goto_2).await?;
98 std::thread::sleep(std::time::Duration::from_millis(100));
99 gripper.write_async(cmd_atr).await?;
100 while gripper.read_async().await?.fault != GripperFault::AutomaticReleaseCompleted {
101 std::thread::sleep(std::time::Duration::from_millis(100));
102 }
103 std::thread::sleep(std::time::Duration::from_millis(1000));
104
105 gripper
106 .reset()
107 .await?
108 .activate()
109 .await?
110 .await_activate()
111 .await?
112 .go_to(0x00, 0xFF, 0xFF)
113 .await?
114 .await_go_to()
115 .await?;
116
117 Ok(())
118}Sourcepub fn gto(self, b: bool) -> Self
pub fn gto(self, b: bool) -> Self
The “Go To” action moves the gripper fingers to the requested position using the configuration defined by the other register,
gto(rGTO) will engage motion while byte 3,4,5 will determine aimed position, force, and speed.
The only motions performed without gto(rGTO) bit are activation and automation release routines.
Examples found in repository?
4async fn main() -> Result<(), RobotiqError> {
5 // The serial port path
6 let path = "COM17";
7
8 // create a connection to serial RS485 modbus
9 let mut gripper = RobotiqGripper::from_path(path)?;
10
11 // Reset and Activation of Gripper
12 //
13 // reset gripper, recommended
14 gripper.reset().await?;
15 // activate the gripper, it will try to open and close.
16 gripper.activate().await?.await_activate().await?;
17 println!("finished activation.");
18 std::thread::sleep(std::time::Duration::from_millis(1000));
19
20 // Basic Gripper Command
21 //
22 // set gripper with position, speed and force
23 gripper.go_to(0x08, 0x00, 0x00).await?;
24 // the result of the setting command, return whether or not it have clamp an object
25 let obj_detect_status = gripper.await_go_to().await?;
26 println!("Object Detect Status : {:?}", obj_detect_status);
27 std::thread::sleep(std::time::Duration::from_millis(1000));
28
29 // Chained command
30 //
31 // chained command with builder pattern
32 let obj_detect_status = gripper.go_to(0xFF, 0xFF, 0xFF).await?.await_go_to().await?;
33 println!("Object Detect Status : {:?}", obj_detect_status);
34 std::thread::sleep(std::time::Duration::from_millis(1000));
35
36 // Automatic Release Routine
37 //
38 // set the gripper into motion
39 gripper.go_to(0x08, 0x00, 0x00).await?;
40 std::thread::sleep(std::time::Duration::from_millis(100));
41 gripper.automatic_release(false).await?;
42 // you will need to reset and reactivate the gripper after automatic release routine
43 gripper
44 .reset()
45 .await?
46 .activate()
47 .await?
48 .await_activate()
49 .await?;
50 std::thread::sleep(std::time::Duration::from_millis(1000));
51 gripper.go_to(0x08, 0x00, 0x00).await?;
52 std::thread::sleep(std::time::Duration::from_millis(1000));
53
54 // Gripper Command
55 //
56 // Construct GripperCommand to command gripper
57 //
58 // a null command, all zero, will deactivate and reset the gripper
59 let cmd_null = GripperCommand::new();
60 // command to activate the gripper
61 let cmd_act = GripperCommand::new().act(true);
62 // commands to set the gripper with position requested, speed, and force
63 let cmd_goto_1 = GripperCommand::new()
64 .act(true)
65 .gto(true)
66 .pos_req(0x08)
67 .speed(0x00)
68 .force(0x00);
69 let cmd_goto_2 = GripperCommand::new()
70 .act(true)
71 .gto(true)
72 .pos_req(0xFF)
73 .speed(0xFF)
74 .force(0xFF);
75 // command to perform automatic release routine
76 let cmd_atr = GripperCommand::new().act(true).atr(true).ard(true);
77
78 //
79 //
80 gripper.write_async(cmd_null).await?;
81 gripper.write_async(cmd_act).await?;
82 while gripper.read_async().await?.sta != ActivationStatus::Completed {
83 std::thread::sleep(std::time::Duration::from_millis(100));
84 }
85 std::thread::sleep(std::time::Duration::from_millis(1000));
86
87 //
88 //
89 gripper.write_async(cmd_goto_1).await?;
90 while gripper.read_async().await?.obj == ObjDetectStatus::InMotion {
91 std::thread::sleep(std::time::Duration::from_millis(100));
92 }
93 std::thread::sleep(std::time::Duration::from_millis(1000));
94
95 //
96 //
97 gripper.write_async(cmd_goto_2).await?;
98 std::thread::sleep(std::time::Duration::from_millis(100));
99 gripper.write_async(cmd_atr).await?;
100 while gripper.read_async().await?.fault != GripperFault::AutomaticReleaseCompleted {
101 std::thread::sleep(std::time::Duration::from_millis(100));
102 }
103 std::thread::sleep(std::time::Duration::from_millis(1000));
104
105 gripper
106 .reset()
107 .await?
108 .activate()
109 .await?
110 .await_activate()
111 .await?
112 .go_to(0x00, 0xFF, 0xFF)
113 .await?
114 .await_go_to()
115 .await?;
116
117 Ok(())
118}Sourcepub fn atr(self, b: bool) -> Self
pub fn atr(self, b: bool) -> Self
Automatic Release routine action slowly opens the gripper fingers until all motion axes reach their mechanical limits
After all motion are completed, the gripper sends a fault signal and needed to be reinitalized before any other motion is performed.
The atr(rATR) bit overrides all other commands excluding the activation bit act(rACT).
Examples found in repository?
4async fn main() -> Result<(), RobotiqError> {
5 // The serial port path
6 let path = "COM17";
7
8 // create a connection to serial RS485 modbus
9 let mut gripper = RobotiqGripper::from_path(path)?;
10
11 // Reset and Activation of Gripper
12 //
13 // reset gripper, recommended
14 gripper.reset().await?;
15 // activate the gripper, it will try to open and close.
16 gripper.activate().await?.await_activate().await?;
17 println!("finished activation.");
18 std::thread::sleep(std::time::Duration::from_millis(1000));
19
20 // Basic Gripper Command
21 //
22 // set gripper with position, speed and force
23 gripper.go_to(0x08, 0x00, 0x00).await?;
24 // the result of the setting command, return whether or not it have clamp an object
25 let obj_detect_status = gripper.await_go_to().await?;
26 println!("Object Detect Status : {:?}", obj_detect_status);
27 std::thread::sleep(std::time::Duration::from_millis(1000));
28
29 // Chained command
30 //
31 // chained command with builder pattern
32 let obj_detect_status = gripper.go_to(0xFF, 0xFF, 0xFF).await?.await_go_to().await?;
33 println!("Object Detect Status : {:?}", obj_detect_status);
34 std::thread::sleep(std::time::Duration::from_millis(1000));
35
36 // Automatic Release Routine
37 //
38 // set the gripper into motion
39 gripper.go_to(0x08, 0x00, 0x00).await?;
40 std::thread::sleep(std::time::Duration::from_millis(100));
41 gripper.automatic_release(false).await?;
42 // you will need to reset and reactivate the gripper after automatic release routine
43 gripper
44 .reset()
45 .await?
46 .activate()
47 .await?
48 .await_activate()
49 .await?;
50 std::thread::sleep(std::time::Duration::from_millis(1000));
51 gripper.go_to(0x08, 0x00, 0x00).await?;
52 std::thread::sleep(std::time::Duration::from_millis(1000));
53
54 // Gripper Command
55 //
56 // Construct GripperCommand to command gripper
57 //
58 // a null command, all zero, will deactivate and reset the gripper
59 let cmd_null = GripperCommand::new();
60 // command to activate the gripper
61 let cmd_act = GripperCommand::new().act(true);
62 // commands to set the gripper with position requested, speed, and force
63 let cmd_goto_1 = GripperCommand::new()
64 .act(true)
65 .gto(true)
66 .pos_req(0x08)
67 .speed(0x00)
68 .force(0x00);
69 let cmd_goto_2 = GripperCommand::new()
70 .act(true)
71 .gto(true)
72 .pos_req(0xFF)
73 .speed(0xFF)
74 .force(0xFF);
75 // command to perform automatic release routine
76 let cmd_atr = GripperCommand::new().act(true).atr(true).ard(true);
77
78 //
79 //
80 gripper.write_async(cmd_null).await?;
81 gripper.write_async(cmd_act).await?;
82 while gripper.read_async().await?.sta != ActivationStatus::Completed {
83 std::thread::sleep(std::time::Duration::from_millis(100));
84 }
85 std::thread::sleep(std::time::Duration::from_millis(1000));
86
87 //
88 //
89 gripper.write_async(cmd_goto_1).await?;
90 while gripper.read_async().await?.obj == ObjDetectStatus::InMotion {
91 std::thread::sleep(std::time::Duration::from_millis(100));
92 }
93 std::thread::sleep(std::time::Duration::from_millis(1000));
94
95 //
96 //
97 gripper.write_async(cmd_goto_2).await?;
98 std::thread::sleep(std::time::Duration::from_millis(100));
99 gripper.write_async(cmd_atr).await?;
100 while gripper.read_async().await?.fault != GripperFault::AutomaticReleaseCompleted {
101 std::thread::sleep(std::time::Duration::from_millis(100));
102 }
103 std::thread::sleep(std::time::Duration::from_millis(1000));
104
105 gripper
106 .reset()
107 .await?
108 .activate()
109 .await?
110 .await_activate()
111 .await?
112 .go_to(0x00, 0xFF, 0xFF)
113 .await?
114 .await_go_to()
115 .await?;
116
117 Ok(())
118}Sourcepub fn ard(self, b: bool) -> Self
pub fn ard(self, b: bool) -> Self
Auto-release direction.
When auto-releasing, ard(rARD) commands the direction of the movement. The ard(rARD) bit should be set prior to
or at the same time as the atr(rATR) bit. as the motion direction is set when the auto-release is initated.
Examples found in repository?
4async fn main() -> Result<(), RobotiqError> {
5 // The serial port path
6 let path = "COM17";
7
8 // create a connection to serial RS485 modbus
9 let mut gripper = RobotiqGripper::from_path(path)?;
10
11 // Reset and Activation of Gripper
12 //
13 // reset gripper, recommended
14 gripper.reset().await?;
15 // activate the gripper, it will try to open and close.
16 gripper.activate().await?.await_activate().await?;
17 println!("finished activation.");
18 std::thread::sleep(std::time::Duration::from_millis(1000));
19
20 // Basic Gripper Command
21 //
22 // set gripper with position, speed and force
23 gripper.go_to(0x08, 0x00, 0x00).await?;
24 // the result of the setting command, return whether or not it have clamp an object
25 let obj_detect_status = gripper.await_go_to().await?;
26 println!("Object Detect Status : {:?}", obj_detect_status);
27 std::thread::sleep(std::time::Duration::from_millis(1000));
28
29 // Chained command
30 //
31 // chained command with builder pattern
32 let obj_detect_status = gripper.go_to(0xFF, 0xFF, 0xFF).await?.await_go_to().await?;
33 println!("Object Detect Status : {:?}", obj_detect_status);
34 std::thread::sleep(std::time::Duration::from_millis(1000));
35
36 // Automatic Release Routine
37 //
38 // set the gripper into motion
39 gripper.go_to(0x08, 0x00, 0x00).await?;
40 std::thread::sleep(std::time::Duration::from_millis(100));
41 gripper.automatic_release(false).await?;
42 // you will need to reset and reactivate the gripper after automatic release routine
43 gripper
44 .reset()
45 .await?
46 .activate()
47 .await?
48 .await_activate()
49 .await?;
50 std::thread::sleep(std::time::Duration::from_millis(1000));
51 gripper.go_to(0x08, 0x00, 0x00).await?;
52 std::thread::sleep(std::time::Duration::from_millis(1000));
53
54 // Gripper Command
55 //
56 // Construct GripperCommand to command gripper
57 //
58 // a null command, all zero, will deactivate and reset the gripper
59 let cmd_null = GripperCommand::new();
60 // command to activate the gripper
61 let cmd_act = GripperCommand::new().act(true);
62 // commands to set the gripper with position requested, speed, and force
63 let cmd_goto_1 = GripperCommand::new()
64 .act(true)
65 .gto(true)
66 .pos_req(0x08)
67 .speed(0x00)
68 .force(0x00);
69 let cmd_goto_2 = GripperCommand::new()
70 .act(true)
71 .gto(true)
72 .pos_req(0xFF)
73 .speed(0xFF)
74 .force(0xFF);
75 // command to perform automatic release routine
76 let cmd_atr = GripperCommand::new().act(true).atr(true).ard(true);
77
78 //
79 //
80 gripper.write_async(cmd_null).await?;
81 gripper.write_async(cmd_act).await?;
82 while gripper.read_async().await?.sta != ActivationStatus::Completed {
83 std::thread::sleep(std::time::Duration::from_millis(100));
84 }
85 std::thread::sleep(std::time::Duration::from_millis(1000));
86
87 //
88 //
89 gripper.write_async(cmd_goto_1).await?;
90 while gripper.read_async().await?.obj == ObjDetectStatus::InMotion {
91 std::thread::sleep(std::time::Duration::from_millis(100));
92 }
93 std::thread::sleep(std::time::Duration::from_millis(1000));
94
95 //
96 //
97 gripper.write_async(cmd_goto_2).await?;
98 std::thread::sleep(std::time::Duration::from_millis(100));
99 gripper.write_async(cmd_atr).await?;
100 while gripper.read_async().await?.fault != GripperFault::AutomaticReleaseCompleted {
101 std::thread::sleep(std::time::Duration::from_millis(100));
102 }
103 std::thread::sleep(std::time::Duration::from_millis(1000));
104
105 gripper
106 .reset()
107 .await?
108 .activate()
109 .await?
110 .await_activate()
111 .await?
112 .go_to(0x00, 0xFF, 0xFF)
113 .await?
114 .await_go_to()
115 .await?;
116
117 Ok(())
118}Sourcepub fn pos_req(self, b: u8) -> Self
pub fn pos_req(self, b: u8) -> Self
This register is used to set the target position for the gripper’s fingers.
The position 0x00 and 0xFF correspond respectively to the fully opened and fully closed mechanical stops.
For detail finger trajectory, please refer to the Specifications section of repective manual.
0x00- Open position0xFF- Close position
§Info
The activation will allow the gripper to adjust to any fingertips.
No matter what is the size and/or shape of the fingertips,
0 will always be fully opened and 255 fully closed,
with a quasi-linear relationship between the two values.
Examples found in repository?
4async fn main() -> Result<(), RobotiqError> {
5 // The serial port path
6 let path = "COM17";
7
8 // create a connection to serial RS485 modbus
9 let mut gripper = RobotiqGripper::from_path(path)?;
10
11 // Reset and Activation of Gripper
12 //
13 // reset gripper, recommended
14 gripper.reset().await?;
15 // activate the gripper, it will try to open and close.
16 gripper.activate().await?.await_activate().await?;
17 println!("finished activation.");
18 std::thread::sleep(std::time::Duration::from_millis(1000));
19
20 // Basic Gripper Command
21 //
22 // set gripper with position, speed and force
23 gripper.go_to(0x08, 0x00, 0x00).await?;
24 // the result of the setting command, return whether or not it have clamp an object
25 let obj_detect_status = gripper.await_go_to().await?;
26 println!("Object Detect Status : {:?}", obj_detect_status);
27 std::thread::sleep(std::time::Duration::from_millis(1000));
28
29 // Chained command
30 //
31 // chained command with builder pattern
32 let obj_detect_status = gripper.go_to(0xFF, 0xFF, 0xFF).await?.await_go_to().await?;
33 println!("Object Detect Status : {:?}", obj_detect_status);
34 std::thread::sleep(std::time::Duration::from_millis(1000));
35
36 // Automatic Release Routine
37 //
38 // set the gripper into motion
39 gripper.go_to(0x08, 0x00, 0x00).await?;
40 std::thread::sleep(std::time::Duration::from_millis(100));
41 gripper.automatic_release(false).await?;
42 // you will need to reset and reactivate the gripper after automatic release routine
43 gripper
44 .reset()
45 .await?
46 .activate()
47 .await?
48 .await_activate()
49 .await?;
50 std::thread::sleep(std::time::Duration::from_millis(1000));
51 gripper.go_to(0x08, 0x00, 0x00).await?;
52 std::thread::sleep(std::time::Duration::from_millis(1000));
53
54 // Gripper Command
55 //
56 // Construct GripperCommand to command gripper
57 //
58 // a null command, all zero, will deactivate and reset the gripper
59 let cmd_null = GripperCommand::new();
60 // command to activate the gripper
61 let cmd_act = GripperCommand::new().act(true);
62 // commands to set the gripper with position requested, speed, and force
63 let cmd_goto_1 = GripperCommand::new()
64 .act(true)
65 .gto(true)
66 .pos_req(0x08)
67 .speed(0x00)
68 .force(0x00);
69 let cmd_goto_2 = GripperCommand::new()
70 .act(true)
71 .gto(true)
72 .pos_req(0xFF)
73 .speed(0xFF)
74 .force(0xFF);
75 // command to perform automatic release routine
76 let cmd_atr = GripperCommand::new().act(true).atr(true).ard(true);
77
78 //
79 //
80 gripper.write_async(cmd_null).await?;
81 gripper.write_async(cmd_act).await?;
82 while gripper.read_async().await?.sta != ActivationStatus::Completed {
83 std::thread::sleep(std::time::Duration::from_millis(100));
84 }
85 std::thread::sleep(std::time::Duration::from_millis(1000));
86
87 //
88 //
89 gripper.write_async(cmd_goto_1).await?;
90 while gripper.read_async().await?.obj == ObjDetectStatus::InMotion {
91 std::thread::sleep(std::time::Duration::from_millis(100));
92 }
93 std::thread::sleep(std::time::Duration::from_millis(1000));
94
95 //
96 //
97 gripper.write_async(cmd_goto_2).await?;
98 std::thread::sleep(std::time::Duration::from_millis(100));
99 gripper.write_async(cmd_atr).await?;
100 while gripper.read_async().await?.fault != GripperFault::AutomaticReleaseCompleted {
101 std::thread::sleep(std::time::Duration::from_millis(100));
102 }
103 std::thread::sleep(std::time::Duration::from_millis(1000));
104
105 gripper
106 .reset()
107 .await?
108 .activate()
109 .await?
110 .await_activate()
111 .await?
112 .go_to(0x00, 0xFF, 0xFF)
113 .await?
114 .await_go_to()
115 .await?;
116
117 Ok(())
118}Sourcepub fn speed(self, b: u8) -> Self
pub fn speed(self, b: u8) -> Self
This register is used to set the gripper closing and opening speed in real time, however, setting a speed will not initiate a motion.
0x00- Minimum speed0xFF- Maximum speed
Examples found in repository?
4async fn main() -> Result<(), RobotiqError> {
5 // The serial port path
6 let path = "COM17";
7
8 // create a connection to serial RS485 modbus
9 let mut gripper = RobotiqGripper::from_path(path)?;
10
11 // Reset and Activation of Gripper
12 //
13 // reset gripper, recommended
14 gripper.reset().await?;
15 // activate the gripper, it will try to open and close.
16 gripper.activate().await?.await_activate().await?;
17 println!("finished activation.");
18 std::thread::sleep(std::time::Duration::from_millis(1000));
19
20 // Basic Gripper Command
21 //
22 // set gripper with position, speed and force
23 gripper.go_to(0x08, 0x00, 0x00).await?;
24 // the result of the setting command, return whether or not it have clamp an object
25 let obj_detect_status = gripper.await_go_to().await?;
26 println!("Object Detect Status : {:?}", obj_detect_status);
27 std::thread::sleep(std::time::Duration::from_millis(1000));
28
29 // Chained command
30 //
31 // chained command with builder pattern
32 let obj_detect_status = gripper.go_to(0xFF, 0xFF, 0xFF).await?.await_go_to().await?;
33 println!("Object Detect Status : {:?}", obj_detect_status);
34 std::thread::sleep(std::time::Duration::from_millis(1000));
35
36 // Automatic Release Routine
37 //
38 // set the gripper into motion
39 gripper.go_to(0x08, 0x00, 0x00).await?;
40 std::thread::sleep(std::time::Duration::from_millis(100));
41 gripper.automatic_release(false).await?;
42 // you will need to reset and reactivate the gripper after automatic release routine
43 gripper
44 .reset()
45 .await?
46 .activate()
47 .await?
48 .await_activate()
49 .await?;
50 std::thread::sleep(std::time::Duration::from_millis(1000));
51 gripper.go_to(0x08, 0x00, 0x00).await?;
52 std::thread::sleep(std::time::Duration::from_millis(1000));
53
54 // Gripper Command
55 //
56 // Construct GripperCommand to command gripper
57 //
58 // a null command, all zero, will deactivate and reset the gripper
59 let cmd_null = GripperCommand::new();
60 // command to activate the gripper
61 let cmd_act = GripperCommand::new().act(true);
62 // commands to set the gripper with position requested, speed, and force
63 let cmd_goto_1 = GripperCommand::new()
64 .act(true)
65 .gto(true)
66 .pos_req(0x08)
67 .speed(0x00)
68 .force(0x00);
69 let cmd_goto_2 = GripperCommand::new()
70 .act(true)
71 .gto(true)
72 .pos_req(0xFF)
73 .speed(0xFF)
74 .force(0xFF);
75 // command to perform automatic release routine
76 let cmd_atr = GripperCommand::new().act(true).atr(true).ard(true);
77
78 //
79 //
80 gripper.write_async(cmd_null).await?;
81 gripper.write_async(cmd_act).await?;
82 while gripper.read_async().await?.sta != ActivationStatus::Completed {
83 std::thread::sleep(std::time::Duration::from_millis(100));
84 }
85 std::thread::sleep(std::time::Duration::from_millis(1000));
86
87 //
88 //
89 gripper.write_async(cmd_goto_1).await?;
90 while gripper.read_async().await?.obj == ObjDetectStatus::InMotion {
91 std::thread::sleep(std::time::Duration::from_millis(100));
92 }
93 std::thread::sleep(std::time::Duration::from_millis(1000));
94
95 //
96 //
97 gripper.write_async(cmd_goto_2).await?;
98 std::thread::sleep(std::time::Duration::from_millis(100));
99 gripper.write_async(cmd_atr).await?;
100 while gripper.read_async().await?.fault != GripperFault::AutomaticReleaseCompleted {
101 std::thread::sleep(std::time::Duration::from_millis(100));
102 }
103 std::thread::sleep(std::time::Duration::from_millis(1000));
104
105 gripper
106 .reset()
107 .await?
108 .activate()
109 .await?
110 .await_activate()
111 .await?
112 .go_to(0x00, 0xFF, 0xFF)
113 .await?
114 .await_go_to()
115 .await?;
116
117 Ok(())
118}Sourcepub fn force(self, b: u8) -> Self
pub fn force(self, b: u8) -> Self
The force setting defines the final gripper force for the gripper. The force will fix the maximum current sent to the motor. If the current limit is exceeded, the fingers stop and trigger an object detection notification. Please refer to the “Picking Features” section of respective manual.
0x00- Minimum force0xFF- Maximum force
Examples found in repository?
4async fn main() -> Result<(), RobotiqError> {
5 // The serial port path
6 let path = "COM17";
7
8 // create a connection to serial RS485 modbus
9 let mut gripper = RobotiqGripper::from_path(path)?;
10
11 // Reset and Activation of Gripper
12 //
13 // reset gripper, recommended
14 gripper.reset().await?;
15 // activate the gripper, it will try to open and close.
16 gripper.activate().await?.await_activate().await?;
17 println!("finished activation.");
18 std::thread::sleep(std::time::Duration::from_millis(1000));
19
20 // Basic Gripper Command
21 //
22 // set gripper with position, speed and force
23 gripper.go_to(0x08, 0x00, 0x00).await?;
24 // the result of the setting command, return whether or not it have clamp an object
25 let obj_detect_status = gripper.await_go_to().await?;
26 println!("Object Detect Status : {:?}", obj_detect_status);
27 std::thread::sleep(std::time::Duration::from_millis(1000));
28
29 // Chained command
30 //
31 // chained command with builder pattern
32 let obj_detect_status = gripper.go_to(0xFF, 0xFF, 0xFF).await?.await_go_to().await?;
33 println!("Object Detect Status : {:?}", obj_detect_status);
34 std::thread::sleep(std::time::Duration::from_millis(1000));
35
36 // Automatic Release Routine
37 //
38 // set the gripper into motion
39 gripper.go_to(0x08, 0x00, 0x00).await?;
40 std::thread::sleep(std::time::Duration::from_millis(100));
41 gripper.automatic_release(false).await?;
42 // you will need to reset and reactivate the gripper after automatic release routine
43 gripper
44 .reset()
45 .await?
46 .activate()
47 .await?
48 .await_activate()
49 .await?;
50 std::thread::sleep(std::time::Duration::from_millis(1000));
51 gripper.go_to(0x08, 0x00, 0x00).await?;
52 std::thread::sleep(std::time::Duration::from_millis(1000));
53
54 // Gripper Command
55 //
56 // Construct GripperCommand to command gripper
57 //
58 // a null command, all zero, will deactivate and reset the gripper
59 let cmd_null = GripperCommand::new();
60 // command to activate the gripper
61 let cmd_act = GripperCommand::new().act(true);
62 // commands to set the gripper with position requested, speed, and force
63 let cmd_goto_1 = GripperCommand::new()
64 .act(true)
65 .gto(true)
66 .pos_req(0x08)
67 .speed(0x00)
68 .force(0x00);
69 let cmd_goto_2 = GripperCommand::new()
70 .act(true)
71 .gto(true)
72 .pos_req(0xFF)
73 .speed(0xFF)
74 .force(0xFF);
75 // command to perform automatic release routine
76 let cmd_atr = GripperCommand::new().act(true).atr(true).ard(true);
77
78 //
79 //
80 gripper.write_async(cmd_null).await?;
81 gripper.write_async(cmd_act).await?;
82 while gripper.read_async().await?.sta != ActivationStatus::Completed {
83 std::thread::sleep(std::time::Duration::from_millis(100));
84 }
85 std::thread::sleep(std::time::Duration::from_millis(1000));
86
87 //
88 //
89 gripper.write_async(cmd_goto_1).await?;
90 while gripper.read_async().await?.obj == ObjDetectStatus::InMotion {
91 std::thread::sleep(std::time::Duration::from_millis(100));
92 }
93 std::thread::sleep(std::time::Duration::from_millis(1000));
94
95 //
96 //
97 gripper.write_async(cmd_goto_2).await?;
98 std::thread::sleep(std::time::Duration::from_millis(100));
99 gripper.write_async(cmd_atr).await?;
100 while gripper.read_async().await?.fault != GripperFault::AutomaticReleaseCompleted {
101 std::thread::sleep(std::time::Duration::from_millis(100));
102 }
103 std::thread::sleep(std::time::Duration::from_millis(1000));
104
105 gripper
106 .reset()
107 .await?
108 .activate()
109 .await?
110 .await_activate()
111 .await?
112 .go_to(0x00, 0xFF, 0xFF)
113 .await?
114 .await_go_to()
115 .await?;
116
117 Ok(())
118}Trait Implementations§
Source§impl Clone for GripperCommand
impl Clone for GripperCommand
Source§fn clone(&self) -> GripperCommand
fn clone(&self) -> GripperCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more