Skip to content
Permalink
Browse files

Added ROS node from private repo, updated README

  • Loading branch information...
luca-della-vedova committed Jul 2, 2019
1 parent f8b8fae commit 2cbcaf95e91f169d89570efdb9bd3200de89e16b
Showing with 1,529 additions and 4 deletions.
  1. +1 −4 firmware/ovc3/test_board/README.md
  2. +5 −0 software/ovc3/README.md
  3. +5 −0 software/ovc3/ovc_embedded_driver/.gitignore
  4. +203 −0 software/ovc3/ovc_embedded_driver/CMakeLists.txt
  5. +10 −0 software/ovc3/ovc_embedded_driver/README.md
  6. +214 −0 software/ovc3/ovc_embedded_driver/include/ovc_embedded_driver/dma_shapeshifter.h
  7. +98 −0 software/ovc3/ovc_embedded_driver/include/ovc_embedded_driver/i2c_driver.h
  8. +11 −0 software/ovc3/ovc_embedded_driver/include/ovc_embedded_driver/sensor_constants.h
  9. +68 −0 software/ovc3/ovc_embedded_driver/include/ovc_embedded_driver/spi_driver.h
  10. +22 −0 software/ovc3/ovc_embedded_driver/include/ovc_embedded_driver/uio_driver.h
  11. +46 −0 software/ovc3/ovc_embedded_driver/include/ovc_embedded_driver/vdma_driver.h
  12. +3 −0 software/ovc3/ovc_embedded_driver/msg/ImageCorner.msg
  13. +1 −0 software/ovc3/ovc_embedded_driver/msg/ImageCornerArray.msg
  14. +2 −0 software/ovc3/ovc_embedded_driver/msg/Metadata.msg
  15. +62 −0 software/ovc3/ovc_embedded_driver/package.xml
  16. +103 −0 software/ovc3/ovc_embedded_driver/src/dma_shapeshifter.cpp
  17. +174 −0 software/ovc3/ovc_embedded_driver/src/i2c_driver.cpp
  18. +180 −0 software/ovc3/ovc_embedded_driver/src/ovc_embedded_driver_node.cpp
  19. +126 −0 software/ovc3/ovc_embedded_driver/src/spi_driver.cpp
  20. +44 −0 software/ovc3/ovc_embedded_driver/src/uio_driver.cpp
  21. +148 −0 software/ovc3/ovc_embedded_driver/src/vdma_driver.cpp
  22. +3 −0 software/ovc3/ovc_embedded_driver/srv/ConfigureFAST.srv
@@ -13,14 +13,11 @@ Explaining the flow of bootable image creation is out of the scope of this readm
* The default FSBL provided by Xilinx doesn't work, use the one provided by Trenz in their sw\_lib.
* Bootable image configured through petalinux doesn't work because of the custom FSBL, create the image manually through Xilinx SDK.

The tested order of boot (and tool used to build it) is:
The tested order of boot (and tool used to build it) is, an example boot.bif is provided in the main folder:
1. TE0820 FSBL (XSDK)
2. Standard pmufw (XSDK)
3. FPGA bitfile for configuration (Vivado)
4. bl31.elf (Petalinux)
5. u-boot.elf (Petalinux)

Make sure to export your hardware definition (.hdf) file to petalinux to correctly configure the kernel image and binaries.

### Final quirks
The Petalinux project is version 2018.3 while the Vivado project is in Vivado 2019.1. This works but is unsupported behavior. Interrupts temporarily don't work if the kernel is compiled with Petalinux 2019.1, currently being investigated and once solved the whole design will be migrated to 2019.1
@@ -1,3 +1,5 @@
## Setup

OVC 3 is running a full Ubuntu distribution and a ROS node in itself.
On startup, it will configure itself as a USB ethernet gadget with a static IP of 10.0.1.1 and ia DHCP server that will assign an IP of 10.0.1.2 to the connected host, it will then look for a ROS master in 10.0.1.2, once it is found it will start publishing the images and IMU data.

@@ -19,3 +21,6 @@ ip a

on your machine.

## Message definitions

If you want to read all the output from the node (i.e. the image corners) you will need the custom message definitions, you can obtain them by building the node on your host machine as well.
@@ -0,0 +1,5 @@
# Vim files
*.swp
*.swo

tags
@@ -0,0 +1,203 @@
cmake_minimum_required(VERSION 2.8.3)
project(ovc_embedded_driver)

add_compile_options(-std=c++14)
# For debugging
# add_compile_options(-std=c++14 -fsanitize=address)

## 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 roscpp image_transport message_generation)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## 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()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend tag for "message_generation"
## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
## but can be declared for certainty nonetheless:
## * add a exec_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
add_message_files(
FILES
ImageCorner.msg
ImageCornerArray.msg
Metadata.msg
)

## Generate services in the 'srv' folder
add_service_files(
FILES
ConfigureFAST.srv
)

## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )

## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs # Or other packages containing msgs
)

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed

## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
# LIBRARIES ovc_embedded_driver
# CATKIN_DEPENDS other_catkin_pkg
# DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
)

## Declare a C++ library
add_library(${PROJECT_NAME}
src/uio_driver.cpp
src/vdma_driver.cpp
src/i2c_driver.cpp
src/spi_driver.cpp
src/dma_shapeshifter.cpp
)

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## 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/ovc_embedded_driver_node.cpp)

## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")

## Add cmake target dependencies of the executable
## same as for the library above
add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
target_link_libraries(${PROJECT_NAME}_node
${catkin_LIBRARIES}
${PROJECT_NAME}
i2c
#-fsanitize=address
)

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

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

## Mark executables and/or libraries for installation
# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_ovc_embedded_driver.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)
@@ -0,0 +1,10 @@
# ovc_embedded_driver

This is the ROS node that runs on the embedded Ubuntu on the OVC3 to interface between imagers / IMU and any additional hardware and the host system.
Currently it offers the following capabilities:

* Configuration and initialization of ICM-20948 IMU through SPI.
* Configuration of imagers through I2C.
* Synchronization between the two and timestamping.
* Configuration of FAST FPGA corner detector.
* Streaming of all data to ROS topics (IMU, images and corners).

0 comments on commit 2cbcaf9

Please sign in to comment.
You can’t perform that action at this time.