
kslaxme
India
Asked
@Athena which approach is recommended for a interactive robot which control by VR oculus. ARC on Pi as a brain to robot, 4 motors and serial servos as arms to Arduino mega here i have another doubt also Hbridge skill has only 2 motor control. if i have 4 motors how to control it.
Related Controls
Unnamed Plugin
Dual HBridge w/PWM
We moved your question into your robot thread because it concerns using control commands and has nothing to do with the Oculus VR robot skill. Let me explain further.
You can send commands to other robot skills using a command called ControlCommand() . It is highlighted in the Getting Started guide. Here is a great link to better understand it. I encourage you to read the links that we provide: https://synthiam.com/Support/Programming/control-command
Now that you have read that link let me provide you with more information on how to do what you're trying to do.
This is how you should do it
Your question doesn't make sense of what you are attempting to do because the Oculus VR robot skill already controls the servos. You specify the servo ports and positions, which will move about the hand position. For example, you can have up to 255 servos on a single servo setting in ARC. This is done by pressing the ADVANCED button when selecting servo parameters. It is documented in the guide; here is a link: https://synthiam.com/Support/ARC-Overview/Servo-Controls
The Oculus VR robot skill is already designed to move the servos into position based on the values provided by the Oculus VR headset. You do not need to use extra robot skills. You should read the manual for the Oculus VR headset. The manual for the Oculus VR headset is detailed and explains how it works. Here is a link for you to read it: https://synthiam.com/Support/Skills/Virtual-Reality/Oculus-Quest-Robot?id=21158
This is what you want to do
You're asking to take arbitrary servo positions and contradicting oculus vr robot skill the manual by assuming they are cartesian coordinates. While that doesn't make sense and won't provide any practical result, I'll explain how you "can" do it. Remember, what you'll do by following these instructions is to prove to yourself that you do not need to do this. But, this exercise might help you achieve and learn a bit, which I think you will value greatly.
In the Oculus VR robot skill, instead of selecting real ports (d0, d2, d6, etc), choose vx (virtual ports). I'm unsure of the range because this solution doesn't make sense, but you can try it anyway. So, the range can be set to Min:1 and Max: 180. If you don't know what a Virtual Port is, it's because you are not reading any of the links. To understand the difference between ports, here's the link about servos again: https://synthiam.com/Support/ARC-Overview/Servo-Controls
Now that you have read the above link, you will know what a virtual port is.
Let's add a script robot skill. In the script robot skill, you'll want to create a script. Here is a script to take the virtual port values you specified and send them to the inverse kinematics robot skill. You can change the ports in my example script to match yours. You may also need to change the robot skill names in the ControlCommand to match yours.
I have added comments to this JAVASCRIPT example to show how to use it. The ports are v0, v1, and v2 for the x,y, and z, respectively. As I mentioned above, you may need to change some of these for your usage.
support, that's not entirely true. the end effector of the servo positions is normalized to a servo range from the cartesian coordinates. so it'll "sort of" work. your script will work okay I think. but the values will have to be adjusted by a multiplier. This is because the inverse kinematics robot skill expects CM. So the range of 1-180 might work, but that's 180 cm which is almost 2 meters.
anyway, be worth trying the way it is and add a multiplier to the x,y,z values if necessary