Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,11 @@ SRCHEADERS := \
emc/ini/inifile.hh \
emc/ini/inifile.h \
emc/nml_intf/emcpos.h \
emc/nml_intf/emcpose.h \
emc/nml_intf/motion_types.h \
libposemath/gomath.h \
libposemath/gotypes.h \
libposemath/emcpose.h \
libposemath/posemath.h \
libposemath/sincos.h \
libposemath/posemath.hh \
libposemath/posemath_types.h \
rtapi/rtapi.h \
rtapi/rtapi_app.h \
rtapi/rtapi_atomic.h \
Expand Down Expand Up @@ -1292,7 +1291,7 @@ tpmod-objs += emc/tp/tcq.o
tpmod-objs += emc/tp/tp.o
tpmod-objs += emc/tp/spherical_arc.o
tpmod-objs += emc/tp/blendmath.o
tpmod-objs += emc/nml_intf/emcpose.o
tpmod-objs += libposemath/emcpose.o
tpmod-objs += libposemath/_posemath.o
tpmod-objs += emc/tp/sp_scurve.o
tpmod-objs += emc/tp/ruckig_wrapper.o
Expand Down
4 changes: 2 additions & 2 deletions src/emc/kinematics/genserfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
#endif
#include <rtapi_math.h>
#include <hal.h>
#include <gotypes.h> /* go_result, go_integer */
#include <gomath.h> /* go_pose */
#include "libposemath/gotypes.h" /* go_result, go_integer */
#include "libposemath/gomath.h" /* go_pose */
#include <kinematics.h>

#include "genserkins.h" /* these decls */
Expand Down
4 changes: 2 additions & 2 deletions src/emc/kinematics/genserkins.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#define GENSERKINS_H

#include <hal.h> /* HAL data types */
#include <gotypes.h> /* go_result, go_integer */
#include <gomath.h> /* go_pose */
#include "libposemath/gotypes.h" /* go_result, go_integer */
#include "libposemath/gomath.h" /* go_pose */
#include <kinematics.h>

/*!
Expand Down
1 change: 0 additions & 1 deletion src/emc/kinematics/scorbot-kins.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <rtapi_app.h>
#include <rtapi_math.h>
#include <hal.h>
#include <gotypes.h>
#include <kinematics.h>


Expand Down
2 changes: 0 additions & 2 deletions src/emc/nml_intf/Submakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ LIBEMCSRCS := \
emc/nml_intf/emcglb.c \
emc/rs274ngc/modal_state.cc \
emc/nml_intf/emc.cc \
emc/nml_intf/emcpose.c \
emc/nml_intf/emcargs.cc \
emc/nml_intf/emcops.cc \
emc/nml_intf/canon_position.cc \
Expand All @@ -27,7 +26,6 @@ TARGETS += ../lib/liblinuxcnc.a

EMCNMLINTFINCS = \
./emc/nml_intf/emcpos.h \
./emc/nml_intf/emcpose.h \
./emc/nml_intf/motion_types.h

$(patsubst ./emc/nml_intf/%,../include/%,$(EMCNMLINTFINCS)): ../include/%.h: ./emc/nml_intf/%.h
Expand Down
24 changes: 5 additions & 19 deletions src/emc/nml_intf/emcpos.h
Original file line number Diff line number Diff line change
@@ -1,36 +1,22 @@
/********************************************************************
* Description: emcpos.h
*
* EmcPose now lives in emcpose.h, beside the pose math it is built out
* of. This header stays so that code including it keeps working.
*
* Derived from a work by Fred Proctor & Will Shackleford
*
* Author:
* License: GPL Version 2
* System: Linux
*
*
* Copyright (c) 2004 All rights reserved.
*
* Last change:
********************************************************************/
#ifndef __LINUXCNC_EMCPOS_H
#define __LINUXCNC_EMCPOS_H

#include "posemath.h" /* PmCartesian */

typedef struct EmcPose {
PmCartesian tran;
double a, b, c;
double u, v, w;
} EmcPose;

#define ZERO_EMC_POSE(pos) do { \
(pos).tran.x = 0.0; \
(pos).tran.y = 0.0; \
(pos).tran.z = 0.0; \
(pos).a = 0.0; \
(pos).b = 0.0; \
(pos).c = 0.0; \
(pos).u = 0.0; \
(pos).v = 0.0; \
(pos).w = 0.0; } while(0)
#include "emcpose.h"

