Problem with micro-ROS while using ESP32 MCPWM

asked 2023-03-20 03:09:34 -0600

Stag gravatar image

updated 2023-03-20 03:13:47 -0600

I am using MIcroRos and trying to drive a motor with an ESP32. The problem is, when I do it with an Arduino IDE, getting no errors, hence with the good value of the duty cycle, ESP32 can drive the motors which prove that, the hardware stuff is correct. But when I switch to the micro-ROS, the motor does not move at all, even when some certain duty cycle value is published to /pwm topic.

PS: I already tried to put these the duty_setters in the callback block, but still nothing happened.

   mcpwm_set_duty(MCPWM_UNIT_0, MCPWM_TIMER_0, MCPWM_OPR_A,;
   mcpwm_set_duty(MCPWM_UNIT_0, MCPWM_TIMER_0, MCPWM_OPR_B, 100.0 -;

Distro: Ubuntu 20.04
Ros Version : Foxy

Code :

edit retag flag offensive close merge delete