Send action from Js to Python simple action server rosnodejs
I have a python simple action server that i run and works with a python simple action client.
actionlib.SimpleActionServer('move_to_beacon_action', proximity.msg.BeaconAction, execute_cb=self.execute_cb, auto_start = False)`
now i want to use javascript to send an action to the python simple action server. I'm using rosnodejs but dont know how how to send an action. right now connecting doesn't work either. I tried to look for examples but none worked.
rosnodejs.initNode('my_node', { onTheFly: true })
.then(() => {
const proximity = rosnodejs.require('proximity');
const goal = new proximity.msg.BeaconGoal({ address: 'Hello' });
const ac = new rosnodejs.SimpleActionClient({
nh: rosnodejs.nh,
type: proximity.msg.BeaconAction,
actionServer: 'move_to_beacon_action'
});
ac.waitForServer()
.then(() => {
rosnodejs.log.info('Connected to action server!');
})
This doesnt work however. I get the error:
[INFO] [1586955599.210] (ros): Connected to master at http://192.168.2.10:11311!
[ERROR] [1586955599.239] (ros.rosnodejs): Exception trying to advertise topic move_to_beacon_action/goal
Does anyone know how to do this? am i doing something wrong? Is this even possible? I' m a big ROS noob and would love help! Thanks for your time and reading :)