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

ID 101 and 114 not subscribing #8

Open
PatrickCesar opened this issue May 6, 2019 · 2 comments
Open

ID 101 and 114 not subscribing #8

PatrickCesar opened this issue May 6, 2019 · 2 comments

Comments

@PatrickCesar
Copy link

Hello, I am the same person of MSP problem in the other repo. I've been out of the lab for a few days. Today I went back to the drone, and I'm having the following problem when running the ros package:

process[multiwii-2]: started with pid [1315]
message ID 101 not subscribed
message ID 114 not subscribed

After a while I get the following errors:

Version marker 62 is not recognised!
Message marker 204 is not recognised!
Version marker 255 is not recognised!
Message marker 0 is not recognised!
Version marker 58 is not recognised!
Message marker 6 is not recognised!
Version marker 108 is not recognised!
Message marker 255 is not recognised!
Version marker 243 is not recognised!
Message marker 0 is not recognised!
Version marker 0 is not recognised!
Message marker 106 is not recognised!
Version marker 0 is not recognised!
Message marker 77 is not recognised!
Version marker 62 is not recognised!
Message marker 77 is not recognised!
Version marker 33 is not recognised!
Message marker 246 is not recognised!
Version marker 255 is not recognised!
Message marker 255 is not recognised!
Version marker 249 is not recognised!
Message marker 0 is not recognised!
Version marker 1 is not recognised!
Message marker 0 is not recognised!
Version marker 101 is not recognised!
Message marker 255 is not recognised!
Version marker 249 is not recognised!
Message marker 255 is not recognised!
Version marker 247 is not recognised!
Message marker 136 is not recognised!
Version marker 0 is not recognised!
Message marker 198 is not recognised!
Version marker 36 is not recognised!
Message marker 255 is not recognised!
Version marker 3 is not recognised!
Message marker 0 is not recognised!
Version marker 0 is not recognised!
Message marker 0 is not recognised!
Version marker 104 is not recognised!
@christianrauch
Copy link
Owner

The message ID <id> not subscribed error is shown for messages, that are not subscribed but for which a update rate is set via the dynamic config:

void dynconf_callback(multiwii::UpdateRatesConfig &config, uint32_t /*level*/) {
// define map with matching update rate per message ID
const std::map<msp::ID, double> msp_rates = {
{msp::ID::MSP_STATUS, config.MSP_STATUS},
{msp::ID::MSP_RAW_IMU, config.MSP_RAW_IMU},
{msp::ID::MSP_ALTITUDE, config.MSP_ALTITUDE},
{msp::ID::MSP_ATTITUDE, config.MSP_ATTITUDE},
{msp::ID::MSP_RC, config.MSP_RC},
{msp::ID::MSP_SERVO, config.MSP_SERVO},
{msp::ID::MSP_MOTOR, config.MSP_MOTOR},
{msp::ID::MSP_SERVO, config.MSP_SERVO},
{msp::ID::MSP_MISC, config.MSP_MISC},
{msp::ID::MSP_ANALOG, config.MSP_ANALOG},
{msp::ID::MSP_SONAR_ALTITUDE, config.MSP_SONAR_ALTITUDE},
};
// apply update
for(const auto& r : msp_rates) {
if(fcu->hasSubscription(r.first)) {
fcu->getSubscription(r.first)->setTimerFrequency(r.second);
}
else {
std::cerr<<"message ID "<<uint(r.first)<<" not subscribed"<<std::endl;
}
}
}

These are the messages the node subscribes to:

node.fc().subscribe(&MultiWiiNode::onImu, &node);
node.fc().subscribe(&MultiWiiNode::onAttitude, &node);
node.fc().subscribe(&MultiWiiNode::onAltitude, &node);
node.fc().subscribe(&MultiWiiNode::onRc, &node);
node.fc().subscribe(&MultiWiiNode::onServo, &node);
node.fc().subscribe(&MultiWiiNode::onMotor, &node);
node.fc().subscribe(&MultiWiiNode::onAnalog, &node);
node.fc().subscribe(&MultiWiiNode::onSonarAltitude, &node);

The set of message for which a update rate is set, is larger than the set of subscribed messages (MSP_STATUS (101), MSP_MISC (114)). I guess these are some leftovers from a cleanup. You can ignore this message.

The messages Version marker is not recognised! and Message marker is not recognised! are given because the header markers $ and M (version 1) or X (version 2) cannot be recognised. This could be caused by communication errors. Are you getting some valid messages or are all messages corrupted like this?

Since those are given by the library (and not the node), can you make sure that the library is giving you the subscribed messages? E.g. test a standalone executable without ROS that is subscribing to the same messages.

@christianrauch
Copy link
Owner

I removed the MSP_STATUS and MSP_MISC from the rate configuration.
@PatrickCesar Are you still getting errors when reading the marker on a standalone (non-ROS) example?

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

2 participants