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

Revision history [back]

The SMC-04B has a great guide here. Your best bet is the serial interface. Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x01,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver I wrote found here.

The SMC-04B has a great guide here. Your best bet is the serial interface. Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x01,0x7F] [0x80,0x00,0x03,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver I wrote found here.

The SMC-04B has a great guide here. Your best bet is the serial interface. Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x03,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver I wrote found here.

Here's some example code to get you started:

self.ser = serial.Serial(port, 
                         baudrate=9600, 
                         bytesize=8, parity='N', 
                         stopbits=1, timeout=None)
self.ser.write(0x80)
self.ser.write(0x00)
self.ser.write(0x03)
self.ser.write(0x7F)

The SMC-04B has a great guide here. Your best bet is the serial interface. Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x03,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver I wrote found here.

Here's some example code to get you started:

self.ser = serial.Serial(port, serial.Serial('/dev/ttyUSB0', 
                         baudrate=9600, 
                         bytesize=8, parity='N', 
                         stopbits=1, timeout=None)
self.ser.write(0x80)
self.ser.write(0x00)
self.ser.write(0x03)
self.ser.write(0x7F)

The SMC-04B has a great guide here. Your best bet is the serial interface. Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x03,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver I wrote found here.

Here's some example code to get you started:

self.ser import serial
...
s = serial.Serial('/dev/ttyUSB0', 
                         baudrate=9600, 
                         bytesize=8, parity='N', 
                         stopbits=1, timeout=None)
self.ser.write(0x80)
self.ser.write(0x00)
self.ser.write(0x03)
self.ser.write(0x7F)
s.write(0x80)
s.write(0x00)
s.write(0x03)
s.write(0x7F)

The SMC-04B has a great guide here. Your best bet is the serial interface. Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x03,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver I wrote found here.

Here's some example code to get you started:

import serial
...
s = serial.Serial('/dev/ttyUSB0', 
                         baudrate=9600, 
                         bytesize=8, parity='N', 
                         stopbits=1, timeout=None)
s.write(0x80)
s.write(0x00)
s.write(0x03)
s.write(0x7F)
s.write(chr(0x80))
s.write(chr(0x00))
s.write(chr(0x03))
s.write(chr(0x7F))

The SMC-04B has a great guide here. Your best bet is the serial interface. Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x03,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver I wrote found using python's serial interface here.

Here's some example code to get you started:

import serial
...
s = serial.Serial('/dev/ttyUSB0', 
                         baudrate=9600, 
                         bytesize=8, parity='N', 
                         stopbits=1, timeout=None)
s.write(chr(0x80))
s.write(chr(0x00))
s.write(chr(0x03))
s.write(chr(0x7F))

The SMC-04B has a great guide here. Your best bet is the serial interface. interface (page 8). Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x03,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver using python's serial interface here.

Here's some example code to get you started:

import serial
...
s = serial.Serial('/dev/ttyUSB0', 
                         baudrate=9600, 
                         bytesize=8, parity='N', 
                         stopbits=1, timeout=None)
s.write(chr(0x80))
s.write(chr(0x00))
s.write(chr(0x03))
s.write(chr(0x7F))

The SMC-04B has a great guide here. Your best bet is the serial interface (page 8). Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x03,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver using python's serial interface here.

Here's some example code to get you started:

import serial
...
s = serial.Serial('/dev/ttyUSB0', 
                         baudrate=9600, 
                         bytesize=8, parity='N', 
                         stopbits=1, timeout=None)
s.write(chr(0x80))
s.write(chr(0x00))
s.write(chr(0x03))
s.write(chr(0x7F))

Once you have a basic driver written for the SMC-04B you'll have to write a node that subscribes to ~cmd_vel (geometry/Twist) and outputs the corresponding driver commands to achieve the correct linear and angular velocities--that's where code from the irobot create driver may come in handy (if you have a 2-wheel diff drive with caster style robot it'll use the same math).

I'd recommend creating two nodes: smc04b_driver and YOUR_ROBOT_NAME_node which makes use of the smc04b_driver--the idea being that others could reuse smc04b_driver, while the YOUR_ROBOT_NAME_node will be specific to your homebrew platform.

The SMC-04B has a great guide here. Your best bet is the serial interface (page 8). Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x03,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver using python's serial interface here.

Here's some example code to get you started:

import serial
...
s = serial.Serial('/dev/ttyUSB0', 
                         baudrate=9600, 
                         bytesize=8, parity='N', 
                         stopbits=1, timeout=None)
s.write(chr(0x80))
s.write(chr(0x00))
s.write(chr(0x03))
s.write(chr(0x7F))

Once you have a basic driver written for the SMC-04B you'll have to write a node that subscribes to ~cmd_vel (geometry/Twist) and outputs the corresponding driver commands to achieve the correct linear and angular velocities--that's where code from the irobot create driver may come in handy (if you have a 2-wheel diff drive with caster style robot it'll use the same math).

I'd recommend creating two nodes: smc04b_driver and YOUR_ROBOT_NAME_node which makes use of the smc04b_driver--the idea being that others could reuse smc04b_driver, while the YOUR_ROBOT_NAME_node will be specific to your homebrew platform.

PS I think you're confusing terms when you say you have servo motors attached the the SMC-04B. The SMC-04B can accept RC servo commands (it has 3 modes: analog, RC, and serial) but is actually designed for driving standard DC motors in any case.

The SMC-04B has a great guide here. Your best bet is the serial interface (page 8). Seems like a pretty simple and straight forward protocol. You'll want to send serial data in the following form (from the guide):

[start byte, device type, motor # and direction, speed]

so for example sending the bytes:

[0x80,0x00,0x03,0x7F]

will result in full speed of motor #1

pyserial is your friend. if you'd like to see python serial code for example, checkout the IMU driver using python's serial interface here.

Here's some example code to get you started:

import serial
...
s = serial.Serial('/dev/ttyUSB0', 
                         baudrate=9600, 
                         bytesize=8, parity='N', 
                         stopbits=1, timeout=None)
s.write(chr(0x80))
s.write(chr(0x00))
s.write(chr(0x03))
s.write(chr(0x7F))

Once you have a basic driver written for the SMC-04B you'll have to write a node that subscribes to ~cmd_vel (geometry/Twist) and outputs the corresponding driver commands to achieve the correct linear and angular velocities--that's where code from the irobot create driver may come in handy (if you have a 2-wheel diff drive with caster style robot it'll use the same math).

I'd recommend creating two nodes: smc04b_driver and YOUR_ROBOT_NAME_node which makes use of the smc04b_driver--the idea being that others could reuse smc04b_driver, while the YOUR_ROBOT_NAME_node will be specific to your homebrew platform.

PS I think you're confusing terms when you say you have servo motors attached the the SMC-04B. The SMC-04B can accept accept RC servo commands (it has 3 modes: analog, RC, and serial) but is actually designed for driving driving standard DC motors in any case.