Skip to content

Commit

Permalink
adding profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacSheidlower committed Sep 2, 2022
1 parent 943e9f5 commit c3ce258
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 20 deletions.
31 changes: 11 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
geometry_msgs
)

## System dependencies are found with CMake's conventions
Expand All @@ -20,7 +21,7 @@ find_package(catkin REQUIRED COMPONENTS
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
Expand All @@ -47,11 +48,10 @@ find_package(catkin REQUIRED COMPONENTS
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )
add_message_files(
FILES
RobotCommand.msg
)

## Generate services in the 'srv' folder
# add_service_files(
Expand Down Expand Up @@ -105,8 +105,7 @@ find_package(catkin REQUIRED COMPONENTS
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES teleop_lib
# CATKIN_DEPENDS roscpp rospy std_msgs
# DEPENDS system_lib
# Message1.msg
)

###########
Expand Down Expand Up @@ -153,6 +152,7 @@ include_directories(
#############
## Install ##
#############
# Message1.msg

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
Expand All @@ -167,18 +167,8 @@ include_directories(
## Mark executables for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
# install(TARGETS ${PROJECT_NAME}_node
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark libraries for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
# install(TARGETS ${PROJECT_NAME}
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINA
# Message1.msg
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
Expand All @@ -187,6 +177,7 @@ include_directories(

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# Message1.msg
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
Expand Down
7 changes: 7 additions & 0 deletions msg/RobotCommand.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
int8 VELOCITY_COMMAND=1
int8 START_TRIAL_COMMAND=10
int8 STOP_COMMAND=-1

int8 command
geometry_msgs/Twist twist

2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>geometry_msgs</exec_depend>


<!-- The export tag contains other, unspecified, tags -->
Expand Down
Empty file added src/teleop_lib/__init__.py
Empty file.
11 changes: 11 additions & 0 deletions src/teleop_lib/command_queue.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import rospy

class CommandQueue:
def __init__(self, profile, topic, queue_len=10):



if msg.command == teleop_lib.msg.RobotCommand.VELOCITY_COMMAND:
send_vel(msg.twist)
elif msg.command == teleop_lib.msg.RobotCommand.STOP_COMMAND:
estop()
Empty file added src/teleop_lib/input_profile
Empty file.
3 changes: 3 additions & 0 deletions src/teleop_lib/input_profile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python

import rospy

0 comments on commit c3ce258

Please sign in to comment.