Skip to content

Commit ea50d76

Browse files
committed
Update README.md
Signed-off-by: Gregory Mermet <g.mermet@ez-wheel.com>
1 parent ba24f22 commit ea50d76

File tree

2 files changed

+60
-10
lines changed

2 files changed

+60
-10
lines changed

README.md

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Pre-built packages are available for ROS Noetic on Ubuntu 20.04 (for **x64_86**
1919
- `SWD firmware` (**`> 1.0.1`**)
2020
- Ubuntu 20.04
2121
- ROS Noetic
22-
- `swd-services (>= 0.1.3 and <0.2.0)`
22+
- `swd-services (>= 0.2.5)`
2323

2424
### Ubuntu
2525

@@ -64,21 +64,75 @@ source ~/ros_ws/install/setup.bash
6464

6565
## Usage
6666

67-
The package comes with a preconfigured `.launch` file for the [SWD® Starter Kit](https://www.ez-wheel.com/en/development-kit-for-agv-and-amr):
67+
The package comes with a preconfigured `.launch` files which can be started using the `roslaunch` command:
68+
- `swd_diff_drive_controller.launch`: sample configuration for the [SWD® Starter Kit](https://www.ez-wheel.com/en/development-kit-for-agv-and-amr) differential drive robot. To use it, run the following command:
6869

6970
```shell
7071
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ezw/usr/lib
7172
roslaunch swd_ros_controllers swd_diff_drive_controller.launch
7273
```
7374

74-
Or you can run it with a custom configuration, the minimum required parameters are:
75-
75+
You can always use the node with the `rosrun` command, the minimum required parameters are:
7676
```shell
7777
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ezw/usr/lib
7878
rosrun swd_ros_controllers swd_diff_drive_controller \
7979
_baseline:=0.485
8080
```
81+
The corresponding D-Bus services have to be started in order to use the nodes.
82+
Example for the [SWD® Starter Kit](https://www.ez-wheel.com/en/development-kit-for-agv-and-amr) differential drive robot:
83+
* ezw-dbus-user-session.service (dbus-launch > /tmp/SYSTEMCTL_dbus.id) [**OPTIONAL**]
84+
> export $(cat /tmp/SYSTEMCTL_dbus.id) [**OPTIONAL**]
85+
86+
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ezw/usr/lib
87+
* ezw-swd-left.service (/opt/ezw/usr/bin/ezw-smc-service /opt/ezw/usr/etc/ezw-smc-core/swd_left_config.ini)
88+
* ezw-swd-right.service (/opt/ezw/usr/bin/ezw-smc-service /opt/ezw/usr/etc/ezw-smc-core/swd_right_config.ini)
89+
90+
Example of configuration files for [SWD® Starter Kit](https://www.ez-wheel.com/en/development-kit-for-agv-and-amr) differential drive robot:
91+
92+
swd_left_config.ini
93+
```
94+
# SMC Drive service config file
95+
contextId = 12
96+
nodeId = 4
97+
coreNodeId = 6
98+
coreNodeIsMaster = true # Slave:false Master:true
99+
canDevice = can0
100+
dbusNamespace = swd_left
101+
102+
HWConfigurationEntry = SWD_CORE
103+
HWConfigurationFile = /opt/ezw/data/configuration.json
104+
105+
CANOpenEDSFile = /opt/ezw/usr/etc/ezw-canopen-dico/swd_core.eds
106+
```
81107

108+
swd_right_config.ini
109+
```
110+
# SMC Drive service config file
111+
contextId = 12
112+
nodeId = 5
113+
coreNodeId = 7
114+
coreNodeIsMaster = true # Slave:false Master:true
115+
canDevice = can0
116+
dbusNamespace = swd_right
117+
118+
HWConfigurationEntry = SWD_CORE
119+
HWConfigurationFile = /opt/ezw/data/configuration.json
120+
121+
CANOpenEDSFile = /opt/ezw/usr/etc/ezw-canopen-dico/swd_core.eds
122+
```
123+
124+
configuration.json
125+
```
126+
[
127+
{
128+
"name": "SWD_CORE",
129+
"nbStepRevolutionElec": 6,
130+
"nbPolePair": 5,
131+
"reduction": 14.0,
132+
"diameter": 125.0
133+
}
134+
]
135+
```
82136
## The `swd_diff_drive_controller` node
83137

84138
This controller drives two ez-Wheel SWD® wheels as a differential-drive robot.
@@ -101,6 +155,7 @@ This controller drives two ez-Wheel SWD® wheels as a differential-drive robot.
101155
- `control_mode` of type **`string`**: This parameter selects the control mode of the robot, if `'Twist'` is selected, the node will subscribe to the `~cmd_vel` topic, if `'LeftRightSpeeds'` is selected, the node subscribe to `~set_speed` (default `'Twist'`).
102156
- `left_encoder_relative_error` of type **`double`**: Relative error for left wheel encoder, used to calculate variances and propagate them to calculate the uncertainties in the odometry message. Each encoder acquisition **`DIFF_LEFT_ENCODER`** is modeled as: **`DIFF_LEFT_ENCODER +/- abs(left_encoder_relative_error * DIFF_LEFT_ENCODER)`** (default `0.05` corresponding to 5% of error).
103157
- `right_encoder_relative_error` of type **`double`**: Relative error for right wheel encoder, used to calculate variances and propagate them to calculate the uncertainties in the odometry message. Each encoder acquisition **`DIFF_RIGHT_ENCODER`** is modeled as: **`DIFF_RIGHT_ENCODER +/- abs(right_encoder_relative_error * DIFF_RIGHT_ENCODER)`** (default `0.05` corresponding to 5% of error).
158+
- `fine_odometry` of type **`bool`**: Use fine odometry (default `false`). See fine_odometry.md for procedure to follow.
104159

105160
### Subscribed Topics
106161

fine_odometry.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ commissioning.py:
2828
communication_client.setTPDOMappingParameters(PDOId.PDO_3, mapping)
2929
check("setTPDOMappingParameters(PDOId.PDO_3)", error)
3030
```
31-
## ROS2
31+
## ROS
3232
The latest swd_diff_drive controller on github contains a parameter to indicate which odometry shall be used: `"fine_odometry": False.`By default, this parameter is set to false in order to continue using `position_value`data and `getOdometryValue()` function.
3333

34-
## ROS1
35-
Until **getFineOdometry()** is available, a possible workaround is to modif "**nbPolePair**" setting into `configuration.json` file :
36-
`"nbPolePair": 60.0` instead of `"nbPolePair": 5.0`
37-
38-
Thus, the formula used by "**getOdometryValue**" will compute the same value as "**getFineOdometryValue**" and all transparent to the swd_diff_drive_controller node.

0 commit comments

Comments
 (0)