LCOV - code coverage report
Current view: top level - src/HAL - DummyHal.cpp (source / functions) Hit Total Coverage
Test: main_coverage.info Lines: 13 13 100.0 %
Date: 2021-10-05 16:55:17 Functions: 6 6 100.0 %

          Line data    Source code
       1             : /*
       2             :  * Copyright (C) 2019 IIT-HHCM
       3             :  * Author: Luca Muratore
       4             :  * email:  luca.muratore@iit.it
       5             :  *
       6             :  * Licensed under the Apache License, Version 2.0 (the "License");
       7             :  * you may not use this file except in compliance with the License.
       8             :  * You may obtain a copy of the License at
       9             :  * http://www.apache.org/licenses/LICENSE-2.0
      10             :  *
      11             :  * Unless required by applicable law or agreed to in writing, software
      12             :  * distributed under the License is distributed on an "AS IS" BASIS,
      13             :  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      14             :  * See the License for the specific language governing permissions and
      15             :  * limitations under the License.
      16             : */
      17             : 
      18             : #include <ros_end_effector/HAL/DummyHal.h>
      19             : 
      20          41 : ROSEE::DummyHal::DummyHal ( ros::NodeHandle *nh) : EEHal ( nh ) {
      21             :     
      22          82 :     std::string out;
      23             :     
      24          41 :     _hal_joint_state_pub = nh->advertise<sensor_msgs::JointState>("/dummyHal/joint_command", 1);
      25          41 :     _hal_joint_state_sub = nh->subscribe("/dummyHal/joint_states", 1, &ROSEE::DummyHal::hal_js_clbk, this);
      26          41 : }
      27             : 
      28             : 
      29       22393 : bool ROSEE::DummyHal::sense() {
      30             :     //do nothing, it is the hal_js_clbk who "sense"
      31       22393 :     return true;
      32             : }
      33             : 
      34       20981 : bool ROSEE::DummyHal::move() {
      35       20981 :     _hal_joint_state_pub.publish(_mr_msg);
      36       20981 :     return true;
      37             : }
      38             : 
      39       19648 : void ROSEE::DummyHal::hal_js_clbk(const sensor_msgs::JointState::ConstPtr& msg) {
      40             :     
      41       19648 :     _js_msg = *msg;
      42       19771 : }
      43             : 

Generated by: LCOV version 1.13