feat: add release-to-move TCP gizmo control in Webots
Add a native Webots marker for setting the active tool's TCP position and orientation. Dragging edits the preview; releasing the mouse submits one complete, checked joint trajectory with configured TCP speed limits. Unreachable targets reset the marker to the current TCP. Preserve coordinate, joint, and control-file commands through motion reservations and a controller action proxy. Give the gizmo lowest priority and finish its committed trajectory before dispatching queued regular commands, including waits longer than the former two-second service timeout. Place the patron TCP at its working end, 55.2 mm along local Z, and use the flange TCP when no tool is attached. Add digital_twin.tcp_gizmo configuration, ROS interfaces, launch integration, and regression coverage. Document operation, configuration, tool attachment, speed limits, and troubleshooting in both Russian and English. Validation: 42 Python tests and 8 C++ tests passed. Webots regressions covered one action per release, translation and rotation with and without a tool, unreachable targets, and ordinary commands waiting for gizmo completion.
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
# Simulation (Webots)
|
||||
|
||||
!!! info "Work in progress"
|
||||
A detailed simulator guide is being prepared.
|
||||
|
||||
**Webots** is an open-source robot simulator. LWC uses it as a digital twin of the KUKA LBR IIWA 7, allowing control algorithms to be developed and debugged without a physical robot.
|
||||
|
||||
## Key features
|
||||
@@ -11,8 +8,34 @@
|
||||
- The simulation world is set in `cobot-setting.yaml` → `digital_twin.webots.world`.
|
||||
- Start it with `cobot run --simulate`.
|
||||
|
||||
## TCP gizmo
|
||||
|
||||
This simulation-only mode lets you specify the robot's target pose by dragging a marker at its tool center point (TCP) in the Webots window.
|
||||
|
||||
1. Enable `digital_twin.tcp_gizmo.enabled: true` in `cobot-setting.yaml` and launch with `cobot run --simulate`.
|
||||
2. Wait until other robot motions finish. For an initial test, use the regular named-pose command to move to `work`.
|
||||
3. Select the TCP marker in Webots. Drag a translation arrow or rotation handle with the left mouse button. The robot remains stationary while you edit the target.
|
||||
4. Release the button to submit the target. One complete trajectory is sent to the controller, rather than a stream of actions during dragging.
|
||||
5. Wait for completion before dragging again. If the target cannot be reached or the checked path collides, the marker returns to the actual TCP.
|
||||
|
||||
Regular coordinate, joint, and control-file commands remain available. They have priority over new gizmo gestures. An already started gizmo trajectory finishes before a waiting regular command proceeds, even when that wait exceeds two seconds.
|
||||
|
||||
### Tool attachment and speed
|
||||
|
||||
The marker follows the active tool's `tcp` frame. With `patron`, it is at the chuck's working end; with no tool, it is at the flange. Apply tool changes through `cobot robot-setup`, rebuild, and restart the simulation. New tool models must define `tcp` at their working point.
|
||||
|
||||
`max_linear_speed` (m/s) and `max_angular_speed` (rad/s) are upper bounds. Short moves include acceleration and braking, and joint limits may make motion slower. Joint interpolation reaches the requested TCP pose but does not guarantee a straight Cartesian path.
|
||||
|
||||
Set `digital_twin.tcp_gizmo.enabled: false` and restart to disable this mode. The [configuration reference](../configuration.md) describes all parameters. `command_timeout` checks the age of the submitted target; mouse release is detected directly and requires no waiting-time setting.
|
||||
|
||||
### When the marker returns or does not respond
|
||||
|
||||
- Wait for regular motions or a committed gizmo trajectory to finish before starting another drag.
|
||||
- For a rejected target, read `TCP gizmo rejected target: ...` in the launch output. Try a smaller displacement from a reachable posture such as `work`.
|
||||
- With missing or stale robot feedback, the gizmo cannot submit movement. Check that simulation is running and `/joint_states` updates.
|
||||
|
||||
## Differences from the real robot
|
||||
|
||||
- There are no real safety constraints, so motion can be faster.
|
||||
- Motion still obeys configured joint and TCP limits; simulation does not reproduce all physical robot protections.
|
||||
- Physics is approximate, including inertia, friction, and elasticity.
|
||||
- FRI is not used; communication goes through the Webots ROS 2 driver.
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# Симуляция (Webots)
|
||||
|
||||
!!! info "Раздел в разработке"
|
||||
Подробное описание работы в симуляторе готовится.
|
||||
|
||||
**Webots** — симулятор роботов с открытым исходным кодом. В LWC используется как цифровой двойник робота KUKA LBR IIWA 7: позволяет разрабатывать и отлаживать алгоритмы управления без доступа к физическому роботу.
|
||||
|
||||
## Ключевые особенности
|
||||
@@ -11,8 +8,34 @@
|
||||
- Мир симуляции задаётся в `cobot-setting.yaml` → `digital_twin.webots.world`
|
||||
- Для запуска: `cobot run --simulate`
|
||||
|
||||
## Перемещение за TCP
|
||||
|
||||
В этом режиме цифрового двойника целевая поза робота задаётся перетаскиванием маркера рабочей точки инструмента (TCP) прямо в окне Webots.
|
||||
|
||||
1. Включите `digital_twin.tcp_gizmo.enabled: true` в `cobot-setting.yaml` и запустите `cobot run --simulate`.
|
||||
2. Дождитесь завершения других движений. Для первой проверки удобно перейти в именованную позицию `work` обычной командой.
|
||||
3. Выберите маркер TCP в Webots. Удерживая левую кнопку мыши, тяните за стрелку перемещения или ручку вращения. Во время редактирования цели робот стоит.
|
||||
4. Отпустите кнопку: контроллеру отправится одна полная траектория, а не поток action-целей при перетаскивании.
|
||||
5. Дождитесь завершения движения перед следующим переносом. При недостижимой цели или столкновении на проверяемом пути маркер возвращается к фактическому TCP.
|
||||
|
||||
Обычные команды координат, joints и файлы управления остаются доступны и имеют приоритет перед новым перетаскиванием. Уже начатое движение гизмы завершается до выполнения ожидающей обычной команды, в том числе если ожидание длится больше двух секунд.
|
||||
|
||||
### Инструмент и скорость
|
||||
|
||||
Маркер следует за фреймом `tcp` активного инструмента: у `patron` это рабочий торец патрона, без инструмента — фланец. При смене инструмента примените выбор через `cobot robot-setup`, пересоберите проект и перезапустите симуляцию. В моделях новых инструментов задавайте `tcp` в рабочей точке.
|
||||
|
||||
`max_linear_speed` (м/с) и `max_angular_speed` (рад/с) задают верхние пределы. На коротких перемещениях есть разгон и торможение; ограничения суставов также могут снизить скорость. Интерполяция в суставах достигает заданной позы TCP, но не гарантирует прямолинейный декартов путь.
|
||||
|
||||
Для отключения задайте `digital_twin.tcp_gizmo.enabled: false` и перезапустите систему. Все параметры описаны в [справочнике конфигурации](../configuration.md). `command_timeout` проверяет возраст поступившей цели: отпускание мыши определяется напрямую, настройка времени ожидания не требуется.
|
||||
|
||||
### Если маркер возвращается или не реагирует
|
||||
|
||||
- Дождитесь завершения обычной команды или уже начатой траектории гизмы перед новым перетаскиванием.
|
||||
- При отказе смотрите строку `TCP gizmo rejected target: ...` в выводе запуска. Попробуйте небольшое смещение из достижимой позы, например `work`.
|
||||
- При отсутствии или устаревании обратной связи перемещение недоступно. Проверьте, что симуляция работает и `/joint_states` обновляется.
|
||||
|
||||
## Отличия от реального робота
|
||||
|
||||
- Нет ограничений по безопасности (можно двигаться быстрее)
|
||||
- Действуют настроенные ограничения суставов и TCP; симуляция не воспроизводит все защиты физического робота
|
||||
- Физика не идеальна — инерция, трение и упругость приближённые
|
||||
- FRI-протокол не задействован — связь идёт через Webots-драйвер ROS 2
|
||||
|
||||
Reference in New Issue
Block a user