Alternative to deprecated autocomplete-python


#1

Hi,

For the ‘Install Atom Text Editor’ tutorial of the Precision Landing Simulation course, Atom’s website no longer provides access to ‘autocomplete-python’ & I cannot obtain it from 3rd parties …

Can someone please suggest what to do about this and/or what issues I’d be facing in absence of Autocomplete while ultimately hoping to successfully receive reliable drone camera data feeds?

Also, at 02:25 into the tutorial, when checking to see that the bashrc file will be sourced correctly via “/home/droneDojo/courseRoot/catkin_ws/devel/setup.bash”, “/opt/ros/melodic/setup.bash” does not show as per the tutorial …

I added the latter to the relevant script manually, and it now appears as it should (attached). But, I wonder if it may cause issues down the line?

image


#2

Atom has been deprecated as of December 2022. I suggest removing the program and installing PyCharm or VS Code (which I use) instead. IntelliCode is a good VS Code package.

Installing on a MS host you can do this…

sudo apt update

sudo apt install software-properties-common apt-transport-https wget
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg

sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

sudo add-apt-repository “deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main”

sudo apt install code

Launch VS Code and install the package

code

image

Yes, adding source /opt/ros/melodic/setup.bash to your .bashrc file and running the source command is a common and correct way to set up your ROS environment. This ensures that your ROS setup is loaded whenever you open a new terminal session.

To test that it works, follow these steps:

Step 1: Open a New Terminal

  1. Open a new terminal window to ensure the .bashrc file is sourced automatically.

Step 2: Verify Environment Variables

  1. Check if ROS environment variables are set by running:
echo $ROS_DISTRO

This should output melodic .

  1. Check other ROS environment variables, such as:
echo $ROS_PACKAGE_PATH

Step 3: Run a ROS Command

  1. Try running a basic ROS command to see if ROS is properly set up. For example:
roscore

This should start the ROS master. If roscore starts without any issues, your setup is correct.
Use Ctrl-C to exit roscore.

Step 4: Check ROS Nodes

  1. Open another terminal window and source the .bashrc file:
source ~/.bashrc
  1. List available ROS nodes:
rosnode list

If these commands work as expected, your ROS setup is correctly configured and the setup.bash sourcing in your .bashrc file is functioning as intended.

Let me know how it goes.


#4

Right … So I guess you’re confirming that without Autocomplete/IntelliCode/etc., Python won’t be able to action the script(s), ie: it’s not going to work?

In the meantime, I’ve commenced a brand new dependencies installation, documenting each step as I go (attached); I think it’ll be the simplest way to identify errors …

So far I can see that ROS isn’t installed correctly (2nd last screenshot) … Can you possibly suggest how to ‘grant permission’, since a ‘Permission denied’ error is occurring?

Dependencies Build.pdf (1.6 MB)


#5

I have moved on to later versions of Ubuntu and ROS. I will test out the PL code to confirm it works or modify it as needed.


#6
  1. Your suggested Steps 1-4 confirm that it is working correctly, e.g. roscore runs as intended …

  2. When it comes to publishing ‘example_publisher.py’, I get the attached error?

Therefore, it is essential that I know: can the script be published using Atom (without the unavailable autocomplete-python package)?


#7
  1. Please do; it seems that Ubuntu 18 is only compatible/error-proof with the latest Visual Code/Intellicode. Additionally, Visual Code appears to be requiring Python 3 (attached), whereas the Raspberry Pi is running Python 2.

  1. Also, I’m not sure if matters or not, but I noticed that the bashrc file that I’m provided with (right image in the attachment) has a different export path to the one that’s used in the tutorial (left image in the attachment) …


#8

Solved; at least for the time being …

As you can see in my earlier attached VS script, I was missing a ‘/’ before ‘usr’, in line 1.


#9

Don’t worry about the Autocomplete. It was simply a feature to help with coding.
So you can still use Atom.
Good you figured out the issue. Often typos are the source of headaches, so check carefully.
There is one type of error that sometimes pops up for which there is no obvious reason.
It happens when you accidentally use curly quotes instead of straight quotes.