Commit 61a401a8 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Before implementing transmit retries

parent ee967b18
......@@ -5,7 +5,8 @@ TARGETS=lth_fixes.mc \
hijacknet_lth_net.mc \
fei82557End.mc \
hijacknet_test.mc \
extctrl2014_lc.mc
extctrl2014_lc.mc \
hijacknet_extctrl2014.mc
AUTO_GEN=extctrl2014_lc.c \
extctrl2014_lc.h \
mc.globalize.c
......@@ -19,6 +20,10 @@ EXTRA_CFLAGS_hijacknet_lth_net=-I/opt/robot/include
EXTRA_CFLAGS_fei82557End=-Wno-error -Wno-all -Wno-endif-labels
EXTRA_CFLAGS_extctrl2014_lc=-I/usr/include/labcomm \
-DLABCOMM_COMPAT="<labcomm_compat.h>"
EXTRA_CFLAGS_hijacknet_extctrl2014=-I/usr/include/labcomm \
-DLABCOMM_COMPAT="<labcomm_compat.h>"
EXTRA_LDFLAGS_hijacknet_extctrl2014=extctrl2014_lc.mc -Wl,-r,-llabcomm2014
HIDE_hijacknet_extctrl2014=labcomm2014_
ROBOT=
ROBOTWARE=$(shell [ -n "$(ROBOT)" ] && \
../tools/abb_extctrl_setup.py --robot "$(ROBOT)" --robotware)
......@@ -32,7 +37,7 @@ all: $(TARGETS)
mc_test_load: hijack_fei.mc.load spray_test.mc.load
%.mc: %.mc.c
%.mc: %.mc.c Makefile
WIND_BASE=/opt/robot/include/vxworks/5.5.1/ \
i586-wrs-vxworks-gcc \
-O3 -Wall -Wno-unused-but-set-variable -Werror \
......@@ -44,9 +49,9 @@ mc_test_load: hijack_fei.mc.load spray_test.mc.load
-I. \
-I../common \
-o $@ \
-c $<
$< $(EXTRA_LDFLAGS_$*)
%.mc: %.c
%.mc: %.c Makefile
WIND_BASE=/opt/robot/include/vxworks/5.5.1/ \
i586-wrs-vxworks-gcc \
-O3 -Wall -Wno-unused-but-set-variable -Werror \
......@@ -56,7 +61,14 @@ mc_test_load: hijack_fei.mc.load spray_test.mc.load
-I. \
-I../common \
-o $@ \
-c $<
$< $(EXTRA_LDFLAGS_$*)
for h in $(HIDE_$*) ; do \
nm $@ | sed -e "s/.*[DTB] \($$h.*\)/\1/gp;d" > $@.hide || exit 1; \
echo "Hiding: $$h ($$(cat $@.hide | wc -l) symbols)" ; \
i586-wrs-vxworks-objcopy --localize-symbols=$@.hide $@ $@.tmp && \
mv $@.tmp $@ || echo "Hiding failed for $$h" || exit 1 ; \
rm $@.hide ; \
done
%_lc.c %_lc.h: %.lc
labcomm2014 --c=$*_lc.c --h=$*_lc.h $<
......@@ -92,7 +104,10 @@ host_commands:
@echo "ncftpput -uu -pp $(ROBOT) /hd0a/$(DESTDIR) hijacknet_hpnet.mc"
@echo "ncftpput -uu -pp $(ROBOT) /hd0a/$(DESTDIR) hijacknet_fei.mc"
@echo "ncftpput -uu -pp $(ROBOT) /hd0a/$(DESTDIR) hijacknet.mc"
@echo
@echo "ncftpput -uu -pp $(ROBOT) /hd0a/$(DESTDIR) hijacknet_test.mc"
@echo
@echo "ncftpput -uu -pp $(ROBOT) /hd0a/$(DESTDIR) hijacknet_extctrl2014.mc"
.PHONY: robot_commands
robot_commands:
......@@ -101,8 +116,11 @@ robot_commands:
@echo "ld < /hd0a/$(DESTDIR)/hijacknet_hpnet.mc"
@echo "ld < /hd0a/$(DESTDIR)/hijacknet_fei.mc"
@echo "ld < /hd0a/$(DESTDIR)/hijacknet.mc"
@echo
@echo "ld < /hd0a/$(DESTDIR)/hijacknet_test.mc"
@echo
@echo "ld < /hd0a/$(DESTDIR)/hijacknet_extctrl2014.mc"
@echo "hijacknet_extctrl2014_connect \"fei0\",\"38:60:77:b5:0e:cf\""
.PHONY: clean
clean:
......@@ -114,3 +132,4 @@ distclean: clean
hijacknet_fei.mc: fei82557.mc.h hijacknet_private.h
hijacknet.mc: hijacknet.h
hijacknet_extctrl2014.mc: extctrl2014_lc.mc
#ifndef _EXTCTRL_PUB_H_
#define _EXTCTRL_PUB_H_
typedef struct {
int value[4];
} axis_configuration_t; // Up to 128 axes (32 * 4)
typedef struct {
int manualMode; // 1 = teach mode
int controlActive; // 1 = at least torque mode active
} controller_state;
typedef struct extctrl_irb2ext_joint {
/* Control parameters: */
float parKp; /* Position control proportional gain. */
float parKv; /* Velocity control proportional gain. */
float parKi; /* Velocity control integration gain. */
float parTrqMin; /* Minimum torque (control output) allowed. */
float parTrqMax; /* Dito maximum. */
/* Exposed (measured or computed) states: */
double posRawAbs; /* Measured unfiltered motor angle. [abs] */
double posRawFb; /* Measured unfiltered motor angle. [feedback] */
double posFlt; /* Filtered motor angle. */
float velRaw; /* Unfiltered angular velocity. */
float velFlt; /* Dito filtered, also for motor shaft. */
float velOut; /* Dito according to actual velocity control ref. */
float trqRaw; /* Measured (or internal) unfiltered torque. */
float trqRefFlt; /* filtered Torque ref */
double posRef; /* Nominal position reference. */
float velRef; /* Dito for the velocity reference/feedforward. */
float trqFfw; /* Model-based torque feedforward. */
float trqFfwGrav; /* total dynamic model based torque. */
} EXTCTRL_IRB2EXT_JOINT;
typedef struct extctrl_ext2irb_joint {
/* Possibly updated control parameters: */
float parKp;
float parKv;
float parKi;
/* Modified references and feed forward: */
double posRef;
float velRef;
float trqFfw;
} EXTCTRL_EXT2IRB_JOINT;
typedef struct extctrl_communication_data {
int instruction;
float value1;
float value2;
float value3;
float value4;
float value5;
float value6;
char str1[20];
char str2[20];
} EXTCTRL_COMMUNICATION_DATA;
/* To use extctrl_communication from RAPID
* RAPID SYNTAX:
*
* VAR mocgendata mydata=[1,2,3,4,5,6,'str1','str2'];
* MocGenInstr 88999, mydata
* mydata is written to extctrl_communication and NEW data is returned
*/
/*
* To be called by programs invoked from VxWorks prompt,
* i.e. concurrently, hence we need mutex protection. Mutex
* is allocated by extctrl_initialize.
*/
typedef int (*extctrl_active_cb)(axis_configuration_t axis_configuration);
typedef int (*extctrl_submit_cb)(controller_state ctrl_state ,
axis_configuration_t axis_configuration,
EXTCTRL_IRB2EXT_JOINT *joint);
typedef int (*extctrl_obtain_cb)(axis_configuration_t axis_configuration,
EXTCTRL_EXT2IRB_JOINT *joint);
typedef int (*extctrl_communication_cb)(axis_configuration_t ac,
EXTCTRL_COMMUNICATION_DATA *data);
#define extctrl_install_callbacks extctrl_install_callbacks_irc5_110310
int extctrl_install_callbacks(extctrl_active_cb submit_active,
extctrl_submit_cb submit,
extctrl_active_cb obtain_active,
extctrl_obtain_cb obtain,
extctrl_active_cb communication_active,
extctrl_communication_cb communication);
#endif
This diff is collapsed.
Markdown is supported
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