Skip to content

Message constants not working #5

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

Closed
pbeeson opened this issue May 25, 2021 · 2 comments
Closed

Message constants not working #5

pbeeson opened this issue May 25, 2021 · 2 comments

Comments

@pbeeson
Copy link

pbeeson commented May 25, 2021

ROS Messages with Constants do not seem to work in rosnodejs. The resulting message type when printed using console.log does not constant any message fields that have been assigned value.

@chris-smith
Copy link
Contributor

I'll need more information about what you're doing and how you're generating messages (gennodejs, rosnodejs static messages, rosnodejs on the fly).

const rosnodejs = require('./rosnodejs');
const action_msgs = rosnodejs.require('actionlib_msgs');
console.log(action_msgs.msg.GoalStatus);
/* Prints
[Function: GoalStatus] {
  Constants: {
    PENDING: 0,
    ACTIVE: 1,
    PREEMPTED: 2,
    SUCCEEDED: 3,
    ABORTED: 4,
    REJECTED: 5,
    PREEMPTING: 6,
    RECALLING: 7,
    RECALLED: 8,
    LOST: 9
  }
}
*/

@pbeeson
Copy link
Author

pbeeson commented Jun 1, 2021

I see. I didn't notice that there was a constants field in the message. Thanks

@pbeeson pbeeson closed this as completed Jun 1, 2021
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