From 9cc8eecaa873d43be0ff5d99bbb5069993083df5 Mon Sep 17 00:00:00 2001 From: Alexander Schaefer Date: Mon, 12 May 2025 21:51:05 +0200 Subject: [PATCH] AS: 1. readme --- .DS_Store | Bin 8196 -> 6148 bytes README.md | 216 ++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 138 insertions(+), 78 deletions(-) diff --git a/.DS_Store b/.DS_Store index 38f320ae5dc310937393887ac4523dadcfa54fba..4a11c6316604b7e8372583a6690544d5a882ce9a 100644 GIT binary patch delta 144 zcmZp1XfcprU|?W$DortDU=RQ@Ie-{MGjUEV6q~50D9Q?w2aEYKxH9N5on z&dA6*xmn0`@(E#+$#EjWo9#tTFmG(w&bXMJgF}!Rs0j!JxPgQ#$gqut-D;H%-wCm6*+L)6mUM$WMcWLax=v z@KUIk`T~M4AowU=Nd4xgA=zfDC{(L6Vdk66oO5R8J14t)HblhA12;pIBq9q{;L0+Z zIYrEidaA_q$SROQpJGHFkl!k4EzlY;GQjt6>;BJv!*o+ z7zX}J2E_HjMip4nI94bx9cW|<0E}Z;7W9z^NF7^aN#j_dRE15IJut1xbc(^0I_7O5 z4lHRLD^%*llsYlJGSe9fldD6|mg2-p3QcPmFbte#K;-U=^bnc*4m}9v@AxUPZj?VQzI32&$>!;J7S!^MGX>rL~vX-r9)jd9}_UrvYuUzjw5#M$=_nnh| z-FejVhP9Pz_ju5+w*s##6p`??0P0;XA0TE zVagsAv+0z*emj47n6R$jyme>0w(qwC{z{#h>FWkvQQs%+YxHIgGc|H(K)d*Ousz2f9fj)iiyjT=?tZ19L!~1`tI#iELc(}7v&`?W4$9Ke|(I7f`;&F zm-fNC@Op#15c^_>(<{u;_|tya$mLUZE|>pJKg>B<$RnV_6vM#9U|>OQGr0`hihlop zF%DyPX&5jJ{1O8!Ua3~ZegEVcIc!Db+BWKQR8fT7SfNxwBhzu9OvizfKMc{gAu4oA d8pjGTf^zOJ0wVH+pLq^5_kZa!)BFPrd + cd workspace + colcon build + source install/setup.bash + ``` + +4. **Run the Interface** + ```bash + ros2 run osc_ros2 interface + ``` + +--- + +## Interface Setup + +The script will guide you through the setup: + +- **URDF File**: Choose whether to load a URDF to enable kinematics, joint limits, etc. +- **Log/State IP & Ports**: Enter where logs and joint state OSC messages should be sent. +- **Command Port**: Set the port to listen for incoming OSC commands. +- **Limits**: Define workspace limits (x/y/z) and joint limits if desired. +- **Refresh Rate**: Choose how often the interface updates (Hz). + +--- + +## Supported OSC Commands + +| Address | Data Format | Description | +|-------------------------------|-----------------------------------------------------------|----------------------------------------| +| `/joint_positions` | `[q1, ..., qN]` or `[q1, ..., qN, duration]` | Move all joints | +| `/joint_positions/{joint}` | `q1` or `[q1, duration]` | Set one joint only | +| `/tcp_coordinates` | `[x, y, z, roll, pitch, yaw]` or with duration | Move to Cartesian pose | +| `/joint_trajectory` | `[[q1,...], [q2,...], ...]` | Follow a joint-space trajectory | +| `/cartesian_trajectory` | `[[x1,...], [x2,...], ...]` | Follow a Cartesian-space trajectory | +| `/speed_scaling` | `float` (e.g., 0.5 -> 50% of max speed) | Adjust execution speed | + +--- + +## Connecting to Simulation + +Launch the robot driver (replace `x` with correct IP): +```bash +ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur10e robot_ip:=172.18.0.x +``` + +Use `hostname -i` inside each container to retrieve IPs. + +On the teach pendant or URSim, set the ROS 2 container’s IP in the External Control URCap. + +--- + +## Check Connection + +You can test if data is flowing correctly with: +```bash +ros2 topic echo /joint_states +``` + +--- + +## Example Usage + +An example patch in puredata is provided that allows the user to control a 6-DOF robot with sliders via OSC. + +--- + +[^1]: [What is Docker?](https://docs.docker.com/get-started/) +[^2]: [WSL2 & Docker Networking](https://stackoverflow.com/questions/65426891) +[^3]: [USB Device in Docker](https://stackoverflow.com/questions/46467295) +[^4]: [Cisco VPN and WSL2](https://github.com/Microsoft/WSL/issues/4277) +[^5]: macOS is not tested—use Linux or Windows for reliability.