11 nh_private_(nh_private),
27 ROS_INFO(
"Waiting for IK %d to be attached...", serial_num);
32 ROS_FATAL(
"Problem waiting for IK attachment: %s", err.c_str());
42 for (
int i = 0; i <
n_in; i++)
44 char topicname[] =
"digital_input00";
45 snprintf(topicname,
sizeof(topicname),
"digital_input%02d", i);
48 for (
int i = 0; i <
n_out; i++)
50 char topicname[] =
"digital_output00";
51 snprintf(topicname,
sizeof(topicname),
"digital_output%02d", i);
61 char topicname[] =
"analog_input00";
62 snprintf(topicname,
sizeof(topicname),
"analog_input%02d", i);
73 std_msgs::Float32 msg;
74 msg.data =
VREF * float(rawval) / 4095.0f;
85 msg.data = inputValue != 0;
93 phidgets_msgs::SetDigitalOutput::Response& res)
95 ROS_INFO(
"Setting output %d to %d", req.index, req.state);
102 ROS_INFO(
"Setting output %d to %d", index_, msg->data);
103 ik_->setOutputState(index_, msg->data);
int openAndWaitForAttachment(int serial_number, int timeout)
std::vector< ros::Publisher > sensor_pubs_
IKRosI(ros::NodeHandle nh, ros::NodeHandle nh_private)
int getSensorCount() const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
void inputHandler(int index, int inputValue) override
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
void sensorHandler(int index, int sensorValue) override
std::vector< ros::Publisher > in_pubs_
OutputSetter(IK *ik, int index)
static std::string getErrorDescription(int errorCode)
std::vector< std::shared_ptr< OutputSetter > > out_subs_
bool setOutputState(int index, bool state) const
bool set_srv_callback(phidgets_msgs::SetDigitalOutput::Request &req, phidgets_msgs::SetDigitalOutput::Response &res)
void set_msg_callback(const std_msgs::Bool::ConstPtr &msg)
ros::ServiceServer out_srv_
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::NodeHandle nh_private_
bool getParam(const std::string &key, std::string &s) const
int getOutputCount() const
ROSCPP_DECL void shutdown()
int getInputCount() const
int getSensorRawValue(int index) const