Skip to content

Using threads for ros service callback #316

@theksg

Description

@theksg

This is with ref to:

if (m_ServiceImplementationAsync != null)
{
response = await m_ServiceImplementationAsync(requestMessage);
}
else
{
response = m_ServiceImplementation(requestMessage);
}

While creating a script for ROS 2 services in Unity, i realized that Unity uses same thread for ROS 2 service callback and for the Update function. But I wish to run service callbacks on a different thread and Update on main thread.

I am able to manually do it by changing RosState file and it is working fine.

I would like to know if it is fine to do it this way or not. If there are any issues related to threads for ROS 2 service callbacks, what they can be.

Also, are you considering updating the code for the same?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions