Skip to content
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

Implement motor currents reading #187

Merged

Conversation

isorrentino
Copy link
Collaborator

No description provided.

@isorrentino isorrentino force-pushed the feature/addMotorCurrentsReading branch from b5d6136 to 11f29b7 Compare February 4, 2021 09:53
jointCurrents = yarp::eigen::toEigen(m_pimpl->controlBoardRemapperMeasures.jointCurrents);
receiveTimeInSeconds = &m_pimpl->controlBoardRemapperMeasures.receivedTimeInSeconds;
return true;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End of line

Comment on lines 409 to 410
std::cerr << "[YarpSensorBridge::getJointVelocity] " << jointName
<< " could not be found in the configured list of joints" << std::endl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::cerr << "[YarpSensorBridge::getJointVelocity] " << jointName
<< " could not be found in the configured list of joints" << std::endl;
std::cerr << "[YarpSensorBridge::getMotorCurrent] " << jointName
<< " could not be found in the configured list of joints" << std::endl;

@prashanthr05
Copy link
Collaborator

prashanthr05 commented Feb 4, 2021

@isorrentino please be aware of this PR #191

Whichever gets merged first, the other might have to fix merge conflicts ;D

Comment on lines 1210 to 1228
if (std::binary_search(controlBoardRemapperMeasures.jointCurrents.begin(), controlBoardRemapperMeasures.jointCurrents.end(), NAN))
{
std::cerr << logPrefix << " NAN values read from current control interface, use previous measurement" << std::endl;
return false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this should be changed according to #191. Indeed, by reading this code I opened #188 😁

@isorrentino isorrentino force-pushed the feature/addMotorCurrentsReading branch from 5a04b07 to 44e683d Compare February 5, 2021 15:36
Comment on lines 305 to 357
* Helper method to maintain SensorBridgeOptions struct by populating it from the configuration
* parameters
* @note the user may choose to use/not use this method depending on their requirements for the
* implementation if the user chooses to not use the method, the implementation must simply
* contain "return true;"
*
* @param[in] handler Parameters handler
* @param[in] sensorBridgeOptions SensorBridgeOptions to hold the bridge options for streaming sensor measurements
* @param[in] sensorBridgeOptions SensorBridgeOptions to hold the bridge options for streaming
* sensor measurements
*/
virtual bool populateSensorBridgeOptionsFromConfig(std::weak_ptr<BipedalLocomotion::ParametersHandler::IParametersHandler> handler,
SensorBridgeOptions& sensorBridgeOptions) { return true; };
virtual bool populateSensorBridgeOptionsFromConfig(
std::weak_ptr<BipedalLocomotion::ParametersHandler::IParametersHandler> handler,
SensorBridgeOptions& sensorBridgeOptions)
{
return true;
};

/**
* Helper method to maintain SensorLists struct by populating it from the configuration parameters
* @note the user may choose to use/not use this method depending on their requirements for the implementation
* if the user chooses to not use the method, the implementation must simply contain "return true;"
* Helper method to maintain SensorLists struct by populating it from the configuration
* parameters
* @note the user may choose to use/not use this method depending on their requirements for the
* implementation if the user chooses to not use the method, the implementation must simply
* contain "return true;"
*
* @param[in] handler Parameters handler
* @param[in] sensorBridgeOptions configured object of SensorBridgeOptions
* @param[in] sensorLists SensorLists object holding list of connected sensor devices
*/
virtual bool populateSensorListsFromConfig(std::weak_ptr<BipedalLocomotion::ParametersHandler::IParametersHandler> handler,
const SensorBridgeOptions& sensorBridgeOptions,
SensorLists& sensorLists) { return true; };
virtual bool populateSensorListsFromConfig(
std::weak_ptr<BipedalLocomotion::ParametersHandler::IParametersHandler> handler,
const SensorBridgeOptions& sensorBridgeOptions,
SensorLists& sensorLists)
{
return true;
};

/**
* Helper method to maintain SensorBridgeMetaData struct by populating it from the configuration parameters
* @note the user may choose to use/not use this method depending on their requirements for the implementation
* if the user chooses to not use the method, the implementation must simply contain "return true;"
* Helper method to maintain SensorBridgeMetaData struct by populating it from the configuration
* parameters
* @note the user may choose to use/not use this method depending on their requirements for the
* implementation if the user chooses to not use the method, the implementation must simply
* contain "return true;"
*
* @param[in] handler Parameters handler
* @param[in] sensorBridgeMetaData configured object of SensorBridgeMetadata
* @param[in] sensorLists SensorLists object holding list of connected sensor devices
*/
virtual bool populateSensorBridgeMetaDataFromConfig(std::weak_ptr<BipedalLocomotion::ParametersHandler::IParametersHandler> handler,
SensorBridgeMetaData& sensorBridgeMetaData) { return true; };
virtual bool populateSensorBridgeMetaDataFromConfig(
std::weak_ptr<BipedalLocomotion::ParametersHandler::IParametersHandler> handler,
SensorBridgeMetaData& sensorBridgeMetaData)
{
return true;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you can revert these changes, just to have the PR cleaner. In addition, the indentation is weird

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@GiulioRomualdi GiulioRomualdi merged commit ea6cefd into ami-iit:master Feb 9, 2021
@isorrentino isorrentino deleted the feature/addMotorCurrentsReading branch February 9, 2021 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants