Closed enriLoniterp closed 2 years ago
@enriLoniterp please take a look at PR #19 thanks for reporting it.
Hi @razr, now i am able to execute simple RTP process with CMake as described in the new docs!
Next step is to execute my packages and my node.
[vxWorks *]# ls . Hi @razr, now i am able to execute simple RTP process with CMake as described in the new docs!
Next step is to execute my packages and my node. If i put my self inside /bin i have this list command:
[vxWorks *]# ls
.
..
test2
2to3
2to3-3.8
f2py
f2py3
f2py3.8
idle3
idle3.8
pydoc3
pydoc3.8
python3
python3-config
python3.8
python3.8-config
xmltest
rst2html.py
rst2html4.py
rst2html5.py
rst2latex.py
rst2man.py
rst2odt.py
rst2odt_prepstyles.py
rst2pseudoxml.py
rst2s5.py
rst2xetex.py
rst2xml.py
rstpep2html.py
__pycache__
docutils
catkin_create_pkg
catkin_find_pkg
catkin_generate_changelog
catkin_package_version
catkin_prepare_release
catkin_tag_changelog
catkin_test_changelog
_ros2_daemon
ament_index
launch_test
pendulum_demo
pendulum_launch.bash
pendulum_logger
pendulum_teleop
ros2
rttest_plot
tlsf_allocator_example
action_client_not_composable_with_cancel
action_client_member_functions
action_client_not_composable
action_client_not_composable_with_feedback
action_server_member_functions
action_server_not_composable
client_main
composition_publisher
composition_subscriber
composition_composed
publisher_member_function
publisher_not_composable
publisher_lambda
service_main
subscriber_not_composable
subscriber_lambda
subscriber_member_function
timer_member_function
timer_lambda
hlds_laser_publisher
turtlebot3_ros
hello_headers
test
listener
talker
The last 4 files are my tests, in particular the last two are a publisher and a subscriber. I have an external package which i compiled with colcon build and then i extracted from the /install
folder this two executable, i moved them in my simulation and then i tried:
rtp exec -u 0x20000 ros2 run talker
(talker is a simple publisher and obviously it works fine in my pc)
but as i expected it doesn't work:
Launching process 'python3' ...
Process 'python3' (process Id = 0xffff80000825b7d0) launched.
usage: ros2 run [-h] [--prefix PREFIX] package_name executable_name ...
ros2 run: error: the following arguments are required: executable_name, argv
[vxWorks *]# rtp exec -u 0x20000 python3 ros2 run cpp_pubsub talker
Launching process 'python3' ...
Process 'python3' (process Id = 0xffff8000083c9bf0) launched.
Traceback (most recent call last):
File "ros2", line 11, in <module>
load_entry_point('ros2cli==0.7.11', 'console_scripts', 'ros2')()
File "/ata4/lib/python3.8/site-packages/ros2cli/cli.py", line 69, in main
rc = extension.main(parser=parser, args=args)
File "/ata4/lib/python3.8/site-packages/ros2run/command/run.py", line 57, in main
path = get_executable_path(
File "/ata4/lib/python3.8/site-packages/ros2run/api/__init__.py", line 30, in get_executable_path
paths = get_executable_paths(package_name=package_name)
File "/ata4/lib/python3.8/site-packages/ros2pkg/api/__init__.py", line 41, in get_executable_paths
prefix_path = get_prefix_path(package_name)
File "/ata4/lib/python3.8/site-packages/ros2pkg/api/__init__.py", line 34, in get_prefix_path
prefix_path = get_package_prefix(package_name)
File "/ata4/lib/python3.8/site-packages/ament_index_python/packages.py", line 49, in get_package_prefix
content, package_prefix = get_resource('packages', package_name)
File "/ata4/lib/python3.8/site-packages/ament_index_python/resources.py", line 37, in get_resource
for path in get_search_paths():
File "/ata4/lib/python3.8/site-packages/ament_index_python/search_paths.py", line 29, in get_search_paths
raise EnvironmentError(
OSError: Environment variable 'AMENT_PREFIX_PATH' is not set or empty
Can you give me some advice on how to compile and run my node and my packages inside VxWorks because i know how to deal this phase externally but i do not have clear the entire process from my package to my executable? Thanks again for your work and patient for my questions. Enrico
Hi @razr, thank you very much for the previous corrections, it all worked fine.
Now i'm currently finishing the examples, timer_lambda and python examples have been launched succesfully.
Then i passed to the Build a simple Cmake based OSS project:
this 5 lines don't give any error, the i cloned this repository and created the directory:
Then i tried this command:
cmake .. -DCMAKE_TOOLCHAIN_FILE=$TOP_BUILDDIR/buildspecs/cmake/rtp.cmake
It sends me back an error, but after i checked the interested directory rtp.cmake was not in here, instead i've found inside ./buildspecs/cmake: -Platform(directory) -toolchain.cmake
inside toolchain.cmake there is a comment:
My first attemp is Build RTP, i used
export
with the dir to my toolchain.cmake file, after i tried with the first cmake command:cmake -D CMAKE_TOOLCHAIN_FILE=$WIND_CC_SYSROOT/toolchain.cmake -DVX_TARGET_TYPE=RTP ..
but i received:so i've changed this command setting where my wr-cc and wr-c++ are located:
In this section of the error i see that it has moved to CmakeTmp dir and run the build command. Maybe the problem could be exactly because CmakeTmp is empty and wr-cc can't compile as mentioned below:
I can't understand what it is not working, maybe i'm missing some details. Thank you for the help and the attentions.