14 virtual bool getRepr(
const std::string &n, std::string & repr)
const {
15 if(value_.hasMember(n)){
16 std::stringstream sstr;
17 sstr << const_cast< XmlRpc::XmlRpcValue &>(value_)[n];
29 RosChain(nh, nh_priv), motor_allocator_(
"canopen_402",
"canopen::MotorBase::Allocator") {}
33 std::string
name = params[
"name"];
34 std::string &joint =
name;
35 if(params.
hasMember(
"joint")) joint.assign(params[
"joint"]);
42 std::string alloc_name =
"canopen::Motor402::Allocator";
43 if(params.
hasMember(
"motor_allocator")) alloc_name.assign(params[
"motor_allocator"]);
46 if(params.
hasMember(
"motor_layer")) settings = params[
"motor_layer"];
51 motor =
motor_allocator_.allocateInstance(alloc_name, name +
"_motor", node->getStorage(), settings);
53 catch(
const std::exception &e){
54 std::string info = boost::diagnostic_information(e);
64 motor->registerDefaultModes(node->getStorage());
71 if(!handle->prepareFilters(s)){
92 if(!
nh_.
param(
"use_realtime_period",
false)){
96 ROS_INFO(
"Using real-time control period");
virtual void add(const VectorMemberSharedPtr &l)
boost::shared_ptr< ControllerManagerLayer > cm_
const std::string reason() const
XmlRpcSettings(const XmlRpc::XmlRpcValue &v)
virtual bool setup_chain()
boost::shared_ptr< canopen::LayerGroupNoDiag< canopen::MotorBase > > motors_
virtual bool getRepr(const std::string &n, std::string &repr) const
Duration & fromSec(double t)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
MotorChain(const ros::NodeHandle &nh, const ros::NodeHandle &nh_priv)
ClassAllocator< canopen::MotorBase > motor_allocator_
XmlRpc::XmlRpcValue value_
bool hasMember(const std::string &name) const
#define ROS_INFO_STREAM(args)
virtual bool setup_chain()
virtual bool nodeAdded(XmlRpc::XmlRpcValue ¶ms, const canopen::NodeSharedPtr &node, const LoggerSharedPtr &logger)
time_duration update_duration_
#define ROS_ERROR_STREAM(args)
XmlRpcSettings & operator=(const XmlRpc::XmlRpcValue &v)
RobotLayerSharedPtr robot_layer_