Skip to content

Commit

Permalink
Add haptic actuator set and update IWearActuatorsWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
yeshasvitirupachuri committed Jan 18, 2021
1 parent e772a1b commit 7622ad6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class wearable::actuator::IHaptic : public wearable::actuator::IActuator

inline static const std::string getPrefix();

//TODO: Update set and get methods
virtual bool setHapticCommand(double& value) const = 0;
};

inline const std::string wearable::actuator::IHaptic::getPrefix()
Expand Down
9 changes: 9 additions & 0 deletions wrappers/IWearActuators/src/IWearActuatorsWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ void IWearActuatorsWrapper::onRead(msg::WearableActuatorCommand& wearableActuato

wearable::actuator::ActuatorType aType = pImpl->actuatorsMap[info.name]->getActuatorType();
switch (aType) {
case wearable::actuator::ActuatorType::Haptic: {

if(info.type == wearable::msg::ActuatorType::HAPTIC)
{
wearable::ElementPtr<const wearable::actuator::IHaptic> castActuator = std::static_pointer_cast<const wearable::actuator::IHaptic>(pImpl->actuatorsMap[info.name]);
castActuator->setHapticCommand(wearableActuatorCommand.value);
}

}
case wearable::actuator::ActuatorType::Motor: {

// Check if the actuator type in the command is correct
Expand Down

0 comments on commit 7622ad6

Please sign in to comment.