rs_opw_kinematics/
parameters_robots.rs

1//! Hardcoded OPW parameters for a few robots
2
3pub mod opw_kinematics {
4    use crate::parameters::opw_kinematics::Parameters;
5    use std::f64::consts::PI;
6
7    #[allow(dead_code)]
8    impl Parameters {
9        // Provides default values
10        pub fn new() -> Self {
11            Parameters {
12                a1: 0.0,
13                a2: 0.0,
14                b: 0.0,
15                c1: 0.0,
16                c2: 0.0,
17                c3: 0.0,
18                c4: 0.0,
19                offsets: [0.0; 6],
20                sign_corrections: [1; 6],
21                dof: 6,
22            }
23        }
24
25        pub fn igus_rebel() -> Self {
26            Parameters {
27                a1: 0.149,
28                a2: -0.119,
29                b: 0.,
30                c1: 0.1,
31                c2: 0.2384,
32                c3: 0.17,
33                c4: 0.1208,
34                offsets: [0.0; 6],
35                sign_corrections: [-1, 1, 1, 1, 1, 1],
36                dof: 6,
37            }
38        }
39
40        pub fn irb2400_10() -> Self {
41            Parameters {
42                a1: 0.100,
43                a2: -0.135,
44                b: 0.000,
45                c1: 0.615,
46                c2: 0.705,
47                c3: 0.755,
48                c4: 0.085,
49                offsets: [0.0, 0.0, -PI / 2.0, 0.0, 0.0, 0.0],
50                ..Self::new()
51            }
52        }
53
54        // See https://www.staubli.com/content/dam/robotics/products/robots/tx2/TX2-140-160-datasheet-EN.pdf.
55        // These three Staubli robots have spherical wrist and mostly identical plan, with only
56        // two parameters being different. This function does not create usable parameters alone.
57        fn staubli_tx2() -> Self {
58            Parameters {
59                a1: 0.150,
60                a2: 0.000,
61                b: 0.000, // axis aligned
62                c1: 0.550,
63                // c2: model specific
64                // c3: model specific
65                c4: 0.110,
66                offsets: [0.0; 6],
67                ..Self::new()
68            }
69        }
70        pub fn staubli_tx2_140() -> Self {
71            Parameters {
72                c2: 0.625,
73                c3: 0.625,
74                ..Self::staubli_tx2()
75            }
76        }
77
78        pub fn staubli_tx2_160() -> Self {
79            Parameters {
80                c2: 0.825,
81                c3: 0.625,
82                ..Self::staubli_tx2()
83            }
84        }
85
86        pub fn staubli_tx2_160l() -> Self {
87            Parameters {
88                c2: 0.825,
89                c3: 0.925,
90                ..Self::staubli_tx2()
91            }
92        }
93
94        pub fn fanuc_r2000ib_200r() -> Self {
95            Parameters {
96                a1: 0.720,
97                a2: -0.225,
98                b: 0.000,
99                c1: 0.600,
100                c2: 1.075,
101                c3: 1.280,
102                c4: 0.235,
103                offsets: [0.0, 0.0, -PI / 2.0, 0.0, 0.0, 0.0],
104                ..Self::new()
105            }
106        }
107
108        pub fn kuka_kr6_r700_sixx() -> Self {
109            Parameters {
110                a1: 0.025,
111                a2: -0.035,
112                b: 0.000,
113                c1: 0.400,
114                c2: 0.315,
115                c3: 0.365,
116                c4: 0.080,
117                offsets: [0.0, -PI / 2.0, 0.0, 0.0, 0.0, 0.0],
118                sign_corrections: [-1, 1, 1, -1, 1, -1],
119                ..Self::new()
120            }
121        }
122
123        pub fn staubli_tx40() -> Self {
124            Parameters {
125                a1: 0.000,
126                a2: 0.000,
127                b: 0.035,
128                c1: 0.320,
129                c2: 0.225,
130                c3: 0.225,
131                c4: 0.065,
132                offsets: [0.0, 0.0, -PI / 2.0, 0.0, 0.0, 0.0],
133                ..Self::new()
134            }
135        }
136
137        pub fn staubli_rx160() -> Self {
138            Parameters {
139                a1: 0.15,
140                a2: 0.0,
141                b: 0.0,
142                c1: 0.55,
143                c2: 0.825,
144                c3: 0.625,
145                c4: 0.11,
146                ..Self::new()
147            }
148        }
149
150        pub fn irb2600_12_165() -> Self {
151            Parameters {
152                a1: 0.150,
153                a2: -0.115,
154                b: 0.000,
155                c1: 0.445,
156                c2: 0.700,
157                c3: 0.795,
158                c4: 0.085,
159                offsets: [0.0, 0.0, -PI / 2.0, 0.0, 0.0, 0.0],
160                ..Self::new()
161            }
162        }
163
164        pub fn irb4600_60_205() -> Self {
165            Parameters {
166                a1: 0.175,
167                a2: -0.175,
168                b: 0.000,
169                c1: 0.495,
170                c2: 0.900,
171                c3: 0.960,
172                c4: 0.135,
173                offsets: [0.0, 0.0, -PI / 2.0, 0.0, 0.0, 0.0],
174                ..Self::new()
175            }
176        }
177
178        /// Corrected ABB IRB 1600-10/1.45 parameters based on ROS Industrial
179        /// Reference: https://github.com/ros-industrial/abb/blob/noetic-devel/abb_irb1600_support/config/opw_parameters_irb1600_10_145.yaml
180        pub fn abb_1600() -> Self {
181            Parameters {
182                a1: 0.150,  // Distance from base to J1 axis
183                a2: 0.0,    // Distance from J1 to J2 axis (parallel offset)
184                b: 0.0,     // Distance from J2 to J3 axis (perpendicular offset)
185                c1: 0.4865, // Distance from base to J2 axis (height)
186                c2: 0.700,  // Distance from J2 to J3 axis (upper arm length)
187                c3: 0.600,  // Distance from J3 to J4 axis (forearm length)
188                c4: 0.065,  // Distance from J4 to J6 axis (wrist length)
189                offsets: [0.0, 0.0, -std::f64::consts::FRAC_PI_2, 0.0, 0.0, 0.0],
190                sign_corrections: [1, 1, 1, 1, 1, 1],
191                dof: 6,
192            }
193        }
194    }
195}