Hello,
I'm working in a dual cartesian impedance control custom controller that I want to simulate in gazebo. This controller needs both franka_hw/FrankaStateInterface and franka_hw/FrankaModelInterface to compute some variables. I made a urdf.xacro file that holds both robots with different ids, but I'm having issues when add bot state and model code lines that I take from the original franka_robot.xacro file, which are:
<!-- ========================================================== -->
<!-- Adds the required tags to provide a `FrankaStateInterface` -->
<!-- when simulating with franka_hw_sim plugin -->
<!-- -->
<!-- arm_id - Arm ID of the panda to simulate (default 'panda') -->
<!-- ========================================================== -->
<xacro:macro name="transmission-franka-state" params="arm_id:=panda">
<transmission name="${arm_id}_franka_state">
<type>franka_hw/FrankaStateInterface</type>
<joint name="${arm_id}_joint1"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></joint>
<joint name="${arm_id}_joint2"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></joint>
<joint name="${arm_id}_joint3"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></joint>
<joint name="${arm_id}_joint4"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></joint>
<joint name="${arm_id}_joint5"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></joint>
<joint name="${arm_id}_joint6"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></joint>
<joint name="${arm_id}_joint7"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></joint>
<actuator name="${arm_id}_motor1"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></actuator>
<actuator name="${arm_id}_motor2"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></actuator>
<actuator name="${arm_id}_motor3"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></actuator>
<actuator name="${arm_id}_motor4"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></actuator>
<actuator name="${arm_id}_motor5"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></actuator>
<actuator name="${arm_id}_motor6"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></actuator>
<actuator name="${arm_id}_motor7"><hardwareInterface>franka_hw/FrankaStateInterface</hardwareInterface></actuator>
</transmission>
</xacro:macro>
<!-- ============================================================ -->
<!-- Adds the required tags to provide a `FrankaModelInterface` -->
<!-- when simulating with franka_hw_sim plugin -->
<!-- -->
<!-- arm_id - Arm ID of the panda to simulate (default 'panda') -->
<!-- root - Joint name of the base of the robot -->
<!-- tip - Joint name of the tip of the robot (flange or hand) -->
<!-- ============================================================ -->
<xacro:macro name="transmission-franka-model" params="arm_id:=panda root:=panda_joint1 tip:=panda_joint7">
<transmission name="${arm_id}_franka_model">
<type>franka_hw/FrankaModelInterface</type>
<joint name="${root}">
<role>root</role>
<hardwareInterface>franka_hw/FrankaModelInterface</hardwareInterface>
</joint>
<joint name="${tip}">
<role>tip</role>
<hardwareInterface>franka_hw/FrankaModelInterface</hardwareInterface>
</joint>
<actuator name="${root}_motor_root"><hardwareInterface>franka_hw/FrankaModelInterface</hardwareInterface></actuator>
<actuator name="${tip}_motor_tip" ><hardwareInterface>franka_hw/FrankaModelInterface</hardwareInterface></actuator>
</transmission>
</xacro:macro>
my dual_panda_2.urdf.xacro looks like this, I'm just taking code parts from franka_robot.xacro and adding them to this file:
<?xml version="1.0"?>
<launch>
<!-- Launch empty Gazebo world -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="use_sim_time" value="true" />
<arg name="gui" value="true" />
<arg name="paused" value="true" />
<arg name="debug" value="false" />
</include>
<!-- Load the robot description file-->
<param name="robot_description" command="$(find xacro)/xacro '$(find franka_bimanual_controllers)/description/dual_panda_2.urdf.xacro'" />
<!-- Spawn the robot over the robot_description param-->
<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-urdf -param robot_description -model dual_panda" />
<!-- Start the combined control node -->
<rosparam command="load" file="$(find franka_bimanual_controllers)/config/franka_bimanual_controllers.yaml" />
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="bimanual_cartesian_impedance_controller"/>
<node name="rqt_reconfigure" pkg="rqt_reconfigure" type="rqt_reconfigure" required="false" />
<!-- Generate joint_states and tf_tree -->
<!-- <node if="$(arg gui)" name="joint_state_publisher" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" />
<node unless="$(arg gui)" name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<node name="rviz" pkg="rviz" type="rviz" required="true" /> -->
<!-- Optional: Spawn the robot at specific pause use the below spawner args, and set the above paused arg to true. This initial pose should correspond to the initial pose in the robot srdf-->
<!-- <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-urdf -param robot_description -model panda_multiple_arms
-J right_arm_joint1 0.0
-J right_arm_joint2 -0.785
-J right_arm_joint3 0.0
-J right_arm_joint4 -2.356
-J right_arm_joint5 0.0
-J right_arm_joint6 1.571
-J right_arm_joint7 0.785
-J left_arm_joint1 0.0
-J left_arm_joint2 -0.785
-J left_arm_joint3 0.0
-J left_arm_joint4 -2.356
-J left_arm_joint5 0.0
-J left_arm_joint6 1.571
-J left_arm_joint7 0.785
-unpause"/> -->
</launch>
When I try to launch in gazebo, I'm getting this warning during the launch:
[ WARN] [1712839920.741625034]: Transmission panda_right_franka_state has more than one joint. Currently the default robot hardware simulation interface only supports one.
[ WARN] [1712839920.741645279]: Transmission panda_right_franka_model has more than one joint. Currently the default robot hardware simulation interface only supports one.
[ WARN] [1712839920.741652543]: Transmission panda_left_franka_state has more than one joint. Currently the default robot hardware simulation interface only supports one.
[ WARN] [1712839920.741658723]: Transmission panda_left_franka_model has more than one joint. Currently the default robot hardware simulation interface only supports one.
After I press play in gazebo, the simulation crashes with this errors:
[ERROR] [1712839920.805649563]: This controller requires a hardware interface of type 'franka_hw::FrankaModelInterface', but is not exposed by the robot. Available interfaces in robot:
- 'hardware_interface::EffortJointInterface'
- 'hardware_interface::JointStateInterface'
- 'hardware_interface::PositionJointInterface'
- 'hardware_interface::VelocityJointInterface'
[ERROR] [1712839920.805682166]: Initializing controller 'bimanual_cartesian_impedance_controller' failed
I'm doing something wrong?
First, of course that both pandas has more than one joint, how does the hardware simulation just support one?
To expose franka_hw::FrankaModelInterface I added the ```
Hello, I'm working in a dual cartesian impedance control custom controller that I want to simulate in gazebo. This controller needs both franka_hw/FrankaStateInterface and franka_hw/FrankaModelInterface to compute some variables. I made a urdf.xacro file that holds both robots with different ids, but I'm having issues when add bot state and model code lines that I take from the original franka_robot.xacro file, which are:
my dual_panda_2.urdf.xacro looks like this, I'm just taking code parts from franka_robot.xacro and adding them to this file:
And this is my launch:
When I try to launch in gazebo, I'm getting this warning during the launch:
After I press play in gazebo, the simulation crashes with this errors:
I'm doing something wrong?
<xacro:transmission-franka-model arm_id="$(arg arm_id_1)"
I just dont get what wrong here. I also, found this issue where he relates the same warnings #313 but the issue is different