Closed user98765467 closed 4 years ago
If you want to modify the driver, you can query the estimated velocity with robot_->getVel()
. I suggest adding your print/log statements somewhere in the main update method:
But avoid blocking with a loop otherwise the driver will not function properly (ie. you should not need a while (ros::ok())
loop).
Alternatively, you should be able to introspect the same velocity estimate on the odometry topic with tools like rostopic echo
. There shouldn't really be a need to modify the driver if you use this approach.
thanks! i think i'm close to getting it working. any idea why getVel() doesnt publish anything? putting this code in the main update method still appears to break the controller.
geVel() returns a struct. You should try accessing the members:
create::Vel vel = robot_->getVel();
vel.x;
vel.y;
vel.yaw;
To reiterate my previous comment, do not put a while(ros::ok())
loop inside the main update method.
I'm trying to modify the create_driver.cpp very similar to this, but I'm trying to write the linear velocity and angle to the terminal window instead. So far everything I've tried breaks the controller. Any suggestions?