RobotWebTools / roslibjs

The Standard ROS JavaScript Library
https://robotwebtools.github.io/roslibjs
Other
659 stars 372 forks source link

Ros2 Action Client does not let me send any more data to rosbridge after sending goal #716

Open rjbrockbundy opened 2 months ago

rjbrockbundy commented 2 months ago

Description ROS2 action calls from the latest develop branch are freezing other Topic or Service publish calls after the Action Goal is sent to the robot. This occurs until a page refresh when I regain the ability to publish while the action is ongoing.

Steps To Reproduce

const handleStartRoute = () => {
        if (!ros) return;
        console.log('Route start')

        var startRouteAction = new Action({
            ros: ros,
            name: '<action server>',
            actionType: '<action type>'
        });

        var goal = { input: '<some input>' }

        var goal_id = startRouteAction.sendGoal(goal,
            function (result) {
                console.log('Result: ' + startRouteAction.name + ': ' + result);
            },
            function (feedback) {
                console.log('Feedback: ' + feedback);
            },
            function (failed) {
                console.log('Failed: ' + failed);
            }
        );
    }

The Action works fine when sending it from a terminal. And the Robot is receiving the Action Goal when this function is called.

Expected Behavior I expect the Goal to be sent to the server and continue with the action goal while the user can still interact with the robot (i.e. publish topics / send services)

Actual Behavior After sening the goal the robot can still receive topic data, however I can no longer publish to the robot whether that be ROS topics or services. The page requires a refresh when an action is sent in order to regain publishing.

EzraBrooks commented 14 hours ago

Try setting the send_action_goals_in_new_thread parameter on rosbridge. I don't believe this is a problem with roslibjs.