def run(self): rate = rospy.Rate(100) while not rospy.is_shutdown(): vel = PoseVelocity() vel.twist_linear_x = self.x vel.twist_linear_y = self.y vel.twist_linear_z = self.z vel.twist_angular_x = 0.0 vel.twist_angular_y = 0.0 vel.twist_angular_z = 0.0 self.pub.publish(vel) rate.sleep()
def publishArmLinControl(self): pose_vel_msg = PoseVelocity() pose_vel_msg.twist_linear_x = self.joy.axes[ 1] * self.v_lin_gain # Up/Down Axis stick left pose_vel_msg.twist_linear_y = self.joy.axes[ 0] * self.v_lin_gain # Left/Right Axis stick left pose_vel_msg.twist_linear_z = self.joy.axes[ 3] * self.v_lin_gain # Up/Down Axis stick right pose_vel_msg.twist_angular_x = 0 pose_vel_msg.twist_angular_y = 0 pose_vel_msg.twist_angular_z = 0 self.pub_pose_vel_cmd.publish(pose_vel_msg)
def publishArmAngControl(self): pose_vel_msg = PoseVelocity() pose_vel_msg.twist_linear_x = 0 pose_vel_msg.twist_linear_y = 0 pose_vel_msg.twist_linear_z = 0 pose_vel_msg.twist_angular_x = self.joy.axes[ 1] * self.w_ang_gain # Up/Down Axis stick left if self.joy.buttons[1] == 0: # if lip is not pressed pose_vel_msg.twist_angular_y = self.joy.axes[ 0] * self.w_ang_gain # Left/Right Axis stick left elif self.joy.buttons[1] == 1: # if lip is pressed pose_vel_msg.twist_angular_z = self.joy.axes[ 0] * -self.w_ang_gain # Left/Right Axis stick right self.pub_pose_vel_cmd.publish(pose_vel_msg)
def publishArmLinControl(self): pose_vel_msg = PoseVelocity() pose_vel_msg.twist_linear_x = self.joy.axes[ 1] * self.v_lin_gain # Left\Right if self.joy.buttons[1] == 0: # if lip is not pressed pose_vel_msg.twist_linear_y = self.joy.axes[ 0] * self.v_lin_gain # Forward\Backward elif self.joy.buttons[1] == 1: # if lip is pressed pose_vel_msg.twist_linear_z = self.joy.axes[ 0] * self.v_lin_gain # Up/Down Axis stick right pose_vel_msg.twist_angular_x = 0 pose_vel_msg.twist_angular_y = 0 pose_vel_msg.twist_angular_z = 0 self.pub_pose_vel_cmd.publish(pose_vel_msg)