A custom implementation of a gazebo_ros_control plugin, which is able to simulate franka interfaces in Gazebo.
More...
#include <franka_hw_sim.h>
|
| void | doSwitch (const std::list< hardware_interface::ControllerInfo > &start_list, const std::list< hardware_interface::ControllerInfo > &stop_list) override |
| | Switches the control mode of the robot arm. More...
|
| |
| void | eStopActive (const bool active) override |
| | Set the emergency stop state (not yet implemented) More...
|
| |
| | FrankaHWSim () |
| | Create a new FrankaHWSim instance. More...
|
| |
| bool | initSim (const std::string &robot_namespace, ros::NodeHandle model_nh, gazebo::physics::ModelPtr parent, const urdf::Model *const urdf, std::vector< transmission_interface::TransmissionInfo > transmissions) override |
| | Initialize the simulated robot hardware and parse all supported transmissions. More...
|
| |
| bool | prepareSwitch (const std::list< hardware_interface::ControllerInfo > &start_list, const std::list< hardware_interface::ControllerInfo > &) override |
| | Check (in non-realtime) if given controllers could be started and stopped from the current state of the RobotHW with regard to necessary hardware interface switches and prepare the switching. More...
|
| |
| void | readSim (ros::Time time, ros::Duration period) override |
| | Fetch data from the Gazebo simulation and pass it on to the hardware interfaces. More...
|
| |
| void | writeSim (ros::Time time, ros::Duration period) override |
| | Pass the data send from controllers via the hardware interfaces onto the simulation. More...
|
| |
| virtual | ~RobotHWSim () |
| |
| virtual bool | checkForConflict (const std::list< ControllerInfo > &info) const |
| |
| virtual bool | checkForConflict (const std::list< ControllerInfo > &info) const |
| |
| virtual bool | init (ros::NodeHandle &, ros::NodeHandle &) |
| |
| virtual void | read (const ros::Time &, const ros::Duration &) |
| |
| virtual void | read (const ros::Time &, const ros::Duration &) |
| |
| virtual SwitchState | switchResult () const |
| |
| virtual SwitchState | switchResult (const ControllerInfo &) const |
| |
| virtual void | write (const ros::Time &, const ros::Duration &) |
| |
| virtual void | write (const ros::Time &, const ros::Duration &) |
| |
| virtual | ~RobotHW ()=default |
| |
| T * | get () |
| |
| std::vector< std::string > | getInterfaceResources (std::string iface_type) const |
| |
| std::vector< std::string > | getNames () const |
| |
| void | registerInterface (T *iface) |
| |
| void | registerInterfaceManager (InterfaceManager *iface_man) |
| |
|
| void | forControlledJoint (const std::list< hardware_interface::ControllerInfo > &controllers, const std::function< void(franka_gazebo::Joint &joint, const ControlMethod &)> &f) |
| |
| void | guessEndEffector (const ros::NodeHandle &nh, const urdf::Model &urdf) |
| |
| void | initEffortCommandHandle (const std::shared_ptr< franka_gazebo::Joint > &joint) |
| |
| void | initFrankaModelHandle (const std::string &robot, const urdf::Model &urdf, const transmission_interface::TransmissionInfo &transmission, double singularity_threshold) |
| |
| void | initFrankaStateHandle (const std::string &robot, const urdf::Model &urdf, const transmission_interface::TransmissionInfo &transmission) |
| |
| void | initJointStateHandle (const std::shared_ptr< franka_gazebo::Joint > &joint) |
| |
| void | initPositionCommandHandle (const std::shared_ptr< franka_gazebo::Joint > &joint) |
| |
| void | initServices (ros::NodeHandle &nh) |
| |
| void | initVelocityCommandHandle (const std::shared_ptr< franka_gazebo::Joint > &joint) |
| |
| template<int N> |
| std::array< double, N > | readArray (std::string param, std::string name="") |
| |
| bool | readParameters (const ros::NodeHandle &nh, const urdf::Model &urdf) |
| |
| void | restartControllers () |
| |
| void | updateRobotState (ros::Time time) |
| |
| void | updateRobotStateDynamics () |
| |
A custom implementation of a gazebo_ros_control plugin, which is able to simulate franka interfaces in Gazebo.
Specifically it supports the following hardware transmission types
transmission_interface/SimpleTransmission
- hardware_interface/JointStateInterface
- hardware_interface/EffortJointInterface
- hardware_interface/PositionJointInterface
- hardware_interface/VelocityJointInterface
franka_hw/FrankaStateInterface
franka_hw/FrankaModelInterface
- See also
- http://gazebosim.org/tutorials/?tut=ros_control#Advanced:customgazebo_ros_controlSimulationPlugins
Definition at line 50 of file franka_hw_sim.h.
◆ FrankaHWSim()
| franka_gazebo::FrankaHWSim::FrankaHWSim |
( |
| ) |
|
◆ doSwitch()
◆ eStopActive()
| void franka_gazebo::FrankaHWSim::eStopActive |
( |
const bool |
active | ) |
|
|
overridevirtual |
◆ forControlledJoint()
◆ guessEndEffector()
◆ initEffortCommandHandle()
| void franka_gazebo::FrankaHWSim::initEffortCommandHandle |
( |
const std::shared_ptr< franka_gazebo::Joint > & |
joint | ) |
|
|
private |
◆ initFrankaModelHandle()
◆ initFrankaStateHandle()
◆ initJointStateHandle()
| void franka_gazebo::FrankaHWSim::initJointStateHandle |
( |
const std::shared_ptr< franka_gazebo::Joint > & |
joint | ) |
|
|
private |
◆ initPositionCommandHandle()
| void franka_gazebo::FrankaHWSim::initPositionCommandHandle |
( |
const std::shared_ptr< franka_gazebo::Joint > & |
joint | ) |
|
|
private |
◆ initServices()
◆ initSim()
Initialize the simulated robot hardware and parse all supported transmissions.
- Parameters
-
| [in] | robot_namespace | the name of the robot passed inside the <robotNamespace> tag from the URDF |
| [in] | model_nh | root node handle of the node into which this plugin is loaded (usually Gazebo) |
| [in] | parent | the underlying gazebo model type of the robot which was added |
| [in] | urdf | the parsed URDF which should be added |
| [in] | transmissions | a list of transmissions of the model which should be simulated |
- Returns
true if initialization succeeds, false otherwise
Implements gazebo_ros_control::RobotHWSim.
Definition at line 32 of file franka_hw_sim.cpp.
◆ initVelocityCommandHandle()
| void franka_gazebo::FrankaHWSim::initVelocityCommandHandle |
( |
const std::shared_ptr< franka_gazebo::Joint > & |
joint | ) |
|
|
private |
◆ positionControl()
| double franka_gazebo::FrankaHWSim::positionControl |
( |
Joint & |
joint, |
|
|
double |
setpoint, |
|
|
const ros::Duration & |
period |
|
) |
| |
|
staticprivate |
◆ prepareSwitch()
Check (in non-realtime) if given controllers could be started and stopped from the current state of the RobotHW with regard to necessary hardware interface switches and prepare the switching.
Start and stop list are disjoint. This handles the check and preparation, the actual switch is commited in doSwitch().
Reimplemented from hardware_interface::RobotHW.
Definition at line 718 of file franka_hw_sim.cpp.
◆ readArray()
template<int N>
| std::array<double, N> franka_gazebo::FrankaHWSim::readArray |
( |
std::string |
param, |
|
|
std::string |
name = "" |
|
) |
| |
|
inlineprivate |
◆ readParameters()
◆ readSim()
◆ restartControllers()
| void franka_gazebo::FrankaHWSim::restartControllers |
( |
| ) |
|
|
private |
◆ shiftInertiaTensor()
| static Eigen::Matrix3d franka_gazebo::FrankaHWSim::shiftInertiaTensor |
( |
Eigen::Matrix3d |
I, |
|
|
double |
m, |
|
|
Eigen::Vector3d |
p |
|
) |
| |
|
inlinestaticprivate |
Shift the moment of inertia tensor by a given offset.
This method is based on Steiner's Parallel Axis Theorem

where
is the skewMatrix of p
- Parameters
-
| [in] | I | the inertia tensor defined in the original frame or center or mass of m |
| [in] | m | the mass of the body in |
| [in] | p | the offset vector to move the inertia tensor along starting from center of mass |
- Returns
- the shifted inertia tensor
Definition at line 238 of file franka_hw_sim.h.
◆ skewMatrix()
| static Eigen::Matrix3d franka_gazebo::FrankaHWSim::skewMatrix |
( |
const Eigen::Vector3d & |
vec | ) |
|
|
inlinestaticprivate |
Helper function for generating a skew symmetric matrix for a given input vector such that:
.
- Parameters
-
| [in] | vec | the 3D input vector for which to generate the matrix for |
- Returns
i.e. a skew symmetric matrix for vec
Definition at line 212 of file franka_hw_sim.h.
◆ updateRobotState()
| void franka_gazebo::FrankaHWSim::updateRobotState |
( |
ros::Time |
time | ) |
|
|
private |
◆ updateRobotStateDynamics()
| void franka_gazebo::FrankaHWSim::updateRobotStateDynamics |
( |
| ) |
|
|
private |
◆ velocityControl()
| double franka_gazebo::FrankaHWSim::velocityControl |
( |
Joint & |
joint, |
|
|
double |
setpoint, |
|
|
const ros::Duration & |
period |
|
) |
| |
|
staticprivate |
◆ writeSim()
Pass the data send from controllers via the hardware interfaces onto the simulation.
This will e.g. write the joint commands (torques or forces) to the corresponding joint in Gazebo in each timestep. These commands are usually send via an EffortJointInterface
- Parameters
-
| [in] | time | the current (simulated) ROS time |
| [in] | period | the time step at which the simulation is running |
Implements gazebo_ros_control::RobotHWSim.
Definition at line 470 of file franka_hw_sim.cpp.
◆ action_recovery_
◆ arm_id_
| std::string franka_gazebo::FrankaHWSim::arm_id_ |
|
private |
◆ eji_
◆ fmi_
◆ fsi_
◆ gravity_earth_
| std::array<double, 3> franka_gazebo::FrankaHWSim::gravity_earth_ |
|
private |
◆ joints_
◆ jsi_
◆ lower_force_thresholds_nominal_
| std::vector<double> franka_gazebo::FrankaHWSim::lower_force_thresholds_nominal_ |
|
private |
◆ model_
◆ pji_
◆ robot_
| gazebo::physics::ModelPtr franka_gazebo::FrankaHWSim::robot_ |
|
private |
◆ robot_initialized_
| bool franka_gazebo::FrankaHWSim::robot_initialized_ |
|
private |
If gazebo::Joint::GetForceTorque() yielded already a non-zero value.
Definition at line 127 of file franka_hw_sim.h.
◆ robot_initialized_pub_
◆ robot_state_
| franka::RobotState franka_gazebo::FrankaHWSim::robot_state_ |
|
private |
◆ service_collision_behavior_
◆ service_controller_list_
◆ service_controller_switch_
◆ service_set_ee_
◆ service_set_k_
◆ service_set_load_
◆ service_user_stop_
◆ sm_
◆ tau_ext_lowpass_filter_
| double franka_gazebo::FrankaHWSim::tau_ext_lowpass_filter_ |
|
private |
◆ upper_force_thresholds_nominal_
| std::vector<double> franka_gazebo::FrankaHWSim::upper_force_thresholds_nominal_ |
|
private |
◆ verifier_
◆ vji_
The documentation for this class was generated from the following files: