Skip to content
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

Scenic Gazebo PR #246

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Kai-X-Org
Copy link

Description

Adds in the Scenic Gazebo template interface and the example implementation for the Sawyer

Additional Notes

Please ignore the previous PR as that one had some uncleaned comments here and there.
Documentation is in the README in each interface folder. Thank you so much!

@Eric-Vin
Copy link
Collaborator

@Kai-X-Org Should I go ahead and close #215 ?

@Kai-X-Org
Copy link
Author

Kai-X-Org commented Apr 25, 2024 via email

@abanuelo abanuelo mentioned this pull request Jun 28, 2024
@abanuelo abanuelo self-requested a review July 5, 2024 19:23
Copy link
Collaborator

@abanuelo abanuelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kai-X-Org I have been experimenting with some of the gazebo installations and had a couple of items that I wanted to flag as well that were pain points and unclear:

  1. How can we tell if pre-requisites and installation is successful? Can we provide a set of commands/script to run to determine this?
  2. Specifically, when installing Scenic I had trouble installing all the dependencies outside of a virtual environment. To do so can we instruct folks to (a) download the repo navigate to the root and then run (b) /usr/bin/python3 -m pip install -e .
  3. I think we may need to have to add some more dependencies within the pyproject.toml in order to follow a clean installation process for Gazebo, namely I had to pip install the following on a clean environment since they were not readily available:
pyyaml
rospkg
defusedxml


## Instructions for Use

1. Before running Scenic, start the Gazebo simulator with ROS, launch and bringup any ROS stack you need, and unpause the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we give explicit example commands to be run for this? It is a bit unclear as to how to do so!

1. Before running Scenic, start the Gazebo simulator with ROS, launch and bringup any ROS stack you need, and unpause the
simulation.
2. Open a separate terminal, run `scenic <YOUR PROGRAM>.scenic --simulate`(see https://scenic-lang.readthedocs.io/en/latest/options.html for more
command-line options). Make sure you sourced the corresponding `.bash` or `.zsh` needed to run your simulaton in this terminal, too!.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By sourcing to run the simulation do you mean source /opt/ros/noetic/setup.bash? If so I think we should make explicit mention of that here!

while (t1.secs + t1.nsecs/(10**9) - t0.secs - t0.nsecs/(10**9)) < wait_time:
wait
t1 = rospy.get_rostime()
# print((t1.secs + t1.nsecs/(10**9) - t0.secs - t0.nsecs/(10**9)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove print statement

ResetGazeboWorldAndSim,
UnpauseGazebo,
)
from scenic.simulators.Gazebo.utils.state_utils import ( # GetGazeboWorldModelNames,; GetGazeboWorldProperties,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove commented out imports

- Other than the official installation, ROS Noetic can also be installed with [RoboStack](https://robostack.github.io/index.html), which can be helpful if you are on MacOS or Windows.
- Before you install, it might be good to consider installing Scenic outside any virtual environment for Gazebo/ROS purposes since Gazebo/ROS utilizes some Ubuntu native packages that is difficult to get from conda/pip
- When installing Scenic, please do the "Repository" install outlined in this page: https://scenic-lang.readthedocs.io/en/latest/quickstart.html#installation
- For the Sawyer simulator, please install according to the instruction here: https://github.com/RethinkRobotics/sawyer_simulator
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link was unclear on where to find the installation instructions. I ended up using the installation instructions from the tutorial: https://support.rethinkrobotics.com/support/solutions/articles/80000980381-gazebo-tutorial

- Before you install, it might be good to consider installing Scenic outside any virtual environment for Gazebo/ROS purposes since Gazebo/ROS utilizes some Ubuntu native packages that is difficult to get from conda/pip
- When installing Scenic, please do the "Repository" install outlined in this page: https://scenic-lang.readthedocs.io/en/latest/quickstart.html#installation
- For the Sawyer simulator, please install according to the instruction here: https://github.com/RethinkRobotics/sawyer_simulator
- For object models (sdf files), please clone this repo into the interface directory: https://github.com/osrf/gazebo_models
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here where do we clone? Where should this be placed?

@@ -0,0 +1,49 @@
model scenic.simulators.Gazebo_sawyer.model
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire file should be moved to examples/gazebo_sawyer/example.scenic. Also, we should create an example/gazebo directory and place some example files under there as well!

Copy link
Collaborator

@abanuelo abanuelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for making those changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants