Skip to content

Commit 61777a7

Browse files
authored
Merge branch 'main' into fixwindriver
2 parents 6e55493 + effc0a0 commit 61777a7

File tree

4 files changed

+147
-197
lines changed

4 files changed

+147
-197
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ repos:
5151
args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D401,D404"]
5252

5353
- repo: https://github.com/pycqa/flake8
54-
rev: 7.2.0
54+
rev: 7.3.0
5555
hooks:
5656
- id: flake8
5757
args: ["--ignore=E501,W503"]

ur_robot_driver/doc/usage/simulation.rst

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,75 @@ Apart from being used with a real robot, the ROS driver can be used with ros2_co
77

88
Additionally, the robot can be simulated using
99
`Gazebo Classic <https://github.com/UniversalRobots/Universal_Robots_ROS2_Gazebo_Simulation>`_ or
10-
`GZ Sim <https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation>`_ but that's
10+
:ref:`GZ Sim <ur_simulation_gz>` but that's
1111
outside of this driver's scope.
1212

1313
.. _usage_with_official_ur_simulator:
1414

1515
Usage with official UR simulator
1616
--------------------------------
1717

18-
The easiest way to use URSim is the `Docker
19-
image <https://hub.docker.com/r/universalrobots/ursim_e-series>`_ provided by Universal Robots (See
20-
`this link <https://hub.docker.com/r/universalrobots/ursim_cb3>`_ for a CB3-series image).
18+
The easiest way to use URSim is the Docker
19+
image provided by Universal Robots. There is an image for each software generation:
2120

22-
To start it, we've prepared a script:
21+
- `PolyScope 5 <https://hub.docker.com/r/universalrobots/ursim_e-series>`_
22+
- `PolyScope X <https://hub.docker.com/r/universalrobots/ursim_polyscopex>`_
23+
- `CB3 <https://hub.docker.com/r/universalrobots/ursim_cb3>`_
24+
25+
We have prepared a script to unify the startup of the simulator independent of the software
26+
platform version:
2327

2428
.. code-block:: bash
2529
26-
ros2 run ur_client_library start_ursim.sh -m <ur_type>
30+
ros2 run ur_client_library start_ursim.sh -m <ur_type> -v <ursim_version>
31+
32+
If you skip the ``-v`` option, the script will use the latest version of the PolyScope 5 URSim
33+
image. If you skip the ``-m`` option, the robot model will default to a UR5(e) robot.
34+
35+
**Example:**
36+
37+
.. code-block:: console
38+
39+
$ ros2 run ur_client_library start_ursim.sh -v 10.8.0 -m ur20
40+
ROBOT_MODEL: ur20
41+
ROBOT_SERIES: polyscopex
42+
URSIM_VERSION: 10.8.0
43+
5b140a83f8600c7ada0b7d75bc7a5808667adbeec77387e8c73b093f10fd2379
44+
Starting URSim. Waiting for UrService to be up...................................
45+
UrService is up
46+
Installing URCapX /home/feex/.ursim/polyscopex/urcaps/external-control-0.1.0.urcapx
47+
48+
49+
To access PolyScopeX, open the following URL in a web browser.
50+
51+
52+
http://192.168.56.101
53+
54+
To exit, press CTRL+C
55+
56+
57+
Accessing the URSim GUI is done using a web browser. The script will print the URL to access the
58+
GUI. Depending on the PolyScope version, this is different.
59+
60+
.. tabs::
61+
62+
.. group-tab:: PolyScope 5 / CB3
63+
64+
Open http://192.168.56.101:6080/vnc.html in a web browser.
65+
66+
.. group-tab:: PolyScope X
67+
68+
Open http://192.168.56.101 in a web browser.
2769

2870
With this, we can spin up a driver using
2971

3072
.. code-block:: bash
3173
3274
ros2 launch ur_robot_driver ur_control.launch.py ur_type:=<ur_type> robot_ip:=192.168.56.101 launch_rviz:=true
3375
34-
You can view the polyscope GUI by opening `<http://192.168.56.101:6080/vnc.html>`_.
35-
3676
When we now move the robot in Polyscope, the robot's RViz visualization should move accordingly.
3777

38-
For details on the Docker image, please see the more detailed guide :ref:`here <ursim_docker>`.
78+
For details on the (PolyScopr 5 and CB3) Docker image, please see the more detailed guide :ref:`here <ursim_docker>`.
3979

4080
Mock hardware
4181
-------------

ur_robot_driver/include/ur_robot_driver/hardware_interface.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@
4040
#define UR_ROBOT_DRIVER__HARDWARE_INTERFACE_HPP_
4141

4242
// System
43+
#include <limits>
4344
#include <memory>
4445
#include <string>
46+
#include <unordered_map>
4547
#include <vector>
46-
#include <limits>
4748

4849
// ros2_control hardware_interface
4950
#include "hardware_interface/hardware_info.hpp"
@@ -114,6 +115,7 @@ class URPositionHardwareInterface : public hardware_interface::SystemInterface
114115
{
115116
public:
116117
RCLCPP_SHARED_PTR_DEFINITIONS(URPositionHardwareInterface);
118+
URPositionHardwareInterface();
117119
virtual ~URPositionHardwareInterface();
118120

119121
hardware_interface::CallbackReturn on_init(const hardware_interface::HardwareInfo& system_info) final;
@@ -316,6 +318,8 @@ class URPositionHardwareInterface : public hardware_interface::SystemInterface
316318
const std::string FORCE_MODE_GPIO = "force_mode";
317319
const std::string FREEDRIVE_MODE_GPIO = "freedrive_mode";
318320
const std::string TOOL_CONTACT_GPIO = "tool_contact";
321+
322+
std::unordered_map<std::string, std::unordered_map<std::string, bool>> mode_compatibility_;
319323
};
320324
} // namespace ur_robot_driver
321325

0 commit comments

Comments
 (0)