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

Doubled wall spacing #2285

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions launch/soccer.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ def generate_launch_description():
parameters=[param_config_filepath],
on_exit=Shutdown(),
),
Node(
condition=IfCondition(PythonExpression([run_sim])),
package="rj_robocup",
executable="soccer_mom_node",
output="screen",
parameters=[param_config_filepath],
on_exit=Shutdown(),
),
Node(
package="rj_robocup",
executable="planner_node",
Expand Down
6 changes: 6 additions & 0 deletions soccer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ set_target_properties(robocup PROPERTIES SUFFIX ".so")

add_executable(rj_vision_filter)

add_executable(soccer_mom_node)
add_executable(soccer)
add_executable(log_viewer)
add_executable(internal_referee_node)
Expand Down Expand Up @@ -225,6 +226,10 @@ target_link_libraries(internal_referee_node PRIVATE ${REFEREE_NODE_DEPS_SYSTEM_L
target_link_libraries(sim_radio_node PRIVATE ${RADIO_NODE_DEPS_SYSTEM_LIBRARIES}
${RADIO_NODE_DEPS_LIBRARIES})

# -- soccer_mom_node --
target_link_libraries(soccer_mom_node PRIVATE ${RADIO_NODE_DEPS_SYSTEM_LIBRARIES}
${RADIO_NODE_DEPS_LIBRARIES})

# -- network_radio_node --
target_link_libraries(network_radio_node PRIVATE ${RADIO_NODE_DEPS_SYSTEM_LIBRARIES}
${RADIO_NODE_DEPS_LIBRARIES})
Expand Down Expand Up @@ -289,6 +294,7 @@ install(
planner_node
control_node
sim_radio_node
soccer_mom_node
network_radio_node
manual_control_node
global_param_server_node
Expand Down
8 changes: 7 additions & 1 deletion soccer/src/soccer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ set(ROBOCUP_LIB_SRC
radio/packet_convert.cpp
radio/sim_radio.cpp
radio/radio.cpp
soccer_mom.cpp
referee/referee_base.cpp
referee/external_referee.cpp
referee/internal_referee.cpp
Expand Down Expand Up @@ -94,7 +95,7 @@ set(ROBOCUP_LIB_SRC
strategy/agent/position/zoner.cpp
strategy/agent/position/pivot_test.cpp
strategy/agent/position/solo_offense.cpp

strategy/agent/position/runner.cpp
)

set(SOCCER_TEST_SRC
Expand Down Expand Up @@ -133,6 +134,8 @@ set(CONTROL_NODE_SRC control/control_node_main.cpp)

set(SIM_RADIO_NODE_SRC radio/sim_radio_node_main.cpp)

set(SOCCER_MOM_NODE_SRC soccer_mom_node_main.cpp)

set(NETWORK_RADIO_NODE_SRC radio/network_radio_node_main.cpp)

set(MANUAL_CONTROL_NODE_SRC joystick/manual_control_node_main.cpp)
Expand Down Expand Up @@ -175,6 +178,9 @@ target_sources(sim_radio_node PRIVATE ${SIM_RADIO_NODE_SRC})
# ---- sim_radio_node ----
target_sources(network_radio_node PRIVATE ${NETWORK_RADIO_NODE_SRC})

# ---- soccer_mom_node ----
target_sources(soccer_mom_node PRIVATE ${NETWORK_RADIO_NODE_SRC})

# ---- manual_control_node ----
target_sources(manual_control_node PRIVATE ${MANUAL_CONTROL_NODE_SRC})

Expand Down
17 changes: 17 additions & 0 deletions soccer/src/soccer/soccer_mom.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "soccer_mom.hpp"

SoccerMom::SoccerMom() : rclcpp::Node("SoccerMom") { // extends the ROS node and we call it "SoccerMom"
soccer_mom_pub_ = create_publisher<std_msgs::msg::String>("team_fruit", rclcpp::QoS(1)); //instantiate SoccerMom publisher
team_color_sub_ = create_subscription<rj_msgs::msg::TeamColor> (
referee::topics::kTeamColorTopic, rclcpp::QoS(1),
[this](rj_msgs::msg::TeamColor::SharedPtr color) {

Check warning on line 7 in soccer/src/soccer/soccer_mom.cpp

View workflow job for this annotation

GitHub Actions / build-and-test

the parameter 'color' is copied for each invocation but only used as a const reference; consider making it a const reference

Check warning on line 7 in soccer/src/soccer/soccer_mom.cpp

View workflow job for this annotation

GitHub Actions / build-and-test

the parameter 'color' is copied for each invocation but only used as a const reference; consider making it a const reference
auto message = std_msgs::msg::String(); // define msg we're gonna send out "String"
if (color->is_blue) {
message.data = "blueberries";
} else {
message.data = "bananas";
}
soccer_mom_pub_->publish(message);
}
);
}
16 changes: 16 additions & 0 deletions soccer/src/soccer/soccer_mom.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once //so that we don't have duplicate identifiers

#include <rclcpp/rclcpp.hpp>
#include <rj_constants/topic_names.hpp>

#include "std_msgs/msg/string.hpp"
#include "rj_msgs/msg/team_color.hpp"

class SoccerMom : public rclcpp::Node { //extends the ROS node
public:
SoccerMom();
private:
rclcpp::Subscription<rj_msgs::msg::TeamColor>::SharedPtr team_color_sub_; // subscriber
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr soccer_mom_pub_; //publisher

};
7 changes: 7 additions & 0 deletions soccer/src/soccer/soccer_mom_main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "soccer_mom.hpp"

int main(int argc, char** argv) {
rclcpp::init(argc, argv);
auto soccer_mom = std::make_shared<SoccerMom>();
rclcpp::spin(soccer_mom);
}
7 changes: 7 additions & 0 deletions soccer/src/soccer/soccer_mom_node_main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "soccer_mom.hpp"

int main(int argc, char** argv) {
rclcpp::init(argc, argv);
auto soccer_mom = std::make_shared<SoccerMom>();
rclcpp::spin(soccer_mom);
}
Loading
Loading