23 #ifndef ROMEO_DCM_DRIVER_ROMEO_H 24 #define ROMEO_DCM_DRIVER_ROMEO_H 27 #include <boost/shared_ptr.hpp> 28 #include <boost/assign.hpp> 29 #include <boost/lexical_cast.hpp> 32 #include <alcommon/almodule.h> 33 #include <alcommon/alproxy.h> 34 #include <alproxies/almotionproxy.h> 35 #include <alproxies/almemoryproxy.h> 36 #include <alproxies/dcmproxy.h> 47 #include <nav_msgs/Odometry.h> 48 #include <sensor_msgs/JointState.h> 50 #include <romeo_dcm_msgs/BoolService.h> 54 #include <std_msgs/Float32.h> 66 #include <diagnostic_updater/diagnostic_updater.h> 77 template<
typename T,
size_t N>
115 double low_freq_, high_freq_, controller_freq_, joint_precision_;
154 void brokerDisconnected(
const string& event_name,
const string &broker_name,
const string& subscriber_identifier);
157 void DCMTimedCommand(
const string& key,
const AL::ALValue& value,
const int& timeOffset,
158 const string& type=
"Merge");
159 void DCMAliasTimedCommand(
const string& alias,
const vector<float>& values,
const vector<int>& timeOffsets,
160 const string& type=
"Merge",
const string& type2=
"time-mixed");
163 void insertDataToMemory(
const string& key,
const AL::ALValue& value);
164 AL::ALValue getDataFromMemory(
const string& key);
165 void subscribeToEvent(
const std::string& name,
const std::string& callback_module,
166 const std::string& callback_method);
167 void subscribeToMicroEvent(
const std::string& name,
const std::string& callback_module,
168 const std::string& callback_method,
const string& callback_message=
"");
169 void unsubscribeFromEvent(
const string& name,
const string& callback_module);
170 void unsubscribeFromMicroEvent(
const string& name,
const string& callback_module);
171 void raiseEvent(
const string& name,
const AL::ALValue& value);
172 void raiseMicroEvent(
const string& name,
const AL::ALValue& value);
173 void declareEvent(
const string& name);
176 void controllerLoop();
177 void lowCommunicationLoop();
178 void highCommunicationLoop();
183 void commandVelocity(
const geometry_msgs::TwistConstPtr &msg);
184 bool switchStiffnesses(romeo_dcm_msgs::BoolService::Request &req, romeo_dcm_msgs::BoolService::Response &res);
186 void publishJointStateFromAlMotion();
vector< string > joint_names_
hardware_interface::JointStateInterface jnt_state_interface_
controller_manager::ControllerManager * manager_
boost::shared_ptr< AL::ALProxy > dcm_proxy_
ros::Publisher stiffness_pub_
ROSCONSOLE_DECL void initialize()
vector< double > joint_efforts_
hardware_interface::PositionJointInterface jnt_pos_interface_
sensor_msgs::JointState m_jointState
AL::ALMemoryProxy memory_proxy_
vector< double > joint_commands_
ros::ServiceServer stiffness_switch_
boost::shared_ptr< AL::ALMotionProxy > m_motionProxy
std_msgs::Float32 stiffness_
vector< double > joint_angles_
ros::Subscriber cmd_vel_sub_
void run(class_loader::ClassLoader *loader)
diagnostic_updater::Updater diagnostic_
vector< double > joint_velocities_
bool stiffnesses_enabled_
ros::Publisher m_jointStatePub
ros::NodeHandle node_handle_
vector< string > joints_names_