ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Drive rc car using the commercial ESC

asked 2019-02-14 00:37:34 -0600

Asit gravatar image

updated 2022-01-22 16:09:55 -0600

Evgeny gravatar image

ROS : Melodic OS : Ubuntu 18.04 RC Car : ZD Racing 10427s

I am trying to build my first automated rc car. I am currently designing the actuation module that will take the "geometry/twist" msgs and drive the vehicle.

I am trying to reuse the ESC that came with the RC Car, so I am searching for ROS package to do that. I read somewhere that an arduino is needed.

Any suggestion would be helpful...

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-02-14 01:49:28 -0600

ahendrix gravatar image

Hobby ESC take the same kind of signal as a hobby servo: a 1-2 millisecond pulse, where the pulse length sets the speed and direction. Pulses shorter than about 1.5mS are one direction; pulses longer than 1.5mS are the other.

You can generate the servo drive signal with an arduino running rosserial: (and it's relatively easy to extend that demo to control two servo outputs; one for your ESC and one for steering).

There are probably libraries for the Raspberry Pi that will generate a similar signal.

I've done this kind of conversion before, and there are a few things to watch out for:

  • Depending on your ESC, there may be a small deadband around the 1.5mS, or that 1.5mS may drift a little bit. This can make it difficult to drive slowly, and difficult to properly send a stop command.
  • Some ESCs have forward/reverse/brake modes. If possible, try to put your ESC into forward/reverse mode instead.
  • Most ESCs will have a 5-6V OUTPUT on the servo connector instead of needing a 5V supply voltage. If you measure this voltage and hook it up to the right voltage supply on your arduino, you can use it to supply power for your arduino or other circuitry.
  • The stock ESC in most hobby RC cars is tuned to go FAST, and getting it to go slowly can be a challenge.

After using the stock ESC in my robot for about a year, I eventually converted it to a brushed 55T rock crawler motor and a Pololu motor controller with direct PWM and direction inputs.

edit flag offensive delete link more


So if I understand correctly... I can use either an arduino or a motor controller (like Pololu)... But is there a ROS package already available for this....??

Asit gravatar image Asit  ( 2019-02-14 22:37:56 -0600 )edit

How to convert the twist msg to pwm ??

Asit gravatar image Asit  ( 2019-02-20 00:55:25 -0600 )edit

answered 2019-02-14 15:45:20 -0600

ChriMo gravatar image


in my projects, I use an Arduino and a simple ros python driver for external ESC driven motors.

Additionally, check donkeycar , they use I2C connected interfaces to control ESC and motors.

Happy karting



edit flag offensive delete link more


How do you convert twist msg to pwm ??

Asit gravatar image Asit  ( 2019-02-20 00:55:45 -0600 )edit

Question Tools

1 follower


Asked: 2019-02-14 00:37:34 -0600

Seen: 1,074 times

Last updated: Feb 14 '19