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

AMCL_pose for ros3D #88

Open
C-Boucher opened this issue Sep 27, 2021 · 0 comments
Open

AMCL_pose for ros3D #88

C-Boucher opened this issue Sep 27, 2021 · 0 comments

Comments

@C-Boucher
Copy link

C-Boucher commented Sep 27, 2021

Is there a way to use directly the pose from AMCL (PoseWithCovarianceStamped) in the ros3d.Pose() widget? Right now I have to create another publisher to publish a PoseStamped message using this code :

pose_msg = Pose()
def amcl_callback(msg):
    global pose_msg
    pose_msg = msg.pose.pose
    pose = PoseStamped()

    pose.header.seq = 1
    pose.header.stamp = rospy.Time.now()
    pose.header.frame_id = "map"

    pose.pose.position.x = pose_msg.position.x
    pose.pose.position.y = pose_msg.position.y
    pose.pose.position.z = 0.0

    pose.pose.orientation.x = pose_msg.orientation.x
    pose.pose.orientation.y = pose_msg.orientation.y
    pose.pose.orientation.z = pose_msg.orientation.z
    pose.pose.orientation.w = pose_msg.orientation.w

    pose_pub.publish(pose)
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

1 participant