Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Oct 8, 2024
1 parent f4bc4ea commit 1e31614
Show file tree
Hide file tree
Showing 7 changed files with 245 additions and 88 deletions.
13 changes: 2 additions & 11 deletions actuator/cli.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
"""Defines the CLI for the actuator project."""

import time

from actuator.rust.lib import Actuator, ActuatorType
from actuator.rust.py import hello_world


def main() -> None:
act_1 = Actuator(ActuatorType.Robstride, True)
act_1.set_position(0, 0.5)
act_2 = Actuator(ActuatorType.Robstride, True)
act_2.set_position(1, 0.5)
act_2.set_pid_params(1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1)
time.sleep(5)
print(act_1)
print(act_2)
hello_world()


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions actuator/rust/py/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "lib"
name = "py"
version.workspace = true
edition.workspace = true
description.workspace = true
Expand All @@ -9,7 +9,7 @@ license.workspace = true
readme.workspace = true

[lib]
name = "lib"
name = "py"
crate-type = ["cdylib", "rlib"]

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion actuator/rust/py/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn hello_world() -> PyResult<()> {
}

#[pymodule]
fn lib(m: &Bound<PyModule>) -> PyResult<()> {
fn py(m: &Bound<PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(hello_world, m)?)?;
Ok(())
}
Expand Down
1 change: 1 addition & 0 deletions actuator/rust/robstride/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
serialport = "4.5.1"
lazy_static = "1.4.0"
Loading

0 comments on commit 1e31614

Please sign in to comment.