Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Cleanup motion #414

Merged
merged 77 commits into from
Nov 14, 2023
Merged

Cleanup motion #414

merged 77 commits into from
Nov 14, 2023

Conversation

Flova
Copy link
Member

@Flova Flova commented Aug 11, 2023

Proposed changes

  • Remove unused files and scripts
  • Use ros2 numpy
  • Move head mover to motion
  • Add typing to python code
  • Restructure HCM dsd files
  • Move state changes out of HCM descisions

Related prs

bit-bots/bitbots_behavior#334
#414
bit-bots/bitbots_navigation#201
bit-bots/bitbots_lowlevel#136
bit-bots/bitbots_misc#237
bit-bots/udp_bridge#26
bit-bots/humanoid_league_misc#139
bit-bots/wolfgang_robot#280
bit-bots/bitbots_msgs#28

@jaagut jaagut marked this pull request as draft September 14, 2023 17:16
@jaagut jaagut self-requested a review November 2, 2023 15:27
Copy link
Member

@jaagut jaagut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Finally, finished all files!

Comment on lines 156 to +177
def send_animation_request(self):
self.anim_msg.request = True
self.anim_msg.header.stamp = self.get_clock().now().to_msg()
self.hcm_publisher.publish(self.anim_msg)

def send_animation(self, first, last, hcm, pose, torque):
self.anim_msg.request = False
self.anim_msg.first = first
self.anim_msg.last = last
self.anim_msg.hcm = hcm
if pose is not None:
self.traj_msg.joint_names = []
self.traj_msg.points = [JointTrajectoryPoint()]
anim_msg = AnimationMsg()
anim_msg.request = True
anim_msg.header.stamp = self.get_clock().now().to_msg()
self.hcm_publisher.publish(anim_msg)

def send_animation(self, first: bool, last: bool, hcm: bool, pose: dict, torque: dict):
"""Sends an animation to the hcm"""
anim_msg = AnimationMsg()
anim_msg.request = False
anim_msg.first = first
anim_msg.last = last
anim_msg.hcm = hcm
if pose is not None:#
traj_msg = JointTrajectory()
traj_msg.joint_names = []
traj_msg.points = [JointTrajectoryPoint()]
# We are only using a single point in the trajectory message, since we only want to send a single joint goal
self.traj_msg.points[0].positions = []
self.traj_msg.points[0].effort = []
traj_msg.points[0].positions = []
traj_msg.points[0].effort = []
for joint in pose:
self.traj_msg.joint_names.append(joint)
self.traj_msg.points[0].positions.append(pose[joint])
traj_msg.joint_names.append(joint)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think, it is weired how HCM and animation server are intertwined... @Flova do you remember our alternative approach discussed in the TAMS lab? Could you please open an issue for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what you mean.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @jaagut

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember the solution approach. But the thing I was referring to is the (old) quirk of the HCM flag in the PlayAnimation call and the animation server handling it different depending on the flag.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember this. Be we talked about having the head safe states as part of the head mover, so it could select an optimal orientation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not yet, please open an issue.

bitbots_hcm/src/hcm.cpp Show resolved Hide resolved
bitbots_hcm/bitbots_hcm/hcm_dsd/hcm_blackboard.py Outdated Show resolved Hide resolved
bitbots_hcm/bitbots_hcm/hcm_dsd/hcm_blackboard.py Outdated Show resolved Hide resolved
bitbots_hcm/bitbots_hcm/humanoid_control_module.py Outdated Show resolved Hide resolved
@Flova Flova merged commit 0f3f18b into master Nov 14, 2023
@Flova Flova deleted the cleanup_motion branch November 14, 2023 18:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants