Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved Messages to Separate Package and renamed them to match ros convention #34

Merged
merged 3 commits into from
Feb 24, 2021

Conversation

CaptKrasno
Copy link

@CaptKrasno CaptKrasno commented Feb 23, 2021

All message now match the ROS conventions.

I also moved them into a separate package called mscl_msgs. This allows users to read the messages on another host without needing to build the entire ros_mscl package or needing to install MSCL. For example I might want to check mscl_msgs::Status a raspberry pi that runs a gui. With this structure, the Pi will not need to build or install MSCL but can still read it's messages. This is also useful for reading rosbags since you need the message definitions to do so.

Recommendations that I did not implement:

  • You might want to have CMake check if MSCL is installed. If it is build mscl_msgs and ros_mscl. If not build only mscl_msgs. This will make things more flexible if users only want to access the message and not need additional configuration. I felt this was kind of design decision though. So I didn't want to make it for you.
  • This package has many executables, and the CMakeLists file adds and configures them individually. This is tedious and prone to error. My recommendation is to move any cpp file with an int main() (any rosnode basically) to a folder called "nodes" and replace your your executable configuration with something like the following:
file(GLOB HDRS
  "include/${PROJECT_NAME}/*.h"
)
file(GLOB SRCS
  "src/*.cpp"
  "src/*.hpp"
)
file(GLOB NODES
  "nodes/*.cpp"
)

message("buliding ${PROJECT_NAME} node: ")
foreach(NODE_FILE ${NODES})
  get_filename_component(NODE_NAME ${NODE_FILE} NAME_WE)
  message("  - " ${NODE_NAME})

  add_executable(${NODE_NAME} ${NODE_FILE} ${HDRS} ${SRCS})
  add_dependencies(${NODE_NAME}   ### config dependences for batch here
  )   
  target_link_libraries (${NODE_NAME} ${catkin_LIBRARIES} ### MSCL etc)

endforeach(NODE_FILE)

@CaptKrasno
Copy link
Author

I just merged the latest commit with this pull request.

@nathanmillermicrostrain nathanmillermicrostrain merged commit d7077e2 into LORD-MicroStrain:master Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants