Merge branch 'master' into develop

This commit is contained in:
Kayman
2018-03-22 09:33:57 +09:00
committed by GitHub
31 changed files with 763 additions and 593 deletions

View File

@@ -2,29 +2,49 @@
Changelog for package robotis_controller
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.2.8 (2018-03-20)
------------------
* modified CMakeLists.txt for system dependencies (yaml-cpp)
* Contributors: Zerom, Pyo
0.2.7 (2018-03-15)
------------------
* changed the License and package format to version 2
* changed all values read by bulk read are saved to dxl_state\_->bulk_read_table\_.
* Modified to prevent duplicate indirect address write
* Contributors: SCH, Zerom, Pyo
0.2.6 (2017-08-09)
------------------
* multi thread bug fixed.
* unnecessary debug print removed.
* OpenCR control table item name changed. (torque_enable -> dynamixel_power)
* fixed to not update update_time_stamp\_ if bulk read fails.
* Contributors: Zerom
0.2.5 (2017-06-09)
-----------
------------------
* updated for yaml-cpp dependencies
* Contributors: SCH
0.2.4 (2017-06-07)
-----------
------------------
* added cmake_modules in package.xml
* Contributors: SCH
0.2.3 (2017-05-23)
-----------
------------------
* updated the cmake file for ros install
* Contributors: SCH
0.2.2 (2017-04-24)
-----------
------------------
* updated robotis_controller.cpp
* changed to read control cycle from .robot file
* Contributors: Zerom
0.2.1 (2016-11-23)
-----------
------------------
* Merge the changes and update
* - Direct Control Mode bug fixed.
* update
@@ -42,7 +62,7 @@ Changelog for package robotis_controller
* Contributors: Jay Song, Pyo, Zerom, SCH
0.2.0 (2016-08-31)
-----------
------------------
* bug fixed (position pid gain & velocity pid gain sync write).
* added velocity_to_value_ratio to DXL Pro-H series.
* changed some debug messages.
@@ -65,11 +85,11 @@ Changelog for package robotis_controller
* Contributors: Jay Song, Zerom, Pyo, SCH
0.1.1 (2016-08-18)
-----------
------------------
* updated the package information
0.1.0 (2016-08-12)
-----------
------------------
* first public release for Kinetic
* modified the package information for release
* develop branch -> master branch

View File

@@ -1,27 +1,48 @@
################################################################################
# CMake
# Set minimum required version of cmake, project name and compile options
################################################################################
cmake_minimum_required(VERSION 2.8.3)
project(robotis_controller)
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
################################################################################
# Packages
# Find catkin packages and libraries for catkin and system dependencies
################################################################################
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
sensor_msgs
std_msgs
sensor_msgs
robotis_controller_msgs
dynamixel_sdk
robotis_device
robotis_framework_common
cmake_modules
)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CATKIN_DEVEL_PREFIX}/lib/pkgconfig")
find_package(PkgConfig)
pkg_check_modules(yaml_cpp yaml-cpp REQUIRED)
# Resolve system dependency on yaml-cpp, which apparently does not
# provide a CMake find_package() module.
find_package(PkgConfig REQUIRED)
pkg_check_modules(YAML_CPP REQUIRED yaml-cpp)
find_path(YAML_CPP_INCLUDE_DIR
NAMES yaml_cpp.h
PATHS ${YAML_CPP_INCLUDE_DIRS}
)
find_library(YAML_CPP_LIBRARY
NAMES YAML_CPP
PATHS ${YAML_CPP_LIBRARY_DIRS}
)
link_directories(${YAML_CPP_LIBRARY_DIRS})
if(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5")
add_definitions(-DHAVE_NEW_YAMLCPP)
endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5")
################################################################################
# Setup for python modules and scripts
################################################################################
################################################################################
# Declare ROS messages, services and actions
@@ -32,12 +53,12 @@ pkg_check_modules(yaml_cpp yaml-cpp REQUIRED)
################################################################################
################################################################################
# Catkin specific configuration
# Declare catkin specific configuration to be passed to dependent projects
################################################################################
catkin_package(
INCLUDE_DIRS include
LIBRARIES robotis_controller
CATKIN_DEPENDS roscpp roslib sensor_msgs std_msgs robotis_framework_common
CATKIN_DEPENDS roscpp roslib std_msgs sensor_msgs robotis_controller_msgs dynamixel_sdk robotis_device robotis_framework_common cmake_modules
)
################################################################################
@@ -46,12 +67,12 @@ catkin_package(
include_directories(
include
${catkin_INCLUDE_DIRS}
${yaml_cpp_INCLUDE_DIRS}
${YAML_CPP_INCLUDE_DIRS}
)
add_library(robotis_controller src/robotis_controller/robotis_controller.cpp)
add_dependencies(robotis_controller ${catkin_EXPORTED_TARGETS})
target_link_libraries(robotis_controller ${yaml_cpp_LIBRARIES} ${catkin_LIBRARIES})
target_link_libraries(robotis_controller ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES})
################################################################################
# Install

View File

@@ -1,32 +1,18 @@
/*******************************************************************************
* Copyright (c) 2016, ROBOTIS CO., LTD.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of ROBOTIS nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
* Copyright 2018 ROBOTIS CO., LTD.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
/*
* robotis_controller.h

View File

@@ -1,36 +1,28 @@
<?xml version="1.0"?>
<package>
<package format="2">
<name>robotis_controller</name>
<version>0.2.5</version>
<version>0.2.8</version>
<description>
The main package that controls THORMANG3.
robotis_controller package for ROBOTIS's platform like Manipulator-H, THORMANG and OP series
</description>
<license>BSD</license>
<license>Apache 2.0</license>
<author email="zerom@robotis.com">Zerom</author>
<author email="kmjung@robotis.com">Kayman</author>
<author email="sch@robotis.com">SCH</author>
<maintainer email="pyo@robotis.com">Pyo</maintainer>
<url type="bugtracker">https://github.com/ROBOTIS-GIT/ROBOTIS-Framework/issues</url>
<url type="repository">https://github.com/ROBOTIS-GIT/ROBOTIS-Framework</url>
<url type="website">http://wiki.ros.org/robotis_controller</url>
<url type="emanual">http://emanual.robotis.com/docs/en/software/robotis_framework_packages/</url>
<url type="repository">https://github.com/ROBOTIS-GIT/ROBOTIS-Framework</url>
<url type="bugtracker">https://github.com/ROBOTIS-GIT/ROBOTIS-Framework/issues</url>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>roslib</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>dynamixel_sdk</build_depend>
<build_depend>robotis_device</build_depend>
<build_depend>robotis_controller_msgs</build_depend>
<build_depend>robotis_framework_common</build_depend>
<build_depend>cmake_modules</build_depend>
<build_depend>yaml-cpp</build_depend>
<run_depend>roscpp</run_depend>
<run_depend>roslib</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>dynamixel_sdk</run_depend>
<run_depend>robotis_device</run_depend>
<run_depend>robotis_controller_msgs</run_depend>
<run_depend>robotis_framework_common</run_depend>
<run_depend>cmake_modules</run_depend>
<run_depend>yaml-cpp</run_depend>
<export></export>
<depend>roscpp</depend>
<depend>roslib</depend>
<depend>std_msgs</depend>
<depend>sensor_msgs</depend>
<depend>robotis_controller_msgs</depend>
<depend>dynamixel_sdk</depend>
<depend>robotis_device</depend>
<depend>robotis_framework_common</depend>
<depend>cmake_modules</depend>
<depend>yaml-cpp</depend>
</package>

View File

@@ -1,32 +1,18 @@
/*******************************************************************************
* Copyright (c) 2016, ROBOTIS CO., LTD.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of ROBOTIS nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
* Copyright 2018 ROBOTIS CO., LTD.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
/*
* robotis_controller.cpp
@@ -499,7 +485,8 @@ void RobotisController::initializeDevice(const std::string init_file_path)
bulkread_data_length += addr_leng;
for (int l = 0; l < addr_leng; l++)
{
// ROS_WARN("[%12s] INDIR_ADDR: %d, ITEM_ADDR: %d", joint_name.c_str(), indirect_addr, dxl->ctrl_table[dxl->bulk_read_items[i]->item_name]->address + _l);
// ROS_WARN("[%12s] INDIR_ADDR: %d, ITEM_ADDR: %d", joint_name.c_str(), indirect_addr, dxl->ctrl_table[dxl->bulk_read_items[i]->item_name]->address + _l);
read2Byte(joint_name, indirect_addr, &data16);
if (data16 != dxl->ctrl_table_[dxl->bulk_read_items_[i]->item_name_]->address_ + l)
{
@@ -950,8 +937,8 @@ void RobotisController::process()
dxl->dxl_state_->goal_velocity_ = dxl->convertValue2Velocity(data);
else if (dxl->goal_current_item_ != 0 && item->item_name_ == dxl->goal_current_item_->item_name_)
dxl->dxl_state_->goal_torque_ = dxl->convertValue2Torque(data);
else
dxl->dxl_state_->bulk_read_table_[item->item_name_] = data;
dxl->dxl_state_->bulk_read_table_[item->item_name_] = data;
}
}
@@ -1170,8 +1157,8 @@ void RobotisController::process()
dxl->dxl_state_->goal_velocity_ = dxl->convertValue2Velocity(data);
else if (dxl->goal_current_item_ != 0 && item->item_name_ == dxl->goal_current_item_->item_name_)
dxl->dxl_state_->goal_torque_ = dxl->convertValue2Torque(data);
else
dxl->dxl_state_->bulk_read_table_[item->item_name_] = data;
dxl->dxl_state_->bulk_read_table_[item->item_name_] = data;
}
}
@@ -1255,7 +1242,7 @@ void RobotisController::process()
if (result_state == NULL)
{
fprintf(stderr, "[%s] %s", (*module_it)->getModuleName().c_str(), joint_name.c_str());
ROS_ERROR("[%s] %s ", (*module_it)->getModuleName().c_str(), joint_name.c_str());
continue;
}