-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add timestamps to actuator target values #474
Add timestamps to actuator target values #474
Conversation
7745c6f
to
b2211d1
Compare
#[derive(Debug, Clone)] | ||
pub struct Entry { | ||
pub datapoint: Datapoint, | ||
pub actuator_target: Option<DataValue>, | ||
pub actuator_target: Option<ActuatorTarget>, |
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.
This isn't wrong. But the data type of actuator target is Datapoint
(in the .proto
file) so an alternative would be to just use Option<Datapoint>
. I think that would make it easier to reuse the conversion functions already in place for Datapoint
(and would make the data type less nested).
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.
Yes, I thought about this too. Would it make definetly less nested. Then I would suggest to rename the datapoint
in value
or something else because otherwise I think the naming can be confusing. Or value_datapoint
and target_datapoint
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.
Hmm, not so sure about that.
I think the general terminology in VSS (and elsewhere) is to call "value + timestamp" a datapoint. See for example VISS, here and here.
Now. VSS doesn't have the concept of actuator targets, but if we want to introduce a new thing which is also a "value + timestamp", one way to look at it is that it also has the data type DataPoint
.
I suppose you see it as more of a variable name. Both ways to look at it makes sense I think. The alternative is to just keep it as you have already done, or maybe make it a new type ActuatorTarget(Datapoint)
instead.
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.
Okay, I see the point about Option<Datapoint>
for the target value too. I will change it to this and keep the actuator_target
variable name. Should be enough to understand.
b2211d1
to
b1d7cae
Compare
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.
Looks good to me. Rebase, and the build should succeed as well.
b1d7cae
to
4c61bc9
Compare
No description provided.