<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=5&amp;t=8099" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2012-07-20T20:02:19+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=5&amp;t=8099</id>
<entry>
<author><name><![CDATA[wolf]]></name></author>
<updated>2012-07-20T20:02:19+01:00</updated>
<published>2012-07-20T20:02:19+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=8099&amp;p=34888#p34888</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=8099&amp;p=34888#p34888"/>
<title type="html"><![CDATA[AX-12a not responding to sync_write command]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=8099&amp;p=34888#p34888"><![CDATA[
i had the 0xFF 0xFF header included in the checksum calculation, one i removed that it worked!<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=3466">wolf</a> — Fri Jul 20, 2012 8:02 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[wolf]]></name></author>
<updated>2012-07-19T23:32:38+01:00</updated>
<published>2012-07-19T23:32:38+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=8099&amp;p=34882#p34882</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=8099&amp;p=34882#p34882"/>
<title type="html"><![CDATA[AX-12a not responding to sync_write command]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=8099&amp;p=34882#p34882"><![CDATA[
Hello, <br /><br />I'm trying to implement a function to use the sync_write feature of the servos (in Python using PySerial), basically extending the lib_robotis.py library that was posted here recently from hizook.com. <br />I've added this to the USB2Dynamixel class, but when I execute the method, nothing happens. I was wondering if anyone might have any idea what's going on here: <br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>    def sync_send_write_instruction&#40;self, servos, angs, angvels&#41;:<br />        ''' move servos to angles &#40;radians&#41;<br />        '''<br />        # verify validity of input commands<br />        for i in range&#40;len&#40;servos&#41;&#41;:<br />            if angvels&#91;i&#93; &gt; servos&#91;i&#93;.settings&#91;'max_speed'&#93;:<br />                print 'lib_robotis.move_angle: angvel too high - %.2f deg/s' % &#40;math.degrees&#40;angvel&#41;&#41;<br />                print 'lib_robotis.ignoring move command.'<br />                return<br />            if angs&#91;i&#93; &gt; servos&#91;i&#93;.settings&#91;'max_ang'&#93; or angs&#91;i&#93; &lt; servos&#91;i&#93;.settings&#91;'min_ang'&#93;:<br />                print 'lib_robotis.move_angle: angle out of range- ', math.degrees&#40;angs&#91;i&#93;&#41;<br />                print 'lib_robotis.ignoring move command.'<br />                return<br /><br />        msg = &#91; 0XFF, 0XFF, 0XFE, &#40;4+1&#41; * len&#40;servos&#41; + 4, 0x83, 0X1E, 0X04 &#93; # header for sync_write message<br /><br />        for i in range&#40;len&#40;servos&#41;&#41;:<br />            enc_tics = int&#40;round&#40; angs&#91;i&#93; / servos&#91;i&#93;.settings&#91;'rad_per_enc'&#93; &#41;&#41;<br />            enc_tics += servos&#91;i&#93;.settings&#91;'home_encoder'&#93;<br />            enc_tics = min&#40; max&#40; enc_tics, 0 &#41;, servos&#91;i&#93;.settings&#91;'max_encoder'&#93; &#41;<br />            hibyte_ang,lowbyte_ang = enc_tics / 256, enc_tics % 256 # hibyte, lowbyte for angle specification<br /><br />            rpm = angvels&#91;i&#93; / &#40;2 * math.pi&#41; * 60.0<br />            angvel_enc = int&#40;round&#40; rpm / &#40;114.0 / 1024.0&#41; &#41;&#41;<br />            if angvel_enc&lt;0:<br />                hibyte_vel,lowbyte_vel = abs&#40;angvel_enc&#41; / 256 + 4, abs&#40;angvel_enc&#41; % 256<br />            else:<br />                hibyte_vel,lowbyte_vel = angvel_enc / 256, angvel_enc % 256<br /><br />            msg = msg + &#91; servos&#91;i&#93;.servo_id,lowbyte_ang,hibyte_ang,lowbyte_vel,hibyte_vel &#93;<br /><br />        chksum = self.calc_checksum&#40; msg &#41;<br />        msg = msg + &#91;chksum&#93; # add appropriate checksum value<br /><br />        out = ''<br />        for m in msg:<br />            out += chr&#40;m&#41;<br />        <br />        print msg<br /><br />        self.acq_mutex&#40;&#41;<br />        try: <br />            self.send_serial&#40; out &#41; <br />        except: <br />            self.rel_mutex&#40;&#41;<br />            raise<br />        self.rel_mutex&#40;&#41;</code></dd></dl><br /><br />thanks in advance!<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=3466">wolf</a> — Thu Jul 19, 2012 11:32 pm</p><hr />
]]></content>
</entry>
</feed>