Skip to content

Commit

Permalink
Change to Estop -> EStop
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Aug 9, 2024
1 parent b3a6b6a commit ff1254b
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 32 deletions.
10 changes: 5 additions & 5 deletions panther_gazebo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ 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/plugins/EStop.qrc)

add_library(Estop SHARED include/panther_gazebo/plugins/e_stop.hpp
add_library(EStop SHARED include/panther_gazebo/plugins/e_stop.hpp
src/plugins/e_stop.cpp ${resources_rcc})
ament_target_dependencies(Estop ignition-common4 ignition-gazebo6
ament_target_dependencies(EStop ignition-common4 ignition-gazebo6
ignition-plugin1 rclcpp std_srvs)
target_link_libraries(Estop ${Qt5Core_LIBRARIES} ${Qt5Qml_LIBRARIES}
target_link_libraries(EStop ${Qt5Core_LIBRARIES} ${Qt5Qml_LIBRARIES}
${Qt5Quick_LIBRARIES} ${Qt5QuickControls2_LIBRARIES})

install(TARGETS gz_led_strip_manager DESTINATION lib/${PROJECT_NAME})
Expand All @@ -67,7 +67,7 @@ install(
ARCHIVE DESTINATION lib)

install(
TARGETS Estop
TARGETS EStop
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
Expand Down
4 changes: 2 additions & 2 deletions panther_gazebo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ The package contains a launch file and source files used to run the robot simula

## ROS Nodes

### Estop
### EStop

`Estop` is a Gazebo GUI plugin responsible for easy and convenient changing of the robot's E-stop state.
`EStop` is a Gazebo GUI plugin responsible for easy and convenient changing of the robot's E-stop state.

#### Service Clients

Expand Down
2 changes: 1 addition & 1 deletion panther_gazebo/config/teleop_with_estop.config
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@
<property key="pluginToolBarTextColor" type="string">#fafafa</property>
</ignition-gui>
</plugin>
<plugin filename="Estop">
<plugin filename="EStop">
<namespace>{namespace}</namespace>
<ignition-gui>
<property key="x" type="double">0</property>
Expand Down
12 changes: 6 additions & 6 deletions panther_gazebo/include/panther_gazebo/plugins/e_stop.hpp
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_GUI_ESTOP_HPP_
#define PANTHER_GAZEBO_GUI_ESTOP_HPP_
#ifndef PANTHER_GAZEBO_PLUGINS_ESTOP_HPP_
#define PANTHER_GAZEBO_PLUGINS_ESTOP_HPP_

#include <ignition/gui/qt.h>
#include <ignition/gui/Plugin.hh>
Expand All @@ -26,15 +26,15 @@
namespace panther_gazebo
{

class Estop : public ignition::gui::Plugin
class EStop : public ignition::gui::Plugin
{
Q_OBJECT

Q_PROPERTY(QString ns READ GetNamespace WRITE SetNamespace NOTIFY ChangedNamespace)

public:
Estop();
virtual ~Estop();
EStop();
virtual ~EStop();
void LoadConfig(const tinyxml2::XMLElement * plugin_elem) override;
Q_INVOKABLE QString GetNamespace() const;

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

#endif // PANTHER_GAZEBO_GUI_ESTOP_HPP_
#endif // PANTHER_GAZEBO_PLUGINS_ESTOP_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ Rectangle {
id: namespaceField
width: 175
Layout.fillWidth: true
text: Estop.ns
text: EStop.ns
placeholderText: qsTr("Robot namespace")
Layout.alignment: Qt.AlignLeft
onEditingFinished: {
Estop.SetNamespace(text)
EStop.SetNamespace(text)
}
}
}
Expand Down Expand Up @@ -82,7 +82,7 @@ Rectangle {
}
}
onPressed: {
Estop.buttonPressed(eStopButton.checked);
EStop.buttonPressed(eStopButton.checked);
}
}
}
5 changes: 5 additions & 0 deletions panther_gazebo/src/plugins/EStop.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="EStop/">
<file>EStop.qml</file>
</qresource>
</RCC>
2 changes: 0 additions & 2 deletions panther_gazebo/src/plugins/Estop.config

This file was deleted.

5 changes: 0 additions & 5 deletions panther_gazebo/src/plugins/Estop.qrc

This file was deleted.

16 changes: 8 additions & 8 deletions panther_gazebo/src/plugins/e_stop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
namespace panther_gazebo
{

Estop::Estop() : ignition::gui::Plugin() { rclcpp::init(0, nullptr); }
EStop::EStop() : ignition::gui::Plugin() { rclcpp::init(0, nullptr); }

Estop::~Estop() { rclcpp::shutdown(); }
EStop::~EStop() { rclcpp::shutdown(); }

void Estop::LoadConfig(const tinyxml2::XMLElement * plugin_elem)
void EStop::LoadConfig(const tinyxml2::XMLElement * plugin_elem)
{
node_ = rclcpp::Node::make_shared("gz_estop_gui");
e_stop_reset_client_ = node_->create_client<std_srvs::srv::Trigger>(e_stop_reset_service_);
Expand All @@ -43,7 +43,7 @@ void Estop::LoadConfig(const tinyxml2::XMLElement * plugin_elem)
}
}

void Estop::buttonPressed(bool pressed)
void EStop::buttonPressed(bool pressed)
{
auto request = std::make_shared<std_srvs::srv::Trigger::Request>();

Expand All @@ -67,12 +67,12 @@ void Estop::buttonPressed(bool pressed)
if (!result->success) {
ignwarn << "Service call did not succeed: " << result->message << std::endl;
}
ignmsg << "Estop: " << result->message << std::endl;
ignmsg << "EStop: " << result->message << std::endl;
}

QString Estop::GetNamespace() const { return QString::fromStdString(namespace_); }
QString EStop::GetNamespace() const { return QString::fromStdString(namespace_); }

void Estop::SetNamespace(const QString & ns)
void EStop::SetNamespace(const QString & ns)
{
namespace_ = ns.toStdString();
e_stop_reset_service_ = namespace_ + kDefaultEStopResetService;
Expand All @@ -87,4 +87,4 @@ void Estop::SetNamespace(const QString & ns)

} // namespace panther_gazebo

IGNITION_ADD_PLUGIN(panther_gazebo::Estop, ignition::gui::Plugin)
IGNITION_ADD_PLUGIN(panther_gazebo::EStop, ignition::gui::Plugin)

0 comments on commit ff1254b

Please sign in to comment.