mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 10:00:48 +02:00
Prepared msg publisher for joint_offset
This commit is contained in:
@@ -28,7 +28,8 @@ public:
|
|||||||
UrRealtimeCommunication* rt_interface_;
|
UrRealtimeCommunication* rt_interface_;
|
||||||
|
|
||||||
UrDriver(std::condition_variable& msg_cond, std::string host,
|
UrDriver(std::condition_variable& msg_cond, std::string host,
|
||||||
unsigned int safety_count_max = 12, double max_time_step = 0.08, double min_payload= 0., double max_payload=1.);
|
unsigned int safety_count_max = 12, double max_time_step = 0.08,
|
||||||
|
double min_payload = 0., double max_payload = 1.);
|
||||||
void start();
|
void start();
|
||||||
void halt();
|
void halt();
|
||||||
|
|
||||||
|
|||||||
@@ -47,11 +47,12 @@ protected:
|
|||||||
std::thread* rt_publish_thread_;
|
std::thread* rt_publish_thread_;
|
||||||
double io_flag_delay_;
|
double io_flag_delay_;
|
||||||
double max_velocity_;
|
double max_velocity_;
|
||||||
|
std::vector<double> joint_offsets_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RosWrapper(std::string host) :
|
RosWrapper(std::string host) :
|
||||||
as_(nh_, "follow_joint_trajectory", false), robot_(msg_cond_, host), io_flag_delay_(
|
as_(nh_, "follow_joint_trajectory", false), robot_(msg_cond_, host), io_flag_delay_(
|
||||||
0.05) {
|
0.05), joint_offsets_(6, 0.0) {
|
||||||
|
|
||||||
std::string joint_prefix = "";
|
std::string joint_prefix = "";
|
||||||
std::vector<std::string> joint_names;
|
std::vector<std::string> joint_names;
|
||||||
@@ -91,6 +92,7 @@ public:
|
|||||||
ROS_INFO("Bounds for set_payload service calls: [%f, %f]",
|
ROS_INFO("Bounds for set_payload service calls: [%f, %f]",
|
||||||
min_payload, max_payload);
|
min_payload, max_payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
robot_.start();
|
robot_.start();
|
||||||
|
|
||||||
//register the goal and feedback callbacks
|
//register the goal and feedback callbacks
|
||||||
@@ -330,6 +332,9 @@ private:
|
|||||||
joint_msg.header.stamp = ros::Time::now();
|
joint_msg.header.stamp = ros::Time::now();
|
||||||
joint_msg.position =
|
joint_msg.position =
|
||||||
robot_.rt_interface_->robot_state_->getQActual();
|
robot_.rt_interface_->robot_state_->getQActual();
|
||||||
|
for (unsigned int i = 0; i < joint_msg.position.size(); i++) {
|
||||||
|
joint_msg.position[i] += joint_offsets_[i];
|
||||||
|
}
|
||||||
joint_msg.velocity =
|
joint_msg.velocity =
|
||||||
robot_.rt_interface_->robot_state_->getQdActual();
|
robot_.rt_interface_->robot_state_->getQdActual();
|
||||||
joint_msg.effort = robot_.rt_interface_->robot_state_->getIActual();
|
joint_msg.effort = robot_.rt_interface_->robot_state_->getIActual();
|
||||||
|
|||||||
Reference in New Issue
Block a user