Commit f42ac31c authored by Tommy Olofsson's avatar Tommy Olofsson
Browse files

Now we can build a bridge and talk to JGC.

parent d8e3bba6
......@@ -17,7 +17,7 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
#uncomment if you have defined messages
# rosbuild_genmsg()
rosbuild_genmsg()
#uncomment if you have defined services
rosbuild_gensrv()
......
This diff is collapsed.
#!/usr/bin/env bash
# jgc_example should be running
rosrun generator generator.py -l python -c ./jgc_bridge_conf.xml -f
<bridge name="jgc_bridge" port="7357">
<imports>
<topic name="/ec_status" />
</imports>
<exports>
<topic name="/ec_start" />
</exports>
<static-connections>
<target addr="127.0.0.1:8888">
<subscribe name="/ec_start" />
<publish name="/ec_status" />
</target>
</static-connections>
</bridge>
sample struct {
int aua_id;
struct {
struct {
double x;
double y;
double z;
} position;
struct {
double x;
double y;
double z;
double w;
} orientation;
} pose;
} start;
// inputs to controller block (outputs from JGrafchart)
sample double Cf[144];
sample double refs[48];
sample double quat_refs[16];
sample double ctrlpar[240];
sample double chains[120];
sample double chains_params[120];
sample double redund_weight[196];
sample double skillFinished[2];
sample double state;
sample double detuning[2];
// outputs from controller block (inputs to JGrafchart)
sample double y_meas[96];
sample double quats[16];
sample double y_d_dot0[12];
sample double skillToRun[2];
sample double runExtctrl[2];
sample double resetProgram[2];
sample double kinematicsConverged[2];
//// JGrafchart ---> ExtCtrl
// Communication and coordination
sample double startExtCtrl[2];
sample double skillFinished[2];
sample double state;
// Controller parameters
sample double ctrlpar[240];
sample double chains[120];
sample double chains_params[120];
sample double Cf[144];
sample double redund_weight[196];
// References
sample double refs[48];
sample double quat_refs[16];
// Special features
sample double detuning[2];
sample double freeDrive[2];
// Outputs Integrated to ExtCtrl
sample double ifkDigitalIn[8];
//// Extctrl ---> JGrafchart
// Communication and coordinaiton
sample double skillToRun[2]; //RAPID issued
sample double runExtctrl[2];
sample double resetProgram[2];
sample double kinematicsConverged[2];
// Measurments
sample double y_meas[96];
sample double quats[16];
sample double y_d_dot0[12];
// Inputs Integrated to ExtCtrl
sample double ifkAnalogOut[8];
sample double ifkDigitalOut[8];
......@@ -12,5 +12,6 @@
<url>http://ros.org/wiki/ros_extctrl</url>
<depend package="geometry_msgs" />
<depend package="std_msgs" />
</package>
#!/usr/bin/env python
import roslib; roslib.load_manifest('ros_extctrl')
import rospy
from ros_extctrl.msg import ExtCtrlStart, ExtCtrlStatus
def status_cb(data):
print "ExtCtrl responded: %s" % data.status
def interact():
# These should be a service.
pub = rospy.Publisher('ec_start', ExtCtrlStart)
sub = rospy.Subscriber('ec_status', ExtCtrlStatus, status_cb)
while not rospy.is_shutdown():
line = ''
try:
line = raw_input("Choose a controller to activate:")
except EOFError:
print('\nBye')
break
aua_id = 0
try:
aua_id = int(line)
except ValueError:
print("%s is not a number" % line)
continue
v = ExtCtrlStart()
v.aua_id = aua_id
pub.publish(v)
if __name__ == '__main__':
rospy.init_node('extctrl_usage_example')
interact()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment