node-mavlink icon indicating copy to clipboard operation
node-mavlink copied to clipboard

Tell pixhawk to output a PWM signal

Open mariusbrataas opened this issue 7 years ago • 0 comments

Hey!

I've been trying to communicate with a pixhawk using this library, but haven't had any luck so far. My test script looks like this:

var SerialPort = require('serialport');
var mavlink = require('mavlink');

var myMAV = new mavlink(1,1,"v1.0",["common", "pixhawk"]);
var serialport = new SerialPort('/dev/ttyACM0', {baudRate: 57600});

myMAV.createMessage(
	'MAV_CMD_DO_SET_SERVO',
	{
		'1': 2000,
		'2': 2000,
		'3': 2000,
		'4': 2000,
		'5': 2000,
		'6': 2000,
		'7': 2000
	},
	(message) => {
		serialport.write(message.buffer);
	}
);

I guessed at MAV_CMD_DO_SET_SERVO because of it's definition in the common definitions xml file, but the output from running this command is simply saying Message 'MAV_CMD_DO_SET_SERVO' does not exist!, similar to this issue.

Any ideas?

mariusbrataas avatar Dec 15 '18 00:12 mariusbrataas