Python's Duty Acceleration functions

General discussion of using Roboclaw motor controllers
Post Reply
stu
Posts: 4
Joined: Wed May 08, 2019 8:24 am
Python's Duty Acceleration functions

Post by stu »

Python's Duty Accel functions are the only ones with accel first. The serial functions have duty first, and all the cpp code has duty first.

Makes translating code pretty difficult!

Python library:

Code: Select all

	def DutyAccelM1(self,address,accel,duty):
		return self._writeS24(address,self.Cmd.M1DUTYACCEL,duty,accel)

	def DutyAccelM2(self,address,accel,duty):
		return self._writeS24(address,self.Cmd.M2DUTYACCEL,duty,accel)

	def DutyAccelM1M2(self,address,accel1,duty1,accel2,duty2):
		return self._writeS24S24(address,self.Cmd.MIXEDDUTYACCEL,duty1,accel1,duty2,accel2)
Arduino library:

Code: Select all

bool RoboClaw::DutyAccelM1(uint8_t address, uint16_t duty, uint32_t accel)
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Python's Duty Acceleration functions

Post by Basicmicro Support »

We haven't changed them because it would break old user code for no major benefit.

You are free to change the library however you see fit. We provide the source code to the python library specifically for that option.

Post Reply