Project

General

Profile

Wiki » History » Version 6

Gianluca Corsini, 2023-07-05 11:11

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