-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4781fa4
Changes to support new tacho driver updates
rhempel a63978f
Add missing full_travel_count attribute
rhempel cdb0250
Add support for compatible kernel detection
rhempel 8f4b6a9
Merge branch 'develop' into feature-new-tacho-driver-attributes
WasabiFan 9c9e8d7
Reapply changes that were lost in a bad merge
rhempel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
{ | ||
"meta": { | ||
"version": "1.0.0", | ||
"supportedKernel": "v3.16.7-ckt21-9-ev3dev" | ||
"version": "1.1.0", | ||
"specRevision": 0, | ||
"supportedKernel": { | ||
"pattern": "{upstream_version}-{kernel}-{flavour}", | ||
"kernels": [ | ||
"10-ev3dev", | ||
"10-rc1-ev3dev" | ||
] | ||
} | ||
}, | ||
"classes": { | ||
"motor": { | ||
|
@@ -19,7 +26,7 @@ | |
], | ||
"docsLink": "http://www.ev3dev.org/docs/drivers/tacho-motor-class/", | ||
"systemClassName": "tacho-motor", | ||
"systemDeviceNameConvention": "motor{0}", | ||
"systemDeviceNameConvention": "*", | ||
"systemProperties": [ | ||
{ "name": "Address", "systemName": "address", "type": "string", "readAccess": true, "writeAccess": false, | ||
"description": [ | ||
|
@@ -59,8 +66,14 @@ | |
"description": [ | ||
"Returns the number of tacho counts in one rotation of the motor. Tacho counts", | ||
"are used by the position and speed attributes, so you can use this value", | ||
"to convert rotations or degrees to tacho counts. In the case of linear", | ||
"actuators, the units here will be counts per centimeter." | ||
"to convert rotations or degrees to tacho counts. (rotation motors only)" | ||
] | ||
}, | ||
{ "name": "Count Per M", "systemName": "count_per_m", "type": "int", "readAccess": true, "writeAccess": false, | ||
"description": [ | ||
"Returns the number of tacho counts in one meter of travel of the motor. Tacho", | ||
"counts are used by the position and speed attributes, so you can use this", | ||
"value to convert from distance to tacho counts. (linear motors only)" | ||
] | ||
}, | ||
{ "name": "Driver Name", "systemName": "driver_name", "type": "string", "readAccess": true, "writeAccess": false, | ||
|
@@ -78,8 +91,7 @@ | |
"description": [ | ||
"Writing sets the duty cycle setpoint. Reading returns the current value.", | ||
"Units are in percent. Valid values are -100 to 100. A negative value causes", | ||
"the motor to rotate in reverse. This value is only used when `speed_regulation`", | ||
"is off." | ||
"the motor to rotate in reverse." | ||
] | ||
}, | ||
{ "name": "Encoder Polarity", "systemName": "encoder_polarity", "type": "string", "readAccess": true, "writeAccess": true, | ||
|
@@ -91,6 +103,13 @@ | |
"`inversed`." | ||
] | ||
}, | ||
{ "name": "Full Travel Count", "systemName": "full_travel_count", "type": "int", "readAccess": true, "writeAccess": false, | ||
"description": [ | ||
"Returns the number of tacho counts in the full travel of the motor. When", | ||
"combined with the `count_per_m` atribute, you can use this value to", | ||
"calculate the maximum travel distance of the motor. (linear motors only)" | ||
] | ||
}, | ||
{ "name": "Polarity", "systemName": "polarity", "type": "string", "readAccess": true, "writeAccess": true, | ||
"description": [ | ||
"Sets the polarity of the motor. With `normal` polarity, a positive duty", | ||
|
@@ -130,6 +149,13 @@ | |
"rotations or degrees." | ||
] | ||
}, | ||
{ "name": "Max Speed", "systemName": "max_speed", "type": "int", "readAccess": true, "writeAccess": false, | ||
"description": [ | ||
"Returns the maximum value that is accepted by the `speed_sp` attribute. This", | ||
"may be slightly different than the maximum speed that a particular motor can", | ||
"reach - it's the maximum theoretical speed." | ||
] | ||
}, | ||
{ "name": "Speed", "systemName": "speed", "type": "int", "readAccess": true, "writeAccess": false, | ||
"description": [ | ||
"Returns the current motor speed in tacho counts per second. Note, this is", | ||
|
@@ -139,49 +165,43 @@ | |
}, | ||
{ "name": "Speed SP", "systemName": "speed_sp", "type": "int", "readAccess": true, "writeAccess": true, | ||
"description": [ | ||
"Writing sets the target speed in tacho counts per second used when `speed_regulation`", | ||
"is on. Reading returns the current value. Use the `count_per_rot` attribute", | ||
"to convert RPM or deg/sec to tacho counts per second." | ||
"Writing sets the target speed in tacho counts per second used for all `run-*`", | ||
"commands except `run-direct`. Reading returns the current value. A negative", | ||
"value causes the motor to rotate in reverse with the exception of `run-to-*-pos`", | ||
"commands where the sign is ignored. Use the `count_per_rot` attribute to convert", | ||
"RPM or deg/sec to tacho counts per second. Use the `count_per_m` attribute to", | ||
"convert m/s to tacho counts per second." | ||
] | ||
}, | ||
{ "name": "Ramp Up SP", "systemName": "ramp_up_sp", "type": "int", "readAccess": true, "writeAccess": true, | ||
"description": [ | ||
"Writing sets the ramp up setpoint. Reading returns the current value. Units", | ||
"are in milliseconds. When set to a value > 0, the motor will ramp the power", | ||
"sent to the motor from 0 to 100% duty cycle over the span of this setpoint", | ||
"when starting the motor. If the maximum duty cycle is limited by `duty_cycle_sp`", | ||
"or speed regulation, the actual ramp time duration will be less than the setpoint." | ||
"are in milliseconds and must be positive. When set to a non-zero value, the", | ||
"motor speed will increase from 0 to 100% of `max_speed` over the span of this", | ||
"setpoint. The actual ramp time is the ratio of the difference between the", | ||
"`speed_sp` and the current `speed` and max_speed multiplied by `ramp_up_sp`." | ||
] | ||
}, | ||
{ "name": "Ramp Down SP", "systemName": "ramp_down_sp", "type": "int", "readAccess": true, "writeAccess": true, | ||
"description": [ | ||
"Writing sets the ramp down setpoint. Reading returns the current value. Units", | ||
"are in milliseconds. When set to a value > 0, the motor will ramp the power", | ||
"sent to the motor from 100% duty cycle down to 0 over the span of this setpoint", | ||
"when stopping the motor. If the starting duty cycle is less than 100%, the", | ||
"ramp time duration will be less than the full span of the setpoint." | ||
] | ||
}, | ||
{ "name": "Speed Regulation Enabled", "systemName": "speed_regulation", "type": "string", "readAccess": true, "writeAccess": true, | ||
"description": [ | ||
"Turns speed regulation on or off. If speed regulation is on, the motor", | ||
"controller will vary the power supplied to the motor to try to maintain the", | ||
"speed specified in `speed_sp`. If speed regulation is off, the controller", | ||
"will use the power specified in `duty_cycle_sp`. Valid values are `on` and", | ||
"`off`." | ||
"are in milliseconds and must be positive. When set to a non-zero value, the", | ||
"motor speed will decrease from 0 to 100% of `max_speed` over the span of this", | ||
"setpoint. The actual ramp time is the ratio of the difference between the", | ||
"`speed_sp` and the current `speed` and max_speed multiplied by `ramp_down_sp`." | ||
] | ||
}, | ||
{ "name": "Speed Regulation P", "systemName": "speed_pid/Kp", "type": "int", "readAccess": true, "writeAccess": true, | ||
{ "name": "Speed P", "systemName": "speed_pid/Kp", "type": "int", "readAccess": true, "writeAccess": true, | ||
"description": [ | ||
"The proportional constant for the speed regulation PID." | ||
] | ||
}, | ||
{ "name": "Speed Regulation I", "systemName": "speed_pid/Ki", "type": "int", "readAccess": true, "writeAccess": true, | ||
{ "name": "Speed I", "systemName": "speed_pid/Ki", "type": "int", "readAccess": true, "writeAccess": true, | ||
"description": [ | ||
"The integral constant for the speed regulation PID." | ||
] | ||
}, | ||
{ "name": "Speed Regulation D", "systemName": "speed_pid/Kd", "type": "int", "readAccess": true, "writeAccess": true, | ||
{ "name": "Speed D", "systemName": "speed_pid/Kd", "type": "int", "readAccess": true, "writeAccess": true, | ||
"description": [ | ||
"The derivative constant for the speed regulation PID." | ||
] | ||
|
@@ -304,22 +324,6 @@ | |
} | ||
] | ||
}, | ||
{ | ||
"propertyName": "Speed Regulation", | ||
"values": [ | ||
{ "name": "on", | ||
"description": [ | ||
"The motor controller will vary the power supplied to the motor", | ||
"to try to maintain the speed specified in `speed_sp`." | ||
] | ||
}, | ||
{ "name": "off", | ||
"description": [ | ||
"The motor controller will use the power specified in `duty_cycle_sp`." | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"propertyName": "Stop Command", | ||
"values": [ | ||
|
@@ -349,6 +353,7 @@ | |
}, | ||
"largeMotor": { | ||
"friendlyName": "Large Motor", | ||
"systemDeviceNameConvention": "*", | ||
"description": [ | ||
"EV3 large servo motor" | ||
], | ||
|
@@ -359,6 +364,7 @@ | |
}, | ||
"mediumMotor": { | ||
"friendlyName": "Medium Motor", | ||
"systemDeviceNameConvention": "*", | ||
"description": [ | ||
"EV3 medium servo motor" | ||
], | ||
|
@@ -367,6 +373,39 @@ | |
], | ||
"inheritance": "motor" | ||
}, | ||
"nxtMotor": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should do something like we did for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
"friendlyName": "NXT Motor", | ||
"systemDeviceNameConvention": "*", | ||
"description": [ | ||
"NXT servo motor" | ||
], | ||
"driverName": [ | ||
"lego-nxt-motor" | ||
], | ||
"inheritance": "motor" | ||
}, | ||
"firgelli50Motor": { | ||
"friendlyName": "Firgelli L12 50 Motor", | ||
"systemDeviceNameConvention": "linear{0}", | ||
"description": [ | ||
"Firgelli L12 50 linear servo motor" | ||
], | ||
"driverName": [ | ||
"fi-l12-ev3-50" | ||
], | ||
"inheritance": "motor" | ||
}, | ||
"firgelli100Motor": { | ||
"friendlyName": "Firgelli L12 100 Motor", | ||
"systemDeviceNameConvention": "linear{0}", | ||
"description": [ | ||
"Firgelli L12 100 linear servo motor" | ||
], | ||
"driverName": [ | ||
"fi-l12-ev3-100" | ||
], | ||
"inheritance": "motor" | ||
}, | ||
"dcMotor": { | ||
"friendlyName": "DC Motor", | ||
"description": [ | ||
|
@@ -1411,11 +1450,12 @@ | |
{ "name" : "Right", "entries" : ["Red Right", "Green Right"] } | ||
], | ||
"colors": [ | ||
{ "name" : "Black", "value" : [ 0.0, 0.0 ] }, | ||
{ "name" : "Red", "value" : [ 1.0, 0.0 ] }, | ||
{ "name" : "Green", "value" : [ 0.0, 1.0 ] }, | ||
{ "name" : "Amber", "value" : [ 1.0, 1.0 ] }, | ||
{ "name" : "Orange", "value" : [ 1.0, 0.5 ] }, | ||
{ "name" : "Yellow", "value" : [ 0.5, 1.0 ] } | ||
{ "name" : "Yellow", "value" : [ 0.1, 1.0 ] } | ||
] | ||
}, | ||
"button": { | ||
|
@@ -1441,9 +1481,11 @@ | |
{ "name" : "Led2", "entries" : ["Blue Led2"] } | ||
], | ||
"colors": [ | ||
{ "name" : "Black", "value" : [ 0.0 ] }, | ||
{ "name" : "Blue", "value" : [ 1.0 ] } | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 aremotor*
- if you instantiate usingev3dev.Motor
and then change the driver type to a linear motor, the device name changes tolinear*
.You can always instantiate the right motor type and get the more precise motor name