forked from heuristicus/spot_ros
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple rviz panel for interaction with spot
Can use the panel to claim and release the lease, power on and off, sit down and stand up, and set the body pose. To add, go to panels>add new panel and select SpotControlPanel in spot_viz
- Loading branch information
1 parent
caacc5d
commit c3a4f12
Showing
7 changed files
with
575 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(spot_viz) | ||
|
||
find_package(catkin REQUIRED COMPONENTS) | ||
find_package(catkin REQUIRED COMPONENTS rviz) | ||
|
||
catkin_package() | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
|
||
if(rviz_QT_VERSION VERSION_LESS "5") | ||
message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}") | ||
find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui) | ||
include(${QT_USE_FILE}) | ||
else() | ||
message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}") | ||
find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets UiTools) | ||
set(QT_LIBRARIES Qt5::Widgets Qt5::UiTools) | ||
endif() | ||
|
||
include_directories( | ||
${catkin_INCLUDE_DIRS} | ||
) | ||
|
||
set(SRC_FILES | ||
src/spot_panel.cpp | ||
) | ||
|
||
add_library(${PROJECT_NAME} ${SRC_FILES}) | ||
target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${catkin_LIBRARIES}) | ||
|
||
install(TARGETS | ||
${PROJECT_NAME} | ||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
) | ||
|
||
install(DIRECTORY rviz DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) | ||
install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) | ||
install(FILES plugin_description.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<library path="lib/libspot_viz"> | ||
<class name="spot_viz/SpotControlPanel" | ||
type="spot_viz::ControlPanel" | ||
base_class_type="rviz::Panel"> | ||
<description> | ||
A panel for controlling the Boston Dynamics Spot robot with the Clearpath driver | ||
</description> | ||
</class> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,231 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Form</class> | ||
<widget class="QWidget" name="Form"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>456</width> | ||
<height>618</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout_2"> | ||
<item> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<layout class="QHBoxLayout" name="claimLayout"> | ||
<item> | ||
<widget class="QPushButton" name="claimLeaseButton"> | ||
<property name="text"> | ||
<string>Claim Lease</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="releaseLeaseButton"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Release Lease</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="powerLayout"> | ||
<item> | ||
<widget class="QPushButton" name="powerOnButton"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Power On</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="powerOffButton"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Power Off</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="sitStandLayout"> | ||
<item> | ||
<widget class="QPushButton" name="sitButton"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Sit</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="standButton"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Stand</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<layout class="QGridLayout" name="bodyPoseGridLayout"> | ||
<item row="1" column="0" colspan="2"> | ||
<widget class="QLabel" name="bodyPoseLabel"> | ||
<property name="text"> | ||
<string>Body Pose Control</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="3" column="0"> | ||
<widget class="QLabel" name="rollLabel"> | ||
<property name="text"> | ||
<string>Roll</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="5" column="0"> | ||
<widget class="QLabel" name="yawLabel"> | ||
<property name="text"> | ||
<string>Yaw</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="6" column="0" colspan="2"> | ||
<widget class="QPushButton" name="setBodyPoseButton"> | ||
<property name="enabled"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="text"> | ||
<string>Set Body Pose</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="4" column="0"> | ||
<widget class="QLabel" name="pitchLabel"> | ||
<property name="text"> | ||
<string>Pitch</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="0"> | ||
<widget class="QLabel" name="bodyHeightLabel"> | ||
<property name="text"> | ||
<string>Body height</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="1"> | ||
<widget class="QDoubleSpinBox" name="bodyHeightSpin"> | ||
<property name="buttonSymbols"> | ||
<enum>QAbstractSpinBox::NoButtons</enum> | ||
</property> | ||
<property name="decimals"> | ||
<number>2</number> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="3" column="1"> | ||
<widget class="QDoubleSpinBox" name="rollSpin"> | ||
<property name="buttonSymbols"> | ||
<enum>QAbstractSpinBox::NoButtons</enum> | ||
</property> | ||
<property name="decimals"> | ||
<number>1</number> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="4" column="1"> | ||
<widget class="QDoubleSpinBox" name="pitchSpin"> | ||
<property name="buttonSymbols"> | ||
<enum>QAbstractSpinBox::NoButtons</enum> | ||
</property> | ||
<property name="decimals"> | ||
<number>1</number> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="5" column="1"> | ||
<widget class="QDoubleSpinBox" name="yawSpin"> | ||
<property name="buttonSymbols"> | ||
<enum>QAbstractSpinBox::NoButtons</enum> | ||
</property> | ||
<property name="decimals"> | ||
<number>1</number> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="statusLabel"> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
<property name="wordWrap"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
Oops, something went wrong.