I want to make _pwm a rostopic

Hi Chokings,
You can use the RosbotDrive::getSpeed function that is defined in the RosbotDrive.cpp file. It is based on getDutyCycle() function.

I have prepared for you an outline of the solution that is in my fork (link to commit). When you subscribe /pwm topic, message data (Float32) tells you the ratio of low state time to cycle period.

I hope this solution suits you.

Best regards,
Paweł