Skip to content

Commit

Permalink
chenhn basic version
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Nov 14, 2023
1 parent c16b7d3 commit bdd3a6d
Show file tree
Hide file tree
Showing 17 changed files with 1,122 additions and 28 deletions.
64 changes: 51 additions & 13 deletions build_container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,51 @@ RUN pushd ezc3d && \
popd
RUN rm -rf ezc3d


################################# Alembic #################################
# Install imath
RUN git clone https://github.com/AcademySoftwareFoundation/Imath
RUN pushd Imath &&\
git checkout v3.1.9 &&\
mkdir build &&\
pushd build &&\
cmake .. &&\
make install &&\
popd && popd
RUN rm -rf Imath

# Install alembic
RUN git clone https://github.com/alembic/alembic.git
RUN pushd alembic &&\
git checkout 1.8.5 &&\
mkdir build &&\
pushd build &&\
cmake .. &&\
make install &&\
popd && popd
RUN rm -rf alembic

RUN git clone https://github.com/opencv/opencv.git
RUN pushd opencv &&\
git checkout 4.7.0 &&\
mkdir build &&\
pushd build &&\
cmake .. &&\
make -j4 &&\
make install &&\
popd && \
popd && \
rm -rf opencv


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

# RUN ls /usr/local/lib64 | grep assimp
# RUN ls /usr/local/lib | grep assimp
# RUN rm -rf /usr/local/lib64/libassimp.so
# RUN rm -rf /usr/local/lib64/libassimp.5.so
# RUN rm -rf /usr/local/lib64/libassimp.5.0.1.so
RUN protoc --version

# Install spdlog
RUN git clone https://github.com/gabime/spdlog.git
RUN pushd spdlog &&\
Expand All @@ -229,7 +267,6 @@ RUN pushd spdlog &&\
popd &&\
popd
RUN rm -rf spdlog

# This is allowed to be empty string, but if it's not it must be prefixed by
ENV VERSION="0.7.7"

Expand Down Expand Up @@ -261,15 +298,16 @@ RUN ${PYTHON} -m pip install auditwheel
# ${PYTHON} -m auditwheel repair dist/nimblephysics-${VERSION}-${PYTHON_VERSION}-linux_x86_64.whl
# RUN mv /nimblephysics/wheelhouse/nimblephysics-${VERSION}-${PYTHON_VERSION}-manylinux_2_17_x86_64.manylinux2014_x86_64.whl /wheelhouse

ARG uid
ARG gid
ARG user=adamas
ARG group=adamas
ARG home=/home/${user}
RUN mkdir -p /etc/sudoers.d \
&& groupadd -g ${gid} ${group} \
&& useradd -d ${home} -u ${uid} -g ${gid} -m -s /bin/bash ${user}
USER ${user}
WORKDIR ${home}
ENV HOME ${home}
# ARG uid
# ARG gid
# ARG user=adamas
# ARG group=adamas
# ARG home=/home/${user}
# RUN mkdir -p /etc/sudoers.d \
# && groupadd -g ${gid} ${group} \
# && useradd -d ${home} -u ${uid} -g ${gid} -m -s /bin/bash ${user} \
# && echo "${user} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/sudoers_${user}
# USER ${user}
# WORKDIR ${home}
# ENV HOME ${home}
COPY build_wheel.sh /usr/local/bin/build_wheel
15 changes: 15 additions & 0 deletions dart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,21 @@ else()
target_compile_features(dart PUBLIC cxx_std_14)
endif()

# Add Alembic
find_package(Alembic REQUIRED PATHS "/usr/local/include/Alembic")
include_directories("/usr/local/include/Alembic")
include_directories("/usr/local/include/Imath")
target_include_directories(dart PRIVATE /usr/local/include/Imath)
target_link_libraries(dart PRIVATE Alembic::Alembic)

# Add Opencv
find_package(OpenCV REQUIRED COMPONENTS core imgcodecs)
include_directories( ${OpenCV_INCLUDE_DIRS} )
target_link_libraries( dart PRIVATE ${OpenCV_LIBS} )
# include_directories("/usr/local/include/opencv4")
# target_include_directories(dart PRIVATE /usr/local/include/opencv4)
# target_link_libraries(dart PRIVATE )

# Enable pthreads
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
Expand Down
24 changes: 24 additions & 0 deletions dart/dynamics/Skeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,30 @@ SkeletonPtr Skeleton::create(const AspectPropertiesData& properties)
return skel;
}

Eigen::Vector3s Skeleton::getBasePos() {
return base_pos;
}

Eigen::Vector3s Skeleton::getEulerAngle() {
return euler_angle;
}

std::string Skeleton::getURDFPath() {
return urdf_path;
}

void Skeleton::setBasePos(Eigen::Vector3s pos) {
base_pos = pos;
}

void Skeleton::setEulerAngle(Eigen::Vector3s angle) {
euler_angle = angle;
}

void Skeleton::setURDFPath(std::string path) {
urdf_path = path;
}

//==============================================================================
SkeletonPtr Skeleton::getPtr()
{
Expand Down
19 changes: 19 additions & 0 deletions dart/dynamics/Skeleton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ class Skeleton : public virtual common::VersionCounter,
public detail::SkeletonAspectBase
{
public:
std::string urdf_path;

Eigen::Vector3s base_pos;

Eigen::Vector3s euler_angle;

static Eigen::Matrix<s_t, Eigen::Dynamic, Eigen::Dynamic> EMPTY;

// Some of non-virtual functions of MetaSkeleton are hidden because of the
Expand Down Expand Up @@ -164,6 +170,18 @@ class Skeleton : public virtual common::VersionCounter,
/// Create a new Skeleton inside of a shared_ptr
static SkeletonPtr create(const AspectPropertiesData& properties);

Eigen::Vector3s getBasePos();

Eigen::Vector3s getEulerAngle();

std::string getURDFPath();

void setBasePos(Eigen::Vector3s pos);

void setEulerAngle(Eigen::Vector3s angle);

void setURDFPath(std::string string);

/// Get the shared_ptr that manages this Skeleton
SkeletonPtr getPtr();

Expand Down Expand Up @@ -2176,6 +2194,7 @@ class Skeleton : public virtual common::VersionCounter,
void addEntryToSoftBodyNodeNameMgr(SoftBodyNode* _newNode);

protected:

/// The resource-managing pointer to this Skeleton
std::weak_ptr<Skeleton> mPtr;

Expand Down
Loading

0 comments on commit bdd3a6d

Please sign in to comment.