You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following external simulators are tested and known to work with Flexiv Sim Plugin:
17
+
18
+
- NVIDIA [Isaac Sim](https://developer.nvidia.com/isaac/sim) (a template workspace is available [here](https://github.com/flexivrobotics/isaac_sim_ws))
19
+
-[MuJoCo](https://mujoco.org/)
20
+
21
+
In theory, any simulator that meets the following criteria should work:
22
+
23
+
1. Has a C++ or Python interface.
24
+
2. Provides joint positions and velocities of the simulated robot.
25
+
3. The joints of the simulated robot are actuated by torque.
26
+
27
+
## Flexiv Elements Studio Setup
28
+
29
+
### Install Elements Studio
30
+
31
+
1. Prepare a Ubuntu 22.04 computer, all operations below are done on this computer.
32
+
2.[Contact Flexiv](https://www.flexiv.com/contact) to obtain the installation package of Elements Studio.
33
+
3. Extract the package to a non-root directory.
34
+
4. Install Elements Studio:
35
+
36
+
bash setup_FlexivElements.sh
37
+
38
+
5. Switch physics engine from the default built-in to external:
39
+
40
+
bash switch_physics_engine.sh
41
+
42
+
Select *External* or *Isaac Sim* when prompted.
43
+
44
+
### Create a simulated robot in Elements Studio
45
+
46
+
1. Start Flexiv Elements Studio from the application menu.
47
+
2. In the Robot Connection window, select *Simulator*, and click *CREATE*.
48
+
3. Choose "Create according to the selected robot type" and select one from the list, then click *CONFIRM*. A new simulated robot will be added to the simulator list.
49
+
4. Toggle on the *Connect* button for the newly added one, then wait for loading.
50
+
5. When loading is finished, you'll see a robot at its upright pose, with an "Exception" error at the bottom right corner. This is expected because the external simulator is not started yet. But if you see a normally operating robot, that again means you are running the wrong version of Elements Studio that only supports the built-in physics engine.
51
+
6. At the bottom of the window, click on the small robot icon with a "SIM" tag on it, then a small window will pop up, note down the displayed robot serial number.
52
+
7. In the same small pop-up window, click *CHANGE CONNECTION*, then toggle off the *Connect* button to close the simulated robot. We will restart it later. Note that you do NOT need to close the whole Elements Studio program.
53
+
54
+
## Quick Start - C++
55
+
56
+
### Prepare build tools
57
+
58
+
#### Linux
59
+
60
+
1. Install compiler kit using package manager:
61
+
62
+
sudo apt install build-essential
63
+
64
+
2. Install CMake using package manager:
65
+
66
+
sudo apt install cmake
67
+
68
+
### Install the C++ library
69
+
70
+
The following steps are identical on all supported platforms.
71
+
72
+
1. Choose a directory for installing the C++ library of Sim Plugin and its dependencies. This directory can be under system path or not, depending on whether you want Sim Plugin to be globally discoverable by CMake. For example, a new folder named ``sim_plugin_install`` under the home directory.
73
+
2. In a new Terminal, run the provided script to compile and install all dependencies to the installation directory chosen in step 1:
NOTE: ``-D`` followed by ``CMAKE_INSTALL_PREFIX`` sets the absolute path of the installation directory, which should be the one chosen in step 1.
85
+
86
+
4. Install ``flexiv_sim_plugin`` C++ library to ``CMAKE_INSTALL_PREFIX`` path, which may or may not be globally discoverable by CMake:
87
+
88
+
cd flexiv_sim_plugin/build
89
+
cmake --build . --target install --config Release
90
+
91
+
### Use the installed C++ library
92
+
93
+
After the library is installed as ``flexiv_sim_plugin`` CMake target, it can be linked from any other CMake projects. Using the provided `flexiv_sim_plugin-examples` project for instance:
94
+
95
+
cd flexiv_sim_plugin/example
96
+
mkdir build && cd build
97
+
cmake .. -DCMAKE_PREFIX_PATH=~/sim_plugin_install
98
+
cmake --build . --config Release -j 4
99
+
100
+
NOTE: ``-D`` followed by ``CMAKE_PREFIX_PATH`` tells the user project's CMake where to find the installed C++ library. This argument can be skipped if the Sim Plugin library and its dependencies are installed to a globally discoverable location.
101
+
102
+
### Run the example C++ program
103
+
104
+
An example program that mocks an external simulator is provided and can be used to test the plugin with the following steps:
105
+
106
+
1. Start the mock program:
107
+
108
+
cd flexiv_sim_plugin/example/build
109
+
./mock_external_simulator [robot_serial_number]
110
+
111
+
NOTE: the robot serial number provided to the program is the same one you noted down when creating the simulated robot in Flexiv Elements Studio.
112
+
113
+
2. Go back to Elements Studio, then restart the exited simulator by toggling ON the *Connect* button.
114
+
3. Wait for the connection to establish. If the connection is successful, you should see the visualized robot in Elements Studio moving every joint back and forth. A software error should occur in Elements Studio which is expected because the mock external simulator did not close the loop by applying the calculated joint torques command to the simulated robot in it. This won't happen to real external simulators.
115
+
14
116
## Quick Start - Python
15
117
16
118
### Install the Python package
@@ -32,6 +134,19 @@ After the ``flexivsimplugin`` Python package is installed, it can be imported fr
32
134
33
135
The program should print some info messages and "Connected = False" at the end.
34
136
137
+
### Run the example Python script
138
+
139
+
An example script that mocks an external simulator is provided and can be used to test the plugin with the following steps:
0 commit comments