스터디 노트
article thumbnail

Documentation

https://robotology.github.io/osqp-eigen/index.html

 

osqp-eigen

Search for symbols, directories, files, pages or modules. You can omit any prefix from the symbol or file path; adding a : or / suffix lists all members of given symbol or directory. Use ↓ / ↑ to navigate through the list, Enter to go. Tab autocomplete

robotology.github.io

Prerequsite

-Eigen3

-OSQP

-Cmake version Check

-C++ version Check

 

##################################

cd ~/

# OSQP Package Download

git clone https://github.com/osqp/osqp.git  

cd osqp

# OSQP submodule pull (QDLDL)

git submodule update --init --recursive  

#QDLDL build process###############

cd lin_sys/direct/qdldl/qdldl_sources/

mkdir build

cd build

cmake ..

make

#################################

#OSQP build & make install process####

cd ~/osqp

mkdir build

cd build

cmake ..

make

sudo make install

#################################

# OSQP-Eigen Package Download

git clone https://github.com/robotology/osqp-eigen.git

cd osqp-eigen

mkdir build

cd build

cmake ..

make

################################

My Test Environment

Ubuntu 18.04

ROS Melodic

roscpp(c++14)

Cmake 3.8

 

TEST

CMakeLists.txt

cmake_minimum_required(VERSION 3.8)
project(qptest)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
)



find_package(cmake_modules REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(Eigen REQUIRED)
find_package(OsqpEigen REQUIRED)
include_directories(${Eigen_INCLUDE_DIRS})

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES qptest
#CATKIN_DEPENDS std_msgs
DEPENDS Eigen
#  DEPENDS system_lib
)


include_directories(
# include
  ${CMAKE_SOURCE_DIR}/src
 # ${PROJECT_SOURCE_DIR}/src
  ${catkin_INCLUDE_DIRS}
)
add_executable(qp_node src/main.cpp)

target_link_libraries(qp_node ${catkin_LIBRARIES})
target_link_libraries(qp_node ${Eigen_LIBRARIES})
target_link_libraries(qp_node OsqpEigen::OsqpEigen)

package.xml

<?xml version="1.0"?>
<package format="2">
  <name>qptest</name>
  <version>0.0.0</version>
  <description>The qptest package</description>
  <maintainer email="mkyun@todo.todo">mkyun</maintainer>
  <license>TODO</license>
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>rospy</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>cmake_modules</build_depend>
  <build_export_depend>roscpp</build_export_depend>
  <build_export_depend>rospy</build_export_depend>
  <build_export_depend>std_msgs</build_export_depend>

  <exec_depend>cmake_modules</exec_depend>
  <exec_depend>roscpp</exec_depend>
  <exec_depend>rospy</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <!-- The export tag contains other, unspecified, tags -->
  <export>
    <!-- Other tools can request additional information be placed here -->
  <cpp cflags="`pkg-config --cflags eigen3` -I${prefix}/include `rosboost-cfg --cflags`"
         lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib -lplanning_models"/>
  </export>
</package>

TEST Result

example.cpp

profile

스터디 노트

@myeongkyun

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!