This commit is contained in:
Cagdas Aras CIBLAK 2023-03-10 09:40:39 +01:00
parent 7629d6876d
commit b54b9dab5b
5 changed files with 7 additions and 24 deletions

BIN
DynamixelHandler.o Normal file

Binary file not shown.

View File

@ -2,24 +2,6 @@
#$ g++ -c -I./toolkit-dynamixel/include main.cpp #$ g++ -c -I./toolkit-dynamixel/include main.cpp
#$ g++ DynamixelHandler.o main.o L/usr/local/lib ldxl_x64_cpp -lrt #$ g++ DynamixelHandler.o main.o L/usr/local/lib ldxl_x64_cpp -lrt
CC = g++ all: g++ -c -I./toolkit-dynamixel/include toolkit-dynamixel/src/DynamixelHandler.cpp
CFLAGS = -Wall -Werror -std=c++11 dynamixel: g++ -c -I./toolkit-dynamixel/include toolkit-dynamixel/src/DynamixelHandler.cpp
main: g++ -c -I./toolkit-dynamixel/include main.cpp
SRCDIR = src
OBJDIR = obj
BINDIR = bin
SOURCES := $(wildcard $(SRCDIR)/*.cpp)
OBJECTS := $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SOURCES))
EXECUTABLE := $(BINDIR)/main.cpp
all: $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(CFLAGS) $(OBJECTS) -o $@
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(EXECUTABLE) $(OBJECTS)

View File

@ -24,10 +24,10 @@ std::cout << std::endl;
std::vector<uint16_t> l_vCurrentJointPosition; std::vector<uint16_t> l_vCurrentJointPosition;
_oDxlHandler.readCurrentJointPosition(l_vCurrentJointPosition); _oDxlHandler.readCurrentJointPosition(l_vCurrentJointPosition);
// display current joint position // display current joint position
std::cout << vCurrentJointPosition= ( << std::endl; std::cout << "vCurrentJointPosition= (" << std::endl;
for (int l_joint=0; l_joint < l_vCurrentJointPosition.size(); l_joint++) for (int l_joint=0; l_joint < l_vCurrentJointPosition.size(); l_joint++)
std::cout << l_vCurrentJointPosition[l_joint] << , ; std::cout << l_vCurrentJointPosition[l_joint] << ", ";
std::cout << ) << std::endl; std::cout << ")" << std::endl;
// wait 1s // wait 1s
std::this_thread::sleep_for(std::chrono::milliseconds(1000)); std::this_thread::sleep_for(std::chrono::milliseconds(1000));
std::cout << "===Closing the Dynamixel Motor communication====" << std::endl; std::cout << "===Closing the Dynamixel Motor communication====" << std::endl;

BIN
main.o Normal file

Binary file not shown.

1
toolkit-dynamixel Submodule

@ -0,0 +1 @@
Subproject commit 94e8849aa1dce1c20b6ef1d0245d06a765cccaca