Skip to content

features

Davide Conzon edited this page Dec 1, 2019 · 2 revisions

Runnig the Stage SM, you can input g! help command in Felix GoGo shell to see the following ROS commands embeded:

    ros:catkinBuild             # arguments: (String rosWorkspace, String pkg, String node, String... parameters)
    ros:roslaunch               # arguments: (String rosWorkspace, String pkg, String node, String... parameters)
    ros:rosrun                  # arguments: (String workspace, String pkg, String node, String... parameters)

exposed by be.iminds.iot.ros.api and

    ros:env                # list ROS Environments including the ROS_MASTER_URI
    ros:nodes              # list all active nodes when Ros master is running
    ros:provider           # list all active providers when Ros master is running
    ros:publishers         # list all active publishers when Ros master is running
    ros:services           # list all active services when Ros master is running
    ros:subscribers        # list all active subscribers when Ros master is running
    ros:topics             # list all active topics when Ros master is running

exposed by be.iminds.iot.ros.core.

The ROS commands are composed of two parts that are separated by a colon: <Command_Scope>:<Command_Function>, when two command functions have the same name, but different scope names, you have to specify the Command_Scope.

These commands can be accessed by the user both from the command line (through the Felix GoGo shell), if the SM is launched directly, or passing from the Felix web console (accessible at localhost:8081), this web console can also be used to manage the bundles started in the SM.

One of the dependencies is be.iminds.iot.simulator.gazebo. This is an example of using the generated java types of the messages(gazebo_msgs, trajectory_msgs, std_srvs) to send/receive some requests/responses to control the Gazebo simulation process.

There is a file gazebo.bndrun with the following -runproperties: instruction for configuring the launching environment:

To set individual System properties with the -D option to pass the command line parameters to override the properties listed in the -runproperties: when running the SM

for example:

   java -Dverbosity=0 -jar gazebo.jar
    -runproperties: \
	    ros.core.native=true,\        # Indicating if launching the installed ROS system or the rosjava ROScore implementation of the rosjava_core project
	    gazebo.launch=false,\        # You can set it true to just open the Gazebo simulator without running a simulation to use `loadScene` command, but as a dependency bundle for the simulation manager, it's false
	    verbosity=2,\                               # Selected verbosity level: 0 NO_OUTPUT, 1 ONLY_ERROR, 2 ALL
	    ros.master.uri=http://localhost:11311,\     # It is used to manually indicate the Ros environment variable in case the user doesn't set it during the Ros installation
	    org.apache.felix.log.storeDebug=false,\     # Configuration of org.apache.felix.log bundle to determine whether or not debug messages will be stored in the history
	    felix.fileinstall.dir=resources,\           # Configuration of org.apache.felix.fileinstall bundle
	    org.osgi.service.http.port=8080,\           # The default port used for Felix servlets and resources available via HTTP
	    logback.configurationFile=resources/logback.xml         # Configuration of ch.qos.logback.core bundle
To run the `gazebo.bndrun` in in Eclipse:

   Right click `gazebo.bndrun` -> Run as -> Bnd OSGi Run Launcher, then:
       g! help
        gazebo:start                # start the simulation, optionally pass two arguments(boolean sync, float step) to start: 1. sync: set to true to control simulator ticks; 2. step: time (in seconds) to advance the simulator each tick
        gazebo:stop                 # stop the simulation 
        gazebo:pause                # pause the simulation 
        gazebo:tick                 # Advance simulation with one tick, only applies when started with sync=true
        gazebo:loadScene            # load a single model that is as a scene, the model could be a .sdf or .urdf file, e.g: $ loadScene robot.sdf
        gazebo:getPosition          # get the position of an object, e.g: getPosition object_name
        gazebo:setPosition

In this way, you can see that beside the ros generic commands, also commands specific for gazebo are exported,

Clone this wiki locally