Project

General

Profile

Actions

Wiki » History » Revision 4

« Previous | Revision 4/7 (diff) | Next »
Gianluca Corsini, 2022-09-06 20:11


= Introduction

This repository contains a Gazebo plugin that allows simulating a chain of Dynamixel motors connected together to the same serial bus.
It provides the same interface as the real one, i.e. a pty port connection you can connect to, and it emulates completely the Dynamixel Protocol 2.0.
However, not all the functionalities have been implemented yet.

Working functionalities

  • Motor models implemented are MX28T, MX64T.
    • A template for other motors is provided (libdynamixel/src/motors/MOTOR.h).
  • Set position and velocities of the motor.
  • Multiple instances of dxsim-gazebo can be instantiated (NB: specify a different pty port for each!).
  • Emulate RAM and EEPROM of each motor's Control Table (see online documentation).
    • The number of entries is fully customizable through the motors' header files.
  • Debug mode can be enabled from the sdf file, independently for each motor.

Not implemented functionalities

  • Set effort.
  • You can send PID gains, but they are not used.

Assumptions

  • The dynamics of the motor has been neglected.

= Installation

  • You need first to clone and install libydnamixel
    • Follow instructions reported in readme.md file.
  • Then clone dxsim-gazebo repository.
    • To install it, use the following commands:
      $ autoreconf -if
      $ ./configure [--prefix=<installation_path>]
      $ make && make install
      
    • Make sure that the folder lib/gazebo at the installation location is contained in the environment variable GAZEBO_PLUGIN_PATH in your .bashrc.

= How to use

In the sdf file of your model, you have to insert the following lines for each instance you want to create:

  <plugin name="dxsim" filename="dxsim-gazebo.so">
    <pty>/tmp/pty-dynamixel</pty>
    <period>1e-3</period>
    <motors>
      <motor>
        <joint spin="ccw">joint_1</joint>
        <eeprom>/home/gcorsini/dx_eeprom_id1</eeprom>
        <model>MX64T</model>
        <p0>0.0</p0>
        <v0>0.0</v0>
        <id>1</id>
        <noise>0</noise>
        <debug>0</debug>
      </motor>
      <motor>
        <joint spin="ccw">joint_2</joint>
        <eeprom>/home/gcorsini/dx_eeprom_id2</eeprom>
        <model>MX28T</model>
        <p0>0.0</p0>
        <v0>0.0</v0>
        <id>2</id>
        <noise>0</noise>
        <debug>0</debug>
      </motor>
    </motors>
  </plugin>
  • <eeprom>: path where the EEPROM file is saved. Environment variables can be specified, e.g. $HOME.

If a eeprom path has been specified, then at that location you should have a file looking like the following:

model_number 311
model_info 0
firmware_ver 0
id 1
return_delay_time 0
operating_mode 1
secondary_id 255
homing_offset 0
temperature_limit 80
max_voltage_limit 160
min_voltage_limit 95
pwm_limit 885
current_limit 1941
acceleration_limit 32767
velocity_limit 1023

This file is an example of the eeprom of a MX64T motor.
Changes to this file will lead to a runtime error in dynamixel-gazebo if not performed properly; the EEPROM file should contain all the memory entries specified in the motor model's header file related to the EEPROM.

For more details please visit the online Dynamixel documentation.

MX Series documentation.

= Todo

Updated by Gianluca Corsini about 2 years ago · 7 revisions