Class qbSoftHandIndustryCommunicationHandler
Class Documentation
-
class qbSoftHandIndustryCommunicationHandler
The Communication Handler class is aimed to instantiate a ROS node which provides several ROS services to communicate with one - or many - qbrobotics SoftHand Industry connected to the ROS ecosystem.
Public Functions
Protected Functions
-
virtual int activate(const bool &command, const int &max_repeats)
Activate the motors of the device. Do nothing if the device is not connected in the Communication Handler.
See also
activateCallback(), activate(const int &, const bool &, const int &), isActive()
- Parameters:
max_repeats – The maximum number of consecutive repetitions to mark retrieved data as corrupted.
Activate the motors of the SoftHand Industry relative to the node requesting the service.
See also
activate(const int &, const int &)
- Parameters:
request – The request of the given service (see qb_softhand_industry_srvs::srv::Trigger for details).
response – The response of the given service (see qb_softhand_industry_srvs::srv::Trigger for details).
- Returns:
trueif the call succeed (actuallyresponse.successmay be false).
Deactivate the motors of the SoftHand Industry relative to the node requesting the service.
See also
activate(const int &, const int &)
- Parameters:
request – The request of the given service (see qb_softhand_industry_srvs::srv::Trigger for details).
response – The response of the given service (see qb_softhand_industry_srvs::srv::Trigger for details).
- Returns:
trueif the call succeed (actuallyresponse.successmay be false).
Get measurements from SoftHand Industry relative to the node requesting the service.
- Parameters:
request – The request of the given service (see qb_softhand_industry_srvs::srv::GetMeasurements for details).
response – The response of the given service (see qb_softhand_industry_srvs::srv::GetMeasurements for details).
- Returns:
trueif the call succeed (actuallyresponse.successmay be false).
-
bool isValidCurrent(const int ¤t)
Validate current.
- Parameters:
current – parameter to validate
- Returns:
true if valid, false otherwise
-
bool isValidPosition(const int &position)
Validate position.
- Parameters:
position – parameter to validate
- Returns:
true if valid, false otherwise
-
bool isValidVelocity(const int &velocity)
Validate velocity.
- Parameters:
velocity – parameter to validate
- Returns:
true if valid, false otherwise
-
int setCommand(const int &command, const int &max_repeats)
Send a movement command to SoftHand Industry.
- Parameters:
command – the position reference command [ticks]
- Returns:
the response status
-
int setCommands(const int &position, const int &velocity, const int ¤t, const int &max_repeats)
Send a movement command to SoftHand Industry.
- Parameters:
command – the command [ticks]
velocity – [ticks/s]
current – [mA]
- Returns:
the response status
Send a command to SoftHand Industry.
- Parameters:
request – The request of the given service (see qb_softhand_industry_srvs::setCommand for details).
response – The response of the given service (see qb_softhand_industry_srvs::setCommand for details).
- Returns:
trueif the call succeed (actuallyresponse.successmay be false).
Send a command to SoftHand Industry.
- Parameters:
request – The request of the given service (see qb_softhand_industry_srvs::setCommands for details).
response – The response of the given service (see qb_softhand_industry_srvs::setCommands for details).
- Returns:
trueif the call succeed (actuallyresponse.successmay be false).
Protected Attributes
-
rclcpp::Node::SharedPtr node_handle_
-
rclcpp::Parameter ip_
-
rclcpp::Parameter serial_port_name_
-
rclcpp::Parameter use_only_ethernet
-
const rclcpp::NodeOptions &options_ = (rclcpp::NodeOptions().allow_undeclared_parameters(true).automatically_declare_parameters_from_overrides(true))
-
std::unique_ptr<qbsofthand_industry_api::qbSoftHandIndustryAPI> api_handler_
-
virtual int activate(const bool &command, const int &max_repeats)