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

Updated the synchronisation tool #776

Merged
merged 3 commits into from
Aug 4, 2014

Conversation

clement-roblot
Copy link
Contributor

I updated the tool for displaying a video in sync with the log file. Now you can create a "clap" (the screen blinks for 1s) in order to easily get a time flag in the video and in the log file (added a message for that).

I updated the documentation here : https://wiki.paparazziuav.org/wiki/Video_replay#How_to_use_it

IvyBindMsg(on_Airframe_ID, NULL, "^(\\S*) (\\S*)");
IvyBindMsg(on_Airframe_ID, NULL, "^(\\S*) (\\S*) (\\S*)");
IvyBindMsg(on_Airframe_ID, NULL, "^(\\S*) (\\S*) (\\S*) (\\S*)");
IvyBindMsg(on_Airframe_ID, NULL, "^(\\S*) (\\S*) (\\S*) (\\S*) (\\S*)");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why so many bindings to get the airframe ID ? If you only want the ID, you can bind to messages that starts with a numerical value (something like [0-9]+ ) and then anything ( .* ). But it is going to be a lot of messages in the end.
An other option is to bind to the PONG message.

@gautierhattenberger
Copy link
Member

Please try to follow the C style guideline, especially for if statement (I know it's annoying when it's not your coding habits...)
http://docs.paparazziuav.org/latest/stylec.html

@flixr
Copy link
Member

flixr commented Jul 25, 2014

Shouldn't the VIDEO_SYNC message also include the AC ID, so you can actually use it when you have multiple vehicles?

@flixr flixr added this to the v5.2 milestone Jul 26, 2014
@flixr
Copy link
Member

flixr commented Jul 27, 2014

and what should the sync id be used for?

@clement-roblot
Copy link
Contributor Author

You mean adding the aircraft ID after the name of the message ? Putting it in from of it is not enough. Or you may be talking about a global variable that I don't know of.

@clement-roblot
Copy link
Contributor Author

The sync ID is not used right now, but as far as you can press the sync button as much as you want I thought I might as well put an ID to the different sync.

@flixr
Copy link
Member

flixr commented Jul 28, 2014

Ok, overlooked that you send the VIDEO_SYNC message as if it was actually coming from the aircraft...
However it would probably still make sense to add a commandline option to specify the aircraft id and use that if given, as you can have multiple aircrafts in the log and you don't know which one you get from the PONG....

@flixr
Copy link
Member

flixr commented Jul 28, 2014

Actually, I don't see a need to add the VIDEO_SYNC message to telemetry, I think it would make more sense to add it to the ground class. @gautierhattenberger what do you think?

@gautierhattenberger
Copy link
Member

You're right, VIDEO_SYNC message should be in ground class. But ground ground class doesn't produce C header, only datalink and telemetry. Yet, I suggest to add the message to the datalink class (and inlcude "dl_protocol.h" instead of "messages.h") since we are a bit short on ID for the telemetry class.

@clement-roblot
Copy link
Contributor Author

OK, but I get an issue when trying to include dl_protocol.h (No such file or directory). I'm using :

#include "dl_protocol.h"

I guess it's because I'm in the ground segment and not in the airborne part.

@clement-roblot
Copy link
Contributor Author

I figured out how to include that file (I added it to the Makefile), but I still need "DefaultChannel" and "DefaultDevice". Those ones are in airborne code directly, and I can't figure out how to get them.

@gautierhattenberger
Copy link
Member

Oups, I'm really sorry, I just realized that you don't need to use the binary format here, only the Ivy string format. So you don't need to messages C headers and the message definition can go to the ground class.
Again, sorry you've waisted your time on this.

@clement-roblot
Copy link
Contributor Author

ok, so I gess that I should send this message on the ivy bus :

IvySendMsg("dl VIDEO_SYNC %d %d", airframeID, syncID);

And define the message in the ground class like so :

<message name="VIDEO_SYNC" id="110">
  <field name="ac_id" type="string"/>
  <field name="sync_id" type="uint8"/>
</message>

But if I do like that, I don't see it written into the log file, do I need to fetch it an other way afterwards ?

@gautierhattenberger
Copy link
Member

hum, I didn't really looked at how it works. If you need to have it in the log file, you need to have it in telemetry class. So it seems your first shot was correct after all.

@flixr
Copy link
Member

flixr commented Aug 4, 2014

So should we merge it as is, with the VIDEO_SYNC message in telemetry?

@gautierhattenberger
Copy link
Member

no real other choice at the moment I'm afraid...

flixr added a commit that referenced this pull request Aug 4, 2014
I updated the tool for displaying a video in sync with the log file. Now you can create a "clap" (the screen blinks for 1s) in order to easily get a time flag in the video and in the log file (added a message for that).
@flixr flixr merged commit e821c50 into paparazzi:master Aug 4, 2014
@clement-roblot clement-roblot deleted the updateVideoSyncTool branch August 7, 2014 13:45
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

Successfully merging this pull request may close these issues.

None yet

3 participants