On Oct 22, 2005, at 6:19 PM, Michael C. Menefee wrote:
> This may be more appropriate for the design list, but I thought I'd
> try
> here first. I have a few projects I'm looking to implement player/
> stage
> on, but I'm wondering about how to use the motor interface exactly.
> None of my platforms have odometry or any other type of feedback on
> their drive motor outputs. I simply specify a "power level" (0-255,
> Devantech MD22 motor controller) or a PWM pulse width (AVR PWM
> generator). Now, I suppose I _could_ just use the thetaspeed value to
> store this information, but that seems incorrect to me since there are
> actual physical units associated with it. If I performed some kind of
> measurement on the motor (tricky at best, since a few of these are
> underwater thrusters), calibrated this rotational velocity value to a
> power level, etc., I still have no way of ensuring the motor is
> actually
> turning at that speed. (i.e. as the batteries start to wear, motors
> will
> turn more slowly for given power levels, etc.)
>
> So, my question is then what is the appropriate way to handle a
> situation like this? I would say just implement another interface
> type
> ("dumbmotor" or something), but I am by no means experienced with this
> framework, so I thought I'd ask here first.
While you're right that it's kind of ugly to put your power level
byte into the 'thetaspeed' field, that's what I would suggest to
start: Support the motor interface, interpret commanded thetaspeed as
"power" and report "power" as thetaspeed.
Of course you're breaking the semantics of the interface by doing
this (e.g., other drivers or clients that use the motor interface
"properly" won't work with your driver), but think about it as an
exploratory step. The set of interfaces and the messages that they
specify evolve over time as new devices become available and as
developers want to access different functionality. There are many
examples of people (myself included) shoe-horning devices into
existing interfaces in non-obvious ways until an informed decision
can be made to either modify the interface or create a new one.
brian.
|