motors API: passing something other than speed percentage
See original GitHub issueToday in on_for_rotations()
, etc the user passes the speed_pct because this is how the EV3-G block works. I started updating the MINDCUBER demo to use the new API but I end up doing the following all over the place (two lines, one to cald the speed_pct and a second to call the API)
speed_pct = self.turntable.dps_to_speed(MindCuber.rotate_speed)
self.turntable.on_to_position(speed_pct, temp_pos)
which works just fine but doesn’t look super clean (side note, on_to_position()
is new). What if the on_to_XYZ()
methods accepted either speed_pct or (speed_type, speed_value)
tuple such as the following
self.turntable.on_to_position(('dps', MindCuber.rotate_speed), temp_pos)
Valid types there could be ‘dps’, ‘dpm’, ‘rps’, or ‘rpm’.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Motors C++ API — PROS for V5 3.7.3 documentation
This is designed to map easily to the input from the controller's analog stick for simple opcontrol use. The actual behavior of the...
Read more >FMCSA revs up plan to mandate speed limits on truck engines
Federal regulators plan to propose setting a truck speed limit using electronic engine devices in a proposed rule anticipated in 2023.
Read more >VEX V5 C++ API: vex::motor Class Reference - Robot Mesh
Sets the velocity of the motor based on the parameters set in the command. This command will not run the motor. Any subsequent...
Read more >What is an API: Definition, Types, Specifications, Documentation
API is a set of programming code that enables data transmission between one software product and another. It also contains terms of this ......
Read more >Techniques for Drivers to Conserve Fuel
Reducing your speed by 5 to 10 mph can improve fuel economy by 7%–14%. Using cruise control on the highway can help drivers...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Another option would be something like
and then the user would call via
That does look a little less hackish doesn’t it
yeah but I bet most programs only use one speed unit so hopefully won’t be bad…new code posted