Coder Social home page Coder Social logo

Comments (2)

christianrauch avatar christianrauch commented on May 20, 2024

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.

from ros-multiwii.

christianrauch avatar christianrauch commented on May 20, 2024

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?

from ros-multiwii.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.