Skip to content

Commit ba5ab3b

Browse files
committed
readme
1 parent f608fe3 commit ba5ab3b

File tree

2 files changed

+128
-1
lines changed

2 files changed

+128
-1
lines changed

README.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,131 @@ A package that provide a simple python socket based api for controlling inovo ro
1010
## Installation
1111
```bash
1212
pip install inovopy
13+
```
14+
### [Documentation](https://dizzyi.github.io/inovopy/)
15+
16+
17+
## Usage
18+
19+
see [examples](https://github.com/dizzyi/inovopy/tree/main/examples)
20+
21+
22+
### Ros
23+
inovopy provide ros based api to interact with inovo robot arm.
24+
25+
#### Example
26+
```python
27+
from inovopy.rosbridge import InovoRos
28+
29+
ros = InovoRos("192.168.1.122", "Test")
30+
```
31+
32+
All fields are sync to the live robot state through RosBridge
33+
```python
34+
class InovoRos(inovopy.util.Loggable):
35+
# Ros
36+
ros: roslibpy.Ros
37+
38+
# Tcp Speed
39+
tcp_speed_lin: float = 0
40+
tcp_speed_ang: float = 0
41+
42+
# Tcp Pose
43+
tcp_pose_vec: tuple[float, float, float] = (0, 0, 0)
44+
tcp_pose_quat: tuple[float, float, float, float] = (0, 0, 0, 0)
45+
46+
# Joint State
47+
joint_pos: list[float] = []
48+
joint_vel: list[float] = []
49+
joint_eff: list[float] = []
50+
51+
# Power Status
52+
voltage: float = 0
53+
current: float = 0
54+
power_status: str = 0
55+
56+
# Robot Status
57+
driver_state: str = ""
58+
drive_powered: bool = False
59+
60+
# EStop Status
61+
estop_active: bool = False
62+
estop_circuit: bool = False
63+
64+
# Safe Stop Status
65+
safe_stop_active: bool = False
66+
safe_stop_circuit: bool = False
67+
68+
# Runtime State
69+
active_blocks: list[str] = []
70+
current_block_progress: float = 0
71+
runtime_status: RuntimeState = 0
72+
variables: list[Variable] = []
73+
74+
# Arm State
75+
enable: bool = False
76+
state: int = 0
77+
joint_states: list[JointState] = []
78+
```
79+
80+
APIs:
81+
```python
82+
ros.safe_stop_reset()
83+
ros.estop_reset()
84+
ros.power_on()
85+
ros.robot_enable()
86+
87+
ros.runtime_start()
88+
ros.runtime_pause()
89+
ros.runtime_step()
90+
ros.runtime_continue()
91+
ros.runtime_get_var("a")
92+
ros.runtime_set_var("a", 32)
93+
ros.runtime_stop()
94+
ros.runtime_start("do something")
95+
96+
ros.robot_disable()
97+
ros.power_off()
98+
```
99+
100+
### iva
101+
To enact more precise and dynmaic control of robot, you can use [`iva`](https://github.com/dizzyi/inovo-iva), a message framework design to interact with inovo robot arms.
102+
103+
1. Download latest release of [iva.isq](https://github.com/dizzyi/inovo-iva/releases)
104+
2. Import the project to inovo robot psu
105+
3. look for the socket connect block and change the target ip to robot control server's ip address
106+
4. use `inovopy.robot.InovoRobot` to control the robot
107+
108+
[example](https://github.com/dizzyi/inovopy/blob/main/examples/500%20-%20inovo%20iva.py)
109+
110+
```python
111+
from inovopy.robot import InovoRobot
112+
from inovopy.iva import RobotCommand, MotionMode
113+
from inovopy.geometry.transform import Transform
114+
115+
116+
bot = InovoRobot.default_iva("<PSU IP address>", "iva example")
117+
118+
# Get Current
119+
print(bot.get_current_joint())
120+
print(bot.get_current_transform())
121+
122+
# Motion
123+
bot.linear_relative(Transform.from_z(10.0))
124+
bot.joint(bot.get_current_joint().then_j1(10.0))
125+
126+
# Set Motion Parameter
127+
bot.set_param(speed=10.0, accel=50.0, blend_linear=100.0, blend_angular=30.0)
128+
129+
# Digital IO
130+
print(bot.get_io_beckhoff(0))
131+
print(bot.set_io_beckhoff(0, True))
132+
133+
# Sequence
134+
seq = [
135+
RobotCommand.motion(MotionMode.LINEAR_RELATIVE, Transform.from_z(10.0)),
136+
RobotCommand.sleep(10),
137+
RobotCommand.set_parameter(speed=20.0, accel=5.0),
138+
]
139+
bot.sequence(seq)
13140
```

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
VERSION = "1.0.0"
99
DESCRIPTION = "Inovo Robot Arm API"
10-
LONG_DESCRIPTION = Path(__file__).parent.read_text()
10+
LONG_DESCRIPTION = (Path(__file__).parent / "README.md").read_text()
1111

1212
# Setting up
1313
setup(

0 commit comments

Comments
 (0)