Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ros2_control SimpleTransmission implementation #1881

Open
AlePuglisi opened this issue Nov 19, 2024 · 0 comments
Open

ros2_control SimpleTransmission implementation #1881

AlePuglisi opened this issue Nov 19, 2024 · 0 comments

Comments

@AlePuglisi
Copy link

Hello!
I'm working on ros2 Humble, Ubuntu 22.04, Gazebo classic 11.0.
I'm investigating how SimpleTransmission is implemented in ros2_control, because I need it for a bigger project.
( In the big project I work on a 4-limbed robot with 7 DOF per limb, and I want to control each joint using the /effort_controller/commands topic, created by the effort_controllers/JointGroupEffortController. All the control input works, but I want to simulate the internal gearbox of the motors, which I need for independent joint control. Because having a high gear ratio allows for disturbance reduction in the closed-loop motor control)

To understand it, I wrote a simplified system composed of just a box and cylinder connected by a revolute joint.
I want to make it possible to properly simulate a simple gearbox transmission ratio, as the one implemented by a Dynamixel Motor.
Here is the simple_system_ros2_control.urdf:

  <hardware>
    <plugin>gazebo_ros2_control/GazeboSystem</plugin>
  </hardware>

  <joint name="motor_joint">
    <command_interface name="position">
      <param name="min">-10</param>
      <param name="max">10</param>
    </command_interface>
    <command_interface name="velocity">
      <param name="min">-3</param>
      <param name="max">3</param>
    </command_interface>
    <command_interface name="effort">
      <param name="min">-10</param>
      <param name="max">10</param>
    </command_interface>
    <state_interface name="position">  <!-- Set initial joint position -->
      <param name="initial_value"> 0.0 </param>
    </state_interface>
    <state_interface name="velocity"/>
    <state_interface name="effort"/>

    <!-- TENTATIVE N.1-->
    <!-- <transmission name="motor_joint_transmission">
      <plugin>transmission_interface/SimpleTransmission</plugin>
      <param name="joint_to_actuator">250.0.0</param>
    </transmission>
     -->
    
  </joint>

  <!-- TENTATIVE N.2-->
  <!-- <transmission name="motor_joint_transmission">
    <plugin>transmission_interface/SimpleTransmission</plugin>
    <joint name="motor_joint" role="motor_joint">
      <mechanical_reduction>250.0</mechanical_reduction>
    </joint>
  </transmission> -->


  <!-- TENTATIVE N.3 -->
  <!-- <transmission name="motor_joint_transmission">
    <type>transmission_interface/SimpleTransmission</type>
      <joint name="motor_joint">
        <hardwareInterface>EffortJointInterface</hardwareInterface>
      </joint>
      <actuator name="motor_joint_motor">
        <mechanicalReduction>250.0</mechanicalReduction>
        <hardwareInterface>EffortJointInterface</hardwareInterface>
      </actuator>
  </transmission> -->


</ros2_control>
-------------------------------------------------------------------------------------------------- I commented out the different tentative here, none of them seems to work. Tentatives N.1 and N.2 are completely ignored by the parser I think. In fact I also tried to set a reduction ratio of 0.0 and no ERROR was reported... even if as I saw from simple_transmission.hpp there is a proper handling of 0 reduction ratio setting. While tentative N.3 give me the error: [ERROR] [gzserver-1]: process has died [pid 41504, exit code 255, cmd 'gzserver -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so']. ( so maybe is a bad plugin import...)

Someone has some clear example code on how to use simple transmission that works properly??
Also, if there is an already written plug-in to create a topic that publish the internal motor angle and torque?
Ideally I want to work at the motor level.. But I don't know how to do it in an intuitive way without implementing low level plug-ins on my own.
Anyway, for now my main issue is related to a working implementation of Transmission interface for gearbox reduction ratio simulation in Gazebo.

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant