Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing reference frame in Cartesian trajectories #173

Closed
pouyan-asg opened this issue Jun 1, 2023 · 1 comment
Closed

Changing reference frame in Cartesian trajectories #173

pouyan-asg opened this issue Jun 1, 2023 · 1 comment

Comments

@pouyan-asg
Copy link

Description

I send Cartesian waypoint trajectories to Gen3 robot. By default (based on api_python example "02-send_cartesian_waypoint_trajectory") the reference frame is BASE. See below code:

 def cartesian_pose(waypointInformation):
            waypoint = Base_pb2.CartesianWaypoint()  
            waypoint.maximum_linear_velocity = 0.5
            waypoint.maximum_angular_velocity = 99
            waypoint.reference_frame = Base_pb2.CARTESIAN_REFERENCE_FRAME_BASE
            waypoint.pose.x = waypointInformation[0]
            waypoint.pose.y = waypointInformation[1]
            waypoint.pose.z = waypointInformation[2]
            waypoint.blending_radius = waypointInformation[3]
            waypoint.pose.theta_x = waypointInformation[4]
            waypoint.pose.theta_y = waypointInformation[5]
            waypoint.pose.theta_z = waypointInformation[6]
            return waypoint

I need to change reference frame to CARTESIAN_REFERENCE_FRAME_MIXED. However, I see this error when I change waypoint.reference_frame = Base_pb2.CARTESIAN_REFERENCE_FRAME_BASE with waypoint.reference_frame = Base_pb2.CARTESIAN_REFERENCE_FRAME_MIXED. The error is shown below:

Error found in Stroke trajectory
trajectory_error_elements {
  error_type: TRAJECTORY_ERROR_TYPE_INVALID_REFERENCE_FRAME
  min_value: 1.0
  max_value: 2.0
  message: "Requested reference frame is not supported"
  waypoint_index: 1
}

My question is, do you know how can I change reference frame to Mixed one? I should mention that I added below code in my Main file but it does not work.

with utilities.DeviceConnection.createTcpConnection(args) as router:
      base = BaseClient(router)
      vari = ControlConfigClient(router)
      ref_f = CartesianReferenceFrameInfo()
      ref_f.reference_frame = 1
      vari.SetCartesianReferenceFrame(ref_f)

Thanks for time and consideration

regards,
Pouyan

@felixmaisonneuve
Copy link
Contributor

Hi @pouyan-asg,

I have looked into this issue, I found that the first CartesianWaypoint needs to be in a Base Reference Frame. Following waypoints can be in Mixed Reference Frame.

According to the documentation, using SetCartesianReferenceFrame will only work for twist and wrench commands

Defines the reference frame to use with twist and wrench commands

Best,
Felix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants