GithubHelp home page GithubHelp logo

Comments (23)

facontidavide avatar facontidavide commented on July 22, 2024 3

@ahundt and @Chunting, no need to apolgize !
I am glade that you are both helping suggesting improvements and reporting bugs! If people don't report this kind of issue, I can not make PlotJuggler better on my own.

But I just can't resist the temptation to use silly memes... like this one:

image

from plotjuggler.

Chunting avatar Chunting commented on July 22, 2024 1

It works as well as expected. You can close this issue now. Thanks.

from plotjuggler.

ahundt avatar ahundt commented on July 22, 2024

cc @Chunting

from plotjuggler.

facontidavide avatar facontidavide commented on July 22, 2024

Let's see if I can help you...

  1. dump the data into a rosbag
    if you can do it easily, that might be a shortcut.

  2. dump to CSV (must every csv entry be occupied or can some be blank?)
    Yes, every entry must be occupied :(

  3. write a custom plugin
    it is not terribly hard, but time consuming for sure. I can help you if you want.

  4. another alternative you might advise (is there a way to load json?)
    Nope. Options 1, 2, 3 are your best shot

Let me think about the other problem (comparing clocks) to see if I can figure out a solution :)

from plotjuggler.

ahundt avatar ahundt commented on July 22, 2024

Cool, thanks! That gives me some direction. I can start with just CSV with a "base" clock + differences. There will be some discontinuities and the file might be very large because I'll be looking at ~3 minutes data recorded with 1-4ms timesteps, but it would get me started.

from plotjuggler.

facontidavide avatar facontidavide commented on July 22, 2024

If I correctly understood, you have to load a single log file, which contains all the information.

Looking at the flatbuffer description, few things come to my mind:

Keep in mind that a time series in PlotJuggler is identified by a name (a single string) and a sequence of [time,value] pairs of doubles.
There is no way to plot a string. I am sayind that because some of the fields of timeEvent are string, such as device_clock_id, event_name and local_clock_id.

Therefore, I expect the name of the time serie to be a combination of device_clock_id, event_name and local_clock_id AND the field name you want to plot (for instance device_time).

Do not forget that you also need to specify the X value (time axis) of the series; it is not clear to me which one you want to use.

In an ideal world what do you think that the plot name, the X axis and Y axis of a plot should be?

from plotjuggler.

ahundt avatar ahundt commented on July 22, 2024

The strings are basically a "rostopic" string so the different devices can be separated from each other in the message. In a CSV that will simply be the title.

What I might be able to do something like the following pseudocode at each time step to write out the csv:

# on the first message save local_request_time as the initial_local_request_time
# on the first message save device_time as the initial_device_time
X = local_request_time
local_request_offset = (local_request_time - initial_local_request_time)
current_device_offset = (device_time - initial_device_time)
Y = current_device_offset - local_request_offset

Then Y should drift around based on how the clocks change relative to each other without any counting to infinity, unless the clocks are actually drifting that way.

from plotjuggler.

ahundt avatar ahundt commented on July 22, 2024

Ok we've been able to plot the data via CSV by plotting all numbers as offsets relative to a single clock as described in my post above. This approach looks like it has great potential but we have run into a problem.

We started by simply merging the data from the three separate devices into one CSV, repeating previous values when there is no data from one time source but there is from the other. This led to the appearance that all the changes or no changes happened over very short periods of time, and thus there are massive discontinuities in the data.

For that reason, another approach is necessary. Is it possible to load two separate csv files and plot the graphs together in a single time frame? That has potential to do the trick.

from plotjuggler.

facontidavide avatar facontidavide commented on July 22, 2024

The problem is that loading two files with the same field names is not possible, in theory.
To fix that, I just added a new feature to the Dialog that is showed when a rosbag is loaded.

I can add it also to the CSV plugin, that will take some more work

from plotjuggler.

Chunting avatar Chunting commented on July 22, 2024

plot2
plot1

This is the time offset we ploted via CSV.

from plotjuggler.

facontidavide avatar facontidavide commented on July 22, 2024

is that... good news or bad news? I don't know what to think...
Is the Y axis scale nanoseconds?

from plotjuggler.

ahundt avatar ahundt commented on July 22, 2024

Unfortunately, that's bad news, the giant vertical jumps in the green bar are due to those discontinuities I was mentioning, rather than the actual data. Just trying to demonstrate the issue we're trying to resolve by loading two separate CSVs with different time steps from a single clock. We can give you sample CSVs if you'd like.

from plotjuggler.

facontidavide avatar facontidavide commented on July 22, 2024

This commit might help a little. 0f2d09b

now it is possible to parse CSV files with empty cells

image

from plotjuggler.

ahundt avatar ahundt commented on July 22, 2024

cool that might do the trick! we will give it a try

from plotjuggler.

facontidavide avatar facontidavide commented on July 22, 2024

Is there anything else I can do for you? Can we close this issue?

from plotjuggler.

Chunting avatar Chunting commented on July 22, 2024

from plotjuggler.

ahundt avatar ahundt commented on July 22, 2024

Thank you for the update! It is mostly working but as @Chunting mentioned, there seems to be minor bugs remaining for this use case.

@Chunting Would you mind actually uploading a CSV file to this github issue which demonstrates the problematic behaviors so he can actually reproduce and fix it? You can do it directly from this issue's page on the github website, since it appears you're using the email interface.

@facontidavide I wanted to thank you for this project it is turning out to work terrifically for us, especially with how easy it is to load up and see data at both a high level and at the finest levels of detail, plus it has a very responsive interface!

from plotjuggler.

facontidavide avatar facontidavide commented on July 22, 2024

@Chunting
Also could you please give more information about this error? “DataLoadCSV: problem parsing the first two lines”, sometimes I cannot plot data because of this error.

"Luke
image

A sample file to reproduce the error would help

from plotjuggler.

Chunting avatar Chunting commented on July 22, 2024

Thanks, there was a bug in my code and I fixed it.
But how about this problem?
If some cell in the first line is empty, PlotJuggler can’t recognize it or ignore it. I need to fill it out by zero manually, can you fix it? It can’t recognize kuka_local_request_time, kuka_device_time_offset and Y_kuka.
csv_file
plotdata

Thanks,
Chunting

from plotjuggler.

facontidavide avatar facontidavide commented on July 22, 2024

I just made a commit that might solve your issue.

please, if the problem persist, SEND ME the file. If it is solved, let me know

from plotjuggler.

Chunting avatar Chunting commented on July 22, 2024

Here is the CSV file.
2018_02_15_15_47_34_FTKUKA.csv.zip

Thanks.

from plotjuggler.

facontidavide avatar facontidavide commented on July 22, 2024

With the last modifications I made yesterday, the file you sent loads just fine. close the issue if you can confirm on your side that it works

image

from plotjuggler.

ahundt avatar ahundt commented on July 22, 2024

@facontidavide My apologies for all the trouble here, this is (to my knowledge) @Chunting's first time trying to provide all the information necessary to reproduce a bug to someone on a public project whom he hasn't met. I recall it was tricky my first time too so I appreciate your patience!

I'll talk to him and see if there was still an issue he is able to reproduce or if that's it, I think there might have been when the CSV starts with blanks on the first line.

Thanks a million for your help!

from plotjuggler.

Related Issues (20)

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.