Hello there!
I'd like to give commands to a robot using java's remote api in V-rep.
I already know how to start a comunication between v-rep and java.
Is it possible to have some basic examples on how to give commands to a robot, for example how to move a robot's arm or how to move forward the youbot, using Java's remote Api?
Unfortunatly, the examples on the programming/remoteApiBindigs didn't help me so much.
Thank you for your help.
Controlling a Robot using Java.
Re: Controlling a Robot using Java.
Hello,
the best would be to send from Java only high-level commands, since you always have the communication delay overhead, and because the remote API doesn't directly support all regular API functions.
Best would probably to use mainly simxCallScriptFunction from your remote API client, and handle all the details in a simulation script.
Cheers
the best would be to send from Java only high-level commands, since you always have the communication delay overhead, and because the remote API doesn't directly support all regular API functions.
Best would probably to use mainly simxCallScriptFunction from your remote API client, and handle all the details in a simulation script.
Cheers
Re: Controlling a Robot using Java.
coppelia wrote:Hello,
the best would be to send from Java only high-level commands, since you always have the communication delay overhead, and because the remote API doesn't directly support all regular API functions.
Best would probably to use mainly simxCallScriptFunction from your remote API client, and handle all the details in a simulation script.
Cheers
Hello, thank you for your reply.
Can I do the same using simxSetStringSignal(in java) and simGetStringSignal(lua script)?
So, for example, using the simxSetStringSignal I'll send(from my java client) a signal to vrep allowing him to move the robot's arm. If the signal is not received vrep won't move anything.
Could it work or it's only a waste of time?
Thank you :)
Re: Controlling a Robot using Java.
That would also work. It is not that elegant, but works too. Once you have received a signal on the V-REP side, you will have to erase it directly after processing the corresponding command.
Cheers
Cheers
Re: Controlling a Robot using Java.
THanks again for the reply.
I'm so sorry but I've now another problem :(
The java function simxSetStringSignal uses charWA signal and not a string signal (like matlab, for example). How can I translate a charWA into a string in lua script? Or how can I send a signal without using a charWA variable?
Thank you very much.
I'm so sorry but I've now another problem :(
The java function simxSetStringSignal uses charWA signal and not a string signal (like matlab, for example). How can I translate a charWA into a string in lua script? Or how can I send a signal without using a charWA variable?
Thank you very much.
Re: Controlling a Robot using Java.
lol my bad, there was a huge mistake in my code but I thought the program didn't work because of the charWA.Litterio wrote:THanks again for the reply.
I'm so sorry but I've now another problem :(
The java function simxSetStringSignal uses charWA signal and not a string signal (like matlab, for example). How can I translate a charWA into a string in lua script? Or how can I send a signal without using a charWA variable?
Thank you very much.
Now the problem is solved and I can move my robot using signals. It works fine.
Thanks again coppelia.