Skip to content

Commit

Permalink
feat: updating submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro-Roque committed May 9, 2024
1 parent 8149503 commit 041a3dd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 50 deletions.
48 changes: 0 additions & 48 deletions simulation/scripts/spawn_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ def __init__(self, args):
)
parser.add_argument("-pose", nargs="+", type=str, help="initial pose as a list")

# TODO(shivesh): Wait for /set_model_configuration
# (https://github.com/ros-simulation/gazebo_ros_pkgs/issues/779)
# parser.add_argument('-J', dest='joints', default=[], action='append',
# metavar=('JOINT_NAME', 'JOINT_POSITION'), type=str, nargs=2,
# help='initialize the specified joint at the specified position')

parser.add_argument(
"-package_to_model",
action="store_true",
Expand All @@ -173,12 +167,6 @@ def __init__(self, args):
)
self.args = parser.parse_args(args[1:])

# TODO(shivesh): Wait for /set_model_configuration
# (https://github.com/ros-simulation/gazebo_ros_pkgs/issues/779)
# Convert position of joints to floats
# for i in range(len(self.args.joints)):
# self.args.joints[i][1] = float(self.args.joints[i][1])

def run(self):
"""
Run node, spawning entity and doing other actions as configured in program arguments.
Expand Down Expand Up @@ -291,7 +279,6 @@ def entity_xml_cb(msg):
# Form requested Pose from arguments
initial_pose = Pose()
if hasattr(self.args, "pose"):
print(self.args.pose)
pose = self.args.pose[0].split(" ")

initial_pose.position.x = float(pose[0])
Expand Down Expand Up @@ -321,17 +308,6 @@ def entity_xml_cb(msg):
self.get_logger().error("Spawn service failed. Exiting.")
return 1

# TODO(shivesh): Wait for /set_model_configuration
# (https://github.com/ros-simulation/gazebo_ros_pkgs/issues/779)
# Apply joint positions if any specified
# if len(self.args.joints) != 0:
# joint_names = [joint[0] for joint in self.args.joints]
# joint_positions = [joint[1] for joint in self.args.joints]
# success = _set_model_configuration(joint_names, joint_positions)
# if not success:
# self.get_logger().error('SetModelConfiguration service failed. Exiting.')
# return 1

# Unpause physics if user requested
if self.args.unpause:
client = self.create_client(
Expand Down Expand Up @@ -426,30 +402,6 @@ def _delete_entity(self):
+ "Was Gazebo started with GazeboRosFactory?"
)

# def _set_model_configuration(self, joint_names, joint_positions):
# self.get_logger().info(
# 'Waiting for service %s/set_model_configuration' % self.args.gazebo_namespace)
# client = self.create_client(SetModelConfiguration, 'set_model_configuration')
# if client.wait_for_service(timeout_sec=5.0):
# req = SetModelConfiguration.Request()
# req.model_name = self.args.entity
# req.urdf_param_name = ''
# req.joint_names = joint_names
# req.joint_positions = joint_positions
# self.get_logger().info(
# 'Calling service %s/set_model_configuration' % self.args.gazebo_namespace)
# srv_call = client.call_async(req)
# while rclpy.ok():
# if srv_call.done():
# self.get_logger().info(
# 'Set model configuration status: %s' % srv_call.result().status_message)
# break
# rclpy.spin_once(self)
# return srv_call.result().success
# self.get_logger().error('Service %s/set_model_configuration unavailable. \
# Was Gazebo started with GazeboRosState?')
# return False


def quaternion_from_euler(roll, pitch, yaw):
cy = math.cos(yaw * 0.5)
Expand Down
2 changes: 1 addition & 1 deletion submodules/px4

0 comments on commit 041a3dd

Please sign in to comment.