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

AttributeError: 'DataFrame' object has no attribute 'TIME_StartTime' #38

Open
egorfolley opened this issue Jun 18, 2019 · 2 comments
Open

Comments

@egorfolley
Copy link

I installed px4tools using conda and everything works fine, except for
px4tools.logsysid.control_design_ulog(data, do_plot=True)
Jupyter notebook returns:

AttributeError Traceback (most recent call last)
in
----> 1 px4tools.logsysid.control_design(data, do_plot=True)

~/anaconda3/lib/python3.6/site-packages/px4tools/logsysid.py in control_design(raw_data, do_plot, rolling_mean_window, verbose)
403 :return: (gain ordered dict, local variables)
404 """
--> 405 data, dt = setup_data(raw_data)
406 d_tc = 1.0 / 125 # nyquist frequency of derivative in PID, (250 Hz/2)
407 K_guess_att = np.matrix([[1.0]]).T

~/anaconda3/lib/python3.6/site-packages/px4tools/logsysid.py in setup_data(df)
25 :return: (df_rs, dt) resample dataframe and period (1 ms)
26 """
---> 27 df = px4tools.get_float_data(df)
28
29 t = pandas.to_timedelta(

~/anaconda3/lib/python3.6/site-packages/px4tools/analysis.py in get_float_data(dataframe)
165 Get float data out of dataframe.
166 """
--> 167 dataframe = dataframe[np.isfinite(dataframe.TIME_StartTime)]
168 float_cols = [isfloatarray(col) for col in dataframe.values.T]
169 return (dataframe.T[float_cols].T).astype(float)

~/.local/lib/python3.6/site-packages/pandas/core/generic.py in getattr(self, name)
5065 if self._info_axis._can_hold_identifiers_and_holds_name(name):
5066 return self[name]
-> 5067 return object.getattribute(self, name)
5068
5069 def setattr(self, name, value):

AttributeError: 'DataFrame' object has no attribute 'TIME_StartTime'

Is there any resolution for this issue ? or how can I see analyze for PID controller?

@DanAbara
Copy link

DanAbara commented Aug 1, 2019

@EgorFollia did you manage to sort this out?

cc: @jgoppert

I have the similar issue only that I am trying to run the ulog example ulog_analysis using my own ulog file. The data reading goes through but after that, I get the following error:

`'DataFrame' object has no attribute 't_vehicle_groundtruth_0__f_q_0_'


AttributeError Traceback (most recent call last)
in
1 d_concat = d.concat(dt=0.1)
2 d_concat_computed = px4tools.compute_data(d_concat)
----> 3 px4tools.estimator_analysis(d_concat_computed)

C:\ProgramData\Anaconda3\envs\idenv\lib\site-packages\px4tools\ulog.py in estimator_analysis(df, plot)
505 data = {
506 'roll_error_mean': np.rad2deg(
--> 507 df.t_vehicle_attitude_0__f_roll_error.mean()),
508 'pitch_error_mean': np.rad2deg(
509 df.t_vehicle_attitude_0__f_pitch_error.mean()),

C:\ProgramData\Anaconda3\envs\idenv\lib\site-packages\pandas\core\generic.py in getattr(self, name)
5178 if self._info_axis._can_hold_identifiers_and_holds_name(name):
5179 return self[name]
-> 5180 return object.getattribute(self, name)
5181
5182 def setattr(self, name, value):

AttributeError: 'DataFrame' object has no attribute 't_vehicle_attitude_0__f_roll_error'
`

Please help. The noise analysis example runs without any issues.

@dan-leo
Copy link

dan-leo commented Apr 9, 2020

I had the same error when I had run px4tools.concat more than once in this example. Hopefully that fixes it. Print the column labels for each dictionary entry in d and you'll see if t_vehicle_attitude_0__f_roll_error exists.

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

3 participants