Skip to content

Commit 708b065

Browse files
author
Marco Boneberger
committed
minor improvements to documentation
1 parent 52f83c6 commit 708b065

File tree

5 files changed

+37
-12
lines changed

5 files changed

+37
-12
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ fn main() -> FrankaResult<()> {
117117

118118

119119
## How to get started
120-
As it is a straight port, you may find the
120+
121+
Since libfranka-rs is a port of libfranka, you may find the
121122
[Franka Control Interface Documentation](https://frankaemika.github.io/docs/index.html) helpful.
122123

123124
### With zero Rust knowledge
@@ -138,8 +139,8 @@ hoping that it makes your introduction into the Rust world as smooth as possible
138139
### With zero libfranka knowledge
139140
The [Franka Control Interface Documentation](https://frankaemika.github.io/docs/index.html) also includes a setup guide.
140141
You can skip the installation of libfranka as you will be using libfranka-rs.
141-
Take a look at the [Documentation](https://docs.rs/libfranka-rs) and the examples folder. You should run the
142-
communication_test example to verify that your setup is correct.
142+
Take a look at the [Documentation](https://docs.rs/libfranka-rs) and the [examples](examples) folder. You should run the
143+
[communication_test](examples/communication_test.rs) example to verify that your setup is correct.
143144

144145
### How to use libfranka-rs
145146
If you want to use libfranka-rs in your project, you have to add

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
//! use std::f64::consts::PI;
2626
//! use franka::{JointPositions, MotionFinished, Robot, RobotState, Fr3, FrankaResult};
2727
//! fn main() -> FrankaResult<()> {
28-
//! let mut robot = Fr3::new("robotik-bs.de", None, None)?;
28+
//! let mut robot = Fr3::new("robotik-bs.de", None, None)?;
2929
//! robot.set_default_behavior()?;
3030
//! robot.set_collision_behavior([20.0, 20.0, 18.0, 18.0, 16.0, 14.0, 12.0], [20.0, 20.0, 18.0, 18.0, 16.0, 14.0, 12.0],
3131
//! [20.0, 20.0, 18.0, 18.0, 16.0, 14.0, 12.0], [20.0, 20.0, 18.0, 18.0, 16.0, 14.0, 12.0],
@@ -129,7 +129,7 @@
129129
//! # fn joint_positions() -> JointPositions {
130130
//! # let time = 0.;
131131
//! # let mut out = JointPositions::new([0.;7]);
132-
//!
132+
//! #
133133
//! if time >= 5.0 {
134134
//! return out.motion_finished();
135135
//! }

src/model.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ pub trait RobotModel {
104104
fn new<S: AsRef<Path>>(model_filename: S, libm_filename: Option<&Path>) -> FrankaResult<Self>
105105
where
106106
Self: Sized;
107+
108+
/// Returns the path where model is stored if it exists.
109+
fn get_model_path(&self) -> Option<PathBuf>;
110+
107111
/// Gets the 4x4 pose matrix for the given frame in base frame.
108112
///
109113
/// The pose is represented as a 4x4 matrix in column-major format.
@@ -114,10 +118,6 @@ pub trait RobotModel {
114118
/// * `EE_T_K` - Stiffness frame K in the end effector frame.
115119
/// # Return
116120
/// Vectorized 4x4 pose matrix, column-major.
117-
118-
/// Returns the path where model is stored if it exists.
119-
fn get_model_path(&self) -> Option<PathBuf>;
120-
121121
#[allow(non_snake_case)]
122122
fn pose(
123123
&self,

src/robot/fr3.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@ impl PrivateRobot for Fr3 {
5353
}
5454

5555
impl Fr3 {
56+
/// Establishes a connection with a FR3 robot.
57+
///
58+
/// # Arguments
59+
/// * `franka_address` - IP/hostname of the robot.
60+
/// * `realtime_config` - if set to Enforce, an exception will be thrown if realtime priority
61+
/// cannot be set when required. Setting realtime_config to Ignore disables this behavior. Default is Enforce
62+
/// * `log_size` - sets how many last states should be kept for logging purposes.
63+
/// The log is provided when a [`ControlException`](`crate::exception::FrankaException::ControlException`) is thrown.
64+
/// # Example
65+
/// ```no_run
66+
/// use franka::{FrankaResult, RealtimeConfig, Fr3};
67+
/// fn main() -> FrankaResult<()> {
68+
/// // connects to the robot using real-time scheduling and a default log size of 50.
69+
/// let mut robot = Fr3::new("robotik-bs.de", None, None)?;
70+
/// // connects to the robot without using real-time scheduling and a log size of 1.
71+
/// let mut robot = Fr3::new("robotik-bs.de", RealtimeConfig::Ignore, 1)?;
72+
/// Ok(())
73+
/// }
74+
/// ```
75+
/// # Errors
76+
/// * [`NetworkException`](FrankaException::NetworkException) if the connection is unsuccessful.
77+
/// * [`IncompatibleLibraryVersionError`](FrankaException::IncompatibleLibraryVersionError) if this version of `libfranka-rs` is not supported or
78+
/// if the robot is not a FR3.
5679
pub fn new<RtConfig: Into<Option<RealtimeConfig>>, LogSize: Into<Option<usize>>>(
5780
franka_address: &str,
5881
realtime_config: RtConfig,

src/robot/panda.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use std::mem::size_of;
3838
pub struct Panda(RobotImplGeneric<Self>);
3939

4040
impl Panda {
41-
/// Establishes a connection with the robot.
41+
/// Establishes a connection with a Panda robot.
4242
///
4343
/// # Arguments
4444
/// * `franka_address` - IP/hostname of the robot.
@@ -58,8 +58,9 @@ impl Panda {
5858
/// }
5959
/// ```
6060
/// # Errors
61-
/// * [`NetworkException`](`crate::exception::FrankaException::NetworkException`) if the connection is unsuccessful.
62-
/// * IncompatibleVersionException if this version of `libfranka-rs` is not supported.
61+
/// * [`NetworkException`](FrankaException::NetworkException) if the connection is unsuccessful.
62+
/// * [`IncompatibleLibraryVersionError`](FrankaException::IncompatibleLibraryVersionError) if this version of `libfranka-rs` is not supported or
63+
/// if the robot is not a Panda.
6364
pub fn new<RtConfig: Into<Option<RealtimeConfig>>, LogSize: Into<Option<usize>>>(
6465
franka_address: &str,
6566
realtime_config: RtConfig,

0 commit comments

Comments
 (0)