26 : control_cycle_msec_(0),
31 goal_acceleration_(0),
42 result_[
"gripper"]->goal_position_ = 0;
90 if(msg->joint_name[0] ==
"gripper" && msg->item_name ==
"goal_position")
92 result_[
"gripper"]->goal_position_ =
robot_->
dxls_[
"gripper"]->convertValue2Radian(msg->value[0]);
93 ROS_WARN(
"BASE_MODULE: goalposition : %d -> %f", msg->value[0],
result_[
"gripper"]->goal_position_);
98 rh_p12_rn_base_module_msgs::GetItemValue::Response &res)
100 if(req.joint_name !=
"gripper")
103 if(req.item_name ==
"torque_enable")
105 else if(req.item_name ==
"goal_position")
107 else if(req.item_name ==
"goal_velocity")
109 else if(req.item_name ==
"goal_current")
111 else if(req.item_name ==
"goal_acceleration")
113 else if(req.item_name ==
"is_moving")
115 else if(req.item_name ==
"present_position")
117 else if(req.item_name ==
"present_velocity")
119 else if(req.item_name ==
"present_current")
130 std::map<std::string, double> sensors)
132 std::map<std::string, uint32_t> _table = dxls[
"gripper"]->dxl_state_->bulk_read_table_;
143 std_msgs::Int32 _pos;
147 std_msgs::Int32 _curr;
155 for (std::map<std::string, robotis_framework::DynamixelState *>::iterator state_it =
result_.begin();
156 state_it !=
result_.end(); state_it++)
158 std::string joint_name = state_it->first;
161 std::map<std::string, robotis_framework::Dynamixel*>::iterator dxl_it = dxls.find(joint_name);
162 if (dxl_it != dxls.end())
163 _dxl = dxl_it->second;
ros::Publisher present_current_pub_
void setPosition(const robotis_controller_msgs::SyncWriteItem::ConstPtr &msg)
boost::thread queue_thread_
std::map< std::string, DynamixelState * > result_
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
ControlMode control_mode_
std::map< std::string, Dynamixel * > dxls_
void setCallbackQueue(CallbackQueueInterface *queue)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::Publisher present_position_pub_
void process(std::map< std::string, robotis_framework::Dynamixel * > dxls, std::map< std::string, double > sensors)
robotis_framework::Robot * robot_
void initialize(const int control_cycle_msec, robotis_framework::Robot *robot)
bool getItemValueCallback(rh_p12_rn_base_module_msgs::GetItemValue::Request &req, rh_p12_rn_base_module_msgs::GetItemValue::Response &res)