Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
cmake_minimum_required(VERSION 3.5)
project(rocket_tracker)

# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

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)

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


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

ament_package()
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ To run the tracker IRL, do `python3 control_telescope.py`

## Installing camera software:
https://pypi.org/project/camera-zwo-asi/


## ROS commands

ros2 launch rocket_tracker rsp_sim.launch.py
1 change: 1 addition & 0 deletions description/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all these files are copied from https://github.com/joshnewans/urdf_example
121 changes: 121 additions & 0 deletions description/example_gazebo.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

<!-- This file demonstrates the use of some <gazebo> tags -->

<!-- To include it add the following line -->
<!-- <xacro:include filename="example_gazebo.xacro" /> -->



<!-- Gazebo is unable to use the same <material> tags that are already in the URDF (that RViz uses). -->
<!-- Instead, we need to add gazebo tags for our links that refer to Gazebo materials -->


<gazebo reference="base_link">
<material>Gazebo/Green</material>
</gazebo>

<gazebo reference="slider_link">
<material>Gazebo/Blue</material>
</gazebo>

<gazebo reference="arm_link">
<material>Gazebo/Orange</material>
</gazebo>




<!-- Gazebo requires the use of plugins to interact with other systems such as ROS. -->


<!-- This plugin will publish the joint_states for the selected joints
(which robot_state_publisher can then use to broadcast the approprate tf). -->

<gazebo>
<plugin name="gazebo_ros_joint_state_publisher"
filename="libgazebo_ros_joint_state_publisher.so">
<update_rate>20</update_rate>
<joint_name>azi_joint</joint_name>
<joint_name>alt_joint</joint_name>
</plugin>
</gazebo>


<!-- This plugin will read a JointTrajectory message from the /set_joint_trajectory topic
and move the machine accordingly. It's a bit clunky but it works. -->
<!-- You'll probably want to add damping to the joints to stop them it flopping around.
e.g. <dynamics damping="10.0" friction="10.0"/> -->
<!-- Here's an example message to publish to test it:
ros2 topic pub -1 /set_joint_trajectory trajectory_msgs/msg/JointTrajectory '{header: {frame_id: world}, joint_names: [arm_joint], points: [ {positions: {0.6}} ]}' -->
<gazebo>
<plugin name="gazebo_ros_joint_pose_trajectory"
filename="libgazebo_ros_joint_pose_trajectory.so">
<update_rate>2</update_rate>
</plugin>
</gazebo>







<!-- The next section shows an example of adding a sensor, in this case a depth camera. -->

<!-- Due to a quirk of how cameras work, an extra joint/link is required to create an
"optical frame" for the sensor. That isn't the focus for this tutorial, but you can
look at https://www.ros.org/reps/rep-0103.html#suffix-frames for slightly more information. -->



<!-- First, create the link and joint for the optical frame -->

<joint name="camera_optical_joint" type="fixed">
<origin xyz="0 0 0" rpy="-1.571 0 -1.571" />
<parent link="camera_link" />
<child link="camera_link_optical" />
</joint>

<link name="camera_link_optical"></link>


<!-- Add a gazebo tag for the ORIGINAL camera_link (but in the plugin we reference the optical frame so that ROS can orient things correctly) -->
<!-- Within the gazebo tag we have the sensor tag, and inside that there is (among other things) the camera tag with the camera parameters,
and the plugin tag with some extra parameters the plugin needs. -->
<!-- Note that although visualise is set to true, it won't actually visualise the depth camera in gazebo. To see the preview,
try swapping "depth" to "camera"-->
<gazebo reference="camera_link">
<sensor type="camera" name="my_camera">
<update_rate>20</update_rate>
<visualize>true</visualize>
<camera name="cam">
<horizontal_fov>1.3962634</horizontal_fov>
<image>
<width>640</width>
<height>480</height>
<format>R8B8G8</format>
</image>
<clip>
<near>0.02</near>
<far>10000</far>
</clip>
<noise>
<type>gaussian</type>
<mean>0.0</mean>
<stddev>0.007</stddev>
</noise>
</camera>
<plugin name="camera_controller" filename="libgazebo_ros_camera.so">
<frame_name>camera_link_optical</frame_name>
<min_depth>0.1</min_depth>
<max_depth>10000</max_depth>
</plugin>
</sensor>
</gazebo>




</robot>
49 changes: 49 additions & 0 deletions description/example_include.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" >

<!-- This file is not a robot in and of itself, it just contains some useful tags that could be included in any robot -->



<!-- Specify some colours -->

<material name="white">
<color rgba="1 1 1 1"/>
</material>

<material name="orange">
<color rgba="1 0.3 0.1 1"/>
</material>

<material name="blue">
<color rgba="0.2 0.2 1 1"/>
</material>



<!-- Specify some standard inertial calculations https://en.wikipedia.org/wiki/List_of_moments_of_inertia -->
<!-- These make use of xacro's mathematical functionality -->

<xacro:macro name="inertial_box" params="mass x y z *origin">
<inertial>
<xacro:insert_block name="origin"/>
<mass value="${mass}" />
<inertia ixx="${(1/12) * mass * (y*y+z*z)}" ixy="0.0" ixz="0.0"
iyy="${(1/12) * mass * (x*x+z*z)}" iyz="0.0"
izz="${(1/12) * mass * (x*x+y*y)}" />
</inertial>
</xacro:macro>


<xacro:macro name="inertial_cylinder" params="mass length radius *origin">
<inertial>
<xacro:insert_block name="origin"/>
<mass value="${mass}" />
<inertia ixx="${(1/12) * mass * (3*radius*radius + length*length)}" ixy="0.0" ixz="0.0"
iyy="${(1/12) * mass * (3*radius*radius + length*length)}" iyz="0.0"
izz="${(1/2) * mass * (radius*radius)}" />
</inertial>
</xacro:macro>


</robot>
Loading