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

Add Animation Record UI #341

Merged
merged 54 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
34f79cd
Add ROS 1 version of record ui
Flova Feb 7, 2024
d4dea5b
Fix loading of ui components
Flova Feb 7, 2024
b39c52a
Fix formatting
Flova Feb 7, 2024
a3ed894
Remove docs
Flova Feb 7, 2024
0162494
fix key event
Flova Feb 7, 2024
eb5cfab
Use more snake case
Flova Feb 7, 2024
16be57a
current state
Flova Feb 11, 2024
bbdaae7
Add torque boxes
Flova Feb 11, 2024
f78aefd
Remove mode selector
Flova Feb 11, 2024
30f3c0d
Further cleanup record ui
Flova Feb 11, 2024
62a9022
Add on the fly animation server updates
Flova Feb 12, 2024
631c5e6
Cleanup recorder
Flova Feb 12, 2024
19aa23c
Minor fixes to get a launching state again
Flova Feb 12, 2024
f184d2a
WIP
Flova Feb 13, 2024
d309a8d
Add new word
Flova Feb 13, 2024
f8ff935
Fixes and explicit HCM integration
Flova Feb 13, 2024
1762559
Kind of working version
Flova Feb 13, 2024
221d0c8
Remove debug prints
Flova Feb 13, 2024
2ade52e
Fix new animation button
Flova Feb 13, 2024
d1ccc45
add standard services name to dictionary
Flova Feb 13, 2024
08f9b8f
Rename gamestate message
Flova Feb 13, 2024
dae0cbd
Use PyQt5 instead of ros specific Qt Wrapper
Flova Feb 13, 2024
d37bbea
Add utility functions for dicts
Flova Feb 16, 2024
4264337
Rename window
Flova Feb 16, 2024
b5b947b
Sort motors according to hierarchy and move torque switch
Flova Feb 16, 2024
acfe334
Add bind robot script
Flova Feb 16, 2024
7cc8d96
Rework animation handling
Flova Feb 16, 2024
79ac19e
Merge branch 'main' into record_ui
Flova Mar 12, 2024
1d8501e
Fix animation time check
Flova Mar 12, 2024
329b8c1
Better torque controls
Flova Mar 12, 2024
8093827
Use fixed animation name
Flova Mar 12, 2024
43d6306
Fixes for animation creation
Flova Mar 12, 2024
8b7397d
Merge remote-tracking branch 'origin/main' into record_ui
Flova Mar 13, 2024
6c860c9
Fix misuse of exit()
Flova Mar 13, 2024
d5853ce
Fix animation stuff and head mover
Flova Mar 13, 2024
23abde3
Merge branch 'main' into record_ui
Flova Mar 15, 2024
3e5d5d3
Update bitbots_msgs/action/PlayAnimation.action
Flova Mar 15, 2024
1eb4392
Update bitbots_msgs/msg/Animation.msg
Flova Mar 15, 2024
2837f03
Update bitbots_motion/bitbots_head_mover/src/move_head.cpp
Flova Mar 15, 2024
7c60454
Update bitbots_motion/bitbots_animation_server/bitbots_animation_serv…
Flova Mar 15, 2024
68fac21
Dont use humanoid league msgs
Flova Mar 15, 2024
c6d73b9
Merge branch 'main' into record_ui
Flova Mar 15, 2024
6b97905
Rename teaching service
Flova Mar 17, 2024
b595123
Remove teching service from blackboard
Flova Mar 17, 2024
84896cb
Fix animation timestamping
Flova Mar 17, 2024
0a92751
Fix wait from motor startup
Flova Mar 17, 2024
81a18c9
Fix last_* by hcm and make animation descision more forgiving during …
Flova Mar 17, 2024
69c8721
Fix wrong print in deploy tool
Flova Mar 17, 2024
5c657ec
Fix deploy tool dying when build fails
Flova Mar 17, 2024
f542458
Fix head mover deth if no joint states are present
Flova Mar 17, 2024
6ca28de
Update bitbots_msgs/msg/Animation.msg
Flova Mar 17, 2024
930937d
Add walkready btn and fix seg fault
Flova Mar 17, 2024
79819ae
Fix teaching mode
Flova Mar 17, 2024
b2f9a18
Merge branch 'record_ui' of github.com:bit-bots/bitbots_main into rec…
Flova Mar 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"autoDocstring.startOnNewLine": true,
"cSpell.language": "en,de-de,lorem",
"cSpell.words": [
"animatable",
"ansible",
"autoconnect",
"basler",
Expand Down Expand Up @@ -87,6 +88,7 @@
"seaborn",
"segmentations",
"ssid",
"std_srvs",
"taskset",
"teamplayer",
"teleop",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,32 +101,32 @@ def get_team_id(self):
def get_red_cards(self):
return self.gamestate.team_mates_with_red_card

def gamestate_callback(self, gs: GameState):
if self.gamestate.penalized and not gs.penalized:
def gamestate_callback(self, gamestate_msg: GameState):
if self.gamestate.penalized and not gamestate_msg.penalized:
self.unpenalized_time = self.node.get_clock().now().nanoseconds / 1e9

if gs.own_score > self.gamestate.own_score:
if gamestate_msg.own_score > self.gamestate.own_score:
self.last_goal_from_us_time = self.node.get_clock().now().nanoseconds / 1e9
self.last_goal_time = self.node.get_clock().now().nanoseconds / 1e9

if gs.rival_score > self.gamestate.rival_score:
if gamestate_msg.rival_score > self.gamestate.rival_score:
self.last_goal_time = self.node.get_clock().now().nanoseconds / 1e9

if (
gs.secondary_state_mode == 2
gamestate_msg.secondary_state_mode == 2
and self.gamestate.secondary_state_mode != 2
and gs.game_state == GameState.GAMESTATE_PLAYING
and gamestate_msg.game_state == GameState.GAMESTATE_PLAYING
):
# secondary action is now executed but we will not see this in the new messages.
# it will look like a normal kick off, but we need to remember that this is some sort of free kick
# we set the kickoff value accordingly, then we will not be allowed to move if it is a kick for the others
self.free_kick_kickoff_team = gs.secondary_state_team
self.free_kick_kickoff_team = gamestate_msg.secondary_state_team

if gs.secondary_state_mode != 2 and gs.secondary_seconds_remaining == 0:
if gamestate_msg.secondary_state_mode != 2 and gamestate_msg.secondary_seconds_remaining == 0:
self.free_kick_kickoff_team = None

if self.free_kick_kickoff_team is not None:
gs.has_kick_off = self.free_kick_kickoff_team == self.team_id
gamestate_msg.has_kick_off = self.free_kick_kickoff_team == self.team_id

self.last_update = self.node.get_clock().now().nanoseconds / 1e9
self.gamestate = gs
self.gamestate = gamestate_msg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, blackboard, dsd, parameters):
self.mode = parameters.get("mode", None)
if self.mode is None or self.mode not in ("striker", "supporter", "others"):
self.blackboard.node.get_logger().error("mode for corner kick not specified")
exit()
raise ValueError("mode for corner kick not specified")

