Coder Social home page Coder Social logo

moorepants / bicycleparameters Goto Github PK

View Code? Open in Web Editor NEW
37.0 4.0 19.0 961 KB

Calculates the geometry, masses, centers of mass, and the moments of inertia of the bicycle rider system.

Home Page: https://bicycleparameters.readthedocs.io

License: Other

Python 99.86% CSS 0.12% Procfile 0.02%
python bicycle engineering dynamics

bicycleparameters's People

Contributors

chrisdembia avatar jrmvv avatar moorepants avatar oliverlee avatar rrryy39 avatar sandertyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bicycleparameters's Issues

The arms and legs aren't going in the right place anymore.

rigid.add_rider('Jason', reCalc=True)
There is no rider on the bicycle, now adding Jason.
Calculating the human configuration.
Left arm's actual position does not match its desired position on the bike's handlebar. Left arm actual position:
[[ 0.76204482]
[-0.27266064]
[-1.10340464]] .
Left arm desired position:
[[ 0.68981424]
[-0.2675 ]
[-1.1186071 ]]
Left arm base to end distance: 0.581688096145 , Left arm D: 0.518569971695
Right arm's actual position does not match its desired position on the bike's handrebar. Right arm actual position: [[ 0.76204481]
[ 0.27266071]
[-1.10340466]] .
Right arm desired position:
[[ 0.68981424]
[ 0.2675 ]
[-1.1186071 ]] .
Right arm base to end distance: 0.581688096145 , Right arm D: 0.518569971695

Cycle App Bootstraps for Mobile

On mobile devices and smaller screens in general, there are a few changes that need to be made in Bootstraps for it to display nicely.

  • Navbar has 3 line menu option despite not containing any hyperlinks. Hyperlinks to parts of the page should be added, or more likely, the menu 3 line box should be removed entirely
  • The eigenvalue slider displays in between the first datatable and the other two. The slider should move to be on top of all of the datatables with the other options
  • Possibly center or reposition the reset button and plot display options alongside the eigenvalue slider for mobile devices? They work as is, but it could be nicer if they were neatly aligned.

Here is an image using inspect element for the iPhoneX. I didn't see the 3 bars on the navbar, but I'll take your word for it Jason.

iphone x

Add "download eigenvalues/eigenvectors" button on the web app

The eigenvalue plot has data for multiple lines plotted against the independent variable (speed). There are four eigenvalues and each have real and imaginary parts. So you want to be able to download the plotted data in to a CSV file that looks like:

speed,eval1_real,eval2_real,eval3_real,eval4_real,eval1_imag,eval2_imag,eval3_imag,eval4_imag
3.0,x.xxx,x.xxx,x.xxx,x.xxx,x.xxx,x.xxx,x.xxx,x.xxx,x.xxx,x.xxx

The x.xxx should be values printed to 14 decimal places using '{:1.14f}'.format(eval1_real).

This function calculates the eigenvalues: https://github.com/moorepants/BicycleParameters/blob/master/bicycleparameters/main.py#L853

Release version 1.1.0

Things that need to be done:

  • rename cycle_app.py to app.py.
  • Add entry point for the app.
  • get it working on Python 3.10 (including Yeadon)
  • Autodoc the new models (or make them private for now)
  • Complete all docstrings of the new modules
  • Decide to lock in the new module API or make the modules private for now
  • Improve and update the app colophon

Copy of TODO.rst

Removed TODO.rst from the repo and moved the notes here:

  • Add the root loci plots in the complex plane.
  • Add a transfer function method to the Bicycle class.
  • Start using some other convention other than camel case for the file names.
  • Add a critical speed method to the Bicycle class.
  • Add methods to ouput other parameter sets (Sharp2008, JBike6, etc).
  • Change lsp + lst to just one variable for the bike geometry.
  • Move some of the functionality to DynamicistToolKit and have the imports work with uncertainties.
  • Add a load_parameters method to the Bicycle class.
  • Add lots of tests for the code.

Child's arms are not placed on the handlebars properly

I added a Child sized person to sit on the Gyro bicycle. The current code to set the shoulder angles does not work for the child.

Check this branch 37df2b2

I have much better code for picking these angles in my dissertation that solves 8 non-linear equations to lock the degrees of freedom and force the arms to hang downward: https://github.com/moorepants/dissertation/blob/master/src/extensions/arms/arms_holonomic.m

This needs to be implemented in BicycleParameters with respect to Yeadon's coordinate system.

Yeadon human rider arm position is not working for all angles.

The hands are not being correctly placed onto the bicycle's handlebars; specifically the right arm. This was initially a problem only for the Stratos bicycle, but also has occurred with the Browserins bike (did not check all bicycles; going to sleep).

Possible OS version incompatibility.

Running from windows terminal on my system, the cycle app appears as so:
windows
It also does that jarring screen move effect whenever the eigenvalue slider is change. We had fixed this before on past versions. You can also see that the eigenvalue slider is not readable, which is what I had mentioned in the pull request.

However, when I run through my linux subshell, the app appears correctly, the same as it does on the live version. Here is what that looks like;
linux

I've done conda update --all, and each of my packages should be equivalent across my windows and linux versions of python. I have no idea what could be causing this. For now, I'll just run through the linux subshell.

Documentation Hyperlinks

As per the suggestions from Bryn Cloud, we can go ahead and change a few things

  • Remove the title underline and embolden it some other way. The underline can be confused for a hyperlink
  • Include documentation hyperlinks for the version control box in the lower left hand corner. I'm not sure how to dynamically access these documentation pages, as I feel the url may change over time or as new versions are released. If anybody knows, please let me know.
  • Add a link to this repository

Datatable Selected Cell Highlighting and Text Color

When a cell is selected and hovered over, it appears as so;

hover-over

However, when the cell is selected and you do not hover over it, the pink background disappears and the text becomes very difficult to read

selected

The culprit CSS is right here. If the color value on the right where the arrow points is changed, then the text color will change. I've tried multiple ways of directly putting this CSS into our styles.css file in assets, but it does not good.

CSS

My goal is to remove the pink background, leave the border, and have the text be white and legible as it normally is. It would look like this. It is much nicer this way because there isn't currently a method (as far as I know) to unselect a cell, so the default pink border is far less obnoxious than the entire cell background changing.

goal

In the Dash documentation, in the section about the dark theme, when you click on the cells of their table the text color does not change. My dark mode styling is identical. I guessed that the bootstrap theme was overriding something, but changing the theme does not fix the issue. The text color changing when a cell is selected also existed before bootstraps was even implemented within the app, so there's something hidden going on.

Improve the explanation below the app

Andrew Dressel had this comment:

"Will you implement some kind of "About" or "Help" functionality in the UI? For example, How it steer axis tilt measured? It certainly is discoverable, especially if you switch to degrees, but some users, especially the old ones, might prefer just to read it explicitly."

We need to explain the parameters and the outputs more carefully so the app is self contained.

Error in add_rider()

In [15]: b.add_rider('Jason')                                                                                                               
There is no rider on the bicycle, now adding Jason.
No parameter files found, calculating the human configuration.
Calculations in yeadon failed. No rider added.
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
~/miniconda3/lib/python3.6/site-packages/bicycleparameters/main.py in add_rider(self, riderName, reCalc, draw)
    452                     # load the parameter file
--> 453                     riderPar = io.load_parameter_text_file(pathToParFile)
    454                 except IOError:

~/miniconda3/lib/python3.6/site-packages/bicycleparameters/io.py in load_parameter_text_file(pathToFile)
     54     # parse the text file
---> 55     with open(pathToFile, 'r') as f:
     56         for line in f:

FileNotFoundError: [Errno 2] No such file or directory: './riders/Jason/Parameters/JasonPistaBenchmark.txt'

During handling of the above exception, another exception occurred:

ParserError                               Traceback (most recent call last)
<ipython-input-15-a6a6f147a0f9> in <module>
----> 1 b.add_rider('Jason')

~/miniconda3/lib/python3.6/site-packages/bicycleparameters/main.py in add_rider(self, riderName, reCalc, draw)
    465                     riderPar, human, bicycleRiderPar =\
    466                         rider.configure_rider(pathToRider, bicycleName,
--> 467                                 bicyclePar, measuredPar, draw)
    468                 else:
    469                     print("Loaded the precalculated parameters from " +

~/miniconda3/lib/python3.6/site-packages/bicycleparameters/rider.py in configure_rider(pathToRider, bicycle, bicyclePar, measuredPar, draw)
    110         # reference frame about the Yeadon origin.
    111         human = rider_on_bike(bicyclePar, measuredPar,
--> 112                               pathToYeadon, pathToCFG, draw)
    113 
    114         # This is the rotation matrix that relates Yeadon's reference frame

~/miniconda3/lib/python3.6/site-packages/bicycleparameters/rider.py in rider_on_bike(benchmarkPar, measuredPar, yeadonMeas, yeadonCFG, drawrider)
    203 
    204     # create human using input measurements and configuration files
--> 205     human = yeadon.Human(yeadonMeas, yeadonCFG)
    206 
    207     # The relevant human measurments:

~/miniconda3/lib/python3.6/site-packages/yeadon/human.py in __init__(self, meas_in, CFG, symmetric, density_set)
    195             self.meas = meas_in
    196         elif type(meas_in) == str:
--> 197             self._read_measurements(meas_in)
    198         # average left and right limbs for symmetry (maybe)
    199         if self.is_symmetric == True:

~/miniconda3/lib/python3.6/site-packages/yeadon/human.py in _read_measurements(self, fname)
   1384         # open measurement file
   1385         fid = open(fname, 'r')
-> 1386         mydict = yaml.load(fid.read())
   1387         fid.close()
   1388         # loop until all 95 parameters are read in

~/miniconda3/lib/python3.6/site-packages/yaml/__init__.py in load(stream, Loader)
     70     loader = Loader(stream)
     71     try:
---> 72         return loader.get_single_data()
     73     finally:
     74         loader.dispose()

~/miniconda3/lib/python3.6/site-packages/yaml/constructor.py in get_single_data(self)
     33     def get_single_data(self):
     34         # Ensure that the stream contains a single document and construct it.
---> 35         node = self.get_single_node()
     36         if node is not None:
     37             return self.construct_document(node)

~/miniconda3/lib/python3.6/site-packages/yaml/composer.py in get_single_node(self)
     37 
     38         # Ensure that the stream contains no more documents.
---> 39         if not self.check_event(StreamEndEvent):
     40             event = self.get_event()
     41             raise ComposerError("expected a single document in the stream",

~/miniconda3/lib/python3.6/site-packages/yaml/parser.py in check_event(self, *choices)
     96         if self.current_event is None:
     97             if self.state:
---> 98                 self.current_event = self.state()
     99         if self.current_event is not None:
    100             if not choices:

~/miniconda3/lib/python3.6/site-packages/yaml/parser.py in parse_document_start(self)
    172                         "expected '<document start>', but found %r"
    173                         % self.peek_token().id,
--> 174                         self.peek_token().start_mark)
    175             token = self.get_token()
    176             end_mark = token.end_mark

ParserError: expected '<document start>', but found '<scalar>'
  in "<unicode string>", line 15, column 1:
    totalmass=83.5 # This Jason's to ... 
    ^

Accuracy of placing limbs is not always high

For some ot the bicycle/rider combinations the hands and feet are not placed within machine precision, sometimes only to milimeter accuracy.

Two examples:

import bicycleparameters as bp
rigid = bp.Bicycle('Rigid', pathToData='data', forceRawCalc=True)
rigid.add_rider('Jason', reCalc=True)
rigid = bp.Bicycle('Rigidcl', pathToData='data', forceRawCalc=True)
rigid.add_rider('Charlie', reCalc=True)

Can't use predefined bike parameters and the rider config parameters

If you only define the geometry needed for configuring the rider in the measured parameters input file and want to use a bicycle that only has the benchmark parameters explicitly defined then you have to use Bicycle(... forceRawCalc=True) to make the measured parameters evident for the rider configuration calculations, but the program fails because it then tries to compute the benchmark parameters but there are no measured parameters defined.

Possible solutions:

  1. Put the rider configuration parameters in a different file so the forceRawCalc=True flag isn't needed when creating a Bicycle object.

Deprecation warnings when calling Bicycle

real_bike = bp.Bicycle('Rigidcl', pathToData='/home/moorepants/src/BicycleParameters/data/')

We have foundeth a directory named: /home/moorepants/src/BicycleParameters/data/bicycles/Rigidcl.
Found the RawData directory: /home/moorepants/src/BicycleParameters/data/bicycles/Rigidcl/RawData
Recalcuting the parameters.
The glory of the Rigidcl parameters are upon you!

/home/moorepants/src/BicycleParameters/bicycleparameters/com.py:55: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
  cartesian(arrays[1:], out=out[0:m,1:])
/home/moorepants/src/BicycleParameters/bicycleparameters/com.py:57: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
  out[j*m:(j+1)*m,1:] = out[0:m,1:]

Consistent Cycle App display across browsers

The App currently appears differently depending upon which browser you view it in. I've only tested it in Edge, Firefox, and Chrome, but Chrome seems to be the outlier where it appears as I have intended it. I believe the fundamental issue is that the font sizes within the datatable are changing in each browser, because the text does not wrap in Chrome but in Edge and Firefox it does. Chrome has a smaller font size than the others, but this difference only occurs within the datatable and not within the information section further down in the page.

(how it appears in chrome)
chromesmall

(how it appears in edge)
edgelarge

I've even tried changing the dash version from our current 1.12 to the most recent 13.4. While this version is stable and works fine with our app, it does not solve this issue.

Table Formatting

The purpose of this is to update the datatable presentation based on the feedback we've seen so far. I'd also like to brush up on a few stylistic things in general. Here's what's planned to get done;

  • Fix the datatable background color so the values are viewable in night mode and against the dark page background
  • Move the Parameters table to be on top of the 4 main body tables
  • Change the title of contextual parameters to just 'parameters'. Other suggestions are welcome
  • Make the label column uneditable
  • Add units to all the labels
  • Format initial table values with proper sig figs
  • Display steer axis tilt in degrees rather than radians

Feel free to comment on other suggestions. It's annoying that table values cannot be edited digit by digit at the moment, I plan to see if that can be fixed at some point.

Initial thoughts on the UI design

@sandertyu You probably have some or all of these already in your head, but here are my initial thoughts:

  • Each parameter needs units beside the name, like Radius [m]
  • Each parameter value should display a reasonable number of significant figures. We need to decide on them, but distances probably only down to mm masses maybe 1/10 kg, etc.
  • The width of the parameter table should have a fixed width that leaves minimal horizontal space in the cells.
  • The table should be left-right centered.
  • The figures should be left-right centered.
  • We should choose a color scheme with 3 or 4 colors and stick to that for all elements. You can use sites like: https://mycolor.space/
  • I don't see any need for the dark/light mode once we pick a color scheme.
  • The bicycle selection box needs a title like "Select a bicycle:" above the box.
  • Bicycle selection box should have a fixed with.
  • Make the bicycle geometry plot on the left and eigenvalues on the right. (we could also think about addind the bode plot too)
  • It seems to work fine for mobile sized screens now, which is good.
  • Steer axis tilt should be entered in degrees instead of radians.
  • We need a better name for the app. Some ideas:
    • Bicycle Dynamics Analysis App
    • Linearized Bicycle Dynamics
    • Bicycle Parameter App
    • Bicycle Dynamics Design App
    • JBike7 (would have to ask Andrew)

Docs have a bunch of warnings of missing things

(bicycleparameters-dev) moorepants@garuda:docs(docs)$ make html
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.5.6
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: [extensions changed] 7 added, 0 changed, 0 removed
reading sources... [100%] installation                                                                                                                                                                             
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.add_rider'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.calculate_from_measured'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.canonical'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.compare_bode_speeds'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.eig'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.plot_bicycle_geometry'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.plot_bode'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.plot_eigenvalues_vs_speed'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.save_parameters'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.show_pendulum_photos'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.state_space'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.main.Bicycle.steer_assembly_moment_of_inertia'
/home/moorepants/src/BicycleParameters/bicycleparameters/main.py:docstring of bicycleparameters.main.Bicycle.plot_eigenvalues_vs_speed:10: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.tables.Table.create_rst_table'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.tables.Table.generate_table_data'
/home/moorepants/src/BicycleParameters/docs/bicycleparameters.rst:18: WARNING: toctree references unknown document 'bicycleparameters.tables.Table.generate_variable_list'
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] installation                                                                                                                                                                              
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.add_rider'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.calculate_from_measured'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.canonical'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.compare_bode_speeds'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.eig'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.plot_bicycle_geometry'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.plot_bode'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.plot_eigenvalues_vs_speed'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.save_parameters'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.show_pendulum_photos'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.state_space'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.steer_assembly_moment_of_inertia'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.tables.Table.create_rst_table'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.tables.Table.generate_table_data'
<autosummary>:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.tables.Table.generate_variable_list'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.add_rider'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.calculate_from_measured'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.canonical'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.compare_bode_speeds'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.eig'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.plot_bicycle_geometry'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.plot_bode'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.plot_eigenvalues_vs_speed'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.save_parameters'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.show_pendulum_photos'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.state_space'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.main.Bicycle.steer_assembly_moment_of_inertia'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.tables.Table.create_rst_table'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.tables.Table.generate_table_data'
None:None: WARNING: toctree contains reference to nonexisting document 'bicycleparameters.tables.Table.generate_variable_list'
generating indices... genindex py-modindex
writing additional pages... search
copying images... [100%] bicycleGeometry.png                                                                                                                                                                       
copying static files... WARNING: html_static_path entry '/home/moorepants/src/BicycleParameters/docs/_static' does not exist
done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 47 warnings.

Build finished. The HTML pages are in _build/html.

Error in plot_eigenvalues_vs_speed()

In [11]: b.plot_eigenvalues_vs_speed()                                                                                                      
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-11-24499917e773> in <module>
----> 1 b.plot_eigenvalues_vs_speed()

TypeError: plot_eigenvalues_vs_speed() missing 1 required positional argument: 'speeds'

In [12]: import numpy as np                                                                                                                 

In [13]: speeds = np.linspace(0, 10)                                                                                                        

In [14]: b.plot_eigenvalues_vs_speed(speeds)                                                                                                
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~/miniconda3/lib/python3.6/site-packages/matplotlib/__init__.py in __setitem__(self, key, val)
    860             try:
--> 861                 cval = self.validate[key](val)
    862             except ValueError as ve:

KeyError: 'text.fontsize'

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
<ipython-input-14-d390ffb522c2> in <module>
----> 1 b.plot_eigenvalues_vs_speed(speeds)

~/miniconda3/lib/python3.6/site-packages/bicycleparameters/main.py in plot_eigenvalues_vs_speed(self, speeds, fig, generic, color, show, largest, linestyle)
    884             'figure.figsize': figsize
    885             }
--> 886         plt.rcParams.update(params)
    887 
    888         if not fig:

~/miniconda3/lib/python3.6/_collections_abc.py in update(*args, **kwds)
    839             if isinstance(other, Mapping):
    840                 for key in other:
--> 841                     self[key] = other[key]
    842             elif hasattr(other, "keys"):
    843                 for key in other.keys():

~/miniconda3/lib/python3.6/site-packages/matplotlib/__init__.py in __setitem__(self, key, val)
    866             raise KeyError(
    867                 '%s is not a valid rc parameter. See rcParams.keys() for a '
--> 868                 'list of valid parameters.' % (key,))
    869 
    870     def __getitem__(self, key):

KeyError: 'text.fontsize is not a valid rc parameter. See rcParams.keys() for a list of valid parameters.'

Add a widget to set the y limits on the eigenvalue plot

The caster line (lower blue one in this plot) often makes the lower y limit very large and the more interesting parts of the graph are not shown. It would be nice to both have a better default limits (maybe -10 to 10 would suffice for most bikes) and helpful to allow the user to change the limits. We change the x limits via the speed slider. We could add a slider for the y limits or maybe simple text boxes are enough. Here's an example of a plot that isn't zoomed like we want:

image

But fixing #78 would allow the user to dynamically zoom, so that is a better long term solution for changing the axes.

Display options for center of mass and inertia ellipses on the geometry plot.

The plan is to give the user the ability to turn on/off the center of mass and inertia ellipse drawings on the geometry plot:

  • Add a checklist component for user selection
  • Format the component within its visual context
  • Add/edit callbacks to redraw the geometry plot with new keyword parameters as the user selects a checklist option.

Here is what it currently looks like on a wider resolution. I want to get the top edge of both EigenValue slider and the Display Options to be at the same level. When the resolution shrinks, they stack on top of eachother like the plots do (which is good).
wide

Improve the table input

Some of Andrews comments:

  • it doesn't seem possible for me to edit the existing number, to tweek a just a digit intead of replacing the entire number
  • It seems that I can click on and edit the row labels, such as "mass", and "radius", but I suspect that the program does not read these changes. I cannot edit the column labels

Move the location of foot position on the bike`

Right now the feet are pointed along the leg and the tip of the toe is constrained to the bottom bracket axis. This makes the knees sit up too high and doesn't represent the foot inertia well.

First idea (more work):
Make the foot bend at the ankle at 90 degrees for the bike configuration and constrain the bottom of the arch of the foot to the bottom bracket axis (or the ball of the foot)

Second idea:
Don't bend the ankle but constrain the foot at the heel center (or something appropriate) to the bottom bracket axis.

Small documentation mistakes

Thought lets collect small documentation mistakes while going though the documentation:

  • In example.rst >>> bicycle.parameters['Benchmark']['mB] = 50. misses an '.
  • In data.rst it says two times <rider name><bicycle name>YeadonCFG.txt. The second should be <rider name><bicycle name>YeadonMeas.txt if I'm not mistaken.
  • The reference to the raw data sheet reference in data.rst does not work anymore.

Switch to JS based figure in the app

We should develop a custom Plotly based figure (like in the skijumpdesign app) or convert the matplotlib lib figure to a plotly figure or use some other JS based output (matplotlib can produce SVG, and JS backed figures, or Bokeh, altair, or other).

Just saw this:

https://github.com/plotly/dash-alternative-viz

Might make it easy to turn the Matplotlib plot into a JS figure, as opposed to switching to plotly.

Display Steer Axis Tilt in Degrees

As I mentioned in issue #46 , there are a couple things to be solved. The method needs to be able to identify and select between 2 different cases:

  1. The callback is fed a steer axis tilt in radians from the default app-data bicycles. This isn't too difficult, I can just selectively convert the value to degrees and insert it that way.
  2. The callback receives that there is user edited data, and it has to receive the value in degrees, convert to radians to recalculate, and then go back into degrees like in case 1.

Functionally, we need to be able to determine whether values are being received in radians or degrees, and then do the conversion in case 2 as necessary. It may be easier to add functionality in bicycleparameters to accept degrees, but otherwise, how could we solve this?

@moorepants

Dash Bootstraps Overhaul

The purpose here is to integrate and replace my current CSS with that already written in Dash Bootstrap Components. The main benefit is using its layout features, so elements can be positioned easily and in ways that I don't know how to program myself. Secondly, there are a few components in the Dash Bootstrap Components library, such as button, which can essentially replace current components while looking a little nicer. The main goals are as follows;

  • Use bootstrap layout in order to organize the web elements.
  • Replace a few current components with the bootstrap counter-part (this is often as easy as replacing module html with dbc).
  • Choose a theme for the app. Currently my favorite is Slate, but the rest can be navigated through by the "Themes" toolbar at the top of the linked page.
  • Fit everything on to one screen page. This may be a stretch, but it should be possible, especially now that the CSS is easier to work with.

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.