File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ fn main() {
5353
5454``` rust
5555use rustypot :: servo :: feetech :: sts3215 :: STS3215Controller ;
56+ use std :: time :: Duration ;
5657
5758fn main () {
5859 let serial_port = serialport :: new (" /dev/ttyUSB0" , 1_000_000 )
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ impl DynamixelProtocolHandler {
3131 ///
3232 /// # Examples
3333 /// ```no_run
34- /// use rustypot::{DynamixelProtocolHandler, device ::mx};
34+ /// use rustypot::{DynamixelProtocolHandler, servo::dynamixel ::mx};
3535 /// use std::time::Duration;
3636 ///
3737 /// let mut serial_port = serialport::new("/dev/ttyACM0", 1_000_000)
@@ -57,7 +57,7 @@ impl DynamixelProtocolHandler {
5757 ///
5858 /// # Examples
5959 /// ```no_run
60- /// use rustypot::{DynamixelProtocolHandler, device ::xl320};
60+ /// use rustypot::{DynamixelProtocolHandler, servo::dynamixel ::xl320};
6161 /// use std::time::Duration;
6262 ///
6363 /// let mut serial_port = serialport::new("/dev/ttyACM0", 1_000_000)
Original file line number Diff line number Diff line change 3838//! ### With the high-level API
3939//! ```no_run
4040//! use rustypot::servo::feetech::sts3215::STS3215Controller;
41+ //! use std::time::Duration;
4142//!
42- //! let serial_port = serialport::new(serialportname, baudrate )
43+ //! let serial_port = serialport::new("/dev/ttyUSB0", 1_000_000 )
4344//! .timeout(Duration::from_millis(1000))
44- //! .open()?;
45+ //! .open()
46+ //! .unwrap();
4547//!
4648//! let mut c = STS3215Controller::new()
4749//! .with_protocol_v1()
4850//! .with_serial_port(serial_port);
4951//!
50- //! let pos = c.read_present_position(&vec![1, 2])? ;
52+ //! let pos = c.read_present_position(&vec![1, 2]).unwrap() ;
5153//! println!("Motors present position: {:?}", pos);
5254//!
53- //! c.write_goal_position(&vec![1, 2], &vec![1000, 2000])? ;
55+ //! c.write_goal_position(&vec![1, 2], &vec![1000, 2000]).unwrap() ;
5456//! ```
5557
5658pub mod servo;
@@ -59,3 +61,5 @@ mod dynamixel_protocol;
5961pub use dynamixel_protocol:: { CommunicationErrorKind , DynamixelProtocolHandler } ;
6062
6163type Result < T > = std:: result:: Result < T , Box < dyn std:: error:: Error > > ;
64+
65+ // TODO: clippy
You can’t perform that action at this time.
0 commit comments