Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mavlink_command_sender doesn't transmit messages #9415

Closed
okalachev opened this issue May 5, 2018 · 1 comment
Closed

mavlink_command_sender doesn't transmit messages #9415

okalachev opened this issue May 5, 2018 · 1 comment

Comments

@okalachev
Copy link
Contributor

okalachev commented May 5, 2018

Trying to make PX4 send some MAVLink commands to other devices. Using vehicle_command topic for that. But have some problems with uORB. MavlinkStreamCommandLong and mavlink_command_send just don't receive my messages and so don't transmit them.

Here is the example code, that I have in my module:

vehicle_command_s cmd = {};

cmd.command = 123;
cmd.param1 = 456;
cmd.param2 = 123;
cmd.param3 = 456;
cmd.target_system = 8; // random target system
cmd.target_component = 0;
cmd.source_system = 1; // our id

orb_advert_t cmd_pub = orb_advertise_queue(ORB_ID(vehicle_command), &cmd, 5); // tried without the queue, didn't help

while(true) {
// publish a message once a second
usleep(1000000);
cmd.timestamp = hrt_absolute_time();
orb_publish(ORB_ID(vehicle_command), cmd_pub, &cmd);
}

I see all these messages via topic_listener.

So, I should get something like cmd sender command 123 sent (first, retries: 1/0, channel: 0) once a second, BUT, it happens only sometimes (once per 10–20 seconds), so most of the messages just got skipped.

Anyone can help?

@okalachev
Copy link
Contributor Author

#9427

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant