-
Notifications
You must be signed in to change notification settings - Fork 39
Changes to support new tacho driver updates #152
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
Conversation
rhempel
commented
Mar 6, 2016
- Eliminate speed_regulation_enabled attribute
- Add max_speed attribute
- Add count_per_m attribute for linear motors
- Add fullt_travel_count attribute linear motors
- Add subclasses for all known motor types
- Change the speed_regulation_pid parameters to speed_pid
- Add a paragraph to explain when attributes are handled.
- See Can't change speed_sp anymore while motor is running ev3dev#558
- Fix line endings without commas
- Eliminate speed_regulation_enabled attribute - Add max_speed attribute - Add count_per_m attribute for linear motors - Add fullt_travel_count attribute linear motors - Add subclasses for all known motor types - Change the speed_regulation_pid parameters to speed_pid - Add a paragraph to explain when attributes are handled. - See ev3dev/ev3dev#558 - Fix line endings without commas
@@ -362,7 +359,40 @@ | |||
], | |||
"inheritance": "motor" | |||
}, | |||
"dcMotor": { | |||
"nxtMotor": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should do something like we did for specialSensorTypes
for these, because they should be able to be completely automatically generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
], | ||
"docsLink": "http://www.ev3dev.org/docs/drivers/tacho-motor-class/", | ||
"systemClassName": "tacho-motor", | ||
"systemDeviceNameConvention": "motor{0}", | ||
"systemDeviceNameConvention": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a workaround for the fact that we have two types of motors - the Firgellis have a device name of linear*
while all others are motor*
- if you instantiate using ev3dev.Motor
and then change the driver type to a linear motor, the device name changes to linear*
.
You can always instantiate the right motor type and get the more precise motor name
@@ -344,6 +346,7 @@ | |||
}, | |||
"largeMotor": { | |||
"friendlyName": "Large Motor", | |||
"systemDeviceNameConvention": "motor{0}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really related to this PR, but looks like we have a mix of two mask styles: *
and {0}
. May be we need to choose one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree -- we should normalize on a way of specifying this information and stick with it. I'll need to take a look at the underlying device code in my JS lib to refresh my memory on how I do it, but I think I currently transform it into a regex. That would probably be a good format to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In python this gets translated to file system mask, so *
may be used directly. {0}
is also not a problem though, because it coincidentally is the string format marker in python (as in 'motor{0}'.format('*')
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WasabiFan - I will defer to your judgement on this - I agree with pick one and stick with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I say we normalize to *
-- it's a universally understood symbol for a wildcard and single characters are simpler in general.
Good morning, how many weeks to release a new version to be effect the changes in motor class? |
@rhempel Can you update the spec version number and supported kernel version? I think the spec version deserves incrementing the major. |
Will do - chicken and egg - I need to know also the next kernel cycle version :-) |
@WasabiFan - the version in my branch looks like this:
The version in develop looks like this:
The proposed new version will be
And if we do a non-breaking revision after that, we just add a
line, OK? |
As long as we plan to tag an ev3dev-lang release after these changes are released, I'm fine with that. |
@WasabiFan,I was thinking about this after my discussion with @dlech and probably the right thing to do is make the
That way it's independent of the target board kernel and depends only on our updates to the drivers... |
That makes sense. Feel free to make that change. |
Regex would actually be Anything between the 10 and ev3dev is for development releases only and can probably be omitted. |
I thought the kernel version string had to end in And this re does match:
|
Here's a slightly better regex that actually matches the kernel string I have:
|
Nope, EV3 hardware ends in The |
Does this regex have to actually match against |
No, it does not have to match, but it's a clue that you can use to figure out why your script isn't working when we change attributes :-) |
I was just trying to figure out some way to make that string useful across all the kernel strings that we might support |
If it is not used programmatically, then why not make it human readable like |
Honestly, I think it would make sense to add an |
What if the kernel verison changed with no changes required for |
Then the support method returns false, saying that it is an untested platform. If we have tested it and it is supported, we publish a new version. |
I'm in favour now of @dlech's suggestion of a human readable expression - the language binding can easily replace the known text with the appropriate matching pattern in case it's not compatible with standard regexen. I'll add a section for optional release candidate like this:
unless we can convince @dlech to make |
There will never be an official release with So, no, I can't move "optional text" because it would change how version numbers are compared and it doesn't seem appropriate to have it in the spec anyway unless the spec is targeting a pre-release version, in which case you would specify |
OK, how about And we can have a list of compatible s in the meta data. Sorry if I'm dragging this out, but I deal with checking hardware and firmware compatibility regularly at work, and it's a mess if you get it wrong. |
👍 |
- Added an easily matched text string to allow for a more complex regexp to be used to match kernel variants across supported platform - Added a list of kernel variants that are compatible with the current json.spec
@WasabiFan and @dlech, I've added the support for allowing kernel compatibility to be checked. The strings are easily identified to allow for binding-specific string matching, and we have an array of compatible kernel variants that the binding can iterate through to test for compatibility :-) |
I'm not sure that I understand. What's the point of the |
The pattern is there because it lets the binding easily substitute patterns for the upstream version and the flavour, and iterate through the supported kernel versions. I see your point about just listing supported kernel variant strings. The patterns allow the binding to know where to find the important This becomes important when we support different upstream kernels and the flavours include EV3, rPi, BB, etc |
What's the plan for this? Merge it once the new drivers are released? |
Drivers have been released so you can proceed with this pull request. |
Additional changes needed are
|
I'm going to merge this as-is, and open a new PR for the breaking changes to the new kernel that @dlech mentions above. |