strainge data on hardware interface

asked 2020-05-12 08:22:51 -0600

dinesh gravatar image

updated 2020-05-12 08:25:18 -0600

i am using ros control boiler plate pkg and made a diff drive controller with rrbot example. Here when i log the joint_position_command[0] ... etc i'm getting this kind of log:

0   -0.196247   0
0   0.433369    0
0   -0.198108   0
0   0.426332    0
0   -0.19987    0
0   0.41921 0
0   -0.201547   0
0   0.411986    0
0   -0.203138   0
0   0.404662    0
0   -0.204615   0
0   0.397269    0
0   -0.206005   0
0   0.389776    0
0   -0.207301   0
0   0.382194    0

I am publishing the twist topics from terminal for this as:

rostopic pub /rrbot/mobile_base_controller/cmd_vel geometrmsgs/Twist "linear:
  x: 5.0
  y: 6.0
  z: 7.0
angular:
  x: 1.0
  y: 2.0
  z: 3.0" 
publishing and latching message. Press ctrl-C to terminate

here is my wrute methode inside rrbot_hw_interface.cpp:

void RRBotHWInterface::write(ros::Duration &elapsed_time)
{
  // Safety
  enforceLimits(elapsed_time);

  // ----------------------------------------------------
  // ----------------------------------------------------
  // ----------------------------------------------------
  //
  // FILL IN YOUR WRITE COMMAND TO USB/ETHERNET/ETHERCAT/SERIAL ETC HERE
  //
  // FOR A EASY SIMULATION EXAMPLE, OR FOR CODE TO CALCULATE
  // VELOCITY FROM POSITION WITH SMOOTHING, SEE
  // sim_hw_interface.cpp IN THIS PACKAGE
  //
  // DUMMY PASS-THROUGH CODE
  for (std::size_t joint_id = 0; joint_id < num_joints_; ++joint_id) {
    joint_position_[joint_id] += joint_position_command_[joint_id];
    std::cout<<joint_position_command_[joint_id]<<"\t"<<joint_velocity_command_[joint_id]<<"\t"
            <<joint_effort_command_[joint_id]<<std::endl;
  }
  // END DUMMY CODE
  //
  // ----------------------------------------------------
  // ----------------------------------------------------
  // ----------------------------------------------------
}

what does this mean?

edit retag flag offensive close merge delete

Comments

Have you fixed #q351873?

gvdhoorn gravatar image gvdhoorn  ( 2020-05-12 08:36:22 -0600 )edit

i forgot, their was some error, hench i left that. i'll check it again.

dinesh gravatar image dinesh  ( 2020-05-12 09:23:29 -0600 )edit