Project

General

Profile

Wiki » History » Version 4

Gianluca Corsini, 2022-09-06 20:11

1 1 Gianluca Corsini
{{toc}}
2
>
3
4
h2. = Introduction
5
>
6
This repository contains a @Gazebo@ plugin that allows simulating a chain of @Dynamixel@ motors connected together to the same serial bus.
7
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@.
8
*However*, not all the functionalities have been implemented yet.
9
>
10
11
h3. Working functionalities
12
>
13
* Motor models implemented are @MX28T@, @MX64T@.
14
** A template for other motors is provided (@libdynamixel/src/motors/MOTOR.h@).
15
* Set position and velocities of the motor.
16
* Multiple instances of @dxsim-gazebo@ can be instantiated (*NB:* specify a different pty port for each!).
17
* Emulate @RAM@ and @EEPROM@ of each motor's Control Table (see online documentation).
18
** The number of entries is fully customizable through the motors' header files.
19
* Debug mode can be enabled from the @sdf@ file, independently for each motor.
20
>
21
22
h3. Not implemented functionalities
23
>
24
* Set effort.
25
* You can send PID gains, but they are not used.
26
27
h3. Assumptions
28
>
29
* The dynamics of the motor has been neglected.
30
31
h2. = Installation
32
>
33
* You need first to clone and install "libydnamixel":https://redmine.laas.fr/projects/libdynamixel
34
** Follow instructions reported in "readme.md":https://redmine.laas.fr/projects/libdynamixel/repository/libdynamixel/revisions/master/entry/readme.md file.
35
* Then clone @dxsim-gazebo@ repository.
36
** To install it, use the following commands:
37
<pre><code class="shell">
38
$ autoreconf -if
39
$ ./configure [--prefix=<installation_path>]
40
$ make && make install
41
</code></pre>
42
** Make sure that the folder @lib/gazebo@ at the installation location is contained in the environment variable @GAZEBO_PLUGIN_PATH@ in your @.bashrc@.
43
>
44
45 2 Gianluca Corsini
h2. = How to use
46 1 Gianluca Corsini
>
47
In the @sdf@ file of your model, you have to insert the following lines for each instance you want to create:
48
49 3 Gianluca Corsini
<pre><code class="XML">
50
  <plugin name="dxsim" filename="dxsim-gazebo.so">
51
    <pty>/tmp/pty-dynamixel</pty>
52
    <period>1e-3</period>
53
    <motors>
54
      <motor>
55
        <joint spin="ccw">joint_1</joint>
56
        <eeprom>/home/gcorsini/dx_eeprom_id1</eeprom>
57
        <model>MX64T</model>
58
        <p0>0.0</p0>
59
        <v0>0.0</v0>
60
        <id>1</id>
61
        <noise>0</noise>
62
        <debug>0</debug>
63
      </motor>
64
      <motor>
65
        <joint spin="ccw">joint_2</joint>
66
        <eeprom>/home/gcorsini/dx_eeprom_id2</eeprom>
67
        <model>MX28T</model>
68
        <p0>0.0</p0>
69
        <v0>0.0</v0>
70
        <id>2</id>
71
        <noise>0</noise>
72
        <debug>0</debug>
73
      </motor>
74
    </motors>
75
  </plugin>
76 1 Gianluca Corsini
</code></pre>
77
78 4 Gianluca Corsini
* @<eeprom>@: path where the EEPROM file is saved. Environment variables can be specified, e.g. @$HOME@.
79
80 1 Gianluca Corsini
>
81
If a @eeprom@ path has been specified, then at that location you should have a file looking like the following:
82
83
<pre>
84
model_number 311
85
model_info 0
86
firmware_ver 0
87
id 1
88
return_delay_time 0
89
operating_mode 1
90
secondary_id 255
91
homing_offset 0
92
temperature_limit 80
93
max_voltage_limit 160
94
min_voltage_limit 95
95
pwm_limit 885
96
current_limit 1941
97
acceleration_limit 32767
98
velocity_limit 1023
99
</pre>
100
101
+This file is an example of the @eeprom@ of a @MX64T@ motor.+
102
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.
103
> For more details please visit the "online Dynamixel documentation":https://emanual.robotis.com/.
104
>> "MX Series documentation":https://emanual.robotis.com/docs/en/dxl/mx/.
105
106
h2. = Todo
107
>