Open adamdbrw opened 2 weeks ago
This issue has been mentioned on ROS Discourse. There might be relevant details there:
https://discourse.ros.org/t/tools-to-use-other-simulators-as-an-alternative-to-gazebo/40556/2
considering OSI in https://github.com/OpenSimulationInterface and ISO 23150 in https://www.iso.org/standard/83293.html ?
@ZhenshengLee in my opinion, OSI it is not a good match for the task for several reasons:
This does not mean that OSI is not useful, but rather that it solves another problem.
Is it common practice to use the services? I usually use a launch file when I start up a robot in a simulation, and rather than calling the spawn_entity service, I start up a create node. So the tool I'm making is implemented as a node.
Should I re-implement it so that it can be started up as a service?
So the running node represents the spawned robot and when you kill the node, the robot is removed? Or how is it done?
It makes sense to me to have this functionality as a service because then you can easier integrate spawning multiple robots e.g. in a program loop.
I am referring to the create node in the ros_gz_sim package. In the tool I made, the node automatically ends after the robot is generated in the simulation.
Thanks @adamdbrw for kicking this off. I do agree that having a standardized simulation interface would be good for the community.
Generally, I think we want to start small and try to make the interfaces as generic as possible. Here a few comments/questions toward that goal:
spawnable
? It's not clear if spawnable
is what Gazebo calls model
which might be any static or dynamic object with or without kinematics, or if it's specific to dynamic objects like robotsget_current_level
, get_available_levels
and unload_current_level
out of the standard.reset_simulation
or simply reset
? I would also suggest that we use a different service type. It is not recommended to use messages form std_msgs
(see https://github.com/ros2/common_interfaces/pull/116), and I think the same logic applies to std_srvs
. Instead, I suggest we create a new type called Reset
or ResetSimulation
. This would allow us to extend the message in the future, for example with the ability to reset to a specific time or reset just the poses of objects without resetting the time.@hijimasa Service carries a response, which is useful in handling of various cases (sim not running, service can be not ready, there can be an error which is then communicated to the user, etc.). As for running a node, I think this is a part of implementation choices. O3DE runs a ROS 2 simulation node(s) natively but other sims might have a different approach, and instead run a kind of wrapper / bridge / communication node.
@azeey I agree to start lean for the core interface, and would also love to make good use of optional fields and the concept of standard extensions. The standard does not have to be implemented entirely from the get-go.
worlds
is an important part of the simulation interfaces, to support the goal of testing automation, to be able to switch between worlds. Would renaming level to scene
or world
make more sense? Or is it something that you foresee as costly to support in Gazebo?I would love to go ahead and prepare a PR to accompany the discussion, where we can have a review process. Could you help with creating a repository?
Problem
The number of simulator choices for ROS increased over time, and these simulators offer different advantages and trade-offs. For certain applications Gazebo is a match, for others, Open 3D Engine (O3DE) does the job the best, and for others yet, Isaac Sim might be a fit. There are many more yet.
Open 3D Engine robotic simulation (the ROS 2 Gem) depends on _gazebomsgs package, which was deprecated with the Jazzy release, but also, as an exception, released to make life easier for O3DE users. The _gazebomsgs package interfaces are quite generic and thus were reused in O3DE. However, one simulator interface user experience should not depend on a release cycle of another simulator, but rather be tied to a certain standard.
There is currently no standard for simulation interfaces. Simulation interfaces include spawning and de-spawning of robots and other entities, moving them around, pausing and resetting the scene, and so on. They are also highly important for automation of simulation-based testing. These interfaces are mostly services as they offer valuable response interaction which is needed for almost all the interface features.
Proposed solution
A new _simulationinterfaces package which reuses much of _gazebomsgs but also introduces new interfaces and changes some fields to fully support current Gazebo and O3DE community needs. The priority for the first release should be minimizing impact (including semantic differences) for the users, and capturing new requirements in new services rather than re-imagining the entire package.
Current state of O3DE interfaces in use
I come with the O3DE perspective and invite others to supply other perspectives. Note that current use for some of services and their fields is not adhering to their intended semantics, and includes extension Gems beyond the core ROS 2 Gem.
Services for simulation entities spawning and control (all are _gazebomsgs/srv/ services):
Services for simulation scenes and control, especially important for automation with scenario testing (multiple runs of simulation on different scenes). Note that some services are not used semantically as intended, and some services are custom here indicating there is no great fit in current _gazebomsgs interface set:
The benefits
Standardization would improve user experience when using their validation, testing and ML pipelines with several simulators, or when switching between one simulator and the other as they needs come to better match another platform. It would also make it easier to benchmark simulators.
Discussion
Please take a look, @azeey.