-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failing to install scenario
on MacOS
#422
Comments
Hi @lrapetti, yes as you read from the support policy, macOS is not currently supported. If you inspect the CMake output, you'll notice that it fails with the following error:
You should install Ignition Gazebo manually before attempting to install I actually already did some work on macOS in #406 while attempting to finalize conda-forge/staged-recipes#16582, but the last update was conda-forge/staged-recipes#16582 (comment) in which everything was building correctly on macOS (a nice start), but tests were segfaulting. |
I just remembered that we had a previous discussion regarding macOS in #100, not sure if things have changes since. |
Following the ignition gazebo installation, I was able to install both |
Still, I am experiencing the command line tool mentioned in #100 (comment). It looks like the problem is still present in the ignition version I have installed. I was able to run some gym-ignition code such as $python3 launch_cartpole.py
Traceback (most recent call last):
File "/Users/lorenzorapetti/Software/dic-iit/ADAM/adamEnv/lib/python3.9/site-packages/scenario/__init__.py", line 141, in check_gazebo_installation
result = subprocess.run(command, capture_output=True, text=True, check=True)
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ign', 'gazebo', '--versions']' returned non-zero exit status 255. |
What fails here is just a check for a compatible Ignition Gazebo version, it's not strictly needed during runtime. Can you please report if the following command executed from a normal terminal succeeds, and if it does, its output?
If it does not succeed, you can try commenting out the following line in |
Since there is the problem with the command line tool, I am getting the following
So I commted out the lines as you where suggesting, but I am getting the following
I guess that is due to some conflict or wrong configuration on my laptop. Indeed I see the following $ ls /usr/local/opt/urdfdom/lib
liburdfdom_model.1.0.dylib liburdfdom_sensor.dylib
liburdfdom_model.dylib liburdfdom_world.1.0.dylib
liburdfdom_model_state.1.0.dylib liburdfdom_world.dylib
liburdfdom_model_state.dylib pkgconfig
liburdfdom_sensor.1.0.dylib urdfdom |
I see that you have Another option is to try using a conda environment instead of relying on the official macOS packages. Though, even with conda, something could be missing. |
Not sure if this is the right place for reporting experimental environments, but I have had success in getting ScenarIO running on macOS (with GUI) using development branches that add Metal support to Ignition (which will be slowly making there way into released versions - hopefully in time for Ignition Garden). I'd be happy to outline the approach here or somewhere suitable if there is an interest. This looks like a great tool btw! I expect to be using it a good deal. |
Hi @srmainwaring, this is great news, thanks! I'm not sure if @lrapetti has any news after his last attempts, in any case it would be very helpful if you can describe your working setup and whether there's anything missing on our side to run on macOS. |
Sorry, I didn't proceed further at this stage. In case I'll let you know when I start again this investigation. |
Hi @diegoferigo - here's the description, it may take a number of edits to get right as it is fairly involved at this stage. I hope it will simplify as more of the development work is merged into the relevant repos. Install Ignition on macOSThe first step is to get the Ignition graphics API running properly on macOS. I've documented how to install Ignition with Metal rendering on macOS here: https://github.com/srmainwaring/ign-rendering/wiki. Over time this page should become redundant as more features are merged into the https://github.com/ignitionrobotics repos. Install iDynTreeThe installation on macOS largely follows the iDynTree install instructions with an extra step to install to Clone and install: # clone to ~/robotology
$ cd ~/robotology
$ git clone https://github.com/robotology/idyntree.git
$ cd idyntree
$ mkdir build && cd build
$ cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/idyntree/1.0.0 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DIDYNTREE_USES_PYTHON=ON
$ make -j16
$ make install
$ brew link idyntree Check the installation: >>> import idyntree
>>> import idyntree.bindings as iDynTree
>>> p = iDynTree.Position()
>>> print(p)
1.46135e+224 1.0947e+248 1.02265e-259 Run the example: $ cd ~/robotology/idyntree/examples/python
$ python KinDynComputationsTutorial.py Install ScenarIOWe use a patched version of ScenarIO which includes dependency definitions for Ignition Garden. The libraries are installed to # clone to ~/robotology
$ cd ~/robotology
$ git clone https://github.com/robotology/gym-ignition.git
$ git remote add fork https://github.com/srmainwaring/gym-ignition.git
$ git checkout fork/feature/ign-garden-macos
$ cd gym-ignition/scenario
$ mkdir build && cd build
$ cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/scenario/1.0.0 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DSCENARIO_USE_IGNITION=ON \
-DSCENARIO_ENABLE_BINDINGS=ON
$ make -j16
$ make install
$ brew link scenario
$ cd ~/robotology/gym-ignition
$ pip install --user -e scenario
$ pip install --user -e . I have not used a Python virtual environment for my installation, but that should also work. ConfigurationScenarIO uses a custom physics plugin that overrides the defaults in It expects to find the system plugin export IGN_GAZEBO_PLUGIN_INSTALL_DIR=${IGN_GAZEBO_PLUGIN_INSTALL_DIR}:/usr/local/lib/scenario/plugins TestingRun the pendulum Python example from VSCode. Set up a launch configuration entry in {
"version": "0.2.0",
"configurations": [
{
"name": "Python: ScenarIO",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"env": {
"IGN_VERBOSE": "0",
"IGN_CONFIG_PATH": "/usr/local/share/ignition",
"IGN_RENDERING_RESOURCE_PATH": "/usr/local/share/ignition/ignition-rendering7",
},
},
]
} Add the following lines to the pendulum example to ensure that ignition uses the brew installed version of ruby: # ensure we are using /usr/local/opt/ruby/bin/ruby instead of the system version
import os
PATH = os.getenv("PATH")
PATH = "/usr/local/opt/ruby/bin:" + PATH
os.environ["PATH"] = PATH Then run the example: |
Wow @srmainwaring great work, nicely done! Thanks for this big effort to smooth the macOS experience. I don't have a macOS machine to test everything myself, but I will eagerly wait for your contributions to land upstream and then giving another shot in the conda-forge packaging I drafted in conda-forge/staged-recipes#16582 (unfortunately I'm a bit busy lately and I have to postpone it a little longer). As you noted, from the ScenarIO point of view, changes are minimal, only the introduction of Garden support was missing. I can surely add it to the nightly channel so that your setup could get rid of a fork, and those that are interested in building the project from source can benefit from it! And, actually, note to myself, it would a good idea in the future adding a similar CMake support of the development Ignition distribution right after the previous upstream stable version is released. |
Description:
I noticed that macOS is not officially supported. I thought it was good to report anyway.
Steps to reproduce
I tried to install it with
Output can be found below
Additional context
Output
Environment
The text was updated successfully, but these errors were encountered: