BehaviorTree/BehaviorTree.ROS2

Behavior Tree Goal on launch on TreeExecutionServer

Closed this issue · 1 comments

It would be useful to launch a tree with the TreeExecutionServer from it's launch.
This would bypass the secondary node that needs to be created to send a goal to the TreeExecutionServer.

This was actually already possible. As referenced by @MarqRazz: #71 (comment)

Why not just call the Server from your launch file?

Here is an example on calling a service from a python launch file.

from launch.substitutions import FindExecutable
from launch.actions import ExecuteProcess

...

ld.add_action(
    ExecuteProcess(
        cmd=[[
            FindExecutable(name='ros2'),
            " service call ",
            "/namespace/service_to_call ",
            "example_msgs/srv/ExampleMsg ",
            '"{param_1: True, param_2: 0.0}"',
        ]],
        shell=True
    )
)