-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Communication between C++ and Java #51
Comments
Commit df67234 creates the initial path flatbuffer file. |
… default. Still need to add install step.
…ho_server.cpp. Fixed RobonePlugin so it compiles.
I created a few azmq issues during this process to help me learn and debug azmq: |
I ran a test using the instructions with Java in a VM and C++ running in OS X. There was no communication between the two. I took a look and the Java implementation appears to use a pub/sub system rather than a zeromq dealer system. |
It looks like we need to add a motion overlay for FRI command control to work. Here is the Java from Kuka's sample application. package com.kuka.connectivity.fri.example;
import static com.kuka.roboticsAPI.motionModel.BasicMotions.ptp;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import com.kuka.connectivity.fri.FRIConfiguration;
import com.kuka.connectivity.fri.FRIJointOverlay;
import com.kuka.connectivity.fri.FRISession;
import com.kuka.roboticsAPI.applicationModel.RoboticsAPIApplication;
import com.kuka.roboticsAPI.controllerModel.Controller;
import com.kuka.roboticsAPI.deviceModel.LBR;
/**
* Creates a FRI Session.
*/
public class LBRJointSineOverlay extends RoboticsAPIApplication
{
private Controller _lbrController;
private LBR _lbr;
private String _hostName;
@Override
public void initialize()
{
_lbrController = (Controller) getContext().getControllers().toArray()[0];
_lbr = (LBR) _lbrController.getDevices().toArray()[0];
// **********************************************************************
// *** change next line to the FRIClient's IP address ***
// **********************************************************************
_hostName = "127.0.0.1";
}
@Override
public void run()
{
// configure and start FRI session
FRIConfiguration friConfiguration = FRIConfiguration.createRemoteConfiguration(_lbr, _hostName);
friConfiguration.setSendPeriodMilliSec(4);
FRISession friSession = new FRISession(friConfiguration);
FRIJointOverlay jointOverlay = new FRIJointOverlay(friSession);
// wait until FRI session is ready to switch to command mode
try
{
friSession.await(10, TimeUnit.SECONDS);
}
catch (final TimeoutException e)
{
}
// move to start pose
_lbr.move(ptp(Math.toRadians(90), .0, .0, Math.toRadians(90), .0, Math.toRadians(-90), .0));
// async move with overlay ...
_lbr.moveAsync(ptp(Math.toRadians(-90), .0, .0, Math.toRadians(90), .0, Math.toRadians(-90), .0)
.setJointVelocityRel(0.2)
.addMotionOverlay(jointOverlay)
.setBlendingRel(0.1)
);
// ... blending into sync move with overlay
_lbr.move(ptp(Math.toRadians(90), .0, .0, Math.toRadians(90), .0, Math.toRadians(-90), .0)
.setJointVelocityRel(0.2)
.addMotionOverlay(jointOverlay)
);
// done
friSession.close();
}
/**
* main.
*
* @param args
* args
*/
public static void main(final String[] args)
{
final LBRJointSineOverlay app = new LBRJointSineOverlay();
app.runApplication();
}
} |
…ake control. Problems with actually using it still exist
We will serialize one line of the path format, then send it from C++ to Java:
http://www.coppeliarobotics.com/helpFiles/en/pathImportExport.htm
Serialization will be done with a shared flatbuffer data type:
https://github.com/google/flatbuffers
A message passing system, Zeromq, will be used to pass the serialized message from C++ to Java:
http://zeromq.org/
Java will feed the point to the robot initially using smartservo.
FRI can potentially be used later to overlay and adjust the motion.
Question: where to handle transform from optical tracker to robot base frame?
C++
@athundt will take the lead on this
Java
@astrick3 can you take the lead on this part?
Testing
The text was updated successfully, but these errors were encountered: