Browse Source

Create robot object before changing mode

pull/21/head
hello-binit 3 years ago
parent
commit
f8e97ef1b1
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      stretch_core/nodes/stretch_driver

+ 3
- 6
stretch_core/nodes/stretch_driver View File

@ -491,6 +491,9 @@ class StretchBodyNode:
rospy.loginfo("{0} started".format(self.node_name)) rospy.loginfo("{0} started".format(self.node_name))
self.robot = rb.Robot()
self.robot.startup()
mode = rospy.get_param('~mode', "position") mode = rospy.get_param('~mode', "position")
rospy.loginfo('mode = ' + str(mode)) rospy.loginfo('mode = ' + str(mode))
if mode == "position": if mode == "position":
@ -574,12 +577,6 @@ class StretchBodyNode:
self.odom_frame_id = 'odom' self.odom_frame_id = 'odom'
rospy.loginfo("{0} odom_frame_id = {1}".format(self.node_name, self.odom_frame_id)) rospy.loginfo("{0} odom_frame_id = {1}".format(self.node_name, self.odom_frame_id))
self.robot = rb.Robot()
self.robot.startup()
# TODO: check with the actuators to see if calibration is required
#self.calibrate()
self.joint_state_pub = rospy.Publisher('joint_states', JointState, queue_size=1) self.joint_state_pub = rospy.Publisher('joint_states', JointState, queue_size=1)
command_base_velocity_and_publish_joint_state_rate = rospy.Rate(self.joint_state_rate) command_base_velocity_and_publish_joint_state_rate = rospy.Rate(self.joint_state_rate)

Loading…
Cancel
Save