Created
February 16, 2016 05:19
-
-
Save rnsk/3b79067fceeba5571f85 to your computer and use it in GitHub Desktop.
Sota マニュアル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jp.vstone.sotasample; | |
import jp.vstone.RobotLib.CRobotMem; | |
import jp.vstone.RobotLib.CRobotPose; | |
import jp.vstone.RobotLib.CRobotUtil; | |
import jp.vstone.RobotLib.CSotaMotion; | |
public class MotorTest { | |
public static void main(String args[]){ | |
CRobotPose pose = new CRobotPose(); | |
//VSMDと通信ソケット・メモリアクセス用クラス | |
CRobotMem mem = new CRobotMem(); | |
//Sota用モーション制御クラス | |
CSotaMotion motion = new CSotaMotion(mem); | |
if(mem.Connect()){ | |
//VSMDを初期化 | |
motion.InitRobot_Sota(); | |
//サーボモータを現在位置でトルクOnにする | |
motion.ServoOn(); | |
//首ピッチ軸を動作 | |
pose.SetPose(new Byte[] {8} //ID8 | |
, new Short[] {0} //0度 | |
); | |
motion.play(pose,1000); | |
motion.waitEndinterpAll(); | |
CRobotUtil.wait(2000); | |
pose.SetPose(new Byte[] {8} //ID8 | |
, new Short[] {-200} //-20度 | |
); | |
motion.play(pose,500); | |
motion.waitEndinterpAll(); | |
CRobotUtil.wait(500); | |
pose.SetPose(new Byte[] {8} //ID8 | |
, new Short[] {0} //0度 | |
); | |
motion.play(pose,1000); | |
motion.waitEndinterpAll(); | |
CRobotUtil.wait(2000); | |
//サーボモータのトルクオフ | |
motion.ServoOff(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment