moriarty / ros-ev3

How to install ROS (ros_comm) on an ev3 with ev3dev
GNU General Public License v2.0
24 stars 19 forks source link

Building in brickstrap has succeeded, but in EV3 it fails #12

Closed Tom-Shen closed 8 years ago

Tom-Shen commented 8 years ago

I build an identical program in brickstrap and EV3. In Brickstrap, the build went through with no problem, but when I build in EV3, it shows the following error:

Base path: /home/robot Source space: /home/robot/src Build space: /home/robot/build Devel space: /home/robot/devel Install space: /home/robot/install

Running command: "make cmake_check_build_system" in "/home/robot/build"

-- Using CATKIN_DEVEL_PREFIX: /home/robot/devel -- Using CMAKE_PREFIX_PATH: /home/robot/devel;/opt/ros/indigo -- This workspace overlays: /home/robot/devel;/opt/ros/indigo -- Using PYTHON_EXECUTABLE: /usr/bin/python -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/robot/build/test_results -- Found gtest sources under '/usr/src/gtest': gtests will be built -- Using Python nosetests: /usr/bin/nosetests-2.7 -- catkin 0.6.18 Traceback (most recent call last): File "/home/robot/build/catkin_generated/generate_cached_setup.py", line 30, in os.chmod(output_filename, mode | stat.S_IXUSR) OSError: [Errno 1] Operation not permitted: '/home/robot/build/catkin_generated/setup_cached.sh' CMake Error at /home/ros_comm/src/catkin/cmake/safe_execute_process.cmake:11 (message): execute_process(/usr/bin/python "/home/robot/build/catkin_generated/generate_cached_setup.py") returned error code 1 Call Stack (most recent call first): /home/ros_comm/src/catkin/cmake/all.cmake:186 (safe_execute_process) /home/ros_comm/devel/share/catkin/cmake/catkinConfig.cmake:20 (include) CMakeLists.txt:52 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/robot/build/CMakeFiles/CMakeOutput.log". See also "/home/robot/build/CMakeFiles/CMakeError.log". Makefile:474: recipe for target 'cmake_check_build_system' failed make: *\ [cmake_check_build_system] Error 1 Invoking "make cmake_check_build_system" failed

moriarty commented 8 years ago

You're running catkin_make directly on the EV3?

I don't have the patients for that... I usually build in brickstrap use Filezilla to drag the whole workspace over.

Did you increase your swap? I don't think it's recommended to have swap on an sd card but it's needed to compile directly on the EV3, otherwise you'll run out of memory... But that doesn't look like the same error.

Tom-Shen commented 8 years ago

OK I see , I will use the way you suggest. Thanks.

moriarty commented 8 years ago

A side note for running catkin_make in brickstrap.

do it in /home/robot/ not /host-rootfs/... because if you copy the whole workspace over with filezilla some links will be broken later

Tom-Shen commented 8 years ago

Yes, i always build in /home/robot, just a quick question, I check the FileZilla, I did not use it before, I found it is a FTP client, how can I use it to transfer my file to EV3, what is the structure, do I need to setup a ftp server in my Ubuntu, then install FileZilla in EV3, then use FileZilla as a ftp client in EV3?

Thanks for the help!

moriarty commented 8 years ago

FileZilla is just a client- install it on your Ubuntu, everything else is set up.

It needs the IP address, user, password and port (22) to connect to the ev3.

moriarty commented 8 years ago

There is a issue in ev3dev main issues where they discuss possible tutorials for beginners, and FileZilla was one suggestion... Someone posted details there.

moriarty commented 8 years ago

https://github.com/ev3dev/ev3dev/issues/477

Sorry I am on my phone I didn't mean to post 3 replies.

moriarty commented 8 years ago

I've finally push a working example using just one motor.

https://github.com/moriarty/ev3dev_ros_demo

I haven't posted instructions in the README how to use it...

It uses one motor, and subscribes to one topic, and it publishes one topic. Both topics are strings, on the input topic it expects "start" and "stop" and will run or stop the motor. On the output topic it publishes it's state (either RUN or IDLE)

rosnode info

Here is the output of rosnode info. As you can see from the hostnames, it's running on ev3dev.local and my desktop is alex-linux-desktop.local where I'm publishing start and stop.

$ rosnode info /ev3test_controller 
--------------------------------------------------------------------------------
Node [/ev3test_controller]
Publications: 
 * /ev3test_controller/state [std_msgs/String]
 * /rosout [rosgraph_msgs/Log]

Subscriptions: 
 * /ev3test_controller/cmd [std_msgs/String]

Services: 
 * /ev3test_controller/get_loggers
 * /ev3test_controller/set_logger_level

contacting node http://ev3dev.local:32963/ ...
Pid: 2244
Connections:
 * topic: /rosout
    * to: /rosout
    * direction: outbound
    * transport: TCPROS
 * topic: /ev3test_controller/cmd
    * to: /rostopic_17467_1460401560340 (http://alex-linux-desktop.local:38400/)
    * direction: inbound
    * transport: TCPROS

rostopic echo

Here is the output of rostopic echo

$ rostopic echo /ev3test_controller/state 
data: RUN
---
data: IDLE
---

rostopic pub

$ rostopic pub /ev3test_controller/cmd std_msgs/String "data: 'start'" 
publishing and latching message. Press ctrl-C to terminate
^C
$ rostopic pub /ev3test_controller/cmd std_msgs/String "data: 'stop'" 
publishing and latching message. Press ctrl-C to terminate
Tom-Shen commented 8 years ago

Thanks it is crystal clear!