Skip to content

when send action goal , gets an error and tried to find action interface in the msg packages #903

@Cra2yQi

Description

@Cra2yQi

Description

  • Library Version: ros2
  • ROS Version: humble
  • Platform / OS: MacOs / ubuntu22.04

Steps To Reproduce

when i use roslibjs to send a action goal ,rosbridge-suit gets an error and tried to find action interface in the msg packages.

action(serverName, actionName, argument) {
  const rosAction = new ROSLIB.ActionClient({
    ros: this.ros,
    serverName: serverName,
    actionName: actionName
  })
  const goal = new ROSLIB.Goal({
    actionClient: rosAction,
    goalMessage: argument
  });
  // Print out their output into the terminal.
  goal.on('feedback', function (feedback) {
    console.log('Feedback: ' + feedback.sequence);
  });
  goal.on('result', function (result) {
    console.log('Final Result: ' + result.sequence);
  });

  goal.send()
}
image

And I tried to use python to send the action, and I got the same error

import roslibpy
import roslibpy.actionlib
import time

def feedback_callback(feedback):
    print('Feedback received: ', feedback['sequence'])

def result_callback(result):
    print('Result received: ', result['sequence'])

def call_fibonacci_action(order):
    client = roslibpy.Ros(host='10.211.55.5', port=9090)
    client.run()

    action_client = roslibpy.actionlib.ActionClient(client, '/fibonacci', 'actionlib_tutorials/Fibonacci')

    goal = roslibpy.actionlib.Goal(action_client, roslibpy.Message({'order': order}))

    goal.on('feedback', feedback_callback)
    goal.on('result', result_callback)

    print('Sending goal...')
    goal.send()

    # 等待结果
    while not goal.is_finished:
        time.sleep(1)

    print('Goal processing done.')
    client.terminate()

if __name__ == '__main__':
    call_fibonacci_action(5)
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions