<?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=24&amp;t=14026" />

<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>2014-05-16T09:03:07+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=24&amp;t=14026</id>
<entry>
<author><name><![CDATA[hudac]]></name></author>
<updated>2014-05-16T09:03:07+01:00</updated>
<published>2014-05-16T09:03:07+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=14026&amp;p=43223#p43223</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=14026&amp;p=43223#p43223"/>
<title type="html"><![CDATA[DarwinOp - turn off torque for one of the MX28]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=14026&amp;p=43223#p43223"><![CDATA[
Hey.<br /><br />I'm writing code to the <span style="font-weight: bold">DarwinOp</span>. I'm trying to <span style="font-weight: bold">turn off torque of a MX28</span> from inside the code.<br /><br />This action is possible; <span style="font-weight: bold">actioneditor's main() </span>do the exactly same thing in their code with the function <span style="font-weight: bold">OnOffCmd()</span>:<br /><br />This is their function:<br /><br /><span style="text-decoration: underline">void OnOffCmd(CM730 *cm730, bool on, int num_param, int *list)<br />{<br />if(num_param == 0)<br />{<br />for(int id=JointData::ID_R_SHOULDER_PITCH; id&lt;JointData::NUMBER_OF_JOINTS; id++)<br />cm730-&gt;WriteByte(id, MX28::P_TORQUE_ENABLE, (int)on, 0);<br />}<br />else<br />{<br />for(int i=0; i&lt;num_param; i++)<br />{<br />if(list[i] &gt;= JointData::ID_R_SHOULDER_PITCH &amp;&amp; list[i] &lt;= JointData::ID_HEAD_TILT)<br />cm730-&gt;WriteByte(list[i], MX28::P_TORQUE_ENABLE, (int)on, 0);<br />}<br />}<br /><br />ReadStep(cm730);<br />DrawStep(7);<br />}<br /></span><br />I'm trying to imitate this action. I copied the exactly same code (without <span style="font-weight: bold">ReadStep()</span> and <span style="font-weight: bold">DrawStep()</span>). I initialized <span style="font-weight: bold">cm730</span> as in the <span style="font-weight: bold">actioneditor main()</span>. I called an action with <span style="font-weight: bold">m_action-&gt;Start()</span> so the <span style="font-weight: bold">MX28'</span>s will be with torque on<br />and then I tried to call to <span style="font-weight: bold">OnOffCmd()</span> with the following parameters: <span style="font-weight: bold">OnOffCmdtest(&amp;(cm730), false, 0, NULL);</span><br />-&gt; It supposed to turn off all engines (like in the action editor, when you write the command: &quot;<span style="font-weight: bold">off</span>&quot; but nothing happened and the <span style="font-weight: bold">MX28'</span>s was not shut down.<br /><br />The strange thing is that other commands of <span style="font-weight: bold">WriteByte()</span> do succeed. such as:<br /><span style="font-weight: bold">WriteByte(CM730::ID_CM, CM730::P_DXL_POWER, 0, 0)</span><br />It does turn off the <span style="font-weight: bold">cm730</span>.<br /><br />Can you help me? Do you need any further information such as my initialization code and my main() ?<br /><br />Thanks!<br />hudac.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=7799">hudac</a> — Fri May 16, 2014 9:03 am</p><hr />
]]></content>
</entry>
</feed>