ros2_interfaces_rolling/ur_msgs/srv/
set_force_mode.rs

1use serde::{Deserialize, Serialize};
2
3
4#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5pub struct SetForceModeRequest {
6    pub task_frame: crate::geometry_msgs::msg::PoseStamped,
7    pub selection_vector_x: bool, // default: 0
8    pub selection_vector_y: bool, // default: 0
9    pub selection_vector_z: bool, // default: 0
10    pub selection_vector_rx: bool, // default: 0
11    pub selection_vector_ry: bool, // default: 0
12    pub selection_vector_rz: bool, // default: 0
13    pub wrench: crate::geometry_msgs::msg::Wrench,
14    #[serde(rename = "type")]    pub type_: u8, // default: 2
15    pub speed_limits: crate::geometry_msgs::msg::Twist,
16    pub deviation_limits: [f32; 6], // default: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
17    pub damping_factor: f32, // default: 0.025
18    pub gain_scaling: f32, // default: 0.5
19}
20
21impl SetForceModeRequest {
22    pub const TCP_TO_ORIGIN: u8 = 1;
23    pub const NO_TRANSFORM: u8 = 2;
24    pub const TCP_VELOCITY_TO_X_Y: u8 = 3;
25}
26
27impl Default for SetForceModeRequest {
28    fn default() -> Self {
29        SetForceModeRequest {
30            task_frame: crate::geometry_msgs::msg::PoseStamped::default(),
31            selection_vector_x: false,
32            selection_vector_y: false,
33            selection_vector_z: false,
34            selection_vector_rx: false,
35            selection_vector_ry: false,
36            selection_vector_rz: false,
37            wrench: crate::geometry_msgs::msg::Wrench::default(),
38            type_: 2,
39            speed_limits: crate::geometry_msgs::msg::Twist::default(),
40            deviation_limits: [0.01, 0.01, 0.01, 0.01, 0.01, 0.01],
41            damping_factor: 0.025,
42            gain_scaling: 0.5,
43        }
44    }
45}
46
47impl ros2_client::Message for SetForceModeRequest {}
48
49
50
51#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
52pub struct SetForceModeResponse {
53    pub success: bool,
54}
55
56impl Default for SetForceModeResponse {
57    fn default() -> Self {
58        SetForceModeResponse {
59            success: false,
60        }
61    }
62}
63
64impl ros2_client::Message for SetForceModeResponse {}
65
66
67pub struct SetForceMode;
68impl ros2_client::Service for SetForceMode {
69    type Request = SetForceModeRequest;
70    type Response = SetForceModeResponse;
71
72    fn request_type_name(&self) -> &str { "SetForceModeRequest" }
73    fn response_type_name(&self) -> &str { "SetForceModeResponse" }
74}