def perform(self, reevaluate=False):
# The defense position should be a position between the ball and the own goal.
Expand Down
25 changes: 17 additions & 8 deletions bitbots_behavior/bitbots_body_behavior/launch/behavior.launch
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
<launch>
<arg name="dsd_file" default="main.dsd" />
<arg name="tf_prefix" default=""/>
<arg name="sim" default="false" />
<arg name="dsd_file" default="main.dsd" description="The behavior dsd file that should be used" />

<include file="$(find-pkg-share bitbots_body_behavior)/launch/body_behavior.launch">
<arg name="dsd_file" value="$(var dsd_file)" />
<arg name="sim" value="$(var sim)" />
</include>
<let if="$(env IS_ROBOT false)" name="taskset" value="taskset -c 2"/>
<let unless="$(env IS_ROBOT false)" name="taskset" value=""/>

<include file="$(find-pkg-share bitbots_head_mover)/launch/head_mover.launch">
<arg name="sim" value="$(var sim)" />
</include>
<node pkg="bitbots_body_behavior" exec="body_behavior" output="screen" launch-prefix="$(var taskset)">
<param name="dsd_file" value="$(var dsd_file)"/>
<param name="actionlib_client_sub_queue_size" value="-1"/>
<param name="actionlib_client_sub_queue_size" value="-1"/>
<param name="actionlib_server_sub_queue_size" value="-1"/>
<param from="$(find-pkg-share bitbots_body_behavior)/config/body_behavior.yaml"/>
<param from="$(find-pkg-share bitbots_body_behavior)/config/animations.yaml"/>
<param name="odom_frame" value="$(var tf_prefix)odom"/>
<param name="map_frame" value="$(var tf_prefix)map"/>
<param name="ball_frame" value="$(var tf_prefix)ball"/>
<param name="base_footprint_frame" value="$(var tf_prefix)base_footprint"/>
<param name="use_sim_time" value="$(var sim)" />
</node>
</launch>
22 changes: 0 additions & 22 deletions bitbots_behavior/bitbots_body_behavior/launch/body_behavior.launch

This file was deleted.

2 changes: 1 addition & 1 deletion bitbots_lowlevel/bitbots_buttons/src/button_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ButtonNode : public rclcpp::Node {
RCLCPP_INFO(this->get_logger(), "service switch_power not available, waiting again...");
}

teaching_mode_client_ = this->create_client<bitbots_msgs::srv::SetTeachingMode>("set_teaching_mode");
teaching_mode_client_ = this->create_client<bitbots_msgs::srv::SetTeachingMode>("teaching_mode");
buttons_sub_ = this->create_subscription<bitbots_msgs::msg::Buttons>(
"/buttons", 1, std::bind(&bitbots_buttons::ButtonNode::buttonCb, this, _1));
gamestate_sub_ = this->create_subscription<game_controller_hl_interfaces::msg::GameState>(
Expand Down
5 changes: 5 additions & 0 deletions bitbots_misc/bitbots_bringup/launch/motion.launch
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<arg name="sim" value="$(var sim)"/>
</include>

<!-- launch the head mover -->
<include file="$(find-pkg-share bitbots_head_mover)/launch/head_mover.launch">
<arg name="sim" value="$(var sim)" />
</include>

<!-- launch the walking -->
<group if="$(var walking)">
<include file="$(find-pkg-share bitbots_quintic_walk)/launch/quintic_walk.launch">
Expand Down
Empty file.
Loading
Loading