Skip to content

Commit 78e2184

Browse files
authored
Sync changes between Harmonic and Ionic directories (#551)
* Fix anchor links Signed-off-by: Addisu Z. Taddese <[email protected]> * Sync changes between Harmonic and Ionic directories Signed-off-by: Addisu Z. Taddese <[email protected]> --------- Signed-off-by: Addisu Z. Taddese <[email protected]>
1 parent 964d37d commit 78e2184

19 files changed

+319
-93
lines changed

harmonic/GUI_tutorial.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Along the bottom edge of the scene, you'll notice several buttons:
119119

120120
![Playback buttons](tutorials/gui/playback.png)
121121

122-
From left to right, the options are `Play`, `Steps` and `RTF` (real time factor).
122+
From left to right, the options are `Play`, `Steps`, `Reset`, `RTF` (real time factor).
123123

124124
Pressing `Play` will start the simulation.
125125
You can use the same button to pause the simulation as well.
@@ -129,6 +129,8 @@ You can customize step size by hovering over the button.
129129

130130
![hover steps](tutorials/gui/hover_steps.png)
131131

132+
Pressing `Reset` will clear any unsaved modification to the scene. Clicking it will remove the newly inserted shapes `box_0`, `sphere_0` and `capsule_0`.
133+
132134
At the furthest right end of the scene, you can expand `RTF` to see not only the percentage value that compares real time with sim time, but also those individual values themselves, as well as iteration count.
133135

134136
![RTF expanded](tutorials/gui/rtf_expanded.png)

harmonic/Model_insertion_fuel.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,31 @@ Check that the file size on the right is reasonable for your application before
3232

3333
There are a few different ways to spawn a model into the simulation.
3434

35-
1. **Spawn from 'Fuel Resource' using the Resource Spawner plugin.**
35+
1. **Spawn from 'Fuel resources' using the Resource Spawner plugin.**
3636

3737
Select the Resource Spawner plugin from the plugin menu (top right corner).
3838
The plugin will appear in the right panel, you might need to scroll down to be able to see the plugin.
39-
Wait until the resource are loaded under the 'Fuel Resource' panel.
39+
Wait until the resources are loaded under the 'Fuel resources' panel.
4040
Select a resource owner (e.g. openrobotics), you can now search for the model name in the right panel.
4141
Click on the cloud icon to download the model.
4242
When the model has been downloaded, you can click on the model and insert it into your simulation scene.
4343

44-
![Resource Spawner - Fuel Resource](tutorials/fuel_insert/resource_spawner_cloud.png)
44+
![Resource Spawner - Fuel resources](tutorials/fuel_insert/resource_spawner_cloud.png)
4545

4646

4747
2. **Download model files from Fuel and spawn from local sources using the Resource Spawner plugin.**
4848

4949
- Download the model files from [app.gazebosim.org/fuel/models](https://app.gazebosim.org/fuel/models).
50-
- Extract the files and places them under your local model directory (e.g. `~/my-local-models/model-name`).
50+
- Extract the files and place them under your local model directory (e.g. `~/my-local-models/model-name`).
5151
The folder should contain `materials`, `meshes` as well as the `model.config` and the `model.sdf` files.
5252
- Add your model directory as a resource with `export GZ_SIM_RESOURCE_PATH=~/my-local-models/`
5353
- Open the Gazebo Simulator and add the Resource Spawner Plugin, the model should now show up under your local resources.
5454

55-
![Resource Spawner - Fuel Resource](tutorials/fuel_insert/resource_spawner_local.png)
55+
![Resource Spawner - Fuel resources](tutorials/fuel_insert/resource_spawner_local.png)
5656

5757
3. **Copying the SDF snippet and adding it to your custom world SDF file.**
5858

59-
With the `<>` button you can directly copy a SDF snippet to paste into your world SDF file.
59+
With the `<>` button you can directly copy an SDF snippet to paste into your world SDF file.
6060
The SDF snippet will look something like this:
6161

6262
```
@@ -72,10 +72,10 @@ There are a few different ways to spawn a model into the simulation.
7272
7373
![spawn](tutorials/fuel_insert/husky.gif)
7474
75-
4. **Downloading the code to permanently add a Fuel model to your custum SDF file.**
75+
4. **Downloading the code to permanently add a Fuel model to your custom SDF file.**
7676
7777
If you prefer to add a Fuel model permanently to an `sdf` file, you can just as easily download the code by clicking the download-arrow icon to the right of the model's image.
78-
Kook at the tutorial on [SDF Worlds](sdf_worlds) for more information on how to construct a custom world SDF file.
78+
Look at the tutorial on [SDF Worlds](sdf_worlds) for more information on how to construct a custom world SDF file.
7979
8080
Now you can add more models, or even load in any one of the plugins you learned about to interact with the model the same way you could with the shapes in the previous tutorial.
8181

harmonic/install_ubuntu_src.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,17 @@ sudo apt install python3-pip lsb-release gnupg curl
2929

3030
## vcstool and colcon from pip
3131

32-
PIP is available on all platforms:
32+
PIP is available on all platforms. Using a PIP workspace to install the tools:
3333

3434
```bash
35-
pip install vcstool || pip3 install vcstool
35+
python3 -m venv $HOME/vcs_colcon_installation
36+
. $HOME/vcs_colcon_installation/bin/activate
37+
pip3 install vcstool colcon-common-extensions
3638
```
3739

38-
```bash
39-
pip install -U colcon-common-extensions || pip3 install -U colcon-common-extensions
40-
```
41-
42-
Check that no errors were printed while installing with PIP. If your system is not recognising the commands, and you're using a system that is compatible with Debian or Ubuntu packages, see the instructions below to install using `apt`.
43-
44-
After installing `vcstool` and `colcon` with PIP, you may need to add their executables to your `$PATH`.
45-
Check where the installation of these packages took place:
46-
47-
```bash
48-
pip show vcstool || pip3 show vcstool | grep Location
49-
50-
pip show colcon-common-extensions || pip3 show colcon-common-extensions | grep Location
51-
```
52-
53-
If your install path is prefixed with `$HOME/.local`, you'll probably need to add the executables within this directory to your `$PATH` in order to avoid "command not found" errors when using `vcstool` and `colcon` later on:
54-
55-
```bash
56-
export PATH=$PATH:$HOME/.local/bin/
57-
```
40+
`vcs` and `colcon` are now available from the PIP workspace in the current
41+
terminal. For using them in other terminals run the `activate` script as
42+
done above.
5843

5944
## vcstool and colcon from apt
6045

@@ -143,14 +128,23 @@ colcon graph
143128
If that is the case, then you are ready
144129
to build the whole set of libraries:
145130

131+
:::{warning}
132+
133+
Compilation can take up to 16Gb of RAM memory. Use MAKEFLAGS with
134+
colcon as detailed in its instructions to reduce the number of
135+
compilation threads if needed.
136+
137+
:::
138+
139+
146140
```bash
147141
colcon build --merge-install
148142
```
149143

150144
To speed up the build process, you could also disable tests by using
151145

152146
```bash
153-
colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install
147+
colcon build --cmake-args ' -DBUILD_TESTING=OFF' --merge-install
154148
```
155149

156150
To use debuggers activate debug symbols. Gazebo will run slower, but you'll be able to use GDB:
@@ -228,7 +222,7 @@ To perform QML debugging you'll need:
228222
You will need to build Gazebo with:
229223
230224
```bash
231-
colcon build --cmake-args -DQT_QML_DEBUG --merge-install
225+
colcon build --cmake-args ' -DQT_QML_DEBUG' --merge-install
232226
```
233227
234228
> **Note:** Advanced users may note that only the `gz-sim` project needs this flag.

harmonic/install_windows_src.md

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,22 @@ without any failures when using their functionalities.
1515
1616
## Install dependencies
1717

18-
1. Install a conda distribution. As Gazebo uses all dependencies from the conda-forge channel,
19-
we suggest to install miniforge following [the official miniforge installation docs](https://github.com/conda-forge/miniforge#windows)
20-
You will likely want to check the box to add `conda` to your `PATH`
21-
during the installation process so that you won't have to do this step manually.
18+
1. If you do not have the conda package manager installed in your system, install a conda distribution.
19+
As Gazebo uses all dependencies from the conda-forge channel, we suggest to install miniforge following [the official miniforge installation docs](https://github.com/conda-forge/miniforge#windows) by executing the following commands in a "Command Prompt" terminal:
20+
```cmd
21+
curl.exe -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe
22+
start /wait "" Miniforge3-Windows-x86_64.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%UserProfile%\Miniforge3
23+
%UserProfile%\Miniforge3\condabin\conda init
24+
%UserProfile%\Miniforge3\condabin\conda config --set auto_activate_base false
25+
del Miniforge3-Windows-x86_64.exe
26+
```
27+
If you followed this step correctly, you should be able to access `conda` in any new "Command Prompt" terminal you open.
28+
To verify that, check that if you open a new terminal and execute `conda info`, the output begins with:
29+
```cmd
30+
active environment : None
31+
shell level : 0
32+
[..]
33+
```
2234

2335
2. Install [Visual Studio 2019 or 2022](https://visualstudio.microsoft.com/downloads/).
2436
The Community version is free for students, open-source developers, and personal
@@ -27,21 +39,24 @@ without any failures when using their functionalities.
2739
cmake via Conda. All other checkboxes can be left unchecked.
2840

2941
3. Open a Visual Studio Command Prompt (search for "x64 Native Tools Command Prompt
30-
for VS" in the Windows search field near the Windows button). Optionally,
42+
for VS" in the Windows search field near the Windows button) or Developer PowerShell
43+
for VS (search for "developer powershell"). Optionally,
3144
right-click and pin to the task bar for quick access in the future.
3245

33-
If you did not add Conda to your `PATH` environment variable during Conda installation,
34-
you may need to navigate to the location of `condabin` in order to use the `conda` command.
35-
To find `condabin`, search for "Anaconda Prompt" in the Windows search field near the
36-
Windows button, open it, run `where conda`, and look for a line containing the directory `condabin`.
46+
If you chose PowerShell, you need to do a few steps to be able to use Conda and Gazebo in it:
47+
```bash
48+
conda init powershell
49+
# Restart the PowerShell
50+
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
51+
```
3752

38-
4. Navigate to your `condabin`, if necessary, and then create and activate a Conda environment:
53+
4. Create and activate a Conda environment:
3954
```bash
4055
conda create -n gz-ws
4156
conda activate gz-ws
4257
```
4358
Once you have activated an environment, a prefix like `(gz-ws)` will be prepended to
44-
your prompt, and you can use the `conda` command outside of the `condabin` directory.
59+
your prompt.
4560

4661
You can use `conda info --envs` to see all of your environments.
4762

@@ -65,8 +80,8 @@ without any failures when using their functionalities.
6580
conda install cmake git vcstool curl pkg-config ^
6681
colcon-common-extensions dartsim eigen freeimage gdal gts ^
6782
glib dlfcn-win32 ffmpeg ruby tinyxml2 tinyxml ^
68-
libprotobuf urdfdom zeromq cppzmq ogre=1.10 ogre-next jsoncpp ^
69-
libzip qt pybind11 --channel conda-forge
83+
protobuf urdfdom zeromq cppzmq ogre=1.10 ogre-next jsoncpp ^
84+
libzip qt pybind11 boost --channel conda-forge
7085
```
7186
This can take tens of minutes (or less when using libmamba solver).
7287

@@ -104,7 +119,7 @@ colcon graph
104119
If that is the case, then you are ready to build the whole set of libraries:
105120

106121
```bash
107-
colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install --packages-up-to gz-sim8 gz-tools2
122+
colcon build --cmake-args -DBUILD_TESTING=OFF -DSKIP_SWIG=ON --merge-install --packages-up-to gz-sim8 gz-tools2
108123
```
109124
Tests are turned off as they are not currently supported on Windows.
110125

@@ -129,13 +144,16 @@ If there are no errors, all the binaries should be ready to use.
129144
The workspace needs to be sourced every time a new terminal is used (
130145
and Conda environment activated before that).
131146

132-
Run the following command to source the workspace:
147+
The overall instructions for setting up a new terminal to use the built
148+
workspace are:
133149

134150
```bash
135151
# CMD
152+
conda activate gz-ws
136153
call install\setup.bat
137154

138155
# PowerShell
156+
conda activate gz-ws
139157
.\install\setup.ps1
140158
```
141159

harmonic/moving_robot.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,26 @@ The last command will display all messages sent on `/keyboard/keypress` topic.
8888

8989
In the Gazebo window press different keys and you should see data (numbers) on the terminal where you run the `gz topic -e -t /keyboard/keypress` command.
9090

91-
![KeyPublisher](tutorials/moving_robot/keypublisher_data.png)
91+
```
92+
$ gz topic -e -t /keyboard/keypress
93+
data: 68
94+
95+
data: 85
96+
97+
data: 72
98+
99+
data: 74
100+
101+
data: 81
102+
103+
data: 16777235
104+
105+
data: 16777234
106+
107+
data: 16777237
108+
109+
data: 16777236
110+
```
92111

93112
We want to map these keystrokes into messages of type `Twist` and publish them to the `/cmd_vel` topic which our model listens to.
94113
The `TriggeredPublisher` plugin will do this.

harmonic/ros2_integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Launching with composition:
7676
ros2 launch ros_gz_bridge ros_gz_bridge.launch.py bridge_name:=ros_gz_bridge config_file:=<path_to_your_YAML_file> use_composition:=True create_own_container:=True
7777
```
7878
Alternatively, if an existing container is already running, you can pass its name
79-
when launching the bridge using the `container_name` parameter. More info about composition can be viewed [here](ros2_overview#composition)
79+
when launching the bridge using the `container_name` parameter. More info about composition can be viewed [here](ros2_overview.md#composition)
8080

8181
Check [this block](https://github.com/gazebosim/ros_gz/blob/jazzy/ros_gz_bridge/launch/ros_gz_bridge.launch.py#L27-L34)
8282
from the source code to know all the different parameters accepted by this

harmonic/ros2_launch_gazebo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ ros2 launch ros_gz_sim ros_gz_sim.launch.py world_sdf_file:=empty.sdf bridge_nam
137137
In the above launch files you may notice that the `create_own_container` argument for `ros_gz_bridge` is hardcoded to `False`. This has been done to prevent two duplicate containers from getting created (one for `gz_server` and another one for `ros_gz_bridge`), and instead make `ros_gz_bridge` use the container created by `gz_server`. More info about this can be viewed [here](https://github.com/gazebosim/ros_gz/pull/620#issue-2595570189)
138138

139139
More info about `ros_gz_bridge` can be viewed [here](ros2_integration).
140-
More info about composition can be viewed [here](ros2_overview#composition).
140+
More info about composition can be viewed [here](ros2_overview.md#composition).

harmonic/sensors.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,17 +322,18 @@ You can download the finished node for this demo from [here](https://github.com/
322322
#### The lidar_node
323323

324324
```cpp
325-
gz::transport::Node node;
326325
std::string topic_pub = "/cmd_vel";
327-
gz::msgs::Twist data;
326+
gz::transport::Node node;
328327
auto pub = node.Advertise<gz::msgs::Twist>(topic_pub);
329328
```
330329

331-
We declare a `node` which will publish to `cmd_vel` topic and defined the message type `Twist`. Then advertise our node.
330+
We declare a `node` which will publish to `cmd_vel` topic. Then advertise our node.
332331

333332
```cpp
334333
void cb(const gz::msgs::LaserScan &_msg)
335334
{
335+
gz::msgs::Twist data;
336+
336337
bool allMore = true;
337338
for (int i = 0; i < _msg.ranges_size(); i++)
338339
{
@@ -362,11 +363,11 @@ If so we publish a message to our car to move forward. Otherwise we make the rob
362363
```cpp
363364
int main(int argc, char **argv)
364365
{
365-
std::string topic = "/lidar";
366+
std::string topic_sub = "/lidar";
366367
// Subscribe to a topic by registering a callback.
367-
if (!node.Subscribe(topic, cb))
368+
if (!node.Subscribe(topic_sub, cb))
368369
{
369-
std::cerr << "Error subscribing to topic [" << topic << "]" << std::endl;
370+
std::cerr << "Error subscribing to topic [" << topic_sub << "]" << std::endl;
370371
return -1;
371372
}
372373

harmonic/troubleshooting.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ GZ_CONFIG_PATH=<path_to_install_dir>/share/gz/
1919

2020
## macOS
2121

22+
### Maximum number of open files reached `ulimit` error
23+
When installing using homebrew, you may see the following error message:
24+
25+
```bash
26+
Error: The maximum number of open files on this system has been reached. Use 'ulimit -n' to increase this limit.
27+
```
28+
29+
As suggested in the error message, run the command below and check the output. The default value is set to `256` which is too low.
30+
```bash
31+
ulimit -n
32+
```
33+
34+
Run the following command to increase the open files `ulimit` and then proceed with the homebrew install:
35+
```bash
36+
ulimit -n 10240
37+
```
38+
2239
### Unable to find `urdf_model.h` error
2340
After installing all the dependencies and starting the build process, you may encounter an error that looks like this:
2441

@@ -233,3 +250,36 @@ foreach {
233250
}
234251
popd
235252
```
253+
254+
### Many errors from setuptools when running colcon
255+
When calling `colcon` to build the packages, you may face a wall of Python errors similar to this one:
256+
257+
```
258+
> colcon graph
259+
Traceback (most recent call last):
260+
File "<string>", line 1, in <module>
261+
ModuleNotFoundError: No module named 'setuptools.extern'
262+
[10.385s] colcon.colcon_core.package_identification ERROR Exception in package identification extension 'python_setup_py' in 'conda\Lib\site-packages\adodbapi': Command '['D:\\programovani\\gz-ws\\conda\\python.exe', '-c', "import sys;from setuptools.extern.packaging.specifiers import SpecifierSet;from distutils.core import run_setup;dist = run_setup( 'setup.py', script_args=('--dry-run',), stop_after='config');skip_keys = ('cmdclass', 'distclass', 'ext_modules', 'metadata');data = { key: value for key, value in dist.__dict__.items() if ( not key.startswith('_') and not callable(value) and key not in skip_keys and key not in dist.display_option_names )};data['metadata'] = { k: v for k, v in dist.metadata.__dict__.items() if k not in ('license_files', 'provides_extras')};sys.stdout.buffer.write(repr(data).encode('utf-8'))"]' returned non-zero exit status 1.
263+
```
264+
265+
The messages are quite cryptic and do not point at the root cause. The root cause is that you have probably created a conda env directory in the same directory where you have the `src` directory containing the Gazebo sources (you have probably used `conda create --prefix ...` to create the env directory at a non-default destination).
266+
267+
The solution is to move the conda env directory one level up.
268+
269+
E.g., this is the problematic folder structure:
270+
271+
```
272+
gz-ws\
273+
conda\ # The conda env
274+
src\ # The Gazebo sources
275+
gz-sim\
276+
```
277+
278+
To fix it, change the structure to something like this:
279+
280+
```
281+
gz-ws\
282+
src\
283+
gz-sim\
284+
conda\
285+
```
43.4 KB
Loading

0 commit comments

Comments
 (0)