#endif
2 changes: 1 addition & 1 deletion src/hal/components/tpcomp.comp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ option extra_setup;
#include USE_TOPDIR(src/emc/tp/tcq.c)
#include USE_TOPDIR(src/emc/tp/spherical_arc.c)
#include USE_TOPDIR(src/emc/tp/blendmath.c)
#include USE_TOPDIR(src/emc/nml_intf/emcpose.c)
#include USE_TOPDIR(src/libposemath/emcpose.c)
#include USE_TOPDIR(src/libposemath/_posemath.c)
#include USE_TOPDIR(src/libposemath/sincos.c)

Expand Down
12 changes: 8 additions & 4 deletions src/libposemath/Submakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POSEMATHSRCS := $(addprefix libposemath/, _posemath.c posemath.cc gomath.c sincos.c)
POSEMATHSRCS := $(addprefix libposemath/, _posemath.c posemath.cc gomath.c sincos.c emcpose.c)
$(call TOOBJSDEPS, $(POSEMATHSRCS)) : EXTRAFLAGS=-fPIC
USERSRCS += $(POSEMATHSRCS)
TARGETS += ../lib/libposemath.so ../lib/libposemath.so.0
Expand All @@ -10,10 +10,14 @@ TARGETS += ../lib/libposemath.so ../lib/libposemath.so.0
@$(CXX) $(LDFLAGS) -Wl,-soname,$(notdir $@) -shared -o $@ $^

POSEMATHINCS = \
./libposemath/gomath.h \
./libposemath/gotypes.h \
./libposemath/emcpose.h \
./libposemath/posemath.h \
./libposemath/sincos.h
./libposemath/posemath_types.h

POSEMATHCXXINCS = \
./libposemath/posemath.hh

$(patsubst ./libposemath/%,../include/%,$(POSEMATHINCS)): ../include/%.h: ./libposemath/%.h
cp $^ $@
$(patsubst ./libposemath/%,../include/%,$(POSEMATHCXXINCS)): ../include/%.hh: ./libposemath/%.hh
cp $^ $@
2 changes: 1 addition & 1 deletion src/emc/nml_intf/emcpose.c → src/libposemath/emcpose.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
********************************************************************/

#include "emcpose.h"
#include <posemath.h>
#include "posemath.h"
#include <rtapi_math.h>

//#define EMCPOSE_PEDANTIC
Expand Down
33 changes: 31 additions & 2 deletions src/emc/nml_intf/emcpose.h → src/libposemath/emcpose.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
/********************************************************************
* Description: emcpose.h
*
* The EmcPose type and the operations on it. EmcPose is a pose in the
* nine coordinates a machine can have, built out of the pose math types,
* and is not an NML message, which is where it used to live.
*
* Derived from a work by Fred Proctor & Will Shackleford
*
* Author: Robert W. Ellenberg
* License: GPL Version 2
* System: Linux
*
*
* Copyright (c) 2004 All rights reserved.
*
********************************************************************/
#ifndef __LINUXCNC_EMCPOSE_H
#define __LINUXCNC_EMCPOSE_H

#include "emcpos.h"
#include "posemath.h" /* PmCartesian */

typedef struct EmcPose {
PmCartesian tran;
double a, b, c;
double u, v, w;
} EmcPose;

#define ZERO_EMC_POSE(pos) do { \
(pos).tran.x = 0.0; \
(pos).tran.y = 0.0; \
(pos).tran.z = 0.0; \
(pos).a = 0.0; \
(pos).b = 0.0; \
(pos).c = 0.0; \
(pos).u = 0.0; \
(pos).v = 0.0; \
(pos).w = 0.0; } while(0)

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
EMCPOSE_ERR_OK = 0,
Expand Down Expand Up @@ -48,4 +73,8 @@ int emcPoseMagnitude(EmcPose const * const pose, double * const out);

int emcPoseValid(EmcPose const * const pose);

#ifdef __cplusplus
} /* matches extern "C" for C++ */
#endif

#endif
4 changes: 1 addition & 3 deletions src/libposemath/gomath.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
#ifndef __LINUXCNC_GO_MATH_H
#define __LINUXCNC_GO_MATH_H

#include <stddef.h> /* sizeof */
#include "rtapi_math.h" /* M_PI */
#include <float.h> /* FLT,DBL_MIN,MAX,EPSILON */
#include <rtapi_math.h> /* M_PI, NULL, FLT/DBL_MIN,MAX,EPSILON */
#include "gotypes.h" /* go_integer,real */

/*! Returns the square of \a x. */
Expand Down
2 changes: 1 addition & 1 deletion src/libposemath/gotypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef __LINUXCNC_GO_TYPES_H
#define __LINUXCNC_GO_TYPES_H

#include <float.h> /* DBL_MAX, FLOAT_MAX */
#include <rtapi_math.h> /* DBL_MAX, FLT_MAX */

/*!
GO_RESULT symbols run through a small range of values, on the
Expand Down
Loading