Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compile errors #90

Merged
merged 12 commits into from Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .rosinstall
@@ -1,3 +1,3 @@
- git:
local-name: choreonoid_sdfloader_plugin
uri: https://github.com/fkanehiro/choreonoid-sdfloader-plugin.git
#- git:
# local-name: choreonoid_sdfloader_plugin
# uri: https://github.com/fkanehiro/choreonoid-sdfloader-plugin.git
18 changes: 9 additions & 9 deletions .travis.yml
Expand Up @@ -8,9 +8,9 @@ notifications:
on_success: change
on_failure: always
sudo: required
dist: trusty
dist: xenial
before_install:
- export ROS_DISTRO=indigo
- export ROS_DISTRO=kinetic
- export CI_SOURCE_PATH=$(pwd)
- export REPOSITORY_NAME=${PWD##*/}
- echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
Expand All @@ -34,14 +34,14 @@ install:
- catkin init
- catkin config --merge-devel --install
- rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
- cd ~/
- git clone https://github.com/fkanehiro/simtrans.git
- cd simtrans
- sudo -H pip install -r requirements.txt
- sudo python setup.py install
- cd ../
# - cd ~/
# - git clone https://github.com/fkanehiro/simtrans.git
# - cd simtrans
# - sudo -H pip install -r requirements.txt
# - sudo python setup.py install
# - cd ../
before_script:
- source /opt/ros/$ROS_DISTRO/setup.bash
script:
- cd ~/ros/ws_$REPOSITORY_NAME
- catkin build -p 1 choreonoid_ros_pkg
- catkin build --interleave -p 1 choreonoid_ros_pkg
6 changes: 3 additions & 3 deletions choreonoid_plugins/src/BodyRosHighgainControllerItem.cpp
Expand Up @@ -92,7 +92,7 @@ void BodyRosHighgainControllerItem::calculate_hg_parameter(

i = joint->jointId();

if (isnan(qref)) {
if (std::isnan(qref)) {
ROS_ERROR("joint id %03d (%s): joint angle setting is NaN", i, joint->name().c_str());
return;
} else if (qref < joint->q_lower() || qref > joint->q_upper()) {
Expand All @@ -107,7 +107,7 @@ void BodyRosHighgainControllerItem::calculate_hg_parameter(
dq = (qref - joint->q()) / timeStep_;
}

if (isnan(dq)) {
if (std::isnan(dq)) {
ROS_ERROR("joint id %03d (%s): calculate joint velocity, result is NaN", i, joint->name().c_str());
return;
}
Expand All @@ -118,7 +118,7 @@ void BodyRosHighgainControllerItem::calculate_hg_parameter(
ddq = dq / timeStep_;
}

if (isnan(ddq)) {
if (std::isnan(ddq)) {
ROS_ERROR("joint id %03d (%s): calculate joint acceleration, result is NaN", i, joint->name().c_str());
return;
}
Expand Down
10 changes: 5 additions & 5 deletions choreonoid_plugins/src/BodyRosTorqueControllerItem.cpp
Expand Up @@ -236,7 +236,7 @@ void BodyRosTorqueControllerItem::pd_control(Link* joint, double q_ref)
i = joint->jointId();
q = joint->q();

if (isnan(q_ref)) {
if (std::isnan(q_ref)) {
ROS_ERROR("joint id %03d (%s): joint angle setting is NaN", joint->jointId(), joint->name().c_str());
goto done;
} else if (q_ref < joint->q_lower() || q_ref > joint->q_upper()) {
Expand All @@ -247,21 +247,21 @@ void BodyRosTorqueControllerItem::pd_control(Link* joint, double q_ref)

dq_ref = (q_ref - qref_old_[i]) / timeStep_;

if (isnan(dq_ref)) {
if (std::isnan(dq_ref)) {
ROS_ERROR("joint id %03d (%s): calculate dq_ref, result is NaN", joint->jointId(), joint->name().c_str());
goto done;
}

dq = (q - q_old_[i]) / timeStep_;

if (isnan(dq)) {
if (std::isnan(dq)) {
ROS_ERROR("joint id %03d (%s): calculate dq, result is NaN", joint->jointId(), joint->name().c_str());
goto done;
}

u = (q_ref - q) * pgain[i] + (dq_ref - dq) * dgain[i];

if (! isnan(u)) {
if (! std::isnan(u)) {
if (u < u_lower[i]) {
ROS_DEBUG("joint id %03d (%s): calculate u, result is over lower limt. (adjust %f -> %f)",
joint->jointId(), joint->name().c_str(), u, u_lower[i]);
Expand Down Expand Up @@ -317,7 +317,7 @@ void BodyRosTorqueControllerItem::apply_message(Link* joint, size_t idx, traject
} else {
u = point->effort[idx];

if (! isnan(u)) {
if (! std::isnan(u)) {
joint->u() = u;
} else {
ROS_ERROR("Effort setting is NaN (%s)", joint->name().c_str());
Expand Down
21 changes: 8 additions & 13 deletions choreonoid_plugins/src/WorldRosItem.cpp
Expand Up @@ -14,6 +14,7 @@
#include <cnoid/MessageView>
#include <cnoid/ItemTreeView>
#include <cnoid/EigenUtil>
#include <fstream>

using namespace cnoid;

Expand Down Expand Up @@ -545,20 +546,14 @@ bool WorldRosItem::spawnModel(gazebo_msgs::SpawnModel::Request &req,
Load model file.
*/

char tmpfname[L_tmpnam];
boost::filesystem::path temp = boost::filesystem::unique_path();
bool is_loaded = false;

memset(tmpfname, 0x00, sizeof(tmpfname));
strncpy(tmpfname, "cnoid_ros_pkgXXXXXX", sizeof(tmpfname));

if (mkstemp(tmpfname) != -1) {
std::ofstream ofs(tmpfname);
ofs << model_xml << std::endl;
ofs.flush();
ofs.close();
is_loaded = body->loadModelFile(tmpfname);
remove(tmpfname);
}
std::ofstream ofs(temp.native());
ofs << model_xml << std::endl;
ofs.flush();
ofs.close();
is_loaded = body->loadModelFile(temp.native());
remove(temp.native().c_str());

if (! is_loaded) {
return false;
Expand Down
16 changes: 11 additions & 5 deletions choreonoid_ros/package.xml
Expand Up @@ -85,9 +85,11 @@ following libraries:
<build_depend>cmake</build_depend>
<build_depend>boost</build_depend>
<build_depend>eigen</build_depend>
<build_depend>libqt4-dev</build_depend>
<build_depend>libqt4-opengl-dev</build_depend>
<build_depend>qt4-dev-tools</build_depend>
<build_depend>qtbase5-dev</build_depend>
<build_depend>libqt5-opengl-dev</build_depend>
<build_depend>libqt5x11extras5-dev</build_depend>
<build_depend>qt5-qmake</build_depend>
<build_depend>assimp-dev</build_depend>
<build_depend>libglew-dev</build_depend>
<build_depend>yaml</build_depend>
<build_depend>zlib</build_depend>
Expand All @@ -108,8 +110,12 @@ following libraries:
<build_depend>mk</build_depend>

<run_depend>yaml</run_depend>
<run_depend>libqt4</run_depend>
<run_depend>libqt4-opengl</run_depend>
<run_depend>libqt5-core</run_depend>
<run_depend>libqt5-gui</run_depend>
<run_depend>libqt5-widgets</run_depend>
<run_depend>libqt5-network</run_depend>
<run_depend>libqt5-opengl</run_depend>
<run_depend>assimp</run_depend>

<export>
</export>
Expand Down
6 changes: 3 additions & 3 deletions choreonoid_ros/setting_build_args.sh
Expand Up @@ -9,12 +9,12 @@
# for cmake
_CNOID_ROS_PKG_BUILD_CNOID_USER_CMAKE_ARGS=""
_CNOID_ROS_PKG_BUILD_CNOID_CONSTANT_CMAKE_ARGS="
-DENABLE_INSTALL_PATH=ON
-DENABLE_INSTALL_RPATH=ON
-DENABLE_PYTHON=ON
"

# for make
_CNOID_ROS_PKG_BUILD_CNOID_MAKE_ARGS="-j 4"
_CNOID_ROS_PKG_BUILD_CNOID_MAKE_ARGS="-j$(nproc)"

#
# Main.
Expand Down Expand Up @@ -45,7 +45,7 @@ case ${1} in
;;

*)
echo "usage:" `basename ${0}` "[ cmake | make ]"
echo "usage:" `basename ${0}` "[ cmake | make ]"
exit 1
;;
esac
Expand Down
6 changes: 5 additions & 1 deletion choreonoid_ros_pkg/package.xml
Expand Up @@ -18,12 +18,16 @@

<build_depend>choreonoid_ros</build_depend>
<build_depend>choreonoid_plugins</build_depend>
<!--
<build_depend>jvrc_models</build_depend>
-->

<run_depend>choreonoid_ros</run_depend>
<run_depend>choreonoid_plugins</run_depend>
<!--
<run_depend>jvrc_models</run_depend>

-->

<export>
</export>
</package>
Empty file added jvrc_models/CATKIN_IGNORE
Empty file.