Skip to content

Commit

Permalink
Merge pull request #1 from a2s-institute/harley/robot_description
Browse files Browse the repository at this point in the history
Harley/robot description
  • Loading branch information
harleylara authored Oct 24, 2023
2 parents 2ff2669 + 89eb587 commit 591c906
Show file tree
Hide file tree
Showing 28 changed files with 1,000 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# solo12_robot

Base code for Nala robot (SOLO12 robot from Open Dynamic Robot Initiative)
28 changes: 28 additions & 0 deletions solo12_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.8)
project(solo12_bringup)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)

install(DIRECTORY launch DESTINATION share/${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
56 changes: 56 additions & 0 deletions solo12_bringup/launch/robot.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import os
import xacro
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from ament_index_python.packages import get_package_share_directory

def generate_launch_description():

rviz_config_file = PathJoinSubstitution([FindPackageShare("solo12_description"), "rviz", "solo12.rviz"])

# Get URDF path
urdf_path = os.path.join(get_package_share_directory("solo12_description"), 'urdf', 'solo12.urdf.xacro')

robot_description = {"robot_description": xacro.process_file(urdf_path).toxml()}

gazebo = IncludeLaunchDescription(os.path.join(get_package_share_directory("gazebo_ros"), "launch", "gazebo.launch.py"))

spawn = Node(
package="gazebo_ros",
executable="spawn_entity.py",
name="spawn_entity",
arguments=['-topic', "robot_description", "-entity", "solo12"]
)

joint_state_publisher_node = Node(
package="joint_state_publisher",
executable="joint_state_publisher",
)

robot_state_publisher_node = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
output="both",
parameters=[robot_description, {"use_sim_time": True}],
)

rviz_node = Node(
package="rviz2",
executable="rviz2",
name="rviz2",
output="log",
arguments=["-d", rviz_config_file]
)

return LaunchDescription(
[
joint_state_publisher_node,
robot_state_publisher_node,
rviz_node,
gazebo,
spawn
]
)
18 changes: 18 additions & 0 deletions solo12_bringup/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>solo12_bringup</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="[email protected]">jazzy</maintainer>
<license>TODO: License declaration</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
28 changes: 28 additions & 0 deletions solo12_description/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.8)
project(solo12_description)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)

install(DIRECTORY urdf meshes launch rviz DESTINATION share/${PROJECT_NAME}/)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
1 change: 1 addition & 0 deletions solo12_description/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# `solo12_description`
47 changes: 47 additions & 0 deletions solo12_description/launch/test_solo12_description.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import os
import xacro
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from ament_index_python.packages import get_package_share_directory

def generate_launch_description():

package_name = "solo12_description"

rviz_config_file = PathJoinSubstitution([FindPackageShare(package_name), "rviz", "solo12.rviz"])

# Get URDF path
urdf_path = os.path.join(get_package_share_directory(package_name), 'urdf', 'solo12.urdf.xacro')

robot_description = {"robot_description": xacro.process_file(urdf_path).toxml()}

joint_state_publisher_node = Node(
package="joint_state_publisher_gui",
executable="joint_state_publisher_gui",
)

robot_state_publisher_node = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
output="both",
parameters=[robot_description, {"use_sim_time": True}],
)

rviz_node = Node(
package="rviz2",
executable="rviz2",
name="rviz2",
output="log",
arguments=["-d", rviz_config_file]
)

return LaunchDescription(
[
joint_state_publisher_node,
robot_state_publisher_node,
rviz_node,
]
)
Binary file added solo12_description/meshes/collision/base.stl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions solo12_description/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>solo12_description</name>
<version>1.0.0</version>
<description>Robot description for Solo 12 by the Open Dynamic Robot Initiative</description>
<maintainer email="[email protected]">harleylara</maintainer>
<license>BSD-3-clause</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<exec_depend>joint_state_publisher_gui</exec_depend>
<exec_depend>joint_state_publisher</exec_depend>
<exec_depend>urdf</exec_depend>
<exec_depend>xacro</exec_depend>
<exec_depend>rviz2</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Loading

0 comments on commit 591c906

Please sign in to comment.