This commit is contained in:
kayman
2017-02-28 11:38:45 +09:00
14 changed files with 366 additions and 182 deletions

View File

@@ -1,24 +1,45 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package robotis_device
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
* Setting the license to BSD.
* add SensorState
add Singleton template
* XM-430 / CM-740 device file added.
Sensor device added.
* modified.
* variable name changed.
ConvertRadian2Value / ConvertValue2Radian function bug fixed.
* added code to support the gazebo simulator
* renewal
* Contributors: ROBOTIS, ROBOTIS-zerom, pyo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package robotis_device
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.2.1 (2016-11-23)
-----------
* Merge the changes and update
* mode change debugging
* - convertRadian2Value / convertValue2Radian : commented out the code that limits the maximum/minimum value.
* - modified dependency problem.
* 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.
* added velocity p/i/d gain and position i/d gain sync_write code.
* fixed robotis_device build_depend.
* added XM-430-W210 / XM-430-W350 device file.
* rename (present_current\_ -> present_torque\_)
* modified torque control code
* added device file for MX-64 / MX-106
* adjusted position min/max value. (MX-28, XM-430)
* Contributors: Zerom, Pyo
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
* Setting the license to BSD.
* add SensorState
add Singleton template
* XM-430 / CM-740 device file added.
Sensor device added.
* modified.
* variable name changed.
ConvertRadian2Value / ConvertValue2Radian function bug fixed.
* added code to support the gazebo simulator
* renewal
* Contributors: ROBOTIS, ROBOTIS-zerom, pyo

View File

@@ -48,17 +48,23 @@
#define DYNAMIXEL "dynamixel"
#define SENSOR "sensor"
#define SESSION_CONTROL_INFO "control info"
#define SESSION_PORT_INFO "port info"
#define SESSION_DEVICE_INFO "device info"
#define SESSION_TYPE_INFO "type info"
#define SESSION_CONTROL_TABLE "control table"
#define DEFAULT_CONTROL_CYCLE 8 // milliseconds
namespace robotis_framework
{
class Robot
{
private:
int control_cycle_msec_;
public:
std::map<std::string, dynamixel::PortHandler *> ports_; // string: port name
std::map<std::string, std::string> port_default_device_; // port name, default device name
@@ -70,6 +76,8 @@ public:
Sensor *getSensor(std::string path, int id, std::string port, float protocol_version);
Dynamixel *getDynamixel(std::string path, int id, std::string port, float protocol_version);
int getControlCycle();
};
}

View File

@@ -1,23 +1,23 @@
<?xml version="1.0"?>
<package>
<name>robotis_device</name>
<version>0.1.1</version>
<description>
The package that manages device information of ROBOTIS robots.
This package is used when reading device information with the robot information file
from the robotis_controller package.
</description>
<license>BSD</license>
<author email="zerom@robotis.com">Zerom</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_device</url>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>dynamixel_sdk</build_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>dynamixel_sdk</run_depend>
</package>
<?xml version="1.0"?>
<package>
<name>robotis_device</name>
<version>0.2.1</version>
<description>
The package that manages device information of ROBOTIS robots.
This package is used when reading device information with the robot information file
from the robotis_controller package.
</description>
<license>BSD</license>
<author email="zerom@robotis.com">Zerom</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_device</url>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>dynamixel_sdk</build_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>dynamixel_sdk</run_depend>
</package>

View File

@@ -76,6 +76,7 @@ static inline std::vector<std::string> split(const std::string &text, char sep)
}
Robot::Robot(std::string robot_file_path, std::string dev_desc_dir_path)
: control_cycle_msec_(DEFAULT_CONTROL_CYCLE)
{
if (dev_desc_dir_path.compare(dev_desc_dir_path.size() - 1, 1, "/") != 0)
dev_desc_dir_path += "/";
@@ -106,7 +107,16 @@ Robot::Robot(std::string robot_file_path, std::string dev_desc_dir_path)
continue;
}
if (session == SESSION_PORT_INFO)
if (session == SESSION_CONTROL_INFO)
{
std::vector<std::string> tokens = split(input_str, '=');
if (tokens.size() != 2)
continue;
if (tokens[0] == "control_cycle")
control_cycle_msec_ = std::atoi(tokens[1].c_str());
}
else if (session == SESSION_PORT_INFO)
{
std::vector<std::string> tokens = split(input_str, '|');
if (tokens.size() != 3)
@@ -485,3 +495,7 @@ Dynamixel *Robot::getDynamixel(std::string path, int id, std::string port, float
return dxl;
}
int Robot::getControlCycle()
{
return control_cycle_msec_;
}