Fine joystick library control
I am leaning the ROSLiB library and I am using the NG-Joystick virtual joystick library to issue twist instructions to a TurtleSim robot.
My problem is when I use the joystick to move the robot, it lurches around widely which is not acceptable for the TurtleSim and certainly not acceptable for moving a real robot. Below is a screen shot of the effects I'm experiencing.
If you look at the console area on the left of the image, you would see the raw X & Y coordinates I am directly publishing to turtle1/cmd_vel. The right side part of the image shows the erratic effect of those coordinates. The section of my code for publishing those coordinates are simple enough but I thought I'd include it below:
this.joystickComp.joystickMove$.subscribe(d => {
console.log(d);
console.log('X: ' + d.pointerPos.x + ', Y: ' + d.pointerPos.y);
console.log('sending cmd_vel ...');
this.rosService.move(d.pointerPos.x, d.pointerPos.y);
console.log('cmd_vel sent');
});
Can anyone advice how I can get better control ?