pymavlink
pymavlink copied to clipboard
Typescript Mavlink Generator Has Non-Existant Import
In the generator/mavgen_typescript.py
on line 52, 65, 66:
registry_f.write("import {MAVLinkMessage} from 'node-mavlink';\n") # line 52
f.write("import {MAVLinkMessage} from 'node-mavlink';\n") #65
f.write("import {readInt64LE, readUInt64LE} from 'node-mavlink';\n") #66
The import does not exist on npm. If this is reference to omcaree/node-mavlink, there may need to be some sort of instruction on it being a dependency, and how to add it since it is not available on npm, and because the official docs reference the following package ifrunistuttgart/node-mavlink.
If this is actually in reference to the second package, it can be added if for each of the above from 'node-mavlink';
was replaced with from '@ifrunistuttgart/node-mavlink';
Unless there is something I'm missing -- I believe this is necessary for this to work.
+1
Hey do you know why line #66 is needed? Its not being used in any of these files
@rummanwaqar I believe it’s there for some types that you may or may not have defined in your dialect.
+1
The NPM package that is available under the name node-mavlink is ArduPilot's: https://github.com/ArduPilot/node-mavlink But that one does not contain the imports MAVLinkMessage, readInt64LE or readUInt64LE.
+1
The NPM package that is available under the name node-mavlink is ArduPilot's: https://github.com/ArduPilot/node-mavlink But that one does not contain the imports MAVLinkMessage, readInt64LE or readUInt64LE.
Hi guys, I am the maintainer of node-mavlink. What seems to be the issue with readInt64LE and readUInt64LE? Are those breaking some compatibility with other packages? If so you can always make a PR, I'll gladly review it!
Hi, thanks for your response! The issue is that MAVLinkMessage, readInt64LE and readUInt64LE do not seem to exist in node-mavlink, though the generated files try to import those:
import {MAVLinkMessage} from 'node-mavlink';
import {readInt64LE, readUInt64LE} from 'node-mavlink';
Is there a different version of node-mavlink that I am not aware of that does include this class and these functions? Or is node-mavlink referring to a different package than ArduPilot/node-mavlink, as the original issue poster suggested?
The node-mavlink
package that I maintain does not export any of those methods for low-level byte-by-byte reading of values. That's implemented in https://github.com/ArduPilot/node-mavlink/blob/master/lib/serialization.ts, it's an internal part of the system and will never be exposed. This brings me to the conclusion that it must be about some other package.
IDK how I missed that:
generator/mavgen_typescript.py
That's 100% not the package I maintain. My package is published to NPM registry, you cain install it with npm i node-mavlink, it's divided into core, mappings, ftp (in progress though), debug and a few other packages so that if you don't need something you won't get it.
The generated one is, well, generated by whoever needs those mappings and is treated like other mappings for other languages. That is not published so you can't install it from npm.
I hope that makes things clear(er)
Yeah this issue is about the pymavlink repository, which generates code that depends on some package called node-mavlink, but apparently it is not the one that npm installs when you npm install node-mavlink
(the one you maintain), but also not clear which one it does depend on then.