Skip to content

Commit 842ce16

Browse files
committed
Merge branch 'humble-devel' of https://github.com/CoreSenseEU/CoreSense4Home into humble-devel
2 parents 7787bd5 + 2308209 commit 842ce16

File tree

10 files changed

+46
-17
lines changed

10 files changed

+46
-17
lines changed

bt_nodes/arm/src/manipulation/point_at.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ void PointAt::on_tick()
6363
// goal_.pose.pose.position.z = 0.5;
6464
// goal_.pose.pose.orientation = transform_.transform.rotation;
6565
auto angle = std::atan2(transform_.transform.translation.y, transform_.transform.translation.x);
66-
auto pitch = std::atan2(transform_.transform.translation.z, transform_.transform.translation.x);
67-
double desired_radius = 0.9; //0.5
66+
double desired_radius = 0.7; //0.5
6867
auto x_point = desired_radius * std::cos(angle);
6968
auto y_point = desired_radius * std::sin(angle);
7069
goal_.pose.pose.position.x = (std::isnan(x_point) || std::isinf(x_point)) ? 0.0 : (x_point);

bt_nodes/motion/include/motion/head/Pan.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,15 @@ class Pan : public BT::ActionNodeBase
4242
{
4343
BT::InputPort<double>("range"), // in degrees
4444
BT::InputPort<double>("period"), // in seconds
45-
BT::InputPort<double>("pitch_angle") // in degrees
45+
BT::InputPort<double>("pitch_angle"), // in degrees
46+
BT::InputPort<double>("max_vel_yaw") // in rad/s (optional)
4647
});
4748
}
4849

4950
private:
50-
// std::shared_ptr<rclcpp_cascade_lifecycle::CascadeLifecycleNode> node_;
5151
std::shared_ptr<rclcpp_cascade_lifecycle::CascadeLifecycleNode> node_;
5252
rclcpp::Time start_time_;
53-
rclcpp_lifecycle::LifecyclePublisher<trajectory_msgs::msg::JointTrajectory>::SharedPtr
54-
joint_cmd_pub_;
53+
rclcpp_lifecycle::LifecyclePublisher<trajectory_msgs::msg::JointTrajectory>::SharedPtr joint_cmd_pub_;
5554
double yaw_limit_{1.3};
5655
double pitch_limit_{0.92};
5756
double pitch_{0.0};
@@ -64,8 +63,9 @@ class Pan : public BT::ActionNodeBase
6463
double phase_;
6564
double phase_offset_{0.0};
6665
double initial_yaw_{0.0};
67-
6866
int current_position_{0};
67+
double max_vel_yaw_{1.0}; // rad/s, default value
68+
rclcpp::Time last_tick_time_;
6969

7070
double get_joint_yaw(double period, double range, double time, double phase);
7171
};

bt_nodes/motion/src/motion/head/Pan.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ double Pan::get_joint_yaw(double period, double range, double time, double phase
8181
BT::NodeStatus Pan::tick()
8282
{
8383
rclcpp::spin_some(node_->get_node_base_interface());
84-
bool is_first_tick = false;
84+
// bool is_first_tick = false;
8585

8686
if (status() == BT::NodeStatus::IDLE) {
8787
// node_->remove_activation("attention_server");
8888
start_time_ = node_->now();
8989
initial_yaw_ = phase_; // Store the actual starting position
90-
is_first_tick = true;
90+
// is_first_tick = true;
9191

9292
// Calculate phase so the sine wave starts exactly at the current position
9393
// The sine wave equation is: yaw = range * sin(2π/period * t + phase)
@@ -128,8 +128,9 @@ BT::NodeStatus Pan::tick()
128128
command_msg.points[0].positions[1] = std::clamp(pitch_angle_, -pitch_limit_, pitch_limit_);
129129
command_msg.points[0].velocities[0] = 0.0;
130130
command_msg.points[0].velocities[1] = 0.0;
131-
// Use 1.0 second for first command to smoothly transition, then 0.1 for rest
132-
command_msg.points[0].time_from_start = rclcpp::Duration::from_seconds(is_first_tick ? 1.0 : 0.1);
131+
double yaw_diff = std::abs(yaw - phase_);
132+
double time_to_reach = yaw_diff / 1.5; // 1.5 is max velocity
133+
command_msg.points[0].time_from_start = rclcpp::Duration::from_seconds(time_to_reach);
133134
joint_cmd_pub_->publish(command_msg);
134135
rclcpp::spin_some(node_->get_node_base_interface());
135136

robocup_bringup/config/real_time_params.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ attention_server:
66
ros__parameters:
77
period: 0.05
88
max_yaw: 1.3
9-
max_pitch: 0.3 #0.185
10-
max_vel_yaw: 0.01
11-
max_vel_pitch: 0.01
12-
9+
max_pitch: 0.3
10+
max_vel_yaw: 1.75
11+
max_vel_pitch: 1.75
12+
rotation_threshold: 0.436332 # 25 degrees
13+
1314
perception_people_detection:
1415
ros__parameters:
1516
target_frame: base_footprint

robocup_bringup/launch/dialog.launch.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ def generate_launch_description():
3434
model_repo = LaunchConfiguration('model_repo')
3535
model_filename = LaunchConfiguration('model_filename')
3636

37+
declare_model_repo_cmd = DeclareLaunchArgument(
38+
'model_repo', default_value='ggerganov/whisper.cpp',
39+
description='Hugging Face model repo')
40+
41+
declare_model_filename_cmd = DeclareLaunchArgument(
42+
'model_filename', default_value='ggml-large-v3-q5_0.bin',
43+
description='Hugging Face model filename')
44+
3745
# Actions
3846
llama_cmd = create_llama_launch(
3947
n_ctx=2048,
@@ -111,7 +119,8 @@ def generate_launch_description():
111119
)
112120

113121
ld = LaunchDescription()
114-
122+
ld.add_action(declare_model_repo_cmd)
123+
ld.add_action(declare_model_filename_cmd)
115124
ld.add_action(whisper_cmd)
116125
ld.add_action(llava_cmd)
117126
ld.add_action(audio_common_tts_node)
41.9 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
image: maps_experiments.pgm
2+
mode: trinary
3+
resolution: 0.05
4+
origin: [-6.97, -13.2, 0]
5+
negate: 0
6+
occupied_thresh: 0.65
7+
free_thresh: 0.25

robocup_bringup/maps/new_lab.pgm

Lines changed: 5 additions & 0 deletions
Large diffs are not rendered by default.

robocup_bringup/maps/new_lab.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
image: new_lab.pgm
2+
mode: trinary
3+
resolution: 0.05
4+
origin: [-4.11, -9.06, 0]
5+
negate: 0
6+
occupied_thresh: 0.65
7+
free_thresh: 0.25

robocup_bringup/thirdparty.repos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ repositories:
6161
version: main
6262
systems/attention_system:
6363
type: git
64-
url: https://github.com/aaggj/attention_system
64+
url: https://github.com/juandpenan/attention_system
6565
version: humble
6666
systems/navigation_system:
6767
type: git

0 commit comments

Comments
 (0)