Skip to content
This repository has been archived by the owner on Jan 14, 2023. It is now read-only.

Message Headers missing dependency information #16

Open
stonier opened this issue Feb 9, 2014 · 12 comments · May be fixed by #82
Open

Message Headers missing dependency information #16

stonier opened this issue Feb 9, 2014 · 12 comments · May be fixed by #82
Labels
Milestone

Comments

@stonier
Copy link
Contributor

stonier commented Feb 9, 2014

It appears that published messages are missing the message definition for the child types which is used for message introspection.

ros/common_msgs#20

@valentinp
Copy link

Has there been any progress on this bug? This is particularly annoying for collecting rosbags from Android devices.

@stonier
Copy link
Contributor Author

stonier commented May 19, 2014

Rosjava is mostly following a scratch that itch development cycle at the moment. Those of us who are scratching itches right now are working at companies and can commit time to fixes where we need it or can justify it. We don't have a need for this one at our company (yet), so it's on the todo...unless someone else gets a terrific urge to scratch this itch ;)

It's probably not too hard to fix - I think you'll need to compare the way gencpp/genpy does things with the code in message_generation.

@stonier stonier changed the title ROS messages are malformed Messages missing dependency information Jun 29, 2014
@stonier
Copy link
Contributor Author

stonier commented Jun 29, 2014

To summarise the discussion in the issue posted on common_msgs, a likely source is that the message_definition field specified in TCPROS Specification is not providing the dependencies definition as well as the msg definition (should exactly match a rosrun roslib gendeps --cat _msg_file_).

@stonier stonier changed the title Messages missing dependency information Message Headers missing dependency information Jun 29, 2014
@gavanderhoorn
Copy link

gavanderhoorn commented Mar 4, 2018

Not a proper fix at all, but at least a work-around: as I had quite some bags that contained messages published by rosjava publishers where I ran into the exception reported in ros/common_msgs#20, I went for the nuclear option and wrote something that replaces the msg defs in connection headers in bag files with completely expanded ones.

The message definitions obviously need to be available (and identical to what was used by the publisher(s)) on the machine running the script, but that is typically the case.

See gavanderhoorn/rosbag_fixer.


Edit: just solved a pretty serious oversight in rosbag_fixer that caused it to not properly close the bag it writes the "fixed" connection headers to. Smaller bags would suffer data loss which sometimes caused rosbag to not be able to read any messages after running the fixer script. This should now be resolved.

@ramonss
Copy link

ramonss commented Nov 20, 2018

Is there any update on this issue? A permanent fix would be greatly appreciated. Currently, I've been having to use the rosbag_fixer quite often (strangely I do not always have the problem) when recording topics with different types of nodes (rosjava and non-rosjava nodes).

@gavanderhoorn
Copy link

I don't believe there has been any development to fix this. As @stonier writes in his comment above, rosjava itself must be changed for this.

@ramonss
Copy link

ramonss commented Nov 21, 2018

Thanks for the reply. Is there any planned update for rosjava itself? I think the current bug compromises the compatibility with non-rosjava nodes, since recording ros topics into bag files is a very basic ros feature and extensively used for testing purposes.

@gavanderhoorn
Copy link

I'm just a user, like you :)

Dependent on the rosjava gods.

@jubeira
Copy link

jubeira commented Nov 21, 2018

hi @ramonss,

Rosjava is currently developed mainly by its community; there are no developers working full time or part time on it that I know of. If you need this feature, feel free to submit a PR; I'll review it as soon as I can. If it's something that adds new features and doesn't have too much risk of breaking the existing codebase it will be merged rather fast. I've been pretty packed up lately and I don't have the time to implement this right now.

Dependent on the rosjava gods.

That certainly made me laugh 😅

@krixkrix
Copy link

krixkrix commented Jun 3, 2019

@gavanderhoorn: thanks for the rosbag_fixer script, it works for me on melodic.
What about adding an option to rosbag record to use local defs? I would like to do it, but not sure if I am capable. Any hints?

@gavanderhoorn
Copy link

What about adding an option to rosbag record to use local defs?

Well, that would be adding a work-around for an issue local to rosjava to a tool that sees most of its usage outside rosjava contexts.

Unless there are other use-cases, I doubt the rosbag maintainers are going to accept something like that -- and I think I would agree with them.

@ravesteijnd
Copy link

I have created a fix here.

I had trouble getting the child headers for dependencies outside of the current package during runtime, so I'm spawning a process for rosrun roslib gendeps --cat while generating the headers. This makes the generation of interfaces and belonging defintions very slow and forces a dependency on gendeps so this is not a proper fix in my opinion, but it does the job.

@ravesteijnd ravesteijnd linked a pull request Jul 21, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants