15 ROS_ERROR(
"[armadillo2_hw/ricboard_pub]: %s param is missing on param server. make sure that you load this param exist in ricboard_config.yaml " 16 "and that your launch includes this param file. shutting down...",
RIC_PORT_PARAM);
23 ROS_ERROR(
"[armadillo2_hw/ricboard_pub]: %s param is missing on param server. make sure that this param exist in controllers.yaml " 24 "and that your launch includes this param file. shutting down...",
TORSO_JOINT_PARAM);
31 ROS_INFO(
"[armadillo2_hw/ricboard_pub]: ricboard port opened successfully \nport name: %s \nbaudrate: 115200",
ric_port_.c_str());
33 ROS_ERROR(
"[armadillo2_hw/ricboard_pub]: can't open ricboard port. make sure that ricboard is connected. shutting down...");
48 ROS_INFO(
"[armadillo2_hw/ricboard_pub]: ricboard is up");
53 ROS_WARN(
"[armadillo2_hw/ricboard_pub]: ric hardware is disabled");
74 while (
ros::ok() && !
t->interruption_requested())
85 speakMsg(
"emergency, shutting down", 1);
86 ROS_ERROR(
"[armadillo2_hw/ricboard_pub]: EMERGENCY PIN DISCONNECTED, shutting down...");
106 speakMsg(
"rik board disconnected, shutting down", 1);
107 ROS_ERROR(
"[armadillo2_hw/ricboard_pub]: ricboard disconnected. shutting down...");
121 sensor_msgs::Range range_msg;
123 range_msg.header.frame_id =
"front_urf_link";
124 range_msg.min_range = 0.3;
125 range_msg.max_range = 3.0;
126 range_msg.radiation_type = sensor_msgs::Range::ULTRASOUND;
128 range_msg.field_of_view = 0.7f;
132 sensor_msgs::Imu imu_msg;
137 imu_msg.orientation.x = orientation_q.x();
138 imu_msg.orientation.y = orientation_q.y();
139 imu_msg.orientation.z = orientation_q.z();
140 imu_msg.orientation.w = orientation_q.w();
153 sensor_msgs::NavSatFix gps_msg;
154 sensor_msgs::NavSatStatus gps_status;
155 gps_status.status = sensor_msgs::NavSatStatus::STATUS_SBAS_FIX;
156 gps_status.status = sensor_msgs::NavSatStatus::SERVICE_GPS;
158 gps_msg.latitude = sensors.
gps.
lat;
159 gps_msg.longitude = sensors.
gps.
lon;
160 gps_msg.status = gps_status;
static tf::Quaternion createQuaternionFromRPY(double roll, double pitch, double yaw)
ros::Publisher espeak_pub_
#define RIC_WRITE_INTERVAL
void publish(const boost::shared_ptr< M > &message) const
std::vector< hardware_interface::JointStateHandle > joint_state_handles_
ric_interface::RicInterface ric_
void setDeltaTime(float input)
#define TORSO_JOINT_PARAM
protocol::ultrasonic ultrasonic
void connect(std::string port)
ros::Publisher ric_imu_pub_
void pubTimerCB(const ros::TimerEvent &event)
void setCutOffFrequency(float input)
RicboardPub(ros::NodeHandle &nh)
void read(const ros::Duration elapsed)
ROSCPP_DECL bool get(const std::string &key, std::string &s)
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
std::vector< hardware_interface::JointHandle > pos_handles_
ros::Timer ric_dead_timer_
protocol::emergency_alarm emrgcy_alarm
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void write(const ros::Duration elapsed)
void registerHandle(const JointStateHandle &handle)
JointStateHandle getHandle(const std::string &name)
ros::Timer ric_pub_timer_
float update(float input)
ROSCPP_DECL void shutdown()
void writeCmd(const protocol::actuator &actu_pkg, size_t size, protocol::Type type)
ros::Publisher ric_ultrasonic_pub_
void speakMsg(std::string msg, int sleep_time)
int ric_disconnections_counter_
sensors_state getSensorsState()
void ricDeadTimerCB(const ros::TimerEvent &event)
void registerHandles(hardware_interface::JointStateInterface &joint_state_interface, hardware_interface::EffortJointInterface &position_interface)
ros::Publisher ric_gps_pub_
#define MAX_RIC_DISCONNECTIONS