Skip to content

Composer is the ROS orchestration functionality is provided as extensions

Notifications You must be signed in to change notification settings

eclipse-muto/composer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Catkin Make (Build and Test)

Muto Composer

Build

After you checkout the repository, source your ROS environment and make sure the additional dependencies such as the eclipse paho mqtt client library is installed.

source /opt/ros/humble/setup.bash
pip3 install paho-mqtt celery requests

Muto Twins

Muto agent requires network connectivity to the Muto Twins (ditto) and MQTT servers. The address for the muto sandbox is:

Running agent

The muto agent must be launched and the target device and the devices should have access to all the packages required to launch the stacks. For these purposes you can either choose to run a containerized version of muto or launch it direct from the devices after all the packages (such as the muto learning modules) are build and installed on the AV.

source install/setup.bash
ros2 launch agent agent.launch

You can get stacks from twin server via::

curl 'link_to_stack_url'

which returns something similar to the below structure:

{
    "name": "Muto Learning Simulator with Gap Follwer",
    "context": "eteration_office",
    "stackId": "org.eclipse.muto.sandbox:f1tenth-multiagent-gym.launch",
    "stack": [
        {
            "thingId": "org.eclipse.muto.sandbox:racecar1.launch"
        }
    ],
    "node": [ 
        {
            "name": "reactive_gap_follower",
            "pkg": "reactive_gap_follower",
            "exec": "reactive_gap_follower",
            "param": [
              { "from": "$(find reactive_gap_follower)/params.yaml" }
            ]
        }
    ]
}

This is a stack with a single node, "cass_gap_follower". However, it includes another stack (with many other nodes and parameters) that it requires with a stackId reference org.eclipse.muto.sandbox:f1tenth-multiagent-gym.launch. The elements of the stack model resembles a ROS launch XML, so it should be fairly straightforward to understand if you have experience writing XML launch files

Managing Stacks and Vehicles

New stack can be easily stored on the sandbox server using the things API (put). See the ditto documentation for many examples [https://www.eclipse.org/ditto/intro-overview.html]. For example, to add a new stack to the repository we can use the thing PUT api as follows:

$ curl -X PUT -H "Content-Type: application/json" -d ' 
{ 
    "name": "Muto Learning Simulator with Gap Follower", 
    "context": "eteration_office",
    "stackId": "org.eclipse.muto.sandbox:composiv_simulator_gf.launch", 
    "stack": [
        {
            "thingId": "org.eclipse.muto.sandbox:composiv_simulator.launch"
        }
    ],
    "node": [ 
        {
            "name": "cass_gap_follower",
            "pkg": "cass_gap_follower",
            "exec": "cass_gap_follower",
            "param": [
              { "from": "$(find cass_gap_follower)/params.yaml" }
            ]
        }
    ]
}
' http://sandbox.composiv.ai/api/2/things/org.eclipse.muto.sandbox:composiv_simulator_gf.launch

Managing Stacks and Vehicles

We can use the TWINS to directly communicating commands to the vehicle itself. The twin server supports special mqtt channels for these purposes called twin and live channels. For example the following command can be published to the sandbox MQTT server to activate a stack on a car. Each vehicle has its dedicated twin and live channels:

topic: org.eclipse.muto.sandbox::simulator-monster-01/stack/commands/active
payload: {
    "name": "Muto Learning Simulator with Gap Follwer",
    "context": "eteration_office",
    "stackId": "org.eclipse.muto.sandbox::composiv_simulator_gf.launch",
    "stack": [
        {
            "thingId": "org.eclipse.muto.sandbox::composiv_simulator.launch"
        }
    ],
    "node": [ 
        {
            "name": "cass_gap_follower",
            "pkg": "cass_gap_follower",
            "exec": "cass_gap_follower",
            "param": [
              { "from": "$(find cass_gap_follower)/params.yaml" }
            ]
        }
    ]
}

You can use any open-source mqtt client to issue these commands and monitor various muto twin messages MQTTX. Another option is the mosquitto_pub, which is a simple MQTT version 5/3.1.1 client that will publish a single message on a topic and exit. You can publish the message described above using the commandline:

  mosquitto_pub -d -h sandbox.composiv.ai -p 1883  -t "org.eclipse.muto.sandbox::simulator-monster-01/stack/commands/active" -m '{"name":"Composiv Learning Simulator with Gap Follwer","context":"eteration_office","stackId":"org.eclipse.muto.sandbox::composiv_simulator_gf.launch","stack":[{"thingId":"org.eclipse.muto.sandbox::composiv_simulator.launch"}],"node":[{"name":"cass_gap_follower","pkg":"cass_gap_follower","exec":"cass_gap_follower","param":[{"from":"$(find cass_gap_follower)/params.yaml"}]}]}'

Controlling the F1Tenth Car (navigate on/off)

ros2 topic pub --once /mux std_msgs/Int32MultiArray "{layout: { dim: [], data_offset: 0}, data: [0, 0, 0, 0, 1 , 0] }"

More information

Check out the Eclipse Muto github.io page for further reading: Eclipse Muto

About

Composer is the ROS orchestration functionality is provided as extensions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages