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

no such files and open_base model moves itself #5

Open
k-quinted opened this issue Jun 25, 2018 · 12 comments
Open

no such files and open_base model moves itself #5

k-quinted opened this issue Jun 25, 2018 · 12 comments

Comments

@k-quinted
Copy link

Hi, GuiRitter.

I tried to copy the your OpenBase packages to my catkin workspace and do the catkin_make.
But, in this result, I had a fatal error and no such files (the following files)
・open_base/Velocity.h
・open_bace/FrameToFrame.h
・open_bace/KinematicsForward.h
So, this issue is the same problem of mashenlyl.

Also, I tried to copy and launch following xacro files.
・OpenBase/ROS/open_base/xacro/main.urdf.xacro
・OpenBase/ROS/open_base/xacro/rim.urdf.xacro
・OpenBase/ROS/open_base/xacro/roller.urdf.xacro
But, the model moves itself.

I just use following launch files.
So, I have not input anything.
・OpenBase/ROS/open_base/launch/gazebo description.launch
・OpenBase/ROS/open_base/launch/parameter.launch

What is the case this issue?

I use ROS Kinetic and Gazebo7.

Thanks in advance for your help.

@GuiRitter
Copy link
Owner

The issue with the missing files is because the message files need to compiled before the rest, but apparently aren't being.

The model is moving itself probably because of some tests I left behind.

I ask that you forgive me, for I don't have a lot of time right now to take a good look at this. I realized I already have forgotten a lot about ROS just by looking at the previous issue.

@AlvaroFerGar
Copy link

Hello!

I have started working with this repository and I think I have the solution for the message compiling problem. I know it has been more than a month since the last comment but maybe this could be useful for someone.

The solution is really simple. To be sure that the message files are compiled before the rest, you only need to add this just after the target_link_libraries( ):
add_dependencies(name_of_exe package_name_generate_messages_cpp)

So this is how the #Build# part of my CMakeLists.txt actually looks like:

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

include_directories( include
  ${catkin_INCLUDE_DIRS}
  ${Eigen3_INCLUDE_DIRS}
)

add_executable(${PROJECT_NAME}_kinematics src/kinematics.cpp)
target_link_libraries(
  ${PROJECT_NAME}_kinematics
  ${catkin_LIBRARIES}
  ${orocos-kdl_LIBRARIES}
  ${kdl_parser_LIBRARIES}
)
add_dependencies(${PROJECT_NAME}_kinematics open_base_generate_messages_cpp)

add_executable(${PROJECT_NAME}_odometry src/odometry.cpp)
target_link_libraries(
  ${PROJECT_NAME}_odometry
  ${catkin_LIBRARIES}
  ${kdl_parser_LIBRARIES}
)
add_dependencies(${PROJECT_NAME}_odometry open_base_generate_messages_cpp)

add_executable(${PROJECT_NAME}_sensor_encoder src/sensor/encoder.cpp)
target_link_libraries(
  ${PROJECT_NAME}_sensor_encoder
  ${catkin_LIBRARIES}
)
add_dependencies(${PROJECT_NAME}_sensor_encoder open_base_generate_messages_cpp)

add_executable(${PROJECT_NAME}_main src/main.cpp)
target_link_libraries(
  ${PROJECT_NAME}_main
  ${catkin_LIBRARIES}
)
add_dependencies(${PROJECT_NAME}_main open_base_generate_messages_cpp)

This work for me with Ubuntu 16.04LTS and ROS Kinetic. I hope it helps somebody!!

@GuiRitter
Copy link
Owner

@AlvaroFerGar Thanks for the tip! I'll take a look into it soon-ish and update the repository if it works.

GuiRitter added a commit that referenced this issue Aug 11, 2018
I remember that this project was building correctly when I was actively developing it. But, after leaving it alone for a while, I was told it was not being built correctly and I verified that indeed that was the case. The problem is that some executables that depend on messages were being built before the messages. I integrated [AlvaroFerGar](https://github.com/AlvaroFerGar)'s code from [this issue](#5 (comment)) and it seems that this bug has been fixed.
@GuiRitter
Copy link
Owner

@AlvaroFerGar I've adapted the code you provided and it fixed the build order bug. Committed and pushed. Thanks!

@GuiRitter
Copy link
Owner

I tested a project I had created that used this package to control a 4 joints robot. I remember clearly it was working. It failed with the same message generation problems. I fixed it with the same solution. Something must have changed in ROS while I wasn't working on it.

@GuiRitter
Copy link
Owner

@k-quinted I just committed some fixes and I would like some more information from you to see if I can resolve your issues. I hadn't realized before that I didn't understood your question correctly.

The first bit about

  • open_base/Velocity.h
  • open_bace/FrameToFrame.h
  • open_bace/KinematicsForward.h

has been fixed in b3da6f6.

About

I tried to copy and launch following xacro files

How did you try to launch these files? They aren't meant to be launched directly. They are meant to be launched from *.launch files.

About

  • OpenBase/ROS/open_base/launch/gazebo description.launch
  • OpenBase/ROS/open_base/launch/parameter.launch
  • parameter.launch is not meant to be launched directly. It's meant to be launched from other launch files to load common parameters.
  • gazebo description.launch is meant only to load the robot's description in Gazebo, in order to test the description itself. It's not meant to make the robot move. To make the robot move, you can launch velocity controller.launch and pass messages to /open_base/command. You probably can use other launch files to make the robot move, but I forgot how to use them.

@k-quinted
Copy link
Author

@GuiRitter

Thank you for your reply.

My question is why the open_base model moves itself.

I was loading the model on Gazebo by gazebo description.launch.
But, the robot has rotated the wheel without any input.
Then, I did not launch the other launch file and control programs.

@20150388
Copy link

20150388 commented Aug 20, 2018 via email

@GuiRitter
Copy link
Owner

GuiRitter commented Aug 21, 2018

@k-quinted You're welcome!

My question is why the open_base model moves itself.

When using gazebo description.launch, it doesn't create any controllers, because the purpose of this launch file is just to test the description in Gazebo. Without controllers, the joints move freely.

To get movement out of this robot, use velocity controller.launch and pass messages to /open_base/command. You have two options:

  • Write in a terminal rostopic pub /open_base/command then hit Tab a few times to autocomplete the message template and fill the values. To know what each value mean, look into the *.msg files in the msg folder;
  • Edit the scripts/movement*.sh files to your needs and run them with source scripts/movement*.sh.

@20150388 You need to install a few packages to support the controllers I used. These should do:

sudo apt-get install ros-kinetic-joint-state-controller
sudo apt-get install ros-kinetic-effort-controllers
sudo apt-get install ros-kinetic-position-controllers

I'll edit README.md to make these things more clear. A bit right now and more later. Please let me know if you managed to get it working.

@k-quinted
Copy link
Author

@GuiRitter

Ok.

After confirming, I will tell you.

Thank you.

@20150388
Copy link

20150388 commented Aug 21, 2018 via email

@GuiRitter
Copy link
Owner

@20150388 You're welcome! Glad to know it's working.

I don't remember if I've ever worked with keyboard control before, though I have some plans for the distant future.

Maybe this might be a good starting point.

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

No branches or pull requests

4 participants