Closed JayanthS18 closed 1 year ago
Hi, thank you for your inquiry. Can you show us the setup.py and the package structure?
My setup.py file in src
from setuptools import setup, find_packages
from glob import glob
package_name = 'choirbot_examples'
scripts = {
'containment': ['guidance', 'integrator', 'rviz'],
'bearingformationcontrol': ['guidance', 'integrator' ],
'quadrotorbearingformationcontrol': ['guidance', 'controller', 'integrator' ],
'formationcontrol': ['guidance', 'controller'],
'mpc': ['guidance', 'integrator', 'rviz'],
'taskassignment': ['guidance', 'table', 'planner', 'controller'],
}
setup(
name=package_name,
version='0.0.0',
packages=find_packages(),
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
('share/' + package_name, glob('launch/*.launch.py')),
('share/' + package_name, glob('resource/*.rviz')),
('share/' + package_name, glob('resource/*.sdf')),
],
install_requires=['setuptools', 'choirbot'],
zip_safe=True,
maintainer='OPT4SMART',
maintainer_email='info@opt4smart.eu',
description='Example files for ChoiRbot',
license='GNU General Public License v3.0',
tests_require=['pytest'],
entry_points={
'console_scripts': [
'choirbot_{0}_{1} = choirbot_examples.{0}.{1}:main'.format(package, file)
for package, files in scripts.items() for file in files
] + [
'choirbot_formationcontrol_guidance = choirbot_examples.formationcontrol.guidance:main',
'choirbot_formationcontrol_control = choirbot_examples.formationcontrol.control:main',
'choirbot_turtlebot_spawner = choirbot_examples.turtlebot_spawner:main'
],
},
)
My src package structure
├── choirbot
│ ├── choirbot
│ │ ├── communicator
│ │ │ ├── callback_group.py
│ │ │ ├── communicator.py
│ │ │ ├── executor.py
│ │ │ ├── __init__.py
│ │ │ └── __pycache__
│ │ │ ├── callback_group.cpython-38.pyc
│ │ │ ├── communicator.cpython-38.pyc
│ │ │ ├── executor.cpython-38.pyc
│ │ │ └── __init__.cpython-38.pyc
│ │ ├── controller
│ │ │ ├── controller.py
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── controller.cpython-38.pyc
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── quadrotor_accelerationcontroller.cpython-38.pyc
│ │ │ │ ├── quadrotor_controller.cpython-38.pyc
│ │ │ │ └── unicycle_velocity.cpython-38.pyc
│ │ │ ├── quadrotor_accelerationcontroller.py
│ │ │ ├── quadrotor_controller.py
│ │ │ └── unicycle_velocity.py
│ │ ├── guidance
│ │ │ ├── distributed_control
│ │ │ │ ├── bearing_formationcontrol.py
│ │ │ │ ├── containment.py
│ │ │ │ ├── distributed_control.py
│ │ │ │ ├── formationcontrol.py
│ │ │ │ ├── __init__.py
│ │ │ │ └── __pycache__
│ │ │ │ ├── bearing_formationcontrol.cpython-38.pyc
│ │ │ │ ├── containment.cpython-38.pyc
│ │ │ │ ├── distributed_control.cpython-38.pyc
│ │ │ │ ├── formationcontrol.cpython-38.pyc
│ │ │ │ └── __init__.cpython-38.pyc
│ │ │ ├── guidance.py
│ │ │ ├── __init__.py
│ │ │ ├── mpc
│ │ │ │ ├── __init__.py
│ │ │ │ ├── mpc.py
│ │ │ │ └── __pycache__
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ └── mpc.cpython-38.pyc
│ │ │ ├── optimization_thread.py
│ │ │ ├── __pycache__
│ │ │ │ ├── guidance.cpython-38.pyc
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ └── optimization_thread.cpython-38.pyc
│ │ │ └── task
│ │ │ ├── executor.py
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── executor.cpython-38.pyc
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── table.cpython-38.pyc
│ │ │ │ └── task.cpython-38.pyc
│ │ │ ├── table.py
│ │ │ └── task.py
│ │ ├── __init__.py
│ │ ├── integrator
│ │ │ ├── double_integrator.py
│ │ │ ├── __init__.py
│ │ │ ├── integrator.py
│ │ │ ├── __pycache__
│ │ │ │ ├── double_integrator.cpython-38.pyc
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── integrator.cpython-38.pyc
│ │ │ │ ├── quadrotor_integrator.cpython-38.pyc
│ │ │ │ ├── single_integrator.cpython-38.pyc
│ │ │ │ └── unicycle_integrator.cpython-38.pyc
│ │ │ ├── quadrotor_integrator.py
│ │ │ ├── single_integrator.py
│ │ │ └── unicycle_integrator.py
│ │ ├── optimizer
│ │ │ ├── __init__.py
│ │ │ ├── mpc_optimizer.py
│ │ │ ├── optimizer.py
│ │ │ ├── __pycache__
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── mpc_optimizer.cpython-38.pyc
│ │ │ │ ├── optimizer.cpython-38.pyc
│ │ │ │ └── task_optimizer.cpython-38.pyc
│ │ │ └── task_optimizer.py
│ │ ├── planner
│ │ │ ├── __init__.py
│ │ │ ├── planner.py
│ │ │ └── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ └── planner.cpython-38.pyc
│ │ ├── __pycache__
│ │ │ └── __init__.cpython-38.pyc
│ │ └── utils
│ │ ├── __init__.py
│ │ ├── or_event.py
│ │ ├── position_getter.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ ├── or_event.cpython-38.pyc
│ │ │ ├── position_getter.cpython-38.pyc
│ │ │ ├── simple_visualizer.cpython-38.pyc
│ │ │ └── visualizer.cpython-38.pyc
│ │ ├── simple_visualizer.py
│ │ └── visualizer.py
│ ├── package.xml
│ ├── resource
│ │ └── choirbot
│ ├── setup.cfg
│ ├── setup.py
│ └── tests
│ └── communicators
│ └── test_callback_groups.py
├── choirbot_examples
│ ├── choirbot_examples
│ │ ├── bearingformationcontrol
│ │ │ ├── guidance.py
│ │ │ ├── __init__.py
│ │ │ └── integrator.py
│ │ ├── containment
│ │ │ ├── guidance.py
│ │ │ ├── __init__.py
│ │ │ ├── integrator.py
│ │ │ └── rviz.py
│ │ ├── formationcontrol
│ │ │ ├── controller.py
│ │ │ ├── guidance.py
│ │ │ ├── __init__.py
│ │ │ └── __pycache__
│ │ │ ├── controller.cpython-38.pyc
│ │ │ ├── guidance.cpython-38.pyc
│ │ │ └── __init__.cpython-38.pyc
│ │ ├── __init__.py
│ │ ├── mpc
│ │ │ ├── guidance.py
│ │ │ ├── __init__.py
│ │ │ ├── integrator.py
│ │ │ ├── __pycache__
│ │ │ │ ├── guidance.cpython-38.pyc
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── integrator.cpython-38.pyc
│ │ │ │ └── rviz.cpython-38.pyc
│ │ │ └── rviz.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ └── turtlebot_spawner.cpython-38.pyc
│ │ ├── quadrotorbearingformationcontrol
│ │ │ ├── controller.py
│ │ │ ├── guidance.py
│ │ │ ├── __init__.py
│ │ │ └── integrator.py
│ │ ├── taskassignment
│ │ │ ├── controller.py
│ │ │ ├── guidance.py
│ │ │ ├── __init__.py
│ │ │ ├── planner.py
│ │ │ ├── __pycache__
│ │ │ │ ├── controller.cpython-38.pyc
│ │ │ │ ├── guidance.cpython-38.pyc
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── planner.cpython-38.pyc
│ │ │ │ ├── table.cpython-38.pyc
│ │ │ │ └── turtlebot3_position_control_feedback.cpython-38.pyc
│ │ │ ├── table.py
│ │ │ ├── turtlebot3_position_control_feedback.py
│ │ │ └── turtlebot3_position_control.py
│ │ └── turtlebot_spawner.py
│ ├── launch
│ │ ├── bearingformationcontrol.launch.py
│ │ ├── containment.launch.py
│ │ ├── formationcontrol.launch.py
│ │ ├── gazebo.launch.py
│ │ ├── mpc.launch.py
│ │ ├── quadrotorbearingformationcontrol.launch.py
│ │ └── taskassignment.launch.py
│ ├── package.xml
│ ├── resource
│ │ ├── choirbot_examples
│ │ ├── model_burger.sdf
│ │ └── rvizconf.rviz
│ ├── setup.cfg
│ └── setup.py
├── choirbot_interfaces
│ ├── action
│ │ └── PositionAction.action
│ ├── choirbot_interfaces
│ │ └── __init__.py
│ ├── CMakeLists.txt
│ ├── msg
│ │ ├── PositionTaskArray.msg
│ │ └── PositionTask.msg
│ ├── package.xml
│ ├── setup.py
│ └── srv
│ ├── PositionTaskService.srv
│ └── TaskCompletionService.srv
├── docs
│ ├── make.bat
│ ├── Makefile
│ ├── requirements.txt
│ └── source
│ ├── acknowledgements
│ │ └── index.rst
│ ├── api_documentation
│ │ ├── choirbot.communicator.rst
│ │ ├── choirbot.guidance.distributed_control.rst
│ │ ├── choirbot.guidance.mpc.rst
│ │ ├── choirbot.guidance.rst
│ │ ├── choirbot.guidance.task.rst
│ │ └── index.rst
│ ├── biblio.bib
│ ├── citing
│ │ └── index.rst
│ ├── conf.py
│ ├── examples
│ │ ├── dynamic_task_assignment.rst
│ │ ├── formation_control.rst
│ │ ├── index.rst
│ │ └── mpc.rst
│ ├── index.rst
│ ├── installation
│ │ └── index.rst
│ ├── quick_start
│ │ └── index.rst
│ └── _static
│ ├── formationcontrol.png
│ ├── logo_ERC.png
│ ├── logo_OPT4Smart.png
│ ├── mpc.png
│ ├── taskassignment_gazebo.png
│ └── taskassignment_table.png
├── LICENSE
├── README.md
├── readthedocs.yaml
├── requirements_disropt.txt
└── requirements.txt
54 directories, 182 files
Hi, I would suggest not to add new entrypoints as in the last lines of your scripts. Once you declare them in the 'script' dictionary, the loop 'choirbot{0}{1} = choirbot_examples.{0}.{1}:main'.format(package, file) for package, files in scripts.items() for file in files automatically declares them. So when you add ''choirbot_formationcontrol_guidance = choirbot_examples.formationcontrol.guidance:main' I believe you are creating some kind of duplicate which may be the cause of the error
I am trying to implement the formation control example by following the instructions.When I build the package after adding entry points in the setup.py, I am getting the following error
I have used the foxy-devel for my package However, when I colcon build with out adding the entry points in the setup.py