semvec/pypi-packages huggingface dataset:
ctu_bosh_sr450 0.1.0
Package to control CTU/CIIRC robot Bosh SR450 via MARS control unit.
License: BSD 3-Clause
Requires Python: >=3.8

# ctu_bosh_sr450

Package to control CTU/CIIRC robot Bosh SR450 via MARS control unit.
This code is based on `https://github.com/cvut/pyrocon` but adds packaging,
documentation, and some testing.

## Installation
```bash
pip install ctu_bosh_sr450
```

### Installation for old systems via Conda
You need at least Python 3.7 to use this package. In case your python is old (Ubuntu in CIIRC labs has old 3.6), install updated version of python e.g. via miniconda:

```
# Install miniconda:
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh

# Create conda environment with newer python and install ctu_bosh_sr450:
conda create -n ctu_robotics python=3.8
conda activate ctu_robotics
pip install ctu_bosh_sr450
```

## Usage

```python
from ctu_bosh_sr450 import RobotBosh

robot = RobotBosh() # set argument tty_dev=None if you are not connected to robot, it will allow you to compute FK and IK offline
robot.initialize() # initialize connection to the robot
robot.move_to_q([0.1, 0.0, 0.0, 0.0]) # move robot
robot.wait_for_motion_stop()
robot.close() # close the connection
```

### Kinematics

```python
robot = RobotBosh(tty_dev=None) # initialize object without connection to the robot
x, y, z, phi = robot.fk([0, 0, 0, 0]) # compute forward kinematics
q = robot.ik([x, y, z, phi])[0] # compute inverse kinematics, get the first solution
```

## Coordinate systems

The library uses meters and radians for all values.
Variable __q__ is used to denote joint configuration, i.e. the array of joint
angles/joint distance for revolute and prismatic joints, respectively.
Variables __x__, __y__, __z__, and __phi__ are used to denote position and orientation
of the end-effector in the base frame. The orientation is given as rotation around the
z-axis of the base frame.
The reference base frame is located as shown in the figure below.

![](https://raw.githubusercontent.com/CTURobotics/ctu_bosh_sr450/main/doc/base_frame.png)

## Joint configuration

The joint configuration is defined as follows:

- the first joint is revolute and its angle is measured w.r.t. the x-axis of the base
  frame
- the second joint is revolute and is measured w.r.t. the previous link
- the third joint is prismatic and controls the height (i.e. motion in z-axis)
- the last joint is revolute and measured w.r.t. the x-axis of the base frame (i.e. *
  *not** w.r.t. the previous link)