Skip to content
Snippets Groups Projects
Commit c9dbdf5c authored by Christoph Jähne's avatar Christoph Jähne
Browse files

merged develop, adds rt_config parameter to franka_hw

parents 530f50b3 541b5fc1
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ Requires `libfranka` >= 0.7.0 ...@@ -30,6 +30,7 @@ Requires `libfranka` >= 0.7.0
* **BREAKING** Moved `panda_moveit_config` to [`ros-planning`](https://github.com/ros-planning/panda_moveit_config). * **BREAKING** Moved `panda_moveit_config` to [`ros-planning`](https://github.com/ros-planning/panda_moveit_config).
* Added support for ROS Melodic Morenia. * Added support for ROS Melodic Morenia.
* Raised minimum CMake version to 3.4 to match `libfranka`. * Raised minimum CMake version to 3.4 to match `libfranka`.
* Add rosparam to choose value of `franka::RealtimeConfig`.
## 0.6.0 - 2018-08-08 ## 0.6.0 - 2018-08-08
......
...@@ -35,7 +35,7 @@ def getStages(rosDistribution, ubuntuVersion) { ...@@ -35,7 +35,7 @@ def getStages(rosDistribution, ubuntuVersion) {
} }
docker.build("franka_ros-ci-worker:${rosDistribution}", docker.build("franka_ros-ci-worker:${rosDistribution}",
"-f src/franka_ros/.ci/Dockerfile.${rosDistribution} src/franka_ros/.ci").inside { "-f src/franka_ros/.ci/Dockerfile.${rosDistribution} src/franka_ros/.ci").inside('-e MAKEFLAGS') {
withEnv(["CMAKE_PREFIX_PATH+=${env.WORKSPACE}/dist/libfranka/lib/cmake/Franka", withEnv(["CMAKE_PREFIX_PATH+=${env.WORKSPACE}/dist/libfranka/lib/cmake/Franka",
"ROS_HOME=${env.WORKSPACE}/ros-home"]) { "ROS_HOME=${env.WORKSPACE}/ros-home"]) {
stage("${rosDistribution}: Build & Lint (Debug)") { stage("${rosDistribution}: Build & Lint (Debug)") {
......
...@@ -21,6 +21,8 @@ panda_1: ...@@ -21,6 +21,8 @@ panda_1:
cutoff_frequency: 100 cutoff_frequency: 100
# Internal controller for motion generators [joint_impedance|cartesian_impedance] # Internal controller for motion generators [joint_impedance|cartesian_impedance]
internal_controller: joint_impedance internal_controller: joint_impedance
# Used to decide whether to enforce realtime mode [enforce|ignore]
realtime_config: enforce
# Configure the initial defaults for the collision behavior reflexes. # Configure the initial defaults for the collision behavior reflexes.
collision_config: collision_config:
lower_torque_thresholds_acceleration: [20.0, 20.0, 18.0, 18.0, 16.0, 14.0, 12.0] # [Nm] lower_torque_thresholds_acceleration: [20.0, 20.0, 18.0, 18.0, 16.0, 14.0, 12.0] # [Nm]
...@@ -51,6 +53,8 @@ panda_2: ...@@ -51,6 +53,8 @@ panda_2:
cutoff_frequency: 100 cutoff_frequency: 100
# Internal controller for motion generators [joint_impedance|cartesian_impedance] # Internal controller for motion generators [joint_impedance|cartesian_impedance]
internal_controller: joint_impedance internal_controller: joint_impedance
# Used to decide whether to enforce realtime mode [enforce|ignore]
realtime_config: enforce
# Configure the initial defaults for the collision behavior reflexes. # Configure the initial defaults for the collision behavior reflexes.
collision_config: collision_config:
lower_torque_thresholds_acceleration: [20.0, 20.0, 18.0, 18.0, 16.0, 14.0, 12.0] # [Nm] lower_torque_thresholds_acceleration: [20.0, 20.0, 18.0, 18.0, 16.0, 14.0, 12.0] # [Nm]
......
...@@ -15,6 +15,8 @@ rate_limiting: true ...@@ -15,6 +15,8 @@ rate_limiting: true
cutoff_frequency: 100 cutoff_frequency: 100
# Internal controller for motion generators [joint_impedance|cartesian_impedance] # Internal controller for motion generators [joint_impedance|cartesian_impedance]
internal_controller: joint_impedance internal_controller: joint_impedance
# Used to decide whether to enforce realtime mode [enforce|ignore]
realtime_config: enforce
# Configure the initial defaults for the collision behavior reflexes. # Configure the initial defaults for the collision behavior reflexes.
collision_config: collision_config:
lower_torque_thresholds_acceleration: [20.0, 20.0, 18.0, 18.0, 16.0, 14.0, 12.0] # [Nm] lower_torque_thresholds_acceleration: [20.0, 20.0, 18.0, 18.0, 16.0, 14.0, 12.0] # [Nm]
......
...@@ -31,6 +31,17 @@ int main(int argc, char** argv) { ...@@ -31,6 +31,17 @@ int main(int argc, char** argv) {
franka::Robot& robot = franka_control.robot(); franka::Robot& robot = franka_control.robot();
std::string realtime_config_param = node_handle.param("realtime_config", std::string("enforce"));
franka::RealtimeConfig realtime_config;
if (realtime_config_param == "enforce") {
realtime_config = franka::RealtimeConfig::kEnforce;
} else if (realtime_config_param == "ignore") {
realtime_config = franka::RealtimeConfig::kIgnore;
} else {
ROS_ERROR("Invalid realtime_config parameter provided. Valid values are 'enforce', 'ignore'.");
return 1;
}
std::atomic_bool has_error(false); std::atomic_bool has_error(false);
ServiceContainer services; ServiceContainer services;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <list> #include <list>
#include <string> #include <string>
#include <franka/control_types.h>
#include <franka/duration.h> #include <franka/duration.h>
#include <franka/model.h> #include <franka/model.h>
#include <franka/rate_limiting.h> #include <franka/rate_limiting.h>
...@@ -500,6 +501,7 @@ class FrankaHW : public hardware_interface::RobotHW { ...@@ -500,6 +501,7 @@ class FrankaHW : public hardware_interface::RobotHW {
std::string robot_ip_; std::string robot_ip_;
urdf::Model urdf_model_; urdf::Model urdf_model_;
double joint_limit_warning_threshold_{0.1}; double joint_limit_warning_threshold_{0.1};
franka::RealtimeConfig realtime_config_;
bool initialized_{false}; bool initialized_{false};
std::atomic_bool controller_active_{false}; std::atomic_bool controller_active_{false};
......
...@@ -127,6 +127,17 @@ bool FrankaHW::initParameters(ros::NodeHandle& root_nh, ros::NodeHandle& robot_h ...@@ -127,6 +127,17 @@ bool FrankaHW::initParameters(ros::NodeHandle& root_nh, ros::NodeHandle& robot_h
joint_limit_warning_threshold_); joint_limit_warning_threshold_);
} }
std::string realtime_config_param = robot_hw_nh.param("realtime_config", std::string("enforce"));
franka::RealtimeConfig realtime_config;
if (realtime_config_param == "enforce") {
realtime_config_ = franka::RealtimeConfig::kEnforce;
} else if (realtime_config_param == "ignore") {
realtime_config_ = franka::RealtimeConfig::kIgnore;
} else {
ROS_ERROR("Invalid realtime_config parameter provided. Valid values are 'enforce', 'ignore'.");
return false;
}
// Get full collision behavior config from the parameter server. // Get full collision behavior config from the parameter server.
std::vector<double> thresholds = std::vector<double> thresholds =
getCollisionThresholds("lower_torque_thresholds_acceleration", robot_hw_nh, getCollisionThresholds("lower_torque_thresholds_acceleration", robot_hw_nh,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment