I have this problem with bio-molecules. I couldn't convert the PDB file to LAMMPS input. So I convert it to .mol2 file with softwares like gaussview ; then convert this file to LAMMPS format by a home-made matlab script. Atomic coordinates and bonds exists in .mol2 file. I calculate angles, dihedrals and impropers using coordinates and bonds.
Have not investigated the answer further, though I have previosly used software called iBabel (openBable/bablefish) to convert from one file-format to another with some success for a few different formats.
Don't know if it is available for other platforms than mac.
Useful tool is atomsk (http://pierrehirel.info/codes/atomsk/en/formats.html). It can convert or build complex structure/nanostructure using information store in different formats.
If you are unable to generate dihedrals in the input files, the following steps would be helpful
Open VMD > TkConsole
type
topo retypebonds
topo guessdihedrals
topo writelammpsdata C:/ full
Additional considerations are to be given to double bonds, by typing all the syntax of program is available, will guide you on the addition and definition of bonds in structure.
I am converting a water pdb file to lammps data file using topo in VMD and it somehow assign the H atoms as type 1 and O atoms as type 2, which creates a problem later in lammps script (O atoms id should be followed by H atoms for TIP4P model). The pdb file has O atom as type 1 and H atom as type 2, but VMD reads it other way.