Skip to content

Commit

Permalink
Update msg, srv and action files (#4)
Browse files Browse the repository at this point in the history
* Update all messages, services and actions to match what will be on the robot controller with Polyscope 10.7
* Unify small case for message group variables
* Add action_msgs dependency in package.xml
  For Humble this is still required.
* Remove dashboard services for now
  As we don't offer those services on the robot controller currently and
  the driver does not immediately switch to this repo, let's remove those
  services for now.
  • Loading branch information
urfeex authored Nov 29, 2024
1 parent ba2ec02 commit 2b90986
Show file tree
Hide file tree
Showing 26 changed files with 47 additions and 93 deletions.
28 changes: 13 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,30 @@ project(urinterfaces)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(action_msgs REQUIRED)

set(msg_files
"msg/ActiveTCP.msg"
"msg/Analog.msg"
"msg/AnalogStamped.msg"
"msg/AnalogIO.msg"
"msg/AnalogIOStateStamped.msg"
"msg/BoolStamped.msg"
"msg/ControlCycle.msg"
"msg/Current.msg"
"msg/DigitalPort.msg"
"msg/Digital.msg"
"msg/DigitalIO.msg"
"msg/DigitalIOStateStamped.msg"
"msg/DigitalStamped.msg"
"msg/DoubleMultiArrayStamped.msg"
"msg/Float32Stamped.msg"
"msg/Float64Stamped.msg"
Expand All @@ -41,28 +50,17 @@ set(srv_files
"srv/SetAnalogOutput.srv"
"srv/SetDigitalOutput.srv"
"srv/SetSpeedFraction.srv"
"srv/AddToLog.srv"
"srv/GetLoadedProgram.srv"
"srv/GetProgramState.srv"
"srv/GetRobotMode.srv"
"srv/SetPayload.srv"
"srv/GetSafetyMode.srv"
"srv/IsProgramRunning.srv"
"srv/IsProgramSaved.srv"
"srv/Load.srv"
"srv/Popup.srv"
"srv/RawRequest.srv"
)

set(action_files
"action/SetMode.action"
)

rosidl_generate_interfaces(${PROJECT_NAME}
${action_files}
${msg_files}
${srv_files}
${action_files}
DEPENDENCIES builtin_interfaces std_msgs geometry_msgs sensor_msgs action_msgs
DEPENDENCIES builtin_interfaces std_msgs geometry_msgs sensor_msgs
ADD_LINTER_TESTS
)

Expand Down
2 changes: 1 addition & 1 deletion action/SetMode.action
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# non-critical state (e.g. NORMAL or REDUCED), for example after a safety incident happened.

# goal
int8 target_robot_mode
RobotMode target_robot_mode

# Stop program execution before restoring the target mode. Can be used together with 'play_program'.
bool stop_program
Expand Down
3 changes: 3 additions & 0 deletions msg/ActiveTCP.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
std_msgs/Header header

string data
6 changes: 3 additions & 3 deletions msg/Analog.msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
std_msgs/Header header
uint8 CURRENT = 0
uint8 VOLTAGE = 1

uint8 domain # can be VOLTAGE or CURRENT, must match SetAnalogOutput.srv
float32 data
uint8 pin
uint8 domain # can be VOLTAGE or CURRENT
float32 value
3 changes: 3 additions & 0 deletions msg/AnalogIO.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Note: The array indices do not necessarily match the pin number
Analog[] analog_inputs
Analog[] analog_outputs
3 changes: 3 additions & 0 deletions msg/AnalogIOStateStamped.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
std_msgs/Header header

AnalogIO io_state
2 changes: 1 addition & 1 deletion msg/DigitalPort.msg → msg/AnalogStamped.msg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
std_msgs/Header header
bool[] data
Analog data
2 changes: 2 additions & 0 deletions msg/Digital.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uint8 pin
bool state
3 changes: 3 additions & 0 deletions msg/DigitalIO.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Note: The array indices do not necessarily match the pin number
Digital[] digital_inputs
Digital[] digital_outputs
4 changes: 4 additions & 0 deletions msg/DigitalIOStateStamped.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
std_msgs/Header header

DigitalIO configurable_io
DigitalIO standard_io
2 changes: 2 additions & 0 deletions msg/DigitalStamped.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
std_msgs/Header header
Digital data
3 changes: 1 addition & 2 deletions msg/ToolOutputMode.msg
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
std_msgs/Header header
uint8 TOOL_OUPUT=0
uint8 TOOL_OUTPUT=0
uint8 TOOL_POWER=1
uint8 TOOL_SAFE=2

uint8 output_mode

Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<build_depend>std_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>action_msgs</build_depend>

<exec_depend>builtin_interfaces</exec_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>action_msgs</exec_depend>

<depend>action_msgs</depend>

<test_depend>ament_lint_common</test_depend>

Expand Down
4 changes: 0 additions & 4 deletions srv/AddToLog.srv

This file was deleted.

4 changes: 0 additions & 4 deletions srv/GetLoadedProgram.srv

This file was deleted.

5 changes: 0 additions & 5 deletions srv/GetProgramState.srv

This file was deleted.

4 changes: 0 additions & 4 deletions srv/GetRobotMode.srv

This file was deleted.

4 changes: 0 additions & 4 deletions srv/GetSafetyMode.srv

This file was deleted.

4 changes: 0 additions & 4 deletions srv/IsProgramRunning.srv

This file was deleted.

5 changes: 0 additions & 5 deletions srv/IsProgramSaved.srv

This file was deleted.

5 changes: 0 additions & 5 deletions srv/Load.srv

This file was deleted.

4 changes: 0 additions & 4 deletions srv/Popup.srv

This file was deleted.

4 changes: 0 additions & 4 deletions srv/RawRequest.srv

This file was deleted.

16 changes: 3 additions & 13 deletions srv/SetAnalogOutput.srv
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# Note: 'fun' is short for function of the pin to be selected
uint8 CURRENT = 0
uint8 VOLTAGE = 1

# The value for pin [0-1]

# Value for 'FUN_CURRENT' must be from [0.002; 0.020] A ;
# Value for 'FUN_VOLTAGE' must be from [0; 10] V ;

# request fields
int8 pin
uint8 output_type # can be VOLTAGE or CURRENT, must match Analog.msg
float64 data
# Set an analog output to a given value.
# Multiple outputs can be set at once by providing more than one entry in the data array
Analog[] data
---
bool success
12 changes: 3 additions & 9 deletions srv/SetDigitalOutput.srv
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# The value for pin [0-7]

# valid values for 'state' when setting digital IO or flags
bool STATE_OFF = 0
bool STATE_ON = 1

# request fields
int8 pin
bool state
# Set a digital output to a given value.
# Multiple outputs can be set at once by providing more than one entry in the data array
Digital[] data
---
bool success
4 changes: 0 additions & 4 deletions srv/SetPayload.srv

This file was deleted.

0 comments on commit 2b90986

Please sign in to comment.