36 #include <nav_msgs/Odometry.h>
37 #include <geometry_msgs/Twist.h>
38 #include <tf/transform_broadcaster.h>
39 #include <p2os_msgs/BatteryState.h>
40 #include <p2os_msgs/MotorState.h>
41 #include <p2os_msgs/GripperState.h>
42 #include <p2os_msgs/SonarArray.h>
43 #include <p2os_msgs/DIO.h>
44 #include <p2os_msgs/AIO.h>
46 #include <diagnostic_updater/publisher.h>
47 #include <diagnostic_updater/diagnostic_updater.h>
59 p2os_msgs::BatteryState
batt;
122 void cmdvel_cb(
const geometry_msgs::TwistConstPtr &);
132 void check_voltage( diagnostic_updater::DiagnosticStatusWrapper &stat );
133 void check_stall( diagnostic_updater::DiagnosticStatusWrapper &stat );
143 diagnostic_updater::DiagnosedPublisher<p2os_msgs::BatteryState>
batt_pub_;
std::string psos_tcp_host
double TicksToDegrees(int joint, unsigned char ticks)
Convert ticks to degrees.
short motor_max_trans_decel
Minimum translational acceleration in Meters per second per second.
diagnostic_updater::Updater diagnostic_
int motor_max_speed
Maximum motor speed in Meters per second.
struct ros_p2os_data ros_p2os_data_t
Container struct.
void ToggleMotorPower(unsigned char val)
Toggle motors on/off.
ros::Publisher mstate_pub_
int SendReceive(P2OSPacket *pkt, bool publish_data=true)
p2os_msgs::MotorState cmdmotor_state_
Motor state publisher.
p2os_msgs::SonarArray sonar
Container for sonar data.
double RadsPerSectoSecsPerTick(int joint, double speed)
Convert radians per second to radians per encoder tick.
bool use_sonar_
Use the sonar array?
unsigned char RadiansToTicks(int joint, double rads)
Convert radians to ticks.
p2os_msgs::AIO aio
Analog In/Out.
ros::NodeHandle n
Node Handler used for publication of data.
void check_voltage(diagnostic_updater::DiagnosticStatusWrapper &stat)
std::string psos_serial_port
int joystick
Use Joystick?
void gripperCallback(const p2os_msgs::GripperStateConstPtr &msg)
p2os_msgs::GripperState gripper
Provides the state of the gripper.
geometry_msgs::TransformStamped odom_trans
Transformed odometry frame.
ros::Publisher sonar_pub_
void check_and_set_gripper_state()
tf::TransformBroadcaster odom_broadcaster
diagnostic_updater::DiagnosedPublisher< p2os_msgs::BatteryState > batt_pub_
int bumpstall
Stall I hit a wall?
short motor_max_rot_accel
Maximum rotational acceleration in radians per second per second.
p2os_msgs::GripperState gripper_state_
Gripper state publisher.
ros::Publisher grip_state_pub_
int Setup()
Setup the robot for use. Communicates with the robot directly.
P2OSNode(ros::NodeHandle n)
P2OS robot driver node.
ros::Subscriber ptz_cmd_sub_
void cmdmotor_state(const p2os_msgs::MotorStateConstPtr &)
ros::Subscriber cmdvel_sub_
p2os_msgs::BatteryState batt
Provides the battery voltage.
int motor_max_turnspeed
Maximum turn speed in radians per second.
int Shutdown()
Prepare for shutdown.
double lastPulseTime
Last time the node received or sent a pulse.
ros::Subscriber gripper_sub_
ros::Subscriber cmdmstate_sub_
void StandardSIPPutData(ros::Time ts)
void ToggleSonarPower(unsigned char val)
ros::NodeHandle nh_private
Node Handler used for private data publication.
short motor_max_trans_accel
Maximum translational acceleration in Meters per second per second.
double TicksToRadians(int joint, unsigned char ticks)
Convert ticks to radians.
short motor_max_rot_decel
Minimum rotational acceleration in Meters per second per second.
ros_p2os_data_t p2os_data
sensor data container
geometry_msgs::Twist cmdvel_
Command Velocity subscriber.
p2os_msgs::MotorState motors
Provides the state of the motors (enabled or disabled)
double SecsPerTicktoRadsPerSec(int joint, double secs)
Convert Seconds per encoder tick to radians per second.
unsigned char DegreesToTicks(int joint, double degrees)
convert degrees to ticks
void check_and_set_motor_state()
void cmdvel_cb(const geometry_msgs::TwistConstPtr &)
ros::Publisher ptz_state_pub_
nav_msgs::Odometry position
Provides the position of the robot.
int direct_wheel_vel_control
Control wheel velocities individually?
void check_stall(diagnostic_updater::DiagnosticStatusWrapper &stat)
p2os_msgs::DIO dio
Digital In/Out.