Skip to content

Commit

Permalink
Merge pull request #24 from DoernerD/tank_test_config
Browse files Browse the repository at this point in the history
Tank test config
  • Loading branch information
KKalem authored Nov 13, 2023
2 parents bdc9acb + 96c8a84 commit eee29db
Show file tree
Hide file tree
Showing 26 changed files with 422 additions and 1,205 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
cmake_minimum_required(VERSION 2.8.3)
project(state_feedback)
cmake_minimum_required(VERSION 3.0.2)
project(floatsam_description)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
roscpp
rospy
sensor_msgs
std_msgs
tf
)
find_package(catkin REQUIRED)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
Expand Down Expand Up @@ -73,7 +66,7 @@ find_package(catkin REQUIRED COMPONENTS
## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# geometry_msgs# sensor_msgs# std_msgs
# std_msgs # Or other packages containing msgs
# )

################################################
Expand Down Expand Up @@ -107,8 +100,8 @@ find_package(catkin REQUIRED COMPONENTS
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES state_feedback
# CATKIN_DEPENDS geometry_msgs roscpp rospy sensor_msgs std_msgs tf
# LIBRARIES floatsam_description
# CATKIN_DEPENDS other_catkin_pkg
# DEPENDS system_lib
)

Expand All @@ -120,12 +113,12 @@ catkin_package(
## Your package locations should be listed before other locations
include_directories(
# include
${catkin_INCLUDE_DIRS}
# ${catkin_INCLUDE_DIRS}
)

## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/state_feedback.cpp
# src/${PROJECT_NAME}/floatsam_description.cpp
# )

## Add cmake target dependencies of the library
Expand All @@ -136,7 +129,7 @@ include_directories(
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/state_feedback_node.cpp)
# add_executable(${PROJECT_NAME}_node src/floatsam_description_node.cpp)

## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
Expand All @@ -162,16 +155,23 @@ include_directories(

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# catkin_install_python(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
## 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_PACKAGE_BIN_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
# )

## Mark cpp header files for installation
Expand All @@ -193,16 +193,10 @@ include_directories(
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_state_feedback.cpp)
# catkin_add_gtest(${PROJECT_NAME}-test test/test_floatsam_description.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)

add_executable(tf_listener src/tf_listener.cpp)

add_dependencies(tf_listener ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_link_libraries(tf_listener ${catkin_LIBRARIES})
48 changes: 48 additions & 0 deletions floatsam_description/launch/floatsam_description.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<launch>
<arg name="namespace" default="floatsam"/>
<arg name="debug" default="0"/>

<arg name="namespace2" default="sam"/>
<arg name="mode" default="default"/>

<node name="map_2_floatsam" pkg="tf" type="static_transform_publisher" args="0 -1 0 0 0 0 map $(arg namespace)/base_link 100"/>
<node name="map_2_sam" pkg="tf" type="static_transform_publisher" args="0 1 0 0 0 0 map $(arg namespace2)/base_link 100"/>


<group ns="$(arg namespace)">

<param name="robot_description"
command="$(find xacro)/xacro '$(find floatsam_description)/robots/floatsam_usv_default.urdf.xacro' debug:=$(arg debug) namespace:=$(arg namespace)"/>

<!--<node pkg="sam_description" type="joint_state_converter.py" name="joint_state_converter"-->
<!--output="screen"/>-->
<node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher">
<!-- <param name="rate" value="100"/> -->
<param name="use_gui" value="false"/>
<rosparam param="source_list">["command_states"]</rosparam>
</node>

<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="true" output="screen">
<param name="robot_description" value="/$(arg namespace)/robot_description"/>

</node>
</group>


<group ns="$(arg namespace2)">

<param name="robot_description"
command="$(find xacro)/xacro '$(find sam_description)/robots/sam_auv_$(arg mode).urdf.xacro' debug:=$(arg debug) namespace:=$(arg namespace2)" />

<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="true" output="screen">
<param name="robot_description" value="/$(arg namespace2)/robot_description" />
</node>

<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" respawn="true" output="screen">
<param name="use_gui" value="false"/>
<rosparam param="source_list">["/sam/command_states"]</rosparam>
</node>

</group>

</launch>
89 changes: 89 additions & 0 deletions floatsam_description/mesh/floatsam_usv.dae

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions sam_actions/package.xml → floatsam_description/package.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0"?>
<package format="2">
<name>sam_actions</name>
<version>0.0.19</version>
<description>The sam_actions package</description>
<name>floatsam_description</name>
<version>0.0.0</version>
<description>The floatsam_description package</description>

<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="nbore@todo.todo">nbore</maintainer>
<maintainer email="torroba@todo.todo">torroba</maintainer>


<!-- One license tag required, multiple allowed, one license per tag -->
Expand All @@ -19,7 +19,7 @@
<!-- Url tags are optional, but multiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/sam_actions</url> -->
<!-- <url type="website">http://wiki.ros.org/floatsam_description</url> -->


<!-- Author tags are optional, multiple are allowed, one per tag -->
Expand Down
8 changes: 8 additions & 0 deletions floatsam_description/robots/floatsam_usv_default.urdf.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>

<robot name="floatsam" xmlns:xacro="http://www.ros.org/wiki/xacro" >
<xacro:arg name="debug" default="0"/>
<xacro:arg name="namespace" default="floatsam"/>
<xacro:include filename="$(find floatsam_description)/urdf/floatsam_usv.urdf.xacro"/>
<xacro:floatsam_usv namespace="$(arg namespace)" debug="$(arg debug)"/>
</robot>
91 changes: 91 additions & 0 deletions floatsam_description/urdf/floatsam_usv.urdf.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="2.0"?>
<robot name="floatsam" xmlns:xacro="http://www.ros.org/wiki/xacro">

<xacro:property name="body" value="file://$(find floatsam_description)/mesh/floatsam_usv.dae"/>
<xacro:property name="PI" value="3.141592" />
<xacro:macro name="floatsam_usv" params="namespace debug">

<!-- Links. -->
<link name="$(arg namespace)/base_link">
<visual>
<origin xyz="-0.3 0 -0.1" rpy="0 0 0"/>
<geometry>
<mesh filename="${body}" scale="1 1 1"/>
</geometry>
</visual>
</link>

<link name="$(arg namespace)/thruster_port_link"/>
<link name="$(arg namespace)/thruster_starboard_link"/>
<link name="$(arg namespace)/imu_link"/>
<link name="$(arg namespace)/sbg_link"/>
<link name="$(arg namespace)/gps_0_link"/>
<link name="$(arg namespace)/gps_1_link"/>
<link name="$(arg namespace)/rtk_stb_link"/>
<link name="$(arg namespace)/rtk_prt_link"/>
<link name="$(arg namespace)/uw_gps_link"/>
<link name="$(arg namespace)/dvl_link"/>

<joint name="$(arg namespace)/thruster_port_joint" type="fixed">
<parent link="$(arg namespace)/base_link"/>
<child link="$(arg namespace)/thruster_port_link"/>
<origin rpy="0.0 0.0 0.0" xyz="-0.09 0.25 -0.15"/>
</joint>

<joint name="$(arg namespace)/thruster_starboard_joint" type="fixed">
<parent link="$(arg namespace)/base_link"/>
<child link="$(arg namespace)/thruster_starboard_link"/>
<origin rpy="0.0 0.0 0.0" xyz="-0.09 -0.25 -0.15"/>
</joint>

<joint name="$(arg namespace)/imu_joint" type="fixed">
<parent link="$(arg namespace)/base_link"/>
<child link="$(arg namespace)/imu_link"/>
<origin rpy="0.0 0.0 0.0" xyz="0.1 0.0 0.0"/>
</joint>

<joint name="$(arg namespace)/sbg_joint" type="fixed">
<parent link="$(arg namespace)/base_link"/>
<child link="$(arg namespace)/sbg_link"/>
<origin rpy="0.0 0.0 0.0" xyz="0.1 0.1 0.0"/>
</joint>

<joint name="$(arg namespace)/gps_0_joint" type="fixed">
<parent link="$(arg namespace)/base_link"/>
<child link="$(arg namespace)/gps_0_link"/>
<origin rpy="0.0 0.0 0.0" xyz="0.5 0.25 0.11"/>
</joint>

<joint name="$(arg namespace)/gps_1_joint" type="fixed">
<parent link="$(arg namespace)/base_link"/>
<child link="$(arg namespace)/gps_1_link"/>
<origin rpy="0.0 0.0 0.0" xyz="0.5 -0.25 0.11"/>
</joint>

<joint name="$(arg namespace)/rtk_stb_joint" type="fixed">
<parent link="$(arg namespace)/base_link"/>
<child link="$(arg namespace)/rtk_stb_link"/>
<origin rpy="0.0 0.0 0.0" xyz="-0.05 -0.25 0.11"/>
</joint>

<joint name="$(arg namespace)/rtk_prt_joint" type="fixed">
<parent link="$(arg namespace)/base_link"/>
<child link="$(arg namespace)/rtk_prt_link"/>
<origin rpy="0.0 0.0 0.0" xyz="-0.05 0.25 0.11"/>
</joint>

<joint name="$(arg namespace)/uw_gps_joint" type="fixed">
<parent link="$(arg namespace)/base_link"/>
<child link="$(arg namespace)/uw_gps_link"/>
<origin rpy="${PI} 0.0 -${PI / 2}" xyz="0.4 0. -0.15"/>
</joint>

<joint name="$(arg namespace)/dvl_joint" type="fixed">
<parent link="$(arg namespace)/base_link"/>
<child link="$(arg namespace)/dvl_link"/>
<origin rpy="0. 0.0 0." xyz="0.05 -0.25 -0.15"/>
</joint>

</xacro:macro>

</robot>
10 changes: 0 additions & 10 deletions sam_actions/CHANGELOG.rst

This file was deleted.

Loading

0 comments on commit eee29db

Please sign in to comment.