Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 2 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The program should print some info messages and "Connected = False" at the end.

An example script that mocks an external simulator is provided and can be used to test the plugin with the following steps:

1. Setup and run Flexiv Elements Studio simulation. See the relevant instructions at the end of this README.
1. Setup and run Flexiv Elements Studio simulation. See [docs/elements_studio_setup.md](docs/elements_studio_setup.md).

2. Start the mock program:

Expand Down Expand Up @@ -139,7 +139,7 @@ NOTE: ``-D`` followed by ``CMAKE_PREFIX_PATH`` tells the user project's CMake wh

An example program that mocks an external simulator is provided and can be used to test the plugin with the following steps:

1. Setup and run Flexiv Elements Studio simulation. See the relevant instructions at the end of this README.
1. Setup and run Flexiv Elements Studio simulation. See [docs/elements_studio_setup.md](docs/elements_studio_setup.md).

2. Start the mock program:

Expand All @@ -160,29 +160,3 @@ The API documentation can be generated using Doxygen. For example, on Linux:

Open any html file under ``flexiv_sim_plugin/doc/html/`` with your browser to view the doc.


## Flexiv Elements Studio Setup

### Install Elements Studio on Ubuntu

1. [Contact Flexiv](https://www.flexiv.com/contact) to obtain the installation package of Elements Studio.
2. Extract the package to a non-root directory.
3. Install Elements Studio:

bash setup_FlexivElements.sh

4. Switch physics engine from the default built-in to external:

bash switch_physics_engine.sh

Select *External* when prompted.

### Create a simulated robot in Elements Studio

1. Start Flexiv Elements Studio from the application menu.
2. In the Robot Connection window, select *Simulator*, and click *CREATE*.
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.
4. Toggle on the *Connect* button for the newly added one, then wait for loading.
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.
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.
7. Toggle the virtual motion bar slider button to the "auto" position. In resulting popup window, select "AUTO (REMOTE)"
30 changes: 30 additions & 0 deletions docs/elements_studio_setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Flexiv Elements Studio Setup

Flexiv Elements Studio runs the simulated robot controller.
Set it up once before running any external-simulator workspace.

## Install Elements Studio on Ubuntu

1. [Contact Flexiv](https://www.flexiv.com/contact) to obtain the installation package of Elements Studio.
2. Extract the package to a non-root directory.
3. Install Elements Studio:

bash setup_FlexivElements.sh

4. Switch physics engine from the default built-in to external:

bash switch_physics_engine.sh

Select *External* when prompted.

## Create a simulated robot in Elements Studio

1. Start Flexiv Elements Studio from the application menu.
2. In the Robot Connection window, select *Simulator*, and click *CREATE*.
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.
4. Toggle on the *Connect* button for the newly added one, then wait for loading.
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.
6. To enable RDK, Click Settings → Remote Mode → Select a Mode → Ethernet. In the resulting popup window, restart the simulated robot.
7. Toggle the virtual motion bar slider button to the "auto" position. In the resulting popup window, select "AUTO (REMOTE)".
8. 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.

17 changes: 14 additions & 3 deletions include/flexiv/sim_plugin/data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ constexpr size_t kIOPorts = 16;
struct SimRobotStates
{
/** @brief Customized constructor */
SimRobotStates(
uint64_t _servo_cycle, const std::vector<float>& _q, const std::vector<float>& _dq)
SimRobotStates(uint64_t _servo_cycle, const std::vector<float>& _q,
const std::vector<float>& _dq, const std::vector<float>& _wrist_force = {},
const std::vector<float>& _wrist_torque = {})
: servo_cycle(_servo_cycle)
, q(_q)
, dq(_dq)
, wrist_force(_wrist_force)
, wrist_torque(_wrist_torque)
{
}

Expand All @@ -44,6 +47,14 @@ struct SimRobotStates
* \f$. Unit: \f$ [rad/s] or [m/s] \f$.
* @note This contains values for both the external axes (if any) and the robot manipulator. */
std::vector<float> dq = {};

/** Current wrist force sensor reading of the simulated robot: \f$ [f_x, f_y, f_z] \f$. Unit:
* \f$ [N] \f$. */
std::vector<float> wrist_force = {};

/** Current wrist torque sensor reading of the simulated robot: \f$ [m_x, m_y, m_z] \f$. Unit:
* \f$ [Nm] \f$. */
std::vector<float> wrist_torque = {};
};

/** Commands data for a simulated robot in the external simulator */
Expand Down Expand Up @@ -72,4 +83,4 @@ struct SimRobotCommands
} /* namespace sim_plugin */
} /* namespace flexiv */

#endif /* FLEXIV_SIM_PLUGIN_DATA_HPP_ */
#endif /* FLEXIV_SIM_PLUGIN_DATA_HPP_ */
Loading