Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Aug 19, 2024
1 parent 39b7273 commit 628fe4f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 69 deletions.
6 changes: 3 additions & 3 deletions panther_gazebo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ ament_target_dependencies(
target_link_libraries(panther_simulation_plugins ignition-gazebo6::core)

set(CMAKE_AUTOMOC ON)
qt5_add_resources(resources_rcc src/plugins/EStop.qrc)
qt5_add_resources(resources_rcc src/e_stop/EStop.qrc)

add_library(EStop SHARED include/panther_gazebo/plugins/e_stop.hpp
src/plugins/e_stop.cpp ${resources_rcc})
add_library(EStop SHARED include/panther_gazebo/e_stop.hpp
src/e_stop/e_stop.cpp ${resources_rcc})
ament_target_dependencies(EStop ignition-common4 ignition-gazebo6
ignition-plugin1 rclcpp std_srvs)
target_link_libraries(EStop ${Qt5Core_LIBRARIES} ${Qt5Qml_LIBRARIES}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PANTHER_GAZEBO_PLUGINS_ESTOP_HPP_
#define PANTHER_GAZEBO_PLUGINS_ESTOP_HPP_
#ifndef PANTHER_GAZEBO_E_STOP_HPP_
#define PANTHER_GAZEBO_E_STOP_HPP_

#include <string>

Expand Down Expand Up @@ -61,4 +61,4 @@ protected slots:
};
} // namespace panther_gazebo

#endif // PANTHER_GAZEBO_PLUGINS_ESTOP_HPP_
#endif // PANTHER_GAZEBO_E_STOP_HPP_
7 changes: 5 additions & 2 deletions panther_gazebo/include/panther_gazebo/led_strip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@

#include <chrono>
#include <mutex>
#include <vector>
#include <string>

#include <gz/msgs/color.pb.h>
#include <gz/msgs/image.pb.h>
#include <gz/msgs/light.pb.h>
#include <gz/math/Color.hh>
#include <gz/sim/EntityComponentManager.hh>
#include <gz/sim/EventManager.hh>
#include <gz/sim/System.hh>
#include <gz/sim/components/Light.hh>
#include <gz/sim/components/Pose.hh>
#include <gz/transport/Node.hh>
#include <sdf/Element.hh>
#include "gz/sim/components/Pose.hh"

namespace panther_gazebo
{
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "panther_gazebo/plugins/e_stop.hpp"
#include "panther_gazebo/e_stop.hpp"

#include <memory>

Expand Down
20 changes: 8 additions & 12 deletions panther_gazebo/src/led_strip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,11 @@

#include "panther_gazebo/led_strip.hpp"

#include <string>

#include "gz/math/Color.hh"
#include "gz/msgs/image.pb.h"
#include "gz/msgs/light.pb.h"
#include "gz/msgs/marker.pb.h"
#include "gz/plugin/Register.hh"
#include "gz/sim/Model.hh"
#include "gz/sim/components/LightCmd.hh"
#include "gz/sim/components/Name.hh"
#include <gz/msgs/marker.pb.h>
#include <gz/plugin/Register.hh>
#include <gz/sim/Model.hh>
#include <gz/sim/components/LightCmd.hh>
#include <gz/sim/components/Name.hh>

namespace panther_gazebo
{
Expand Down Expand Up @@ -79,6 +74,7 @@ void LEDStrip::Configure(

// Subscribe to the image topic
node.Subscribe(ns + "/" + imageTopic, &LEDStrip::ImageCallback, this);
std::cout << "Subscribed to image topic: " << ns + "/" + imageTopic << std::endl;

// Iterate through entities to find the light entity by name
ecm.Each<gz::sim::components::Name, gz::sim::components::Light>(
Expand All @@ -87,7 +83,7 @@ void LEDStrip::Configure(
const gz::sim::components::Light *) -> bool {
if (_name->Data() == light_name) {
light_entity = _entity;
ignmsg << "Light entity found: " << light_entity << std::endl;
igndbg << "Light entity found: " << light_entity << std::endl;

// Ensure the LightCmd component is created
if (!ecm.Component<gz::sim::components::LightCmd>(light_entity)) {
Expand Down Expand Up @@ -141,7 +137,7 @@ void LEDStrip::Configure(
}

ecm.CreateComponent(light_entity, gz::sim::components::LightCmd(light_msg));
ignmsg << "Created LightCmd component for entity: " << light_entity << std::endl;
igndbg << "Created LightCmd component for entity: " << light_entity << std::endl;
}
}
return true; // Stop searching
Expand Down
48 changes: 0 additions & 48 deletions panther_gazebo/src/main.cpp

This file was deleted.

0 comments on commit 628fe4f

Please sign in to comment.