Skip to content

Commit

Permalink
Fix some clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
kylc committed Sep 25, 2023
1 parent da704c2 commit 540aabb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub fn objective(
let tfm_error = tfm_target.inverse() * tfm_actual;

if let Some(g) = grad {
let grad = robot.ee_error_grad(&tfm_target, &tfm_actual, x, GradientMode::Analytical);
let grad = robot.ee_error_grad(tfm_target, &tfm_actual, x, GradientMode::Analytical);
g.copy_from_slice(grad.as_slice());
}

Expand Down
7 changes: 3 additions & 4 deletions src/py.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use nalgebra::{Isometry3, Matrix4, Translation3, UnitQuaternion};
use pyo3::prelude::*;
use rayon::ThreadPoolBuilder;

use crate::{config::SolverConfig, solve, GradientMode, Robot, SolutionMode, SolverResult};
use crate::{config::SolverConfig, solve, GradientMode, Robot, SolutionMode};

#[pymethods]
impl SolverConfig {
Expand Down Expand Up @@ -50,10 +50,10 @@ fn load_model(path: &str, base_link: &str, ee_link: &str) -> PyRobot {

let base_link = chain
.find_link(base_link)
.expect(&format!("'{}' does not exist!", base_link));
.unwrap_or_else(|| panic!("link '{}' does not exist!", base_link));
let ee_link = chain
.find_link(ee_link)
.expect(&format!("'{}' does not exist!", ee_link));
.unwrap_or_else(|| panic!("link '{}' does not exist!", ee_link));

let serial = k::SerialChain::from_end_to_root(ee_link, base_link);
PyRobot(Robot::new(serial))
Expand Down Expand Up @@ -103,7 +103,6 @@ fn optik(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
m.add_class::<GradientMode>()?;
m.add_class::<SolutionMode>()?;
m.add_class::<SolverConfig>()?;
m.add_class::<SolverResult>()?;
m.add_function(wrap_pyfunction!(set_parallelism, m)?)?;
m.add_function(wrap_pyfunction!(load_model, m)?)?;
m.add_function(wrap_pyfunction!(random_pose, m)?)?;
Expand Down

0 comments on commit 540aabb

Please sign in to comment.