Skip to content

Commit 1c1c5df

Browse files
PaulDancesunjay
authored andcommitted
Add arc_left and arc_right methods on AsyncTurtle
They call the circular_arc method of ProtocolClient with adapted values. Signed-off-by: Paul Mabileau <[email protected]>
1 parent c4bed54 commit 1c1c5df

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/async_turtle.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,28 @@ impl AsyncTurtle {
101101
time::delay_for(time::Duration::from_millis((secs * 1000.0) as u64)).await
102102
}
103103

104+
pub async fn arc_left(&mut self, radius: Distance, extent: Angle) {
105+
self.client
106+
.circular_arc(
107+
self.id,
108+
radius,
109+
self.angle_unit.to_radians(extent),
110+
RotationDirection::Counterclockwise,
111+
)
112+
.await
113+
}
114+
115+
pub async fn arc_right(&mut self, radius: Distance, extent: Angle) {
116+
self.client
117+
.circular_arc(
118+
self.id,
119+
radius,
120+
self.angle_unit.to_radians(extent),
121+
RotationDirection::Clockwise,
122+
)
123+
.await
124+
}
125+
104126
pub fn into_sync(self) -> Turtle {
105127
self.into()
106128
}

0 commit comments

Comments
 (